<!DOCTYPE html>

<%
/************************************************************************************************
*	File			: ErErSessionUsageReportPrint.jsp
*	Version			:	6.3.1
*	Author			:	Ganesh P
*	Creation Date	:	07-06-2018
*
*************************************************************************************************/
%>


<%@ include file="ErTracker.jsp"%>
<%@ page import="com.eg.EgDbInfo"%>
<%@ page import="com.eg.EgMappingInfo"%>
<%@ page import="com.eg.EgReportInfo"%>
<%@ page import="com.eg.EgTablesInfo"%>
<%@ page import = "com.eg.EgConfigInfo"%>
<%@ page import = "com.egurkha.util.DateUtil" %>
<%@ page import="egurkha.reporter.*"%>
<%@ page import="com.eg.EgDateInfo"%>
<%@ page import="com.eg.* "%>
<%@ page import="java.net.*"%>
<%@ page import="java.util.*"%>
<%@ page import="com.egurkha.User"%>
<%@ page import="com.egurkha.util.DateTimeTokenizer"%>
<%@ page import="com.egurkha.util.DateUtil"%>
<%@ page import="net.sf.json.*" %>
<%@ page import = "java.text.SimpleDateFormat" %>

<%@ taglib prefix="egui" uri="../WEB-INF/eg-taglib.tld"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.egurkha.util.StringUtils"%>

<%@ page import="com.eg.EgReportInfo" %>

<%!
	private static final String BLANK_SPACE = " ";
	private static final String COMA = ",";
	private static final String COLON = ":";
	private static final String PIE = "|";
	private static final String BSLASH = "/";
	private static final String UTF_8 = "UTF-8";	
%>
<%
	String SESSION_USAGE_REPORT = "SESSION_USAGE_REPORT";
	String pdfPrint = request.getParameter("pdfPrint");
	String titleToDisplay=request.getParameter("er_RmDispName");
	String s_st_date = request.getParameter("startdate");
	String s_en_date = request.getParameter("enddate");
	String s_st_hr = request.getParameter("starthr");
	String s_en_hr = request.getParameter("endhr");
	String strmin = request.getParameter("startmin");
	String enmin = request.getParameter("endmin");
	String rtype =request.getParameter("er_type");
	String er_mode = request.getParameter("er_mode");
	String timefrom2=request.getParameter("timefrom");
	String minfrom2=request.getParameter("minfrom");
	String timeto2=request.getParameter("timeto");
	String minto2=request.getParameter("minto");
	String reportFor=request.getParameter("reportFor");
	String fontStyleDblSingl = "";
	String s_comptype = request.getParameter("er_compType");
	String appStackUser = request.getParameter("appStackUser");
	String er_component[] = request
				.getParameterValues("er_component");
	String sample = request.getParameter("sample");
	String er_componentType=request.getParameter("er_compType");
		EgReportInfo reportInfo=new EgReportInfo("manager");
//
	String er_option =request.getParameter("er_option");
	String er_site = request.getParameter("er_site");
	String isDomainWithUser = request.getParameter("isUserDomain");
	String headerKeyName="";
		if(er_option!=null && er_option.equalsIgnoreCase("Segment"))
		{
			headerKeyName=er_option+" : "+er_site;
		}
		else if(er_option!=null && er_option.equalsIgnoreCase("Service"))
		{
			headerKeyName=er_option+" : "+er_site;
		}
		else if(er_option!=null && er_option.equalsIgnoreCase("Component"))
		{
			headerKeyName=er_option;
		}
		else
		{
			headerKeyName="Zone"+" : "+request.getParameter("select_farm");
		}


//
	try {

		String isVmCompSt = request.getParameter("isVmComp");
		boolean isVmComp=false;
		if(isVmCompSt!=null && isVmCompSt.equalsIgnoreCase("true"))
		{
			isVmComp=true;
		}


		//For Time Zone Conversion
	EgTimeZoneConverter timeZoneConverterStart = null;
	EgTimeZoneConverter timeZoneConverterEnd = null;
	String startDateForDisplay = null;
	String startHourForDisplay = null;
	String endDateForDisplay = null;
	String endHourForDisplay = null;
	String startMinForDisplay = null;
	String endMinForDisplay = null;

	User userName=UserRegistry.getInstance().getUser(session.getId());

	String mngrIP= new IniFile(new EgConfigInfo("manager").getDbFile()).getValue("DB_PROPERTIES","ManagerUrl");
	String strManagerURL = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort();
		EgDbInfo dbInfo = new EgDbInfo("manager");
		EgMappingInfo intlmap = null;
		if (thisuser != null) {
			intlmap = new EgMappingInfo(thisuser.getLanguage());
		}
		if ((dbInfo.doubleByteEnabled || !thisuser.getLanguage()
				.equals("en_US"))
				&& !(pdfPrint != null
						&& pdfPrint.equalsIgnoreCase("yes") || (sample != null && !sample
						.equalsIgnoreCase("yes")))) {
			fontStyleDblSingl = "multi_font";
		} else {
			fontStyleDblSingl = "";
		}
		EgTablesInfo tablesInfo = new EgTablesInfo("manager");
		ErUtils erUtils = new ErUtils();
		//
	
	List lst = new LinkedList();
	Vector v_measure_csv = new Vector();
	List lst_dat1 = new LinkedList();
%>

<!Doctype html>
<head>
<%
	if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
	{
%>
	<title>&nbsp; <egui:intnl text="reporter.common.Reporter" />
	&nbsp; &nbsp; <egui:intnl text="reporter.common.Print" /> &nbsp;</title>
<%
	}
	else
	{
%>
	<title>&nbsp; <egui:intnl text="reporter.common.Reporter" />
	&nbsp; &nbsp;</title>
<%
	}
%>

<meta name="Author" content="">
<meta  charset="UTF-8">

	
		<link rel="stylesheet" type="text/css" href="../../final/styles/eGLightThemeIcons.css" />
		<link rel="stylesheet" type="text/css" href="../../final/reporter/styles/printpagestyle.css" /> 		

<style>

@media print {body {-webkit-print-color-adjust: exact;}}



body{font-size:11px;line-height:1.5em;color:#2a292a;}
header{font-size:15px;}
.formLabel {font-size:12px;line-height:14px;}
.formValue {font-weight:500;font-size:12px;line-height:14px;}
b{font-weight:500;font-size:11px;}
table tr td{font-size:11px;padding:4px;}

.printTable{border: 1px solid #c3c3c3; border-collapse: collapse;}
.printTable tr td{border: 1px solid #c3c3c3;}
.newFont_bold28{font-size: 20px !important;font-weight:500;color:##2a292a;}
.newFont_normal13{font-size: 13px !important;font-weight:500;color:#2a292a;}
.newFont_normal11{font-size: 11px !important;font-weight:500;color:#2a292a;}
.printTableHeader{font-weight:500;border: 1px solid #c3c3c3;text-align:center;background-color:#cdcdcd;padding:4px;}
.printTableHeader2{font-weight:500;border: 1px solid #c3c3c3;text-align:center;background-color:#dcdcdc;padding:4px;}
.newimg {page-break-inside: avoid} 
#newimg {page-break-inside: avoid}

</style>


<style type="text/css" media="print">
#printbt{ display:none}
</style>

</head>
<body  style="padding:10px;background-color:#ffffff">

<table border="0" cellspacing="0" cellpadding="0" width="100%" style="table-layout:fixed;">
	<tr>
		<td width="100%" align="center" height="100%" valign="top">

			<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"  style="border-bottom:1px solid #999;">
				<tr>
					<td style="padding:2px" width="90%">
<%
	if (!StringUtils.isNull(titleToDisplay))
	{
%>
						<div style="float:left" > <header><%=titleToDisplay%> for &nbsp;<%=headerKeyName%>&nbsp;</header></div>
						<div class="printHeaderBoxPrintIcon" style="float:left"><img class="iconPrinter mouse"  src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border="0" onClick="javascript:print()" alt='<egui:intnl text="reporter.common.PRINT"/>' title='<egui:intnl text="reporter.common.PRINT"/>'/></div>
<%
	}
	else
	{
%>
						<div style="float:left" > <header><egui:intnl text="reporter.common.Application Billing " />&nbsp;<%=headerKeyName%>&nbsp;</header></div>
<%
	}
	if (pdfPrint != null && pdfPrint.equalsIgnoreCase("yes")) 
	{
%>
						<div style="float:right"><img class="iconPrinter mouse"  id="printbt" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border="0" onClick="javascript:print()" alt='<egui:intnl text="reporter.common.PRINT"/>' title='<egui:intnl text="reporter.common.PRINT"/>'/></div>
<%
	}
%>
					</td>
					<td width="10%">
					<div><img src='<%=imageName%>' border="0" /></div>
					</td>
				</tr>
			</table>

			<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" style="border-bottom:1px solid #ccc;">
				<tr>
					<td align="left" valign="top" width="50%">
						<div style="float:left;padding:4px;">
							<div style="float:left" class="formLabel"><%= intlmap.getTextDescription("reporter.thin.Component Type") %></div>
							<div style="float:left;width:10px" align="center" >:</div>
							<div style="float:left;" class="formValue"><%= intlmap.getComponentTypeDescription(s_comptype) %></div>			
						</div>
						<%
						if(reportFor!=null)
						{
							if(reportFor.equalsIgnoreCase("licenseUtilization"))
						{
							String componet = request.getParameter("component");
							componet = componet.substring(0, componet.indexOf(":"));
						%>
								<div style="clear:both;float:left;padding:4px;">
								<div style="float:left" class="formLabel"><%= intlmap.getTextDescription("reporter.thin.Component") %></div>
								<div style="float:left;width:10px" align="center" >:</div>
								<div style="float:left;" class="formValue"><%= intlmap.getComponentTypeDescription(componet) %></div>
							</div>
							<%
							}
							else if(reportFor.equalsIgnoreCase("userStack"))
							{
								%>
								<div style="clear:both;float:left;padding:4px;">
									<div style="float:left" class="formLabel"><%= intlmap.getTextDescription("reporter.thin.User Name") %></div>
									<div style="float:left;width:10px" align="center" >:</div>
									<div style="float:left;" class="formValue"><%= intlmap.getComponentTypeDescription(appStackUser) %></div>
								</div>
								<%
							}
						}%>
						</div>
					</td>
					<td align="right" valign="top">
<%
	String dispStart = "";
	String dispEnd = "";
	//dispStartDate=start_date.trim()+" "+erd.s_sthr+":"+erd.s_startmin;
	dispStart = s_st_date + " " + s_st_hr + COLON + strmin ;
	dispEnd = s_en_date + " " + s_en_hr + COLON + enmin ;
	//Time zone Conversion
		
		timeZoneConverterStart = new EgTimeZoneConverter(dispStart ,userName);
		startDateForDisplay = (String) timeZoneConverterStart.getDate(false);
		startHourForDisplay = timeZoneConverterStart.getHour();
		startMinForDisplay = timeZoneConverterStart.getMinute();

		timeZoneConverterEnd = new EgTimeZoneConverter(dispEnd ,userName);
		endDateForDisplay = (String) timeZoneConverterEnd.getDate(false);
		endHourForDisplay = timeZoneConverterEnd.getHour();
		endMinForDisplay = timeZoneConverterEnd.getMinute();

		String pdfStartDate=startDateForDisplay+" "+startHourForDisplay+":"+startMinForDisplay;
		String pdfEndDate = endDateForDisplay+" "+endHourForDisplay+":"+endMinForDisplay;
//
	lst.add(intlmap.getTextDescription("reporter.common.Application Billing")+" for "+headerKeyName);
	lst.add(intlmap.getTextDescription("reporter.thin.Component Type")+" : "+intlmap.getComponentTypeDescription(s_comptype));

		String Days = reportInfo.getExcludeWeekend("APPLICATION_BILLING");
		String excludeweekend=request.getParameter("er_excwe");
	if (excludeweekend==null ||	excludeweekend.equals(""))
		excludeweekend="No";


	if(excludeweekend.equalsIgnoreCase("Yes") )
	{
		lst.add('"'+intlmap.getTextDescription("reporter.common.Time period")+":"+intlmap.getTextDescription("reporter.common.From")+" "+request.getParameter("timefrom")+":"+request.getParameter("minfrom")+intlmap.getTextDescription("reporter.common.Hrs")+" "+intlmap.getTextDescription("reporter.common.To")+" "+request.getParameter("timeto")+":"+request.getParameter("minto")+intlmap.getTextDescription("reporter.common.Hrs")+'"'+","+'"'+
		
		intlmap.getTextDescription("reporter.common.Exclude weekends")+":"+Days+'"');
		
	}
	else
	{
		lst.add(intlmap.getTextDescription("reporter.common.Time period")+":"+intlmap.getTextDescription("reporter.common.From")+" "+request.getParameter("timefrom")+":"+request.getParameter("minfrom")+intlmap.getTextDescription("reporter.common.Hrs")+" "+intlmap.getTextDescription("reporter.common.To")+" "+request.getParameter("timeto")+":"+request.getParameter("minto")+intlmap.getTextDescription("reporter.common.Hrs"));
		
	}

//
	Vector dvec = new Vector();
	String stimefmt =	pdfStartDate+ " hrs";
	String etimefmt =	pdfEndDate+ " hrs";


	String ssd="Start Date : "+stimefmt+"  "+"End Date : "+etimefmt;
			lst.add('"'+ssd+'"');

%>
						<div style="float:right;padding:4px;">
							<div style="float:left" class="formLabel"> <egui:intnl text="reporter.common.Start Date" /></div>
							<div style="float:left;width:10px" align="center" >:</div>
							<div style="float:left;" class="formValue"> <%=stimefmt%></div>
						</div>
						<div style="clear:both;float:right;padding:4px;">
							<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.End Date" /></div>
							<div style="float:left;width:10px" align="center">:</div>
							<div style="float:left;" class="formValue"><%=etimefmt%></div>
						</div>
					</td>
				</tr>			
			</table>
		</td>
	</tr>
</table>
<%
	Map resultMap = (Map)session.getAttribute("VMAPP_VOLUME_RESULT_MAP");
	if(resultMap!=null)
	{
		Boolean boolObj = null;
		boolean isData = false;		
		if(resultMap.containsKey("isStackUserDetails"))
		{
			boolObj = (Boolean)resultMap.get("isStackUserDetails");
			isData = boolObj.booleanValue();
		}		
		System.out.println("strManagerURL-->"+strManagerURL);
		
		//String controllerURL = strManagerURL+"/final/servlet/com.eg.ErVMAppVolumeLicenseReportC;jsessionid=" + session.getId()+"?";		
		String controllerURL = "/final/servlet/com.eg.ErVMAppVolumeLicenseReportC;jsessionid=" + session.getId()+"?";		
		//String mngrIP = new IniFile(new EgConfigInfo("manager").getDbFile()).getValue("DB_PROPERTIES","ManagerUrl"); 
		System.out.println("mngrIP-->"+mngrIP);
		if(reportFor!=null && reportFor.equalsIgnoreCase("licenseUtilization"))
		{
			JSONObject licenseUtilObj = (JSONObject)resultMap.get("licenseUtil");
			JSONObject licenseDetails = (JSONObject)licenseUtilObj.get("licenseDetails");
			JSONArray licenseUtilArr = (JSONArray)licenseUtilObj.get("licenseUtilArr");
			JSONObject tmpObj = null;
			%>
				<div class="printOuterBox" style="margin:10px 10px 0px 5px;"> 
					<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Overview" />&nbsp;</div>
					<table width="100%">
						<tr><td width="30%" class="graphSeperatorLineRight">
							<table>
								<tr>
									<td>
										<div style="margin:15px 5px 15px 10px;" class="iconTickSelection"></div>
									</td>
									<td>
										<div style="margin:15px 0px 15px 0px;" class="selcetiondetail-bold">Licensed to</div>
									</td>
								</tr>
								<tr>
									<td></td>
									<td>
										<div style="margin:0px 0px 0px 0px;line-height: 1.3;" class="rcontrol-load"><%=licenseDetails.get("info")%></div>
									</td>
								</tr>
								<tr>
									<td></td>
									<td class="graphSeperatorLineBottom">
										<div style="margin:15px 0px 0px 0px;"></div>
									</td>
								</tr>
								<tr>
									<td></td>
									<td>
										<div style="margin:15px 20px 10px 0px;"><span class="selcetiondetail-bold">Valid until: </span><span class="rcontrol-load"><%=licenseDetails.get("licenseEndDate")%></span></div>
									</td>
								</tr>
							</table>
						</td><td width="70%">
							<table>
				<%
					for(int i=0;i<licenseUtilArr.size();i++)
					{
						tmpObj = (JSONObject)licenseUtilArr.get(i);
						String usedDetail = (String)tmpObj.get("usedDetail");
								double licenseUtilization = (Double)tmpObj.get("licenseUtilization");
								String usedCount = (String)tmpObj.get("usedCount");
								String totalCount = (String)tmpObj.get("totalCount");
						%>
								<tr>
									<td width="20%">
										<div  style="margin:0px 15px 0px 0px;text-align:right;" class="rcontrol-load"><%=usedDetail%></div>
									</td>
									<td width="68%">
										<div style="width:100%;background-color:#E5E7E9;">
											<div style="width:<%=licenseUtilization%>%;height:5px;float:left;background-color:#5DADE2 !important;"></div>
											<div style="width:'+(100-<%=licenseUtilization%>)+'%;height:5px;"></div>
									</div>
									</td>
									<td width="12%">
										<div style="margin:0px 5px 0px 10px;">
										<span class="selcetiondetail-bold"><%=usedCount%></span>/<span class="rcontrol-load"><%=totalCount%></span>
									</td>
								</tr>
						<%
					}
				%>
							</table>
						</td></tr>
					</table>
				</div>
			<%
			%>
				<div class="printOuterBox" style="margin:10px 10px 0px 5px;">
				<table border="0" cellspacing="0">
				<tbody>				
			<%
			boolObj = (Boolean)resultMap.get("isUserStackAvailable");
			isData = boolObj.booleanValue();
			if(isData)
			{	
				String userStackURL = controllerURL + "dataKey=userStackChartObj&width=400&height=300&optionType=print";
				String totalUserName = reportInfo.getValue("VM_License_Utilization","totalUserName");
				String totalUserColor = reportInfo.getValue("VM_License_Utilization","totalUserColor");
				String onlineUserColor = reportInfo.getValue("VM_License_Utilization","onlineUserColor");
				String onlineUserName = reportInfo.getValue("VM_License_Utilization","onlineUserName");
				%>
				<tr>
					<td width="50%" class="graphSeperatorLineBottomRight">						
						<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.User Utilization"/></div>
						<table ><tbody>
							<tr width="80%">
								<td>								
								<div>
									<img src="<%=userStackURL%>"/>
								</div>
								</td>
							</tr>
							<tr width="20%"><td>
								<table style="height:45px;width:100%;display:table-cell;vertical-align:middle;padding-left:120px;">
									<tr><td>
											<div style="background-color:<%=totalUserColor%>;width:6px;height:6px;border-radius:50%;"></div>
										</td>
										<td style="text-align:left;padding-left:5px;padding-right:10px;font-size:10px;font-weight:Normal" ><%=totalUserName%>
										</td>
										<td>
											<div style="background-color:<%=onlineUserColor%>;width:6px;height:6px;border-radius:50%;">
											</div>
										</td>
										<td style="text-align:left;padding-left:5px;font-size:10px;font-weight:Normal" ><%=onlineUserName%>
										</td>
									</tr>
								</table>
							</td></tr>
						</tbody></table>						
					</td>				
				<%
			}
			else
			{
				%>
				<tr>
					<td width="50%" class="graphSeperatorLineBottomRight">					
						<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.User Utilization"/></div>
						<div align="center">
							<img src='/final/images/Light/nomeasures_custom.png' />
						</div>
					</td>
				<%
			}			
			boolObj = (Boolean)resultMap.get("isAppStackAvailable");
			isData = boolObj.booleanValue();
			if(isData)
			{
				String appStackURL = controllerURL + "dataKey=appStackChartObj&width=400&height=300&optionType=print";
				String AppStackTotalColor = reportInfo.getValue("VM_License_Utilization","AppStackTotalColor");
				String AppStackTotalName = reportInfo.getValue("VM_License_Utilization","AppStackTotalName");
				String AppStackOnlineColor = reportInfo.getValue("VM_License_Utilization","AppStackOnlineColor");
				String AppStackOnlineName = reportInfo.getValue("VM_License_Utilization","AppStackOnlineName");				
				%>				
					<td width="50%" class="graphSeperatorLineBottom">						
						<div class="printOuterBoxHeader"  style="margin-left:15px;"><egui:intnl text="reporter.common.AppStack Utilization"/></div>
							<table width="100%"><tbody>
								<tr width="80%"><td>								
									<div style="margin-left: 20px;">
										<img src="<%=appStackURL%>"/>
									</div>
								</td></tr>
								<tr width="20%"><td>
									<table style="height:45px;width:100%;display:table-cell;vertical-align:middle;padding-left:110px;">
										<tr><td>
											<div style="background-color:<%=AppStackTotalColor%>;width:6px;height:6px;border-radius:50%;"></div>
										</td>
										<td style="text-align:left;padding-left:5px;padding-right:10px;font-size:10px;font-weight:Normal;" ><%=AppStackTotalName%>
										</td>
										<td>
											<div style="background-color:<%=AppStackOnlineColor%>;width:6px;height:6px;border-radius:50%;">
											</div>
										</td>
										<td style="text-align:left;padding-left:5px;font-size:10px;font-weight:Normal;" ><%=AppStackOnlineName%>
										</td>
									</tr>										
									</table>
								</td></tr>
							</tbody></table>						
						</td>
					</tr>
				<%
			}
			else
			{
				%>				
					<td width="50%" class="graphSeperatorLineBottom">						
						<div class="printOuterBoxHeader" style="margin-left:15px;"><egui:intnl text="reporter.common.AppStack Utilization"/></div>
						<div align="center">
							<img src='/final/images/Light/nomeasures_custom.png' />
						</div>
					</td>
				</tr>
				<%
			}
			boolObj = (Boolean)resultMap.get("isMachineStackAvailable");
			isData = boolObj.booleanValue();
			if(isData)
			{
				String machineStackURL = controllerURL + "dataKey=machineStackChartObj&width=900&height=300&optionType=print";
				
				String totalDesktopColor = reportInfo.getValue("VM_License_Utilization","totalDesktopColor");
				String totalDesktopName = reportInfo.getValue("VM_License_Utilization","totalDesktopName");
				String onlineDesktopColor = reportInfo.getValue("VM_License_Utilization","onlineDesktopColor");
				String onlineDesktopName = reportInfo.getValue("VM_License_Utilization","onlineDesktopName");
				
				String totalServerColor = reportInfo.getValue("VM_License_Utilization","totalServerColor");
				String totalServerName = reportInfo.getValue("VM_License_Utilization","totalServerName");				
				String onlineServerColor = reportInfo.getValue("VM_License_Utilization","onlineServerColor");
				String onlineServerName = reportInfo.getValue("VM_License_Utilization","onlineServerName");
				%>				
				<tr>
					<td width="100%" colspan="2" rowspan="2">						
						<div class="printOuterBoxHeader" style="margin-top:10px;"><egui:intnl text="reporter.common.Computer Utilization"/></div>
						<table width="100%"  align="center" style="align:center;margin:auto auto;"><tbody>
								<tr width="80%"><td>								
									<div>
										<img src="<%=machineStackURL%>"/>
									</div>
							</td></tr>
								<tr width="20%"><td>
								<table style="height:45px;width:100%;display:table-cell;vertical-align:middle;padding-left:250px;">
										<tr><td>
												<div style="background-color:<%=totalDesktopColor%>;width:6px;height:6px;border-radius:50%;"></div>
											</td>
											<td style="text-align:left;padding-left:5px;padding-right:10px;font-size:10px;font-weight:Normal;" ><%=totalDesktopName%>
											</td>
											<td>
												<div style="background-color:<%=onlineDesktopColor%>;width:6px;height:6px;border-radius:50%;">
												</div>
											</td>
											<td style="text-align:left;padding-left:5px;font-size:10px;font-weight:Normal;" ><%=onlineDesktopName%>
											</td>
											<td>
												<div style="background-color:<%=totalServerColor%>;width:6px;height:6px;border-radius:50%;">
												</div>
											</td>
											<td style="text-align:left;padding-left:5px;font-size:10px;font-weight:Normal;" ><%=totalServerName%>
											</td>
											<td>
												<div style="background-color:<%=onlineServerColor%>;width:6px;height:6px;border-radius:50%;">
												</div>
											</td>
											<td style="text-align:left;padding-left:5px;font-size:10px;font-weight:Normal;" ><%=onlineServerName%>
											</td>
										</tr>
									</table>
								</td></tr>
							</tbody></table>
					</td>
				</tr>

				</tbody>
				</table>
				</div>
				<%
			}
			else
			{
				%>	
				<tr>
					<td width="100%"  colspan="2" rowspan="2">
						<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Computer Utilization"/></div>
						<div align="center">
							<img src='/final/images/Light/nomeasures_custom.png' />
						</div>
					</td>
				</tr>				
				</tbody>
				</table>
				</div>
				<%
			}
		}
		else if(reportFor!=null && reportFor.equalsIgnoreCase("userStack") && isData)
		{
			String gridTitle = reportInfo.getValue("VM_License_Utilization", "gridTitle");
			%>
			<div class="printOuterBox" style="margin:10px 10px 0px 5px;">
			<div class="printOuterBoxHeader"><%=gridTitle%></div>
			<div class="newTable">
			<table width="100%">
				<thead>
					<tr><th>User Name</th><th style="text-align: center;">Number of AppStacks Assigned</th></tr>
				</thead>
				<tbody>
			<%
			Map stackUserMap = (Map)resultMap.get("stackUserDetails");
			Set userSet = stackUserMap.keySet();
			Iterator itr = userSet.iterator();
			int stackSize = 0;
			while (itr.hasNext()) 
			{
				String stackUser = (String)itr.next();
				List stackList = (List)stackUserMap.get(stackUser);
				stackSize = stackList.size();
				%>
				<tr>
					<td><%=stackUser%></td>
					<td style="text-align: center;"><%=stackSize%></td>
				</tr>
				<tr>
					<td  colspan="2">
					<div class="printOuterBox newTable" style="padding:10px 10px 10px 10px;">
					<table width="100%">
						<thead>
							<tr><th>App Volume Manager</th><th>AppStacks</th><th>Assigned Time</th></tr>
						</thead>
						<tbody>
				<%
				for(int ii=0;ii<stackSize;ii++)
				{
					List tmp = (List)stackList.get(ii);
					String stackComponent = (String)tmp.get(0);
					String stackName = (String)tmp.get(1);
					String assignedTime = (String)tmp.get(2);
						%>					
						<tr>
							<td><%=stackComponent%></td>
							<td><%=stackName%></td>
							<td><%=assignedTime%></td>
						</tr>						
						<%
				}
				%>
						</tbody>
					</table>
					</div>
					</td>
				</tr>
				<%
			}
			%>
				</tbody>
			</table>
			</div>
			</div>
			<%
		}
		else
		{
			%>
			<div class="printOuterBox newTable" style="padding:10px 0px 0px 0px;">
				<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Session Usage Details"/></div>
				<table width="100%">
					<tr>
						<td align="center"><img src='/final/images/Light/nomeasures_custom.png' /></td>
					</tr>
				</table>
			</div>
			<%
		}

	}
%>

</body>
</html>
<%
//

	
//
} catch(Exception e) {
	e.printStackTrace();
}
%>
<%!
	private List getIniDataList(String data)
	{
		List strList = new ArrayList();
		StringTokenizer keyToken=new StringTokenizer(data,",");
        while(keyToken.hasMoreTokens())
		{
			String s=keyToken.nextToken();
			strList.add(s);
		}
		return strList;
	}
%>
<%!
	private static List getOrderDateSet(List logonList, Map logonDataMap)
	{
		List orderLogonList = new ArrayList();
		List tmpList = null;
		for(int i=0;i<logonList.size();i++)
		{
			tmpList = new ArrayList();
			String logonKey = (String)logonList.get(i);
			if(logonDataMap.containsKey(logonKey))
			{
				String logonData = (String)logonDataMap.get(logonKey);
				tmpList.add(logonKey);tmpList.add(new Double(logonData));
				orderLogonList.add(tmpList);
			}			
		}		
		Collections.sort(orderLogonList, new Comparator() {			
			public int compare(Object o1, Object o2) {					
				List tmp1 = (List)o1;
				double val1 = ((Double)tmp1.get(1)).doubleValue();
				List tmp2 = (List)o2;
				double val2 = ((Double)tmp2.get(1)).doubleValue();				
				if(val1 > val2)
					return -1;
				else if(val1 < val2)
					return 1;
				else
					return 0;
			}	
		});
		return orderLogonList;
	}
%>