<!DOCTYPE html>

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ include file="ErTracker.jsp"%>
<%@ page import="com.eg.EgDbInfo"%>
<%@ page import="com.eg.EgMappingInfo"%>
<%@ page import = "java.text.SimpleDateFormat" %>
<%@ page import = "java.text.DateFormat" %>
<%@ 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"%>
<%@ taglib prefix="egui" uri="../WEB-INF/eg-taglib.tld"%>
<%@ page import="com.egurkha.util.StringUtils"%>
<%@ page import = "org.json.simple.JSONObject"%>
<%@ page import = "org.json.simple.JSONArray"%>
<%!
	public static int logOnDurationTestFreq=5;
	String currentDateFormat =null;
	boolean isViewSummary=false;
%>
<%!
	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";
%>
<%
	Map resultMap = null;
	String upperminor =request.getParameter("upperminor");			
	String uppermajor =request.getParameter("uppermajor");			
	String upperCritical =request.getParameter("upperCritical");			
	String er_option =request.getParameter("er_option");			
	if(er_option == null || (er_option!=null && er_option.isEmpty()))
	{
		 er_option = "Zone";
	}	
	String er_dataFrom =request.getParameter("er_dataFrom");
	String er_service = request.getParameter("er_service");
	if(er_dataFrom!=null && (er_dataFrom.equalsIgnoreCase("Segment")||er_dataFrom.equalsIgnoreCase("Service")||er_dataFrom.equalsIgnoreCase("Zone")))
	{
		if(er_service!=null)
		{
			er_option=er_dataFrom;				
		}
	}
	else if(er_dataFrom!=null && er_dataFrom.equalsIgnoreCase("Component"))
	{
		er_option=er_dataFrom;			
	}
	currentDateFormat = strUserDateFormat;
	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 searchUser = request.getParameter("er_tapplication");
	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 fontStyleDblSingl = "";
	String s_comptype = request.getParameter("er_comptype");
	String er_component[] = request.getParameterValues("er_component");
	String sample = request.getParameter("sample");
	resultMap = (HashMap) session.getAttribute("SLOW_LOGON_REPORT");
	String er_componentType=request.getParameter("er_componentType");
	String enableAggregation =request.getParameter("enableAggregation");
	String er_brokeringFrom=request.getParameter("er_brokeringFrom");
	String select_farm=request.getParameter("select_farm");
	
	try 
	{
		//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;
		JSONObject obj=null;
		JSONArray arr=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 = "";
		}
		EgReportInfo reportInfo = new EgReportInfo("manager");
		EgTablesInfo tablesInfo = new EgTablesInfo("manager");
		ErUtils erUtils = new ErUtils();
	
		List lst = new LinkedList();
		Vector vec1 = new Vector();
		List lst_dat1 = new LinkedList();
		
		if(titleToDisplay==null)
			titleToDisplay="USERLOGON REPORT";
    
		String usrLogons = reportInfo.getValue("USER_LOGON_REPORT","CtxXcXAEuemTest:User Logons");
		String serverCol = reportInfo.getValue("USER_LOGON_REPORT","CtxXcXAEuemTest:Server Start-up");
		String clientCol = reportInfo.getValue("USER_LOGON_REPORT","CtxXcXAEuemTest:Client Start-up");
		String header    = reportInfo.getValue("USER_LOGON_REPORT","CtxXcXAEuemTest:Header");
		String needLogonSplitupTable = request.getParameter("needLogonSplitupTable");
		if(needLogonSplitupTable==null || needLogonSplitupTable.length()==0)
		{
			needLogonSplitupTable = reportInfo.getValue("SLOW_LOGON_REPORT","needLogonSplitupTable");
		}
		if(needLogonSplitupTable==null || needLogonSplitupTable.length()==0)
		{
			needLogonSplitupTable = "Yes";
		}
		String needLogonDetailsTable = reportInfo.getValue("SLOW_LOGON_REPORT","needLogonDetailsTable");
		if(needLogonDetailsTable==null || needLogonDetailsTable.length()==0)
		{
			needLogonDetailsTable = "Yes";
		}
		String usrLogonsArr []    = (usrLogons!=null) ? usrLogons.split(",") : null;
		String serverColArr []    = (serverCol!=null) ? serverCol.split(",") : null;
		String clientColArr []    = (clientCol!=null) ? clientCol.split(",") : null;
		String headerArr []       = (header!=null) ? header.split(",") : null;
                String enableDetailedData = request.getParameter("eDd");
  

%>

<!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>
			#newimg{page-break-inside:avoid}
			.newimg{page-break-inside:avoid}


			
.newPlainTable{
	background-color:#ffffff;
	border:1px solid #cdcdcd;
}
.newPlainTable div:first-child{
	border-bottom:1px solid #c4c4c4;
	padding:0px 0px 5px 0px;
	margin:10px 10px 0px 10px;
}

.newPlainTable div:nth-child(2){
	display:block;
	margin:0px 0px 0px 10px;
	padding:5px 0px 5px 0px;
}

.newPlainTable div:nth-child(2) table{
	width:100%;
}

.newPlainTable div:nth-child(2) table tbody tr td:first-child{
	padding:5px 10px 5px 0px;
	width:80%;
	vertical-align:top;
}

.newPlainTable div:nth-child(2) table tr td:nth-child(2){
	padding:5px 10px 5px 0px;
	width:20%;
	vertical-align:top;
}
.newTable table tbody tr td {border-bottom:1px solid #cdcdcd;padding:4px 10px 1px 10px;font-size:11px;
line-height:12px !important;}

.iconNoalarms{
	background : url('../images/Light/new-status-icon.png') no-repeat;
	background-position: -168px 0px !important;
	width: 24px !important; 
	height: 24px !important;
	margin-bottom:5px !important
}
.commonErrorMsgText{
font-weight:500;
font-size:11px !important;
text-align:center;
color:#1a1a1a;
}
.iconNoalarmsPdf{
	background : url('../images/Light/new-status-icon.png') no-repeat;
	background-position: -168px -3px !important;
	width: 24px !important; 
	height: 24px !important;
	margin-bottom:5px !important
}

		</style>
	</head>
	<body marginwidth="20" marginheight="20" bgcolor="#FFFFFF" style="margin:20px;">
<%
	String strLogCls = "printHeaderBoxLogo";
	if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
	{
		strLogCls = "printHeaderBoxLogo";
	}else
		strLogCls = "printPdfHeaderBoxLogo";

	String noAlarmCls = "iconNoalarms";
	if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
	{
		noAlarmCls = "iconNoalarms";
	}
	else
		noAlarmCls = "iconNoalarmsPdf";
	
	if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
	{
%>
		<div class="<%=strLogCls%>" style="padding:10px"><img src="<%=imageName%>" border="0" /></div> 
<%
	}
	else
	{
%>
		<div class="<%=strLogCls%>"><img src="<%=imageName%>" border="0" /></div> 
<%
	}
%>
		<div class="printHeaderBox">
<%
		if (!StringUtils.isNull(titleToDisplay))
		{
%>
			<div class="printHeaderBoxTitle"><%=titleToDisplay%></div>
<%
		}
		else
		{
%>
			<div class="printHeaderBoxTitle"> <egui:intnl text="reporter.common.SLOW LOGON REPORT " /></div>
<%
		}
		if (pdfPrint != null && pdfPrint.equalsIgnoreCase("yes")) 
		{
%>
			<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>
<%
		}
%>
		</div>

		<div class="printOuterBoxNoBorder">
			<div class="printSelectionFields" ><egui:intnl text="reporter.common.Slow Logon Report"/> - <span class="bold"><%= intlmap.getComponentTypeDescription(s_comptype) %></span></div>
<%
		if(er_option != null && !er_option.equalsIgnoreCase("component"))
		{
			if(select_farm!=null && select_farm.equalsIgnoreCase("--Default--"))
			{
				select_farm = intlmap.getTextDescription("reporter.common."+select_farm);
			}
%>
			<div class="printSelectionFields" ><%=intlmap.getTextDescription("reporter.common."+er_option)%> - <span class="bold"><%=select_farm%></span></div>
<%
		}
		if(er_component != null && er_component.length > 0 && er_component.length <= 2){
			String cmpName="";
			for(int n=0;n<er_component.length;n++){
				String tmpVar=er_component[n];
				if(tmpVar != null && tmpVar.indexOf(":") > -1)
					tmpVar=tmpVar.substring(0,tmpVar.indexOf(":"));
				if(tmpVar!=null && tmpVar.equalsIgnoreCase("All"))
				{
					tmpVar = intlmap.getTextDescription("reporter.common."+tmpVar);
				}
				if(n == 0)
					cmpName=tmpVar;
				else
					cmpName+=", "+tmpVar;
			}
	%>
			<div class="printSelectionFields" ><egui:intnl text="reporter.common.Server"/> - <span class="bold"><%=cmpName%></span></div>
	<%

		}
			String dispStart = "";
			String dispEnd = "";
			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;

			Vector dvec = new Vector();
			String stimefmt =	pdfStartDate+ " hrs";
			String etimefmt =	pdfEndDate+ " hrs";
			dvec.add('"'+"Start Time : "+stimefmt+'"');
			dvec.add('"'+"End Time : "+etimefmt+'"');
			lst.add(dvec);
			String s_tit2= "Slow Logon Analysis ";
			if(s_comptype!=null)
				s_tit2+="for "+intlmap.getComponentTypeDescription(s_comptype);
			if(er_option!=null && !er_option.equalsIgnoreCase("component"))
				lst.add("Slow Logon Details for "+er_option+" : "+request.getParameter("select_farm"));
			lst.add(s_tit2);
%>
		<div class="printSelectionFields"><egui:intnl text="reporter.common.Timeline " /> - <span class="bold"><%=stimefmt%>&nbsp;<egui:intnl text="reporter.common.To" />&nbsp;<%=etimefmt%>&nbsp;</span></div>
	</div>
<%
		if(s_comptype!=null && s_comptype.equalsIgnoreCase("Horizon_Pod"))
		{
			net.sf.json.JSONObject resultMapJson = (net.sf.json.JSONObject)session.getAttribute("USER_LOGON_REPORT_POD");
			HashMap graphDatas=new HashMap();
			if(resultMapJson!=null)
			{
				String noDataStr = (String)resultMapJson.get("NO_DATA");
				//rootJson.put("compType",s_CompType);
				/*if(er_option!=null && !er_option.equalsIgnoreCase("component"))
				{
					lst.add("User Logon Details for "+er_option+" : "+request.getParameter("select_farm"));
				}*/
				if(noDataStr!=null && noDataStr.equalsIgnoreCase("No"))
				{
					//rootJson.put("NO_DATA",false);
					net.sf.json.JSONObject summaryObj = new net.sf.json.JSONObject();
					String Avg_Logons = (String)resultMapJson.get("Avg_Logons");
					summaryObj.put(intlmap.getTextDescription("reporter.common.Total Pool(s)"),(String)resultMapJson.get("Total_Pools")+"#iconUniquePools");
					summaryObj.put(intlmap.getTextDescription("reporter.common.Total Logons"),(String)resultMapJson.get("Total_Logons")+"#iconWebLogIn");
					summaryObj.put(intlmap.getTextDescription("reporter.common.Avg Logon Duration (secs)"), erUtils.round((Double.parseDouble(Avg_Logons)),0)+"#iconSessionHighIdleTime");
					summaryObj.put(intlmap.getTextDescription("reporter.common.Unique Users"),resultMapJson.get("Unique_User")+"#iconLogonUser");
					summaryObj.put(intlmap.getTextDescription("reporter.common.Unique Servers/Desktops"), resultMapJson.get("Desktop_Server_Count")+"#iconClientName");

					if(summaryObj != null)
					{
%>
			<div class="printOuterBox">
				<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Overview"/></div>
				<table width="100%">
					<tr>
<%
						Iterator itr = summaryObj.keySet().iterator();
						while (itr.hasNext())
						{
							String keys = (String)itr.next();
							String valuesInfo = (String)summaryObj.get(keys);
							String iconclass = "";
							if(valuesInfo.indexOf('#')>-1)
							{
								iconclass = valuesInfo.substring(valuesInfo.indexOf('#')+1);
								valuesInfo = valuesInfo.substring(0,valuesInfo.indexOf('#'));
							}
%>
						<td align="center" width="20%" ><table><tr><td align="right" style="padding-right:5px"><div class="<%=iconclass%>"></div></td><td style="text-align:left;padding-left:5px" class="newFont_bold28"><%=valuesInfo%></td></tr><tr><td style="text-align:center;padding: 5px;" colspan="2"><span class="newFont_normal13" ><%=keys%></span></td></tr></table></td> 
<%
						}
%>
					</tr>
				</table>
<%
					}

					net.sf.json.JSONArray summaryTableColumns = (net.sf.json.JSONArray)resultMapJson.get("summaryTableColumns");
					net.sf.json.JSONArray summaryTableDataList = (net.sf.json.JSONArray)resultMapJson.get("summaryTableDataList");
					net.sf.json.JSONObject logonDistributionGrpah = (net.sf.json.JSONObject)resultMapJson.get("logonDistributionGrpah");
					net.sf.json.JSONObject DistributionGraph = (net.sf.json.JSONObject)resultMapJson.get("DistributionGraph");
					net.sf.json.JSONObject columns = (net.sf.json.JSONObject)resultMapJson.get("columns");
					net.sf.json.JSONArray gridData = (net.sf.json.JSONArray)resultMapJson.get("gridData");
					net.sf.json.JSONObject gbObj = (net.sf.json.JSONObject)resultMapJson.get("GROUP_DATA_GP_DATA");
					if(gbObj != null && gbObj.size() == 0)
					{
						gbObj = null;
					}
					graphDatas.put("logonDurationBrkupGrpah",logonDistributionGrpah);
					graphDatas.put("distributionGrpah",DistributionGraph);
					session.setAttribute("GraphDatas",graphDatas);
%>
		</div>
		<div style="margin-top:10px" class="printOuterBox">
			<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Overview by Desktop pools"/></div>
			<div class="newTable" style="padding: 5px 0px 10px 0px;">
				<table width="100%">
					<thead>
						<tr>
<%
					lst_dat1 = new LinkedList();
					vec1 = new Vector();
					for(int la=0;la<summaryTableColumns.size();la++)
					{
						String str_1=(String)summaryTableColumns.get(la);
						String cols = (String)summaryTableColumns.get(la);
						if(cols!=null && cols.indexOf("<br/>")>-1)
						{
							cols = com.egurkha.util.StringUtils.replace(cols,"<br/>"," ");
						}
						vec1.add(cols);
						if(la==0)
						{
%>
							<th><%=str_1%></th>
<%
						}
						else
						{
%>
							<th style="text-align: center;"><%=str_1%></th>
<%
						}
					}
%>
						</tr>
					</thead>
					<tbody>
<%
					for(int la=0;la<summaryTableDataList.size();la++)
					{
%>
						<tr>
<%
						net.sf.json.JSONArray strAry=(net.sf.json.JSONArray)summaryTableDataList.get(la);
						for(int u=0;u<strAry.size();u++)
						{
							if(u==0)
							{
%>
							<td><%=strAry.get(u)%></td>
<%
							}
							else
							{
%>
							<td style="text-align:center;"><%=strAry.get(u)%></td>
<%
							}
						lst_dat1.add(strAry.get(u)+"");
						}
%>
						</tr>
<%
					}
					Hashtable sen11 = new Hashtable();
					sen11.put(vec1,lst_dat1);		
					Hashtable ht11=new Hashtable();
					ht11.put("Summarize by pools",sen11);
					lst.add(ht11);
%>
					</tbody>
				</table>
			</div>
		</div>
		<div style="padding-bottom: 5px;">
			<table width="100%">
				<tr>
					<td width="50%" style="padding:10px 5px 0px 0px;">
						<div class="printOuterBox">
						<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Logon Performance Distribution" /></div>
<%
					String strUrl="../../final/servlet/com.eg.ErCitrixSessionLogonServletC;jsessionid="+session.getId()+"?isGraphReq=true&chartType=donut&chartReqFor=logonDurationBrkupGrpah&imagereq=yes&er_width=250&er_height=250";
%>		
							<table width="100%">
								<tr>
									<td width="60%">
										<div style="float:right;"><img src="<%=strUrl%>" /></div>
									</td>
									<td width="40%" valign="middle">
										<table>
<%
					net.sf.json.JSONObject detailsObj=(net.sf.json.JSONObject)graphDatas.get("logonDurationBrkupGrpah");
					net.sf.json.JSONObject objs=null;
					if(detailsObj!=null)
					{
						net.sf.json.JSONArray legArr=(net.sf.json.JSONArray)detailsObj.get("legendArray");
						if(legArr!=null)
						{
							for(int k=0;k<legArr.size();k++)
							{
								objs=(net.sf.json.JSONObject)legArr.get(k);
%>
											<tr><td style="padding-right: 5px;" ><div style="height:7px;width:7px;-webkit-border-radius:4px;background-color:<%=(String)objs.get("color")%>"></div></td><td><%=(String)objs.get("name")%>&nbsp;(<%=(String)objs.get("percent")%>%)</td></tr>
<%
							}
						}
					}
%>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
					<td width="50%" style="padding:10px 0px 0px 5px;">
						<div class="printOuterBox">
							<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Total Logons vs Avg Logon Duration" /></div>
		<%
				strUrl="../../final/servlet/com.eg.ErCitrixSessionLogonServletC;jsessionid="+session.getId()+"?isGraphReq=true&chartType=donut&chartReqFor=distributionGrpah&imagereq=yes&er_width=430&er_height=250";
		%>		
							<div align="center"><img src="<%=strUrl%>" /></div>
						</div>
					</td>
				</tr>
			</table>
		</div>
<%
					// form Csv data and Main table
					lst_dat1 = new LinkedList();
					vec1 = new Vector();
					Iterator itrs = columns.keySet().iterator();
					String key="";
%>
		<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Session Startup Analysis"/></div>
			<div class="newTable" style="padding: 5px 0px 10px 0px;">
				<table width="100%">
					<thead>
						<tr>
<%
					int u=0;
					while(itrs.hasNext())
					{
						key = (String)itrs.next();
						String vals = (String)columns.get(key);
						if(vals!=null && vals.indexOf("<br/>")>-1)
						{
							vec1.add(com.egurkha.util.StringUtils.replace(vals,"<br/>"," "));
						}
						else
						{
							vec1.add(vals);
						}
						if(u<2)
						{
%>
							<th width="<%=100/columns.size()%>%"><%=vals%></th>
<%
						}
						else
						{
%>
							<th style="text-align:center;" width="<%=100/columns.size()%>%"><%=vals%></th>
<%
						}
						u++;
					}
%>
						</tr>
					</thead>
					</tbody>
<%
					for(int i=0;i<gridData.size();i++)
					{
						String rowcolr="#ffffff";
						if(i%2 != 0)
							rowcolr="#f9f9f9";
						else
							rowcolr="#ffffff";
%>
						<tr>
<%
						net.sf.json.JSONObject tempAry = (net.sf.json.JSONObject)gridData.get(i);
						String compKey = "";
						String stDate = (String)tempAry.get("MSMT_TIME_DB");
						String host = (String)tempAry.get("TRGT_HOST");
						String user = (String)tempAry.get("USERNAME");
						String des_compType = (String)tempAry.get("DESKTOP_COMPTYPE");
						if(user.indexOf("\\")>-1)
						{
							//user = com.egurkha.util.StringUtils.replace(user,"\\","\\\\");
						}
						String desktop = (String)tempAry.get("DESKTOP");
						if(gbObj!=null)
						{
							String gpDurationData = reportInfo.getValue("USER_LOGON_REPORT",des_compType+"_newTable_GPDuration_Splitup");
							String gpData="";
							if(gpDurationData != null && gpDurationData.indexOf("$") > -1)
								gpData=gpDurationData.substring(gpDurationData.indexOf("$")+1);
							ArrayList gpLst = ErUtils.egTokenizer(gpData, ",");
							if(stDate != null && host != null && desktop != null && user!=null)
							{
								compKey=stDate.trim()+"#"+host.trim()+"#+"+user.trim()+"_on_"+desktop;
							}
							else if(stDate!=null)
							{
								compKey=stDate;
							}
							if(gbObj.containsKey(compKey))
							{
								net.sf.json.JSONArray jdnnn = (net.sf.json.JSONArray)gbObj.get(compKey);
								net.sf.json.JSONArray gpHeader = null;
								net.sf.json.JSONArray gpDetailsArr = new net.sf.json.JSONArray();
								for(int z=0;z < jdnnn.size();z++)
								{
									net.sf.json.JSONObject jsnnnn = (net.sf.json.JSONObject)jdnnn.get(z);
									net.sf.json.JSONObject objGp=new net.sf.json.JSONObject();
									if(gpLst != null)
									{
										for(int k=0;k<gpLst.size();k++)
										{
											String str1=(String)gpLst.get(k);
											String strVal1=str1;
											if(str1 != null && str1.indexOf("#") > -1){
												strVal1=str1.substring(str1.indexOf("#")+1);
												str1=str1.substring(0,str1.indexOf("#"));
											}
											if(gpHeader == null)
											{
												gpHeader=new net.sf.json.JSONArray();
												gpHeader.add(strVal1);
											}
											String str2 = (String)jsnnnn.get(str1);
											try
											{
												if(str2 != null)
												{
													double dd = Double.parseDouble(str2);
													if(dd < 0)
													{
														str2="-";
													}
												}
											}
											catch(Exception ee){}
											objGp.put(strVal1,str2);
										}
									}
									gpDetailsArr.add(objGp);
								}

								if(tempAry != null && tempAry.size() > 0){
									gpHeader=new net.sf.json.JSONArray();
									for(int k=0;k<gpLst.size();k++){
										String str1=(String)gpLst.get(k);
										if(str1 != null && str1.indexOf("#") > -1)
										{
											str1=str1.substring(str1.indexOf("#")+1);
										}
										gpHeader.add(str1);
									}
									net.sf.json.JSONObject objGp=new net.sf.json.JSONObject();
									objGp.put("Header",gpHeader);
									objGp.put("Datas",gpDetailsArr);
									tempAry.put("GPDetails",objGp);
								}
							}
						}
						itrs = tempAry.keySet().iterator();
						int um = 0;
						while(itrs.hasNext())
						{
							key = (String)itrs.next();
							Object vals = (Object)tempAry.get(key);
							if(vals instanceof net.sf.json.JSONObject)
							{
%>
							</tr>
							<tr style="background-color:<%=rowcolr%>">
								<td colspan="<%=columns.size()%>" style="border:0px">
								<div>
									<table width="100%" style="border:0px">
										<tr style="background:none">
											<td width="50%" valign="top" style="border:0px;padding:0px">
												<div style="margin:10px 10px 10px 0px;" class="newPlainTable">
													<div class="font_bold12"><egui:intnl text="reporter.common.Logon Time Break-up (secs)"/></div>
													<div style="height:155px;overflow:auto;">
														<table style="border:0px">
		<%
								net.sf.json.JSONObject arr1 = (net.sf.json.JSONObject)tempAry.get("logonBreakup");
								Iterator itr1 = arr1.keySet().iterator();
								while(itr1.hasNext())
								{
									String key1 = (String)itr1.next();
									String value1 = (String)arr1.get(key1);
									if(i==0)
									{
										vec1.add(key1);
									}
									lst_dat1.add(value1);
		%>
										<tr style="background:none"><td style="border:0px"><%=key1%></td><td style="border:0px"><%=value1%></td></tr>
		<%
								}
		%>
														</table>
													</div>
												</div>
											</td>
											<td width="50%" valign="top" style="border:0px;padding:0px">
												<div style="margin:10px 0px 10px 0px;" class="newPlainTable">
													<div class="font_bold12"><egui:intnl text="reporter.common.Group policy Time Break-up (secs)"/></div>
													<div style="height:155px;overflow:auto;">
														<table style="border:0px">
		<%
								arr1 = (net.sf.json.JSONObject)tempAry.get("logonBreakup");
								itr1 = arr1.keySet().iterator();
								while(itr1.hasNext())
								{
									String key1 = (String)itr1.next();
									String value1 = (String)arr1.get(key1);
									if(i==0)
									{
										vec1.add(key1);
									}
									lst_dat1.add(value1);
		%>
										<tr style="background:none"><td style="border:0px"><%=key1%></td><td style="border:0px"><%=value1%></td></tr>
		<%
								}
		%>
														</table>
													</div>
												</div>
											</td>
										</tr>
									</table>
								</div>
							</td>
						</tr>
<%
								if(tempAry != null && tempAry.containsKey("GPDetails"))
								{
									net.sf.json.JSONObject gpBreakup = (net.sf.json.JSONObject)tempAry.get("GPDetails");
									net.sf.json.JSONArray gphdr=(net.sf.json.JSONArray)gpBreakup.get("Header");
									net.sf.json.JSONArray gridGpDatas=(net.sf.json.JSONArray)gpBreakup.get("Datas");
%>
						<tr style="background-color:<%=rowcolr%>;border:0px" >
							<td colspan="<%=columns.size()%>" style="border:0px">
								<div class="font_bold12"><egui:intnl text="reporter.common.Details of client side extensions"/></div>
								<div class="newTable" style="padding: 5px 0px 10px 0px;">
									<table width="100%" style="border:1px solid #cdcdcd;border-bottom:0px">
										<thead>
											<tr>
<%
							lst_dat1.add(" ");
							lst_dat1.add(" ");
							lst_dat1.add(" ");
							lst_dat1.add("Details of client side extensions");
							for(int uv=0;uv<vec1.size()-4;uv++)
							{
								lst_dat1.add(" ");
							}
							lst_dat1.add(" ");
							for(int c=0;c<gphdr.size();c++)
							{
								String hdrStr=(String)gphdr.get(c);
								lst_dat1.add(hdrStr);
%>
												<th><%=hdrStr%></th>
<%
							}
							for(int uv=0;uv<vec1.size()-gphdr.size()-1;uv++)
							{
								lst_dat1.add(" ");
							}
%>
											</tr>
										</thead>
										<tbody>
<%
							for(int c=0;c<gridGpDatas.size();c++)
							{
								lst_dat1.add(" ");
								net.sf.json.JSONObject hdrObj=(net.sf.json.JSONObject)gridGpDatas.get(c);
%>
											<tr>
<%
								for(int j=0;j<gphdr.size();j++)
								{
									String hdrStr=(String)gphdr.get(j);
									lst_dat1.add(hdrStr);
%>
												<td><%=(String)hdrObj.get(hdrStr)%></td>
<%
								}
								for(int uv=0;uv<vec1.size()-gphdr.size()-1;uv++)
								{
									lst_dat1.add(" ");
								}
%>

											</tr>
<%
							}
%>
										</tbody>
									</table>
								</div>
							</td>
						</tr>
<%									
								}
								break;
							}
							else
							{
								if(!columns.containsKey(key))
								{
									continue;
								}
								String valsStr = (String)vals;
								String alignInfo = "left";
								String strPaddingStyle = "";
								if(valsStr != null && valsStr.indexOf("$$") > -1)
								{
									String tmp=valsStr.substring(valsStr.indexOf("$$")+2);
									valsStr=valsStr.substring(0,valsStr.indexOf("$$"));
									String divClassName="";
									if(tmp != null && tmp.equalsIgnoreCase("critical"))
										divClassName = "reporterUserLogonHigh";
									else if(tmp != null && tmp.equalsIgnoreCase("major"))
										divClassName = "reporterUserLogonMedium";
									else if(tmp != null && tmp.equalsIgnoreCase("minor"))
										divClassName =  "reporterUserLogonLow";
									else if(tmp != null && tmp.equalsIgnoreCase("normal"))
										divClassName = "reporterUserLogonNormal";
									else
										divClassName="reporterUserLogonDefault";
									lst_dat1.add(valsStr);
									valsStr="<div style='text-align:center' class='"+divClassName+"'>"+valsStr+"</div>";
									alignInfo="center";
									strPaddingStyle="padding:15px 10px 3px 10px;";
								}
								else
								{
									lst_dat1.add(valsStr);
									if(um>2)
									{
										strPaddingStyle+="text-align:center;";
									}
								}
%>
								<td align=<%=alignInfo%> style="border-bottom:0px;<%=strPaddingStyle%>"><%=valsStr%></td>
<%
							}
							um++;
						}
					}
				}
				else
				{
%>
			<table align="center" width="97%" cellspacing="0" cellpadding="4"   border="0">
				<tr>
					<table width='100%' height='100%'><tr>	<td align='center' valign='middle'><img src='/images/Light/nomeasures_custom.png' /></td></tr></table>
				</tr>
			</table>
<%
				}
			}
			else
			{
%>
			<table align="center" width="97%" cellspacing="0" cellpadding="4"   border="0">
				<tr>
					<table width='100%' height='100%'><tr>	<td align='center' valign='middle'><img src='/images/Light/nomeasures_custom.png' /></td></tr></table>
				</tr>
			</table>
<%
			}
		}
		else
		{
%>
	<div class="printOuterBox">
<%
		String queryString =(String)ErUtils.prepareQueryString(request.getParameterMap());	
		String Qstring="";
		ErSlowLogonDetailsReportBean slowBean=new ErSlowLogonDetailsReportBean();
		
		JSONObject detailObj=null;
		HashMap graphDatas=new HashMap();
		if(upperminor==null || upperminor.length()==0)
			upperminor=reportInfo.getValue("USER_LOGON_REPORT","minorValue");
		if(uppermajor==null || uppermajor.length()==0)
			uppermajor=reportInfo.getValue("USER_LOGON_REPORT","majorValue");
		if(upperCritical==null || upperCritical.length()==0)
			upperCritical=reportInfo.getValue("USER_LOGON_REPORT","criticalValue");
		JSONObject threshObj=new JSONObject();
		threshObj.put("minorVal",upperminor);
		threshObj.put("majorVal",uppermajor);
		threshObj.put("criticalVal",upperCritical);
		String compTable=er_componentType;
		if(er_componentType != null && reportInfo.isVmComponent(er_componentType) && er_brokeringFrom != null && er_brokeringFrom.equalsIgnoreCase("Others")){
			compTable+="_newTable";
		}
		String avgSlowLogon="0";
		if(resultMap != null && resultMap.size() > 0){
			if(resultMap.containsKey("SummaryData")){//for Slow Logon Details Summary Datas
				JSONArray jsnn=(JSONArray)resultMap.get("SummaryData");
				JSONObject summaryObj=slowBean.getLogonSummaryData(jsnn,threshObj,intlmap);
				if(summaryObj != null && summaryObj.containsKey("avgSlowLogonDuration"))//Totallogon
					avgSlowLogon=(String)summaryObj.get("avgSlowLogonDuration");
				if(summaryObj != null && summaryObj.containsKey("LogonSummaryNew")){//Totallogon
					detailObj=(JSONObject)summaryObj.get("LogonSummaryNew");
%>
		<table width="100%">
			<tr>
				<td width="50%" style="padding-right: 5px;">
					<div class="printOuterBox">
						<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Logons" />&nbsp;</div>
						<table width="100%">
							<tr>
			<%
					arr=(JSONArray)detailObj.get("Totallogon");//Slowlogon
					for(int i=0;i<arr.size();i++){
						obj=(JSONObject)arr.get(i);
			%>
								<td align="center" width="33%"><table><tr><td align="right" style="padding-right:5px"><div class="<%=(String)obj.get("iconclass")%>"></div></td><td style="text-align:left;padding-left:5px" class="newFont_bold28"><%=(String)obj.get("value")%></td></tr><tr><td style="text-align:center;padding: 5px;" colspan="2"><span class="newFont_normal13" ><%=(String)obj.get("name")%></span></td></tr></table></td> 
			<%
					}
			%>
							</tr>
						</table>
					</div>
				</td>
				<td width="50%" style="padding-left: 5px;">
					<div class="printOuterBox">
						<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Slow Logons" />&nbsp;</div>
						<table  width="100%">
							<tr>
			<%
					arr=(JSONArray)detailObj.get("Slowlogon");//Slowlogon
					for(int i=0;i<arr.size();i++){
						String percntTmp="";
						obj=(JSONObject)arr.get(i);
						String objVl=(String)obj.get("value");
						String objnme=(String)obj.get("name");
						if(objVl != null && objnme != null && (objnme.equalsIgnoreCase("Total") || objnme.equalsIgnoreCase("Users"))){
							double tmpvl=Double.parseDouble(objVl);
							if(tmpvl > 0){
//								percntTmp="<span class='newFont_normal16'>("+(String)obj.get("percent")+"%)</span>";
								percntTmp="<div style='background:"+(String)obj.get("percentColor")+";padding:5px 4px 3px 4px;margin-left:4px;color:#ffffff;font-family:arial;display:inline-block;text-align:center;line-height:.8em;font-size:12px'>"+(String)obj.get("percent")+"<span style='font-size:10px'>%</span> <br/> <span style='font-size:8px'>SLOW</span></div>";
							}
						}
			%>
								<td align="center" width="33%"><table><tr><td align="right" style="padding-right:5px"><div class="<%=(String)obj.get("iconclass")%>"></div></td><td style="text-align:left;padding-left:5px" class="newFont_bold28"><%=(String)obj.get("value")%><%=percntTmp%></td></tr><tr><td style="text-align:center;padding: 5px;" colspan="2"><span class="newFont_normal13" ><%=(String)obj.get("name")%></span></td></tr></table></td> 
			<%
					}
			%>
							</tr>
						</table>
					</div>
				</td>
			</tr>
		</table>
<%	
				}//end for Logon Details
				if(summaryObj != null && summaryObj.containsKey("DistributionGraph")){
					detailObj=(JSONObject)summaryObj.get("DistributionGraph");
					graphDatas.put("logonPerfDistributionGrpah",detailObj);
				}
			}
	//For Date Conversion 
			SimpleDateFormat sdfrmt=new SimpleDateFormat(currentDateFormat);
			long daysCnt=0;
			try{
				java.util.Date dte1=sdfrmt.parse(pdfStartDate);
				java.util.Date dte2=sdfrmt.parse(pdfEndDate);
				long diff = dte2.getTime() - dte1.getTime();
				daysCnt=(diff/(1000 * 60 * 60 * 24));
			}
			catch(Exception ee){}
			String uiDteFormat=slowBean.getChartlabelFormat(currentDateFormat,daysCnt);
			SimpleDateFormat sdte=null;//2017-09-18
			SimpleDateFormat sdformat=null;//30-08-2017
			String xaxisLabelval="Days";
			if(daysCnt <= 1){//2017-09-26 13:00
				 sdte=new SimpleDateFormat("yyyy-MM-dd HH:mm");
				 sdformat=new SimpleDateFormat(uiDteFormat);
				 xaxisLabelval="Hours";
			}
			else if(daysCnt > 1  && daysCnt < 32){
				 sdte=new SimpleDateFormat("yyyy-MM-dd");
				 sdformat=new SimpleDateFormat(uiDteFormat);
				 xaxisLabelval="Days";
			}
			else if(daysCnt >= 32){
				 sdte=new SimpleDateFormat("MM-yyyy");
				 sdformat=new SimpleDateFormat(uiDteFormat);
				 xaxisLabelval="Months";
			}
			xaxisLabelval = intlmap.getTextDescription("reporter.common."+xaxisLabelval);
			if(resultMap.containsKey("totallogonUsersGraph")){
				JSONObject totlogonbyUsers=(JSONObject)resultMap.get("totallogonUsersGraph");
				JSONObject slowlogonbyUsers=(JSONObject)resultMap.get("slowlogonUsersGraph");
				detailObj=slowBean.getLogonTrendGraphbyUsers(totlogonbyUsers,slowlogonbyUsers,sdte,sdformat,reportInfo,intlmap);
				detailObj.put("xAxisLabelText",xaxisLabelval);
				graphDatas.put("logonTrendbyUsers",detailObj);
			}
			if(resultMap.containsKey("sessionStartupDurationTrendData")){
				JSONArray logonTrend=(JSONArray)resultMap.get("sessionStartupDurationTrendData");
				detailObj=slowBean.getSlowLogonStartupTrend(logonTrend,sdte,sdformat,intlmap);
				detailObj.put("xAxisLabelText",xaxisLabelval);
				graphDatas.put("slowLogonSessnStartupTrend",detailObj);
			}
			if(resultMap.containsKey("logonTrendGraphSeperateTotal")){
				JSONObject totlogonbyUsers=(JSONObject)resultMap.get("logonTrendGraphSeperateTotal");
				JSONObject slowlogonbyUsers=null;
				if(resultMap.containsKey("logonTrendGraphSeperateSlow"))
					slowlogonbyUsers=(JSONObject)resultMap.get("logonTrendGraphSeperateSlow");
				detailObj=slowBean.getLogonTrendGraphbylogonCount(totlogonbyUsers,slowlogonbyUsers,sdte,sdformat,intlmap);
				detailObj.put("xAxisLabelText",xaxisLabelval);
				graphDatas.put("logonTrendbyLogonCount",detailObj);
			}
			if(resultMap.containsKey("maxlogonDurationUsersGraph")){
				JSONArray durationbyUsers=(JSONArray)resultMap.get("maxlogonDurationUsersGraph");
				detailObj=slowBean.getMaxLogonTimeTrendGraph(durationbyUsers,intlmap);
				graphDatas.put("MaxlogonTimebyUsersGrpah",detailObj);
			}
			//getLogonTimeBreakdownGraph
			if(resultMap.containsKey("logonBreakdown")){
				JSONArray logonBreakdownArr=(JSONArray)resultMap.get("logonBreakdown");
				detailObj=slowBean.getLogonTimeBreakdownGraph(logonBreakdownArr,intlmap,compTable);
				//String donutTitle="<span style=\"font-weight:bold;color:red;font-family:Arial;font-size:45px\">23</span><span style=\"color:#666666;font-family:Arial;font-size:12px\">%</span>";style=\"margin-top: -5px;\"
				if(detailObj != null && detailObj.size() > 0){
					String donutTitle="<span align='center' style=\"font-size:32px;font-family:Roboto;font-weight:400;\">"+avgSlowLogon+"</span>";
					String donutSubTitle="<span style=\"font-size:12px;font-family:Roboto;font-weight:400;\">"+intlmap.getTextDescription("reporter.common.secs")+"</span>";
					detailObj.put("title",donutTitle);
					detailObj.put("subTitle",donutSubTitle);
					detailObj.put("isDoNutTitleNeeded","true");
					graphDatas.put("logonTimeDistributionGrpah",detailObj);
				}
			}
			//
			JSONObject detailGridObj=null;
			if(resultMap.containsKey("slowlogonUsersDetails"))
			{
				JSONArray logonDetails=(JSONArray)resultMap.get("slowlogonUsersDetails");
				if(logonDetails != null && logonDetails.size() > 0)
				{
					String detailedData=reportInfo.getValue("SLOW_LOGON_REPORT","enableDetailedData");

					if(er_componentType != null && (er_componentType.equalsIgnoreCase("Citrix_XcXenDesktop_Director") || er_componentType.equalsIgnoreCase("Citrix_XcXenDesktop_Site")||er_componentType.equalsIgnoreCase("Citrix_Cloud_Site")))
					{
						JSONObject dirData=null;
						JSONObject gbSplitup=null;
						JSONObject dirDataFrmVmg=null;
						JSONObject gbSplitupFrmVmg=null;
						if(detailedData != null && detailedData.equalsIgnoreCase("yes") )
						{
							if(resultMap.containsKey("Slow_Logon_Dir_Data")){//for slow logon Details grid 
								dirData=(JSONObject)resultMap.get("Slow_Logon_Dir_Data");
							}
							if(resultMap.containsKey("slowlogonGPDurationSplitup")){
								gbSplitup=(JSONObject)resultMap.get("slowlogonGPDurationSplitup");
							}
							if(resultMap.containsKey("Slow_Logon_Dir_DataForVMG")){//for slow logon Details grid (From VMG Test)
								dirDataFrmVmg=(JSONObject)resultMap.get("Slow_Logon_Dir_DataForVMG");
							}
							if(resultMap.containsKey("slowlogonGPDurationSplitupForVMG")){//for slow logon Details grid (From VMG Test)
								gbSplitupFrmVmg=(JSONObject)resultMap.get("slowlogonGPDurationSplitupForVMG");
							}
						}
						detailGridObj=slowBean.getSlowLogonGridDetailedDatas(logonDetails,dirData,gbSplitup,dirDataFrmVmg,gbSplitupFrmVmg,er_componentType,intlmap,currentDateFormat,lst,needLogonSplitupTable);//
						if(detailGridObj != null && detailGridObj.size() > 0){
							JSONObject gpBreakdownData=new JSONObject();
							JSONObject topUsersbygpTimeData=new JSONObject();
							if(detailGridObj != null && detailGridObj.containsKey("gpKeys")){
								JSONArray gpkeyArr=(JSONArray)detailGridObj.get("gpKeys");
								String gpVal1="Session_id";
								String gpVal2="Session_name";
								slowBean.getgroupPolicyBreakdownGrpah(gbSplitup,gpkeyArr,gpVal1,gpVal2,gpBreakdownData);

								slowBean.topUsersbygpTimeforDirtComp(gbSplitup,gpkeyArr,gpVal2,topUsersbygpTimeData);
							}
							if(detailGridObj != null && detailGridObj.containsKey("gpKeysfrVMG")){
								JSONArray gpkeyArr=(JSONArray)detailGridObj.get("gpKeysfrVMG");
								String gpVal1="CSE_extension_name";
								String gpVal2="CSE_elapsed_time";
								slowBean.getgroupPolicyBreakdownGrpah(gbSplitup,gpkeyArr,gpVal1,gpVal2,gpBreakdownData);

								slowBean.topUsersbygpTimeforDirtComp(gbSplitup,gpkeyArr,gpVal2,topUsersbygpTimeData);
							}

							JSONObject maxgpTimeGraph=slowBean.getMaxGPTimeByUsersGraph(topUsersbygpTimeData,intlmap);
							if(maxgpTimeGraph != null && maxgpTimeGraph.size() > 0)
								graphDatas.put("maxgpTimebyUsersGrpah",maxgpTimeGraph);
	
							JSONObject gpTimeBreakdownGraph=slowBean.getGPTimeBreakDownGraph(gpBreakdownData,intlmap);
							
							if(gpTimeBreakdownGraph != null && gpTimeBreakdownGraph.size() > 0)
								graphDatas.put("gpTimeDistributionGrpah",gpTimeBreakdownGraph);
						}
					}
					else{
						JSONObject gbSplitup=null;
						if(detailedData != null && detailedData.equalsIgnoreCase("yes") )
						{
							if(resultMap.containsKey("slowlogonGPDurationSplitup"))
								gbSplitup=(JSONObject)resultMap.get("slowlogonGPDurationSplitup");
						}

						detailGridObj=slowBean.getLogonDetailsGridData(logonDetails,gbSplitup,compTable,intlmap,currentDateFormat,thisuser,lst,needLogonSplitupTable);
						if(detailGridObj != null && detailGridObj.size() > 0){
//for Gp Time Break Down Graph
							if(detailGridObj != null && detailGridObj.containsKey("gpDetailedList")){
								JSONArray gpKeyList=(JSONArray)detailGridObj.get("gpDetailedList");

								String gpVal1="Session_id";
								String gpVal2="Session_name";
								if(reportInfo.isVmComponent(er_componentType)){
									gpVal1="CSE_extension_name";
									gpVal2="CSE_elapsed_time";
									if(er_brokeringFrom != null && er_brokeringFrom.equalsIgnoreCase("Others")){
										gpVal1="CSE_name";
										gpVal2="CSE_time";
									}
								}
								JSONObject gpBreakdownData=new JSONObject();
								JSONObject topUsersbygpTimeData=new JSONObject();
								slowBean.getgroupPolicyBreakdownGrpah(gbSplitup,gpKeyList,gpVal1,gpVal2,gpBreakdownData);
								
								slowBean.topUsersbygpTimeGraph(gbSplitup,gpKeyList,gpVal2,topUsersbygpTimeData);
								JSONObject maxgpTimeGraph=slowBean.getMaxGPTimeByUsersGraph(topUsersbygpTimeData,intlmap);
								if(maxgpTimeGraph != null && maxgpTimeGraph.size() > 0)
									graphDatas.put("maxgpTimebyUsersGrpah",maxgpTimeGraph);

								JSONObject gpTimeBreakdownGraph=slowBean.getGPTimeBreakDownGraph(gpBreakdownData,intlmap);
								if(gpTimeBreakdownGraph != null && gpTimeBreakdownGraph.size() > 0)
									graphDatas.put("gpTimeDistributionGrpah",gpTimeBreakdownGraph);
							}
						}
					}
				}
			}
			session.setAttribute("GraphDatas",graphDatas);
		%>
			<table width="100%" style="page-break-inside: auto !important">
				<tr>
					<td width="50%" style="padding:10px 5px 0px 0px;">
						<div class="printOuterBox">
			<%
				String strUrl="../../final/servlet/com.eg.ErSlowLogonDetailsReportC;jsessionid="+session.getId()+"?isGraphReq=true&chartType=donut&chartReqFor=logonPerfDistributionGrpah&imagereq=yes&er_width=250&er_height=250";
			%>
						<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Logon Performance Distribution " /></div>
							<table width="100%">
								<tr>
									<td width="60%">
										<div style="float:right;" style="height: 250px;"><img src="<%=strUrl%>" /></div>
									</td>
									<td width="40%" valign="middle">
										<table>
			<%
							detailObj=(JSONObject)graphDatas.get("logonPerfDistributionGrpah");
							if(detailObj!=null)
							{
								JSONArray legArr=(JSONArray)detailObj.get("legendArray");
								for(int k=0;k<legArr.size();k++){
									obj=(JSONObject)legArr.get(k);
			%>
											<tr><td style="padding-right: 5px;" ><div style="height:7px;width:7px;-webkit-border-radius:4px;background-color:<%=(String)obj.get("color")%>"></div></td><td><%=(String)obj.get("name")%></td><td style="padding-left:5px;"><%=(String)obj.get("percent")%>%</td></tr>
			<%
								}
							}
			%>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
					<td width="50%" style="padding:10px 0px 0px 5px;">
			<%
				strUrl="../../final/servlet/com.eg.ErSlowLogonDetailsReportC;jsessionid="+session.getId()+"?isGraphReq=true&chartType=donut&chartReqFor=logonTrendbyUsers&imagereq=yes&er_width=420&er_height=250";
			%>
						<div class="printOuterBox">
							<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Number Of Users Affected by Slow Logons " /></div>
							<div align="center" style="height: 250px;"><img src="<%=strUrl%>" /></div>
						</div>
					</td>
				</tr>
				<tr>
					<td width="50%" style="padding:10px 5px 0px 0px;" >
						<div class="printOuterBox">
			<%
				String trendTitle=intlmap.getTextDescription("reporter.common.Slow Session Startup Duration Trend");
				if(er_componentType != null && (er_componentType.equalsIgnoreCase("Citrix_XcXenDesktop_Director") || er_componentType.equalsIgnoreCase("Citrix_XcXenDesktop_Site")||er_componentType.equalsIgnoreCase("Citrix_Cloud_Site")))
					trendTitle=intlmap.getTextDescription("reporter.common.Slow logon Duration Trend");
				strUrl="../../final/servlet/com.eg.ErSlowLogonDetailsReportC;jsessionid="+session.getId()+"?isGraphReq=true&chartType=donut&chartReqFor=slowLogonSessnStartupTrend&imagereq=yes&er_width=420&er_height=250";
			%>
							<div class="printOuterBoxHeader"><%=trendTitle%></div>
							<div align="center" style="height: 250px;"><img src="<%=strUrl%>" /></div>
						</div>
					</td>
					<td width="50%" style="padding:10px 0px 0px 5px;" >
			<%
				strUrl="../../final/servlet/com.eg.ErSlowLogonDetailsReportC;jsessionid="+session.getId()+"?isGraphReq=true&chartType=donut&chartReqFor=logonTrendbyLogonCount&imagereq=yes&er_width=420&er_height=250";
			%>
						<div class="printOuterBox">
							<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Total Logons vs Slow Logons Trend " /></div>
							<div align="center" style="height: 250px;"><img src="<%=strUrl%>" /></div>
						</div>
					</td>
				</tr>
				<tr class="newimg">
					<td width="50%" style="padding:10px 5px 0px 0px;" >
						<div class="printOuterBox">
			<%
				int titVal=10;
				String colCnt=reportInfo.getValue("SLOW_LOGON_REPORT","UsersCountforMaxLogonGraph");
				if(colCnt != null )
					titVal=Integer.parseInt(colCnt);
				strUrl="../../final/servlet/com.eg.ErSlowLogonDetailsReportC;jsessionid="+session.getId()+"?isGraphReq=true&chartType=donut&chartReqFor=MaxlogonTimebyUsersGrpah&imagereq=yes&er_width=420&er_height=250";
			%>	
							<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Top "/>&nbsp;<%=titVal%>&nbsp;<egui:intnl text="reporter.common.Users by Maximum Logon Duration" /></div>
							<div align="center"><img src="<%=strUrl%>" /></div>
						</div>
					</td>
					<td width="50%" style="padding:10px 0px 0px 5px;">
						<div class="printOuterBox">
			<%
				trendTitle="Avg Slow Session Startup Breakdown ";
				if(er_componentType != null && (er_componentType.equalsIgnoreCase("Citrix_XcXenDesktop_Director")|| er_componentType.equalsIgnoreCase("Citrix_XcXenDesktop_Site")||er_componentType.equalsIgnoreCase("Citrix_Cloud_Site")))
					trendTitle="Avg Slow Logon Duration Breakdown ";
				strUrl="../../final/servlet/com.eg.ErSlowLogonDetailsReportC;jsessionid="+session.getId()+"?isGraphReq=true&chartType=donut&chartReqFor=logonTimeDistributionGrpah&imagereq=yes&er_width=250&er_height=250";
			%>
							<div class="printOuterBoxHeader"><%=trendTitle%> (<egui:intnl text="reporter.common.secs"/>)</div>
			<%
						if(graphDatas != null && graphDatas.containsKey("logonTimeDistributionGrpah")){
			%>
							<table width="100%">
								<tr>
									<td width="60%">
										<div style="float:right;height: 250px;"><img src="<%=strUrl%>" /></div>
									</td>
									<td width="40%" valign="middle">
										<table>
			<%
							detailObj=(JSONObject)graphDatas.get("logonTimeDistributionGrpah");
							JSONArray legArr=null;
							if(detailObj!=null)
							{
								legArr=(JSONArray)detailObj.get("legendArray");
								for(int k=0;k<legArr.size();k++){
									obj=(JSONObject)legArr.get(k);
			%>
											<tr><td style="padding-right: 5px;padding-top:5px;" valign="top"><div style="height:7px;width:7px;-webkit-border-radius:4px;background-color:<%=(String)obj.get("color")%>"></div></td><td><%=(String)obj.get("name")%></td><td style="padding-left:5px;" valign="top"><%=(Double)obj.get("val")%></td></tr>
			<%
									if(obj != null && obj.size() > 0 && obj.containsKey("innerArray")){
										JSONArray tmplegArray=(JSONArray)obj.get("innerArray");
										if(tmplegArray != null && tmplegArray.size() > 0){
											JSONObject tmpobj2=null;
											for(int m=0;m<tmplegArray.size();m++){
												tmpobj2=(JSONObject)tmplegArray.get(m);
												if(tmpobj2 != null && tmpobj2.size() > 0){
			%>
											<tr><td>&nbsp;</td><td>&nbsp;&nbsp;<%=(String)tmpobj2.get("name")%></td><td style="padding-left:5px;" valign="top"><%=(Double)tmpobj2.get("val")%></td></tr>
			<%
												}
											}
										}
									}
								}
							}
			%>
										</table>
									</td>
								</tr>
							</table>
			<%
						}else{
			%>
							<div align="center" style="height: 250px;"><table width="100%" style="height: 250px;"><tr><td align="center"><div class="<%=noAlarmCls%>" ></div><div class="commonErrorMsgText">No Slow Logons found</div></td></tr></table></div>
							
			<%
						}
			%>
						</div>
					</td>
				</tr>
			<%
				if(graphDatas != null && graphDatas.containsKey("gpTimeDistributionGrpah")){
			%>
				<tr class="newimg"><!-- gpTimeDistributionGrpah -->
					<td width="50%" style="padding:10px 5px 0px 0px;" >
			<%
				strUrl="../../final/servlet/com.eg.ErSlowLogonDetailsReportC;jsessionid="+session.getId()+"?isGraphReq=true&chartType=donut&chartReqFor=gpTimeDistributionGrpah&imagereq=yes&er_width=250&er_height=250";
			%>
						<div class="printOuterBox">
							<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Client Side Extension Time Breakdown" /></div>
							<table width="100%">
								<tr>
									<td width="60%">
										<div style="float:right;" style="height: 250px;"><img src="<%=strUrl%>" /></div>
									</td>
									<td width="40%" valign="middle">
										<table>
			<%
										detailObj=(JSONObject)graphDatas.get("gpTimeDistributionGrpah");
										JSONArray legArr=null;
										if(detailObj!=null)
										{
											legArr=(JSONArray)detailObj.get("legendArray");
											for(int k=0;k<legArr.size();k++){
												obj=(JSONObject)legArr.get(k);
			%>
											<tr><td style="padding-right: 5px;padding-top:5px;" valign="top"><div style="height:7px;width:7px;-webkit-border-radius:4px;background-color:<%=(String)obj.get("color")%>"></div></td><td><%=(String)obj.get("name")%></td><td style="padding-left:5px;" valign="top"><%=(Double)obj.get("y")%></td></tr>
			<%
											}
										}

			%>							</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
					<td width="50%" style="padding:10px 0px 0px 5px;" >
						<div class="printOuterBox">
			<%
				strUrl="../../final/servlet/com.eg.ErSlowLogonDetailsReportC;jsessionid="+session.getId()+"?isGraphReq=true&chartType=donut&chartReqFor=maxgpTimebyUsersGrpah&imagereq=yes&er_width=420&er_height=250";
			%>
							<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Top "/>&nbsp;<%=titVal%>&nbsp;<egui:intnl text="reporter.common.Users by Client Side Extension Time" /></div>
							<div align="center"><img src="<%=strUrl%>" /></div>
						</div>
					</td>
				</tr>
			<%
				}
			%>
			</table>
		
	<%
//Grid new Design
	if(resultMap.containsKey("slowlogonUsersDetails"))
	{
		JSONArray logonDetails=(JSONArray)resultMap.get("slowlogonUsersDetails");
		if(logonDetails != null && logonDetails.size() > 0)
		{
			if(er_componentType != null && (er_componentType.equalsIgnoreCase("Citrix_XcXenDesktop_Director")|| er_componentType.equalsIgnoreCase("Citrix_XcXenDesktop_Site")||er_componentType.equalsIgnoreCase("Citrix_Cloud_Site")))
			{
				if(detailGridObj != null && detailGridObj.size() > 0)
				{
					JSONArray colArray=(JSONArray)detailGridObj.get("columns");
					JSONArray datArray=(JSONArray)detailGridObj.get("dataArray");
					JSONObject griddatasObj=null;
					JSONObject startupData=null;
					if(colArray!=null && colArray.size()>11)
					{
	%>
					<pd4ml:page.break htmlWidth="1750">
	<%
					}
		if(needLogonDetailsTable!=null && needLogonDetailsTable.equalsIgnoreCase("yes"))
		{
	%>
		<div class="printOuterBox newTableDiv" style="padding:10px 0px 0px 0px;overflow:unset;">
			<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Slow Logon Details "/>&nbsp;(<egui:intnl text="reporter.common.secs"/>)&nbsp;</div>
			<table width="100%" class="firstTable">
				<thead>
					<tr>
	<%
				for(int i=0;i<colArray.size();i++){
					String colName=(String)colArray.get(i);
	%>
						<th><%=colName%></th>
	<%
				}
	%>
					</tr>
				</thead>
				<tbody>
	<%
				for(int i=0;i<datArray.size();i++)
				{
					JSONObject dataObj=(JSONObject)datArray.get(i);
					JSONObject detailedData=null;
					if(dataObj != null && dataObj.containsKey("dirtData")){
						detailedData=(JSONObject)dataObj.get("dirtData");
					}
		%>
					<tr class="newimg">
		<%
					for(int j=0;j<colArray.size();j++){
						String colName=(String)colArray.get(j);
						String dataVal=(String)dataObj.get(colName);
						if(colName != null && (colName.equalsIgnoreCase("USER NAME") || colName.equalsIgnoreCase("SERVER") || colName.equalsIgnoreCase("SESSION STARTUP TIME") || colName.equalsIgnoreCase("CLIENT IP ADDRESS") || colName.equalsIgnoreCase("CLIENT NAME") || colName.equalsIgnoreCase("CLIENT VERSION") || colName.equalsIgnoreCase("CONTROLLER NAME") || colName.equalsIgnoreCase("LAUNCHED VIA IP ADDRESS") )){
		%>
						<td><%=dataVal%></td>
		<%
						}else{
		%>
						<td align="center"><%=dataVal%></td>
		<%
						}
					}
		%>
					</tr>
		<%			
					if(detailedData != null && needLogonSplitupTable!=null && needLogonSplitupTable.equalsIgnoreCase("yes"))
					{
		%>
				<tr >
					<td colspan="<%=colArray.size()%>"> 
						<div class="userLogonInnerTableOuter" style="margin:10px">
		<%
		

						if(detailedData != null && detailedData.containsKey("clinetServerData") ){
							startupData=(JSONObject)detailedData.get("clinetServerData");
							String tit=(String)startupData.get("title");
							JSONObject mainHeader=(JSONObject)startupData.get("mainHeader");
							JSONObject serverHeader=(JSONObject)startupData.get("serverHeader");
							JSONObject clientHeader=(JSONObject)startupData.get("clientHeader");
							JSONArray commnData=(JSONArray)startupData.get("commnData");
							JSONArray serverData=(JSONArray)startupData.get("serverData");
							JSONArray clientData=(JSONArray)startupData.get("clientData");
		%>

   <table cellpadding="0" cellspacing="0" border="0px" class="newimg">
      <tbody>
         <tr>
            <td style="padding:20px">
               <div class="reporterHtmlFieldsetBody">
		<%
			if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes")){
		%>
                  <div class="reporterLogonFieldsetHeader" nowrap=""><%=tit%></div>
		<%
			}else{
		%>
				 <div style="background:#fbfbfb;height:15px;padding:2px 10px 4px 10px;border:1px solid #e3e3e3;font-size:14px;color:#2a292a;text-align:left;margin-left:20px;margin-top:-20px;width:450px;" nowrap=""><%=tit%></div>
		<%
			}
		%>
                  <table width="100%" cellpadding="0" cellspacing="0" border="0px" style="border:0px">
                     <tbody>

                        <tr>
                           <td colspan="3" style="padding:6px;height:30px" align="center">
                              <div class="reporterLogonSessionStartupBox" style="width:350px;height:24px;margin:20px auto 10px  auto;">
                                 <table border="0" style="margin:3px auto;">
                                    <tbody>
                                       <tr>
                                          <td class="reporterLogonSessionStartup"><egui:intnl text="reporter.common.Session Start-up Duration"/>&nbsp;(<egui:intnl text="reporter.common.secs"/>)&nbsp;:</td>
                                          <td class="reporterLogonSessionStartupValue"><%=(String)mainHeader.get("value")%></td>
                                       </tr>
                                    </tbody>
                                 </table>
                              </div>
                           </td>
                        </tr>

			<tr>
			   <td style="padding:0px 5px 20px 20px" valign="top">
                              <table border="0px" style="width:100%" class="reporterLogonServerStartUpTable">
                                 <tbody>
                                    <tr>


									<td valign="middle" rowspan="2" class="rowspanRightBorder">
                                          <table border="0px" style="width:150px;float:left;margin-top:7px">
                                             <tbody>
							<%
								for(int l=0;l<commnData.size();l++){
									griddatasObj=(JSONObject)commnData.get(l);
							%>
												<tr>
                                                   <td>
                                                      <div class="reporterLoginSessionLabel" style="text-align:center;"><%=(String)griddatasObj.get("key")%></div>
                                                      <div class="reporterLoginPopupVal" style="text-align:center;"><%=(String)griddatasObj.get("value")%></div>
                                                   </td>
                                                </tr>
							<%
								}
							%>


											  </tbody>
                                          </table>
                                       </td>



									   <td valign="top">
                                          <table border="0px" style="width:100%;float:left">
                                             <tbody>
                                                <tr>
                                                   <td class="reporterLogonPanelHead" style="width:90%"><%=(String)serverHeader.get("key")%>&nbsp;(<egui:intnl text="reporter.common.secs"/>)&nbsp;</td>
                                                   <td style="align:right;" class="reporterLogonPanelHead">
                                                      <div style="float:right;width:60px;text-align:left;"><%=(String)serverHeader.get("value")%></div>
                                                   </td>
                                                </tr>
                                             </tbody>
                                          </table>
                                       </td>
                                    </tr>
									
									<tr>
										<!-- <td valign="top">
                                          <table border="0px" style="width:150px;float:left;margin-top:7px">
                                             <tbody>
							<%
								for(int l=0;l<commnData.size();l++){
									griddatasObj=(JSONObject)commnData.get(l);
							%>
												<tr>
                                                   <td>
                                                      <div class="reporterLoginSessionLabel" style="text-align:center;"><%=(String)griddatasObj.get("key")%></div>
                                                      <div class="reporterLoginPopupVal" style="text-align:center;"><%=(String)griddatasObj.get("value")%></div>
                                                   </td>
                                                </tr>
							<%
								}
							%>


											  </tbody>
                                          </table>
                                       </td> -->
									   <td valign="top">
                                          <div style="height:150px;overflow:auto;width:100%">
                                             <table border="0px" style="float:left;" class="reporterLogonPanelBody">
                                                <tbody>
							<%
								for(int l=0;l<serverData.size();l++){
									griddatasObj=(JSONObject)serverData.get(l);
							%>


												  <tr>
                                                      <td style="width:90%"><%=(String)griddatasObj.get("key")%></td>
                                                      <td style="align:right;">
                                                         <div class="valueDiv"><%=(String)griddatasObj.get("value")%></div>
                                                      </td>
                                                   </tr>

							<%
								}
							%>

												 </tbody>
                                             </table>
                                          </div>
                                       </td>
									</tr>
								</tbody>
                              </table>
                           </td>
						   <!-- <td style="padding:0px 10px 0px 10px" valign="top">
                              <div class="reporterLogonDivider"></div>
                           </td> -->

                           <td style="padding:0px 20px 20px 5px">
                              <table border="0" style="width:100%;float:left" class="reporterLogonServerStartUpTable">
                                 <tbody>
									

								    <tr>
                                       <td>
                                          <table width="100%">
                                             <tbody>
                                                <tr>
                                                   <td class="reporterLogonPanelHead" style="text-align:left;width:90%"><%=(String)clientHeader.get("key")%>&nbsp;(<egui:intnl text="reporter.common.secs"/>)&nbsp;</td>
                                                   <td style="align:right;" class="reporterLogonPanelHead">
                                                      <div style="float:right;width:60px;text-align:left;"><%=(String)clientHeader.get("value")%></div>
                                                   </td>
                                                </tr>
                                             </tbody>
                                          </table>
                                       </td>
                                    </tr>

									<tr>
                                    	<td>
                                        	<div style="height:150px;overflow:auto;width:100%">
                                            	<table class="reporterLogonPanelBody" width="100%">
                                            	<tbody>

							<%
								for(int l=0;l<clientData.size();l++){
									griddatasObj=(JSONObject)clientData.get(l);
							%>
                                                   <tr>
													<td style="width:80%"><%=(String)griddatasObj.get("key")%></td>
                                                      <td style="align:right;">
                                                         <div class="valueDiv"><%=(String)griddatasObj.get("value")%></div>
                                                      </td>
                                                   </tr>
							<%
								}
							%>
												</tbody>
                                             </table>
                                          </div>
                                       </td>
                                    </tr>
								</tbody>
                              </table>
                           </td>
						</tr>
					</tbody>
                  </table>
               </div>
            </td>
         </tr>
      </tbody>
   </table>

  
		<%
					}
					if(detailedData != null && detailedData.containsKey("gpDatas") ){
						startupData=(JSONObject)detailedData.get("gpDatas");
						JSONArray gpHeader=(JSONArray)startupData.get("gpHeader");
						JSONArray gpDataArr=(JSONArray)startupData.get("gpDataArr");

		%>

							<div class="userLogonInnerTableOuter bg2" style="position:relative;margin:10px 20px 10px 0px">
				<div class="reportLogonGridColumnHighlightArrow" style="left:100px;top:-10px"></div>
				<p class="font_bold12"><egui:intnl text="reporter.common.Details of client side extensions"/></p>
				<div class="newTable">
					<table width="100%">
						<thead>
							<tr>
		<%
						for(int k=0;k<gpHeader.size();k++){
							String headr=(String)gpHeader.get(k);
		%>
								<th><%=headr%></th>
		<%
						}
		%>
							</tr>
						</thead>
						<tbody>
		<%
						for(int j=0;j<gpDataArr.size();j++){
							griddatasObj=(JSONObject)gpDataArr.get(j);
		%>
							<tr>
		<%
							for(int k=0;k<gpHeader.size();k++){
								String headr=(String)gpHeader.get(k);
		%>
								<td><%=(String)griddatasObj.get(headr)%></td>
		<%
							}
		%>
							</tr>
		<%
						}
		%>

						</tbody>
					</table>
				</div>
			</div>
		<%
					}
		%>
				</div>
			</td>
		</tr>
		<%
		}
				}
		%>
		
		</tbody>
	</table>
</div>
		
		<%
					}
				}
			}
			else
			{
				if(detailGridObj != null && detailGridObj.size() > 0)
				{
					JSONObject obj1=null; 
					JSONObject obj2=null; 
					JSONObject obj3=null; 
					JSONArray arr1=null; 
					JSONArray colArray=(JSONArray)detailGridObj.get("columns");
					JSONArray dataArray=(JSONArray)detailGridObj.get("dataArray");
					if(needLogonDetailsTable!=null && needLogonDetailsTable.equalsIgnoreCase("yes"))
					{
					
		%>
			<div class="printOuterBox newTable" style="padding:10px 0px 0px 0px;">
				<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Slow Logon Details"/>&nbsp;(<egui:intnl text="reporter.common.secs"/>)</div>
				<table width="100%">
					<thead>
						<tr>
		<%
					for(int l=0;l<colArray.size();l++){
						String str1=(String)colArray.get(l);
						if(str1 != null && (str1.equalsIgnoreCase("USER NAME") || str1.equalsIgnoreCase("SERVER") || str1.equalsIgnoreCase("SESSION STARTUP TIME") || str1.equalsIgnoreCase("CLIENT IP ADDRESS") || str1.equalsIgnoreCase("CLIENT NAME"))){
		%>
							<th><%=str1%></th>
		<%
						}else{
		%>
							<th style="text-align: center;"><%=str1%></th>
		<%
						}
					}
		%>
						</tr>
					</thead>
					<tbody>
		<%
					
					String rowcolr="#ffffff";
					for(int l=0;l<dataArray.size();l++){
						if(l%2 != 0)
							rowcolr="#f9f9f9";
						else
							rowcolr="#ffffff";
						
						obj1=(JSONObject)dataArray.get(l);
		%>
						<tr class="newimg" style="background-color:<%=rowcolr%>">
		<%
						for(int k=0;k<colArray.size();k++){
							String str1=(String)colArray.get(k);
							if(str1 != null && (str1.equalsIgnoreCase("USER NAME") || str1.equalsIgnoreCase("SERVER") || str1.equalsIgnoreCase("SESSION STARTUP TIME") || str1.equalsIgnoreCase("CLIENT IP ADDRESS") || str1.equalsIgnoreCase("CLIENT NAME"))){
		%>
							<td><%=(String)obj1.get(str1)%></td>
		<%				
							}else{
		%>
							<td align="center"><%=(String)obj1.get(str1)%></td>
		<%
							}
						}
		%>
						</tr>
		<%
						if(needLogonSplitupTable!=null && needLogonSplitupTable.equalsIgnoreCase("yes"))
						{
		%>
						<tr class="newimg" style="background-color:<%=rowcolr%>">
							<td colspan="<%=colArray.size()%>" >

		<%			
						if(obj1 != null && obj1.containsKey("additionalDatas")){
							obj2=(JSONObject)obj1.get("additionalDatas");
							arr1=(JSONArray)obj2.get("Server");
		%>
						<!-- <tr class="newimg" style="background-color:<%=rowcolr%>">
							<td colspan="<%=colArray.size()%>" >
 -->								<div>
									<table width="100%" style="border:0px">
										<tr style="background:none">
											<td width="50%" valign="top" style="border:0px;padding:0px">
												<div style="margin:10px 10px 10px 0px;" class="newPlainTable">
													<div class="font_bold12"><egui:intnl text="reporter.common.Server Start up"/>&nbsp;(<egui:intnl text="reporter.common.secs"/>)</div>
													<div style="height: 205px;overflow: auto;">
														<table style="border:0px">
		<%
							for(int z=0;z<arr1.size();z++){
								obj3=(JSONObject)arr1.get(z);
		%>
										<tr style="background:none"><td style="border:0px"><%=(String)obj3.get("key")%></td><td style="border:0px"><%=(String)obj3.get("value")%></td></tr>
		<%
							}
		%>
														</table>
													</div>
												</div>
											</td>
											<td width="50%" valign="top" style="border:0px;padding:0px">
												<div style="margin:10px 0px 10px 0px;" class="newPlainTable">
													<div class="font_bold12"><egui:intnl text="reporter.common.Client Start up"/>&nbsp;(<egui:intnl text="reporter.common.secs"/>)</div>
													<div style="height:205px;overflow: auto;">
														<table style="border:0px">
		<%
							arr1=(JSONArray)obj2.get("Client");
							for(int z=0;z<arr1.size();z++){
								obj3=(JSONObject)arr1.get(z);
		%>
										<tr style="background:none"><td style="border:0px"><%=(String)obj3.get("key")%></td><td style="border:0px"><%=(String)obj3.get("value")%></td></tr>
		<%
							}
		%>
														</table>
													</div>
												</div>
											</td>
										</tr>
									</table>
								</div>
		
							<!-- </td>
						</tr> -->
		<%
						}
						if(obj1 != null && obj1.containsKey("additionalDatasforVDI")){
							obj2=(JSONObject)obj1.get("additionalDatasforVDI");
							arr1=(JSONArray)obj2.get("logonBreakup");
		%>
								<div>
									<table width="100%" style="border:0px">
										<tr style="background:none">
											<td width="50%" valign="top" style="border:0px;padding:0px">
												<div style="margin:10px 10px 10px 0px;" class="newPlainTable">
													<div class="font_bold12"><egui:intnl text="reporter.common.logon Time Break-up"/>&nbsp;(<egui:intnl text="reporter.common.secs"/>)</div>
													<div style="height:155px;overflow:auto;">
														<table style="border:0px">
		<%
							for(int z=0;z<arr1.size();z++){
								obj3=(JSONObject)arr1.get(z);
		%>
										<tr style="background:none"><td style="border:0px"><%=(String)obj3.get("key")%></td><td style="border:0px"><%=(String)obj3.get("value")%></td></tr>
		<%
							}
		%>
														</table>
													</div>
												</div>
											</td>
											<td width="50%" valign="top" style="border:0px;padding:0px">
												<div style="margin:10px 0px 10px 0px;" class="newPlainTable">
													<div class="font_bold12"><egui:intnl text="reporter.common.Group policy Time Break-up"/>&nbsp;(<egui:intnl text="reporter.common.secs"/>)</div>
													<div style="height:155px;overflow:auto;">
														<table style="border:0px">
		<%
							arr1=(JSONArray)obj2.get("gpBreakup");
							for(int z=0;z<arr1.size();z++){
								obj3=(JSONObject)arr1.get(z);
		%>
										<tr style="background:none"><td style="border:0px"><%=(String)obj3.get("key")%></td><td style="border:0px"><%=(String)obj3.get("value")%></td></tr>
		<%
							}
		%>
														</table>
													</div>
												</div>
											</td>
										</tr>
									</table>
								</div>
							<!-- </td>
						</tr> -->
		<%
						}//GPDetails
						if(obj1 != null && obj1.containsKey("GPDetails")){
							obj2=(JSONObject)obj1.get("GPDetails");
							JSONArray gphdr=(JSONArray)obj2.get("Header");
							JSONArray gridGpDatas=(JSONArray)obj2.get("Datas");
		%>
							<div>
								<div class="font_bold12"><egui:intnl text="reporter.common.Details of client side extensions"/></div>
								<div class="newTable" style="padding: 5px 0px 10px 0px;">
									<table width="100%" style="border:0px">
										<thead>
											<tr>
		<%
						for(int i=0;i<gphdr.size();i++){
							String hdrStr=(String)gphdr.get(i);
		%>
									<th><%=hdrStr%></th>
		<%
						}
		%>
											</tr>
										</thead>
										<tbody>
		<%
						for(int i=0;i<gridGpDatas.size();i++){
							JSONObject hdrObj=(JSONObject)gridGpDatas.get(i);
		%>
											<tr>
		<%
							for(int j=0;j<gphdr.size();j++){
								String hdrStr=(String)gphdr.get(j);
		%>
												<td><%=(String)hdrObj.get(hdrStr)%></td>
		<%
							}
		%>
											</tr>
		<%
						}
		%>
										</tbody>
									</table>
								</div>
							</div>
		
		<%
						}
		%>
							</td>
						</tr>
		<%
						}
					}
		%>
					</tbody>
				</table>
			</div>
		<%
					}
				}
				else
				{
		%>
				<div class="printOuterBox newTable" style="padding:10px 0px 0px 0px;">
					<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Slow Logon Details"/>&nbsp;(<egui:intnl text="reporter.common.secs"/>)</div>
					<table width="100%">
						<tr>
							<td align="center"><img src='/final/images/Light/nomeasures_custom.png' /></td>
						</tr>
					</table>
				</div>
		<%
				}
			}
		}
	}else{
	%>
				<div class="printOuterBox" style="padding:10px 0px 0px 5px;overflow:unset;margin-top:10px;">
					<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Slow Logon Details "/>&nbsp;(<egui:intnl text="reporter.common.secs"/>)&nbsp;</div>
					<table width="100%">
						<tr>
							<td align="center"><img src='/final/images/Light/nomeasures_custom.png' /></td>
						</tr>
					</table>
				</div>
		<%
	}
			}
			else
			{
%>
				<table width="100%">
					<tr>
						<div align="center" style="height: 50px;"><table width="100%" style="height: 150px;"><tr><td align="center"><div class="<%=noAlarmCls%>" ></div><div class="commonErrorMsgText">No Slow Logons found</div></td></tr></table></div>
					</tr>
				</table>
<%
			}
%>
		</div>
<%
		}
%>
</body>
</html>
<%
	Hashtable sen1 = new Hashtable();
	if(lst_dat1!=null && !lst_dat1.isEmpty())
	{
		if(er_option!=null && !er_option.equalsIgnoreCase("component"))
			lst.add("Slow Logon Details for "+er_option+" : "+request.getParameter("select_farm")+ " - "+s_comptype);
		String s_tit1= "Slow Logon Analysis ";
		if(s_comptype!=null)
			s_tit1+="for "+intlmap.getComponentTypeDescription(s_comptype);
		sen1.put(vec1,lst_dat1);
		Hashtable ht1=new Hashtable();
		ht1.put(s_tit1,sen1);
		lst.add(ht1);
		sen1 = new Hashtable();
		ht1 = new Hashtable();
		session.setAttribute("ScheduleCSVData",lst);
	}
	else if(lst!=null && !lst.isEmpty() && resultMap != null && resultMap.containsKey("slowlogonUsersDetails"))
	{
		session.setAttribute("ScheduleCSVData",lst);
	}
	else
	{
		session.setAttribute("ScheduleCSVData",lst);
	}
	if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
	{	%>
		<div class="printFooterText"><%=strPrintFooterText%></div>
	<%
	}
}
catch(Exception e)
{
	e.printStackTrace();
}
%>
<%@ include file = "ErRemoveUser.jsp" %>
<%
	if(titleToDisplay!=null && !titleToDisplay.isEmpty())
	{
		//For Setting the PDf File Name
		String reportFileName=customReplaceAll(titleToDisplay," ","_");
		HashMap paramVal =new HashMap();
		paramVal.put("fileName","SlowLogon");
		session.setAttribute("parameters", paramVal);
	}

%>
<%!
	// karthikeyan 
    public  String customReplaceAll(String source,String toReplace,String replacement) {
        int idx = source.lastIndexOf(toReplace);
        if (idx != -1) {
            StringBuffer ret = new StringBuffer(source);
            ret.replace(idx, idx + toReplace.length(), replacement);
			while ((idx = source.lastIndexOf(toReplace, idx - 1)) != -1)
			{
                ret.replace(idx, idx + toReplace.length(), replacement);
            }
            source = ret.toString();
        }
        return source;
	}
%>
