<!DOCTYPE html>

<%@ include file = "ErTracker.jsp" %>
<%@ page import = "java.util.*" %>
<%@ page import = "java.text.*" %>

<%@ page import= "com.eg.EgDbInfo" %>
<%@ page import= "com.eg.EgTablesInfo" %>
<%@ page import = "com.egurkha.util.DateUtil"%>
<%@ page import = "com.eg.EgConfigInfo"%>
<%@ page import = "com.eg.EgReportInfo" %>
<%@ page import = "com.eg.EgMappingInfo" %>
<%@ page import= "com.eg.EgServicesInfo" %>
<%@ page import= "com.eg.EgTesterInfo" %>
<%@ page import="com.egurkha.util.StringUtils"%>
<%@ page import="egurkha.reporter.ErUtils"%>
<%@ page import = "net.sf.json.*"%>

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

<%
	String strManagerURL = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort();
	EgTablesInfo tablesInfo = new EgTablesInfo ("manager"); 
	
	Map resultMap = (Map) session.getAttribute("CITRIX_CAPACITY_PREDICTION_REPORT_RESULT");
	List keyList = null;
	ErUtils erUtils = new ErUtils();
	boolean noDataFound = false;
	if(resultMap != null)
	{
		String noData = (String) resultMap.get("NO_DATA_FOUND");
		if(noData != null && noData.equalsIgnoreCase("yes"))
			noDataFound = true;
	}
	else
	{
		noDataFound = true;
	}

	EgReportInfo reportInfo = new EgReportInfo("manager");
	String thisLanguage="";
	if (thisuser != null)
	{
		String userLang = thisuser.getLanguage();
		if (userLang != null && !userLang.equalsIgnoreCase("NULL"))
		{
			thisLanguage = userLang;
		}
	}

	EgMappingInfo intlmap = new EgMappingInfo(thisuser.getLanguage());

	String s_comptype = request.getParameter("er_comptype");
	String s_component = request.getParameter("er_component");
	
	String s_test = request.getParameter("er_test");
	String s_measure = request.getParameter("er_measure");
	
	String s_info = request.getParameter("er_info");
	
	String s_look_forward = request.getParameter("er_look_forward");
	String s_dataoption = request.getParameter("er_dataoption");
	
	String s_type = request.getParameter("er_type");
	
	String showDetails = request.getParameter("er_show_details");
	String er_timeline = request.getParameter("er_timeline");
	String excludeweekend = request.getParameter("er_excwe");
	String s_st_time = request.getParameter("startdate");
	String s_en_time = 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 er_time   =  request.getParameter("er_time");
	String hourFrom = request.getParameter("timefrom");
	String minFrom = request.getParameter("minfrom");
	String hourTo = request.getParameter("timeto");
	String minTo = request.getParameter("minto");
	String iniDate = request.getParameter("inidate");
	String er_option = request.getParameter("er_option");
	String er_site = request.getParameter("er_site");
	String er_siteDisp = er_site;
	if(er_site!=null && er_site.equalsIgnoreCase("--Default--"))
	{
		er_siteDisp = intlmap.getTextDescription("reporter.common.--Default--");
	}
	String incresaseFactor = request.getParameter("increaseBy");
	double incresaseFactorVal = 0.0;
	if(incresaseFactor!=null && incresaseFactor.length()>0)
	{
		try
		{
			incresaseFactorVal = Double.parseDouble(incresaseFactor);
		}
		catch (Exception ex) 
		{
		}
	}

	String uiFile = "eg_ui.ini";
	String s_iniFile_dir = EgInstallInfo.getInstallDir()+ "/manager/config/";
	IniFile egUI = new IniFile(s_iniFile_dir + uiFile);
	String currentDateFormat = strUserDateFormat;
	
	String dispStartDate = DateUtil.changeDateFormat(s_st_time.trim(),iniDate,currentDateFormat);
	String dispEndDate = DateUtil.changeDateFormat(s_en_time.trim(),iniDate,currentDateFormat);
	String timefrom = hourFrom + ":" + minFrom;
	String timeTo = hourTo + ":" + minTo;
	String stTime = "";
	String enTime = "";
	
	String pdfPrint = request.getParameter("pdfPrint");

	if (er_timeline != null)
	{
		stTime = s_st_hr + " " + intlmap.getTextDescription("reporter.common.hrs");
		enTime = s_en_hr + " " +intlmap.getTextDescription("reporter.common.hrs");
	}
	EgTimeZoneConverter converterStart=null;
	EgTimeZoneConverter converterEnd=null;
	String st_dateTime="";
	String en_dateTime="";
	
	converterStart = new EgTimeZoneConverter(dispStartDate+" "+s_st_hr+":"+strmin,thisuser);
	converterEnd = new EgTimeZoneConverter(dispEndDate+" "+s_en_hr+":"+enmin,thisuser);
	
	stTime = (String)converterStart.getDate(false);
	//stTime = (String)converterStart.getDate(false)+" "+converterStart.getHour() +" "+intlmap.getTextDescription("reporter.common.hrs")+" "+converterStart.getMinute()+" "+intlmap.getTextDescription("reporter.common.mins");

	enTime = (String)converterEnd.getDate(false);
	//enTime = (String)converterEnd.getDate(false)+" "+converterEnd.getHour() +" "+intlmap.getTextDescription("reporter.common.hrs")+" "+converterEnd.getMinute()+" "+intlmap.getTextDescription("reporter.common.mins");

	EgDbInfo dbInfo = new EgDbInfo("manager");
	String fontStyleDblSingl = "";
	if((dbInfo.doubleByteEnabled || !thisuser.getLanguage().equals("en_US")) && (pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes")))
	{
		fontStyleDblSingl = "multi_font";
	}
	else
	{
		fontStyleDblSingl = "";
	}
	String er_RmDispName = request.getParameter("er_RmDispName");

%>

<!Doctype html>
<head>
<%
	if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
	{
%>
	<title>
		<egui:intnl text="reporter.common.Capacity Prediction for Virtual Applications"/>
	</title>
<%
	}
	else
	{
%>
	<title>eG Reporter</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 type="text/css" media="print">
#printbt{ display:none}
</style>
</head>

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

	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(er_RmDispName))
	{
%>
			<div class="printHeaderBoxTitle"><%= er_RmDispName %></div>
<%
	}
	else
	{
%>
			<div class="printHeaderBoxTitle"><header><egui:intnl text="reporter.common.CAPACITY PLANNING PREDICTION REPORT"/></header></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">
<%
		if(er_timeline!=null && !er_timeline.equalsIgnoreCase("Any"))
		{
%>
			<egui:intnl text="reporter.common.Based on data collected during the past" />&nbsp;<span class="bold"><%=intlmap.getTextDescription("reporter.common."+er_timeline)%>&nbsp;(<%=stTime%>&nbsp;<egui:intnl text="reporter.common.to" />&nbsp;<%=enTime%>)</span>&nbsp;<egui:intnl text="reporter.common.from" />&nbsp;<span class="bold"><%=intlmap.getComponentTypeDescription(s_comptype)%></span>&nbsp;<egui:intnl text="reporter.common.server in" />
<%
		}
		else
		{
%>
			<egui:intnl text="reporter.common.Based on data collected during" />&nbsp;<span class="bold"><%=stTime%>&nbsp;<egui:intnl text="reporter.common.to" />&nbsp;<%=enTime%></span>&nbsp;<egui:intnl text="reporter.common.from" />&nbsp;<span class="bold"><%=intlmap.getComponentTypeDescription(s_comptype)%></span>&nbsp<egui:intnl text="reporter.common.server in" />
<%
		}
		if(er_option!=null && !er_option.equalsIgnoreCase("Component"))
		{
%>
			<span class="bold">&nbsp;<%=er_siteDisp%>&nbsp;</span><span><%=intlmap.getTextDescription("reporter.common."+er_option)%>,&nbsp;<egui:intnl text="reporter.common.following are the resource usage for" />
<%
		}
		else
		{
%>
			<span class="bold">&nbsp;<%=s_component%>&nbsp;<%=intlmap.getTextDescription("reporter.common."+er_option)%>,&nbsp;</span><span><egui:intnl text="reporter.common.following are the resource usage for" />
<%
		}
		if(incresaseFactorVal>0)
		{
%>
			<span class="bold">&nbsp;<%=incresaseFactor%>%&nbsp;<egui:intnl text="reporter.common.increase in users load" /></span>
<%
		}
		else
		{
%>
			<span class="bold">&nbsp;<egui:intnl text="reporter.common.Current Users" /> 
<%
		}
%>
		</div>
		-->
		<div class="printSelectionFields"><%=intlmap.getTextDescription("reporter.common.Analyze By")%> - <span class="bold"><%=intlmap.getTextDescription("reporter.common."+er_option)%></span></div>
	<%
		if(er_option != null && !er_option.equalsIgnoreCase("Component")){
	%>
			<div class="printSelectionFields"><%=intlmap.getTextDescription("reporter.common.Zone")%> - <span class="bold"><%=er_site%></span></div>
	<%
		}
	%>
			<div class="printSelectionFields"><%=intlmap.getTextDescription("reporter.common.Component Type")%> - <span class="bold"><%=intlmap.getComponentTypeDescription(s_comptype)%></span></div>
	<%
		if(er_option != null && er_option.equalsIgnoreCase("Component")){
	%>
			<div class="printSelectionFields"><%=intlmap.getTextDescription("reporter.common.Component")%> - <span class="bold"><%=s_component%></span></div>
	<%
		}
		if(incresaseFactorVal>0)
		{
%>
			<div class="printSelectionFields"><%=intlmap.getTextDescription("reporter.common.Users Load")%> - <span class="bold">&nbsp;<egui:intnl text="reporter.common.Increase by" />&nbsp;<%=incresaseFactor%>%</span></div>
<%
		}
		else
		{
%>
			<div class="printSelectionFields"><%=intlmap.getTextDescription("reporter.common.Users Load")%> - <span class="bold">&nbsp;<egui:intnl text="reporter.common.Current" /></span></div>
<%
		}
	%>
	</div>

<%
	if(resultMap !=null && resultMap.size() != 0 && !noDataFound)
	{
		HashMap resultDataMap = (HashMap)resultMap.get("RESULT_DATA");
		System.out.println("resultDataMap   "+resultDataMap);
		if(resultDataMap!=null)
		{
			JSONObject resultObj = new JSONObject();
			String SESSION_CONSUMED_CPU_UTIL=(String)resultDataMap.get("SESSION_CONSUMED_CPU_UTIL");
			if(SESSION_CONSUMED_CPU_UTIL==null)
				SESSION_CONSUMED_CPU_UTIL = "0";
			String SESSION_CONSUMED_DISK_USAGE=(String)resultDataMap.get("SESSION_CONSUMED_DISK_USAGE");
			if(SESSION_CONSUMED_DISK_USAGE==null)
				SESSION_CONSUMED_DISK_USAGE = "0";
			String SESSION_CONSUMED_NETWORK_USAGE=(String)resultDataMap.get("SESSION_CONSUMED_NETWORK_USAGE");
			if(SESSION_CONSUMED_NETWORK_USAGE==null)
				SESSION_CONSUMED_NETWORK_USAGE = "0";
			String SESSION_CONSUMED_MEM_UTIL=(String)resultDataMap.get("SESSION_CONSUMED_MEM_UTIL");
			if(SESSION_CONSUMED_MEM_UTIL==null)
				SESSION_CONSUMED_MEM_UTIL = "0";
			String TOTAL_SERVERS=(String)resultDataMap.get("TOTAL_SERVERS");
			if(TOTAL_SERVERS==null)
				TOTAL_SERVERS = "0";
			String CONCURRENT_SESSIONS=(String)resultDataMap.get("CONCURRENT_SESSIONS");
			if(CONCURRENT_SESSIONS==null)
				CONCURRENT_SESSIONS = "0";
			String UNIQUE_USER=(String)resultDataMap.get("UNIQUE_USER");
			if(UNIQUE_USER==null)
				UNIQUE_USER = "0";

			double CPU_UTIL=Double.parseDouble(SESSION_CONSUMED_CPU_UTIL);
			double DISK_USAGE=Double.parseDouble(SESSION_CONSUMED_DISK_USAGE);
			double NETWORK_USAGE=Double.parseDouble(SESSION_CONSUMED_NETWORK_USAGE);
			double MEM_UTIL=Double.parseDouble(SESSION_CONSUMED_MEM_UTIL);
			double SERVERS=Double.parseDouble(TOTAL_SERVERS);
			double SESSIONS=Double.parseDouble(CONCURRENT_SESSIONS);
			double USER=Double.parseDouble(UNIQUE_USER);
			double ADDITIONAL_SERVER=0.0;
 
			if(!noDataFound)
			{
				String ChartMaxValue= reportInfo.getValue("CITRIX_CAPACITY_PREDICTION","ChartMaxValue");
				double chartMaxValueVal = 100.0;
				if(ChartMaxValue!=null && ChartMaxValue.length()>0)
				{
					try
					{
						chartMaxValueVal = Double.parseDouble(ChartMaxValue);
					}
					catch (Exception ex) 
					{
					}
				}
				System.out.println("incresaseFactorVal____________ "+incresaseFactorVal);
				resultObj.put("UNIQUE_USER_ORIGINAL",erUtils.roundOffDigit(USER,0));
				resultObj.put("SESSIONS_ORIGINAL",erUtils.roundOffDigit(SESSIONS,0));
				resultObj.put("TOTAL_SERVERS_ORIGINAL",erUtils.roundOffDigit(SERVERS,0));
				if(incresaseFactorVal>0)
				{
					double factorVal = USER/SESSIONS;
					long increaseUserby = (Math.round((incresaseFactorVal/100)*USER));
					USER = Math.round(USER+increaseUserby); // updated User
					SESSIONS = Math.round(USER/factorVal); //updated Session
				}
				// Calculate Merer Gauge Chart Value
				double maxValue = 0;
				String maxValStr = null;
				double CPU_UTIL_TEMP = (SESSIONS * CPU_UTIL)/SERVERS;
				if(maxValue<CPU_UTIL_TEMP)
				{
					maxValue = CPU_UTIL_TEMP;
					maxValStr = "SESSION_CONSUMED_CPU_UTIL";
				}
				double DISK_USAGE_TEMP = (SESSIONS * DISK_USAGE)/SERVERS;
				if(maxValue<DISK_USAGE_TEMP)
				{
					maxValue = DISK_USAGE_TEMP;
					maxValStr = "SESSION_CONSUMED_DISK_USAGE";
				}
				double NETWORK_USAGE_TEMP = (SESSIONS * NETWORK_USAGE)/SERVERS;
				if(maxValue<NETWORK_USAGE_TEMP)
				{
					maxValue = NETWORK_USAGE_TEMP;
					maxValStr = "SESSION_CONSUMED_NETWORK_USAGE";
				}
				double MEM_UTIL_TEMP = (SESSIONS * MEM_UTIL)/SERVERS;
				if(maxValue<MEM_UTIL_TEMP)
				{
					maxValue = MEM_UTIL_TEMP;
					maxValStr = "SESSION_CONSUMED_MEM_UTIL";
				}
				System.out.println("DISK_USAGE_TEMP______ "+DISK_USAGE_TEMP);
				System.out.println("maxValue______ "+maxValue);
				System.out.println("chartMaxValueVal______ "+chartMaxValueVal);
				System.out.println("maxValStrl______ "+maxValStr);
				if(maxValue>chartMaxValueVal)
				{
					// now Re-calculation is based on maxValStr
					ADDITIONAL_SERVER = maxValue/chartMaxValueVal;
					ADDITIONAL_SERVER = Math.ceil((SERVERS*ADDITIONAL_SERVER)-SERVERS); // additional server percentage

					CPU_UTIL_TEMP = (SESSIONS * CPU_UTIL)/(SERVERS+ADDITIONAL_SERVER);
					DISK_USAGE_TEMP = (SESSIONS * DISK_USAGE)/(SERVERS+ADDITIONAL_SERVER);
					NETWORK_USAGE_TEMP = (SESSIONS * NETWORK_USAGE)/(SERVERS+ADDITIONAL_SERVER);
					MEM_UTIL_TEMP = (SESSIONS * MEM_UTIL)/(SERVERS+ADDITIONAL_SERVER);
				}
				
				resultObj.put("UNIQUE_USER",erUtils.roundOffDigit(USER,0));
				resultObj.put("SESSIONS",erUtils.roundOffDigit(SESSIONS,0));
				resultObj.put("TOTAL_SERVERS",erUtils.roundOffDigit(SERVERS+ADDITIONAL_SERVER,0));
				resultObj.put("ADDITIONAL_SERVER",erUtils.roundOffDigit(ADDITIONAL_SERVER,0));
				
				resultObj.put("MEM_UTIL",erUtils.roundOffDigit(MEM_UTIL_TEMP,2));
				resultObj.put("DISK_USAGE",erUtils.roundOffDigit(DISK_USAGE_TEMP,2));
				resultObj.put("NETWORK_USAGE",erUtils.roundOffDigit(NETWORK_USAGE_TEMP,2));
				resultObj.put("CPU_UTIL",erUtils.roundOffDigit(CPU_UTIL_TEMP,2));

				String cupColor = reportInfo.getValue("CITRIX_CAPACITY_PREDICTION","cupColor");
				String memoryColor = reportInfo.getValue("CITRIX_CAPACITY_PREDICTION","memoryColor");
				String diskColor = reportInfo.getValue("CITRIX_CAPACITY_PREDICTION","diskColor");
				String networkColor = reportInfo.getValue("CITRIX_CAPACITY_PREDICTION","networkColor");

				resultObj.put("CPU_UTIL_CHART",getGaugeChartData(erUtils.roundOffDigit(CPU_UTIL_TEMP,2),intlmap.getTextDescription("reporter.common.CPU Usage"),cupColor));
				resultObj.put("MEM_UTIL_CHART",getGaugeChartData(erUtils.roundOffDigit(MEM_UTIL_TEMP,2),intlmap.getTextDescription("reporter.common.Memory Usage"),memoryColor));
				resultObj.put("DISK_USAGE_CHART",getGaugeChartData(erUtils.roundOffDigit(DISK_USAGE_TEMP,2),intlmap.getTextDescription("reporter.common.Disk Usage"),diskColor));
				resultObj.put("NETWORK_USAGE_CHART",getGaugeChartData(erUtils.roundOffDigit(NETWORK_USAGE_TEMP,2),intlmap.getTextDescription("reporter.common.Network Usage"),networkColor));
				
				resultObj.put("factorValue",erUtils.roundOffDigit(incresaseFactorVal,0));

				String SliderRangeStr = reportInfo.getValue("CITRIX_CAPACITY_PREDICTION","SliderRange");
				int SliderRange = 5;
				try
				{
					SliderRange = Integer.parseInt(SliderRangeStr);
				}
				catch(Exception ex) 
				{}
				resultObj.put("SliderRange",SliderRange);
				session.setAttribute("CITRIX_CAPACITY_PREDICTION_CHART",resultObj);
				String servletURL = "/final/servlet/com.eg.ErCitrixCapacityPredictionReportC;jsessionid=" + session.getId() + "?forPrint=yes&er_height=150&er_width=230";
	int additionalPos = 0;
	if(pdfPrint!=null && pdfPrint.equalsIgnoreCase("yes"))
	{
		additionalPos = 20;
	}
				%>
	<div class="printOuterBox" style="margin-bottom:10px">
<%
	if(incresaseFactorVal>0)
	{
%>
	<table align="center" valign="middle" width="100%" style="height:90px;border-spacing:0px;">
		<col width="50%"><col width="50%">
		<tr>
			<td style="border-right:1px solid #cdcdcd"> 
				<table align="center" valign="middle" width="100%" style="height:90px;border-spacing:0px;">
				<col width="50%"><col width="50%">
					<tbody>
					<tr>
						<td colspan="2"><div class="newFont_bold15"><egui:intnl text="reporter.common.Load Increased by" />&nbsp;<%=incresaseFactor%>%</div></td>
					</tr>
					<tr>
						<td align="center">
							<table  align="center" valign="middle">
								<tr>
									<td align="center">
										<div class="iconLogonUser"/>
									</td>
									<td>
										<div class="newFont_bold25"><%=resultObj.get("UNIQUE_USER")%></div>
									</td>
								</tr>
								<tr>
									<td colspan="2">
										<div class="newFont_bold15"><egui:intnl text="reporter.common.Unique Users" /></div>
									</td>
								</tr>
							</table>
						</td>
						<td align="center">
							<table align="center" valign="middle">
								<tr>
									<td align="center">
										<div class="iconSessionsCompleted"/>
									</td>
									<td>
										<div class="newFont_bold25"><%=resultObj.get("SESSIONS")%></div>
									</td>
								</tr>
								<tr>
									<td colspan="2">
										<div class="newFont_bold15"><egui:intnl text="reporter.common.Concurrent Sessions" /></div>
									</td>
								</tr>
							</table>
						</td>
						</tr>
					</tbody>
				</table>
				</td>
				<td>

<%
	}
%>
				<table align="center" valign="middle" width="100%" style="height:90px;border-spacing:0px;">
				<col width="50%"><col width="50%">
					<tbody>
					<tr>
						<td colspan="2"><div style="margin-left:10px" class="newFont_bold15"><egui:intnl text="reporter.common.Current Load" /></div></td>
					</tr>
					<tr>
						<td align="center">
							<table  align="center" valign="middle">
								<tr>
									<td align="center">
										<div class="iconLogonUser"/>
									</td>
									<td>
										<div class="newFont_bold25"><%=resultObj.get("UNIQUE_USER_ORIGINAL")%></div>
									</td>
								</tr>
								<tr>
									<td colspan="2">
										<div class="newFont_bold15"><egui:intnl text="reporter.common.Unique Users" /></div>
									</td>
								</tr>
							</table>
						</td>
						<td align="center">
							<table align="center" valign="middle">
								<tr>
									<td align="center">
										<div class="iconSessionsCompleted"/>
									</td>
									<td>
										<div class="newFont_bold25"><%=resultObj.get("SESSIONS_ORIGINAL")%></div>
									</td>
								</tr>
								<tr>
									<td colspan="2">
										<div class="newFont_bold15"><egui:intnl text="reporter.common.Concurrent Sessions" /></div>
									</td>
								</tr>
							</table>
						</td>
						</tr>
					</tbody>
				</table>
<%
	if(incresaseFactorVal>0)
	{
%>
				</td>
			</tr>
		</table>
<%
	}
%>
	</div>

	<div style="margin-bottom:10px;display:block">
		<table align="center" valign="middle" width="100%" style="padding:0px;" cellspacing="0px"  style="border-spacing:0px">
		<col width="70%"><col width="30%">
			<tr>
				<td style="padding-right:5px">
					<div class="printOuterBox" style="height:420px">
						<table align="center" valign="top" width="100%" style="border-spacing:0px">
							<tbody>
							<tr>
								<td colspan="2"><div class="newFont_bold15"><egui:intnl text="reporter.common.Resource Usage Prediction" /></div></td>
							</tr>
							<tr>
								<td colspan="2"><div style="margin:5px 0px 5px 0px"><egui:intnl text="reporter.common.For the increased user load, what will be the predicted resource usage?" /></div></td>
							</tr>
							<tr>
								<td style="border-right:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9;text-align:center" valign="top">
									<div class="printOuterBoxHeader" style="text-align:left"><egui:intnl text="reporter.common.CPU Usage" /></div>
									<img src="<%=servletURL+"&resultMapKey=CPU_UTIL_CHART"%>" />
										
								</td>
								<td style="border-bottom:1px solid #e9e9e9;text-align:center" valign="top">
									<div style="padding-left:10px;text-align:left" class="printOuterBoxHeader"><egui:intnl text="reporter.common.Memory Usage" /></div>
									<img src="<%=servletURL+"&resultMapKey=MEM_UTIL_CHART"%>" />
										
								</td>
							</tr>
							<tr>
								<td style="padding-top:10px;border-right:1px solid #e9e9e9;text-align:center" valign="top">
									<div class="printOuterBoxHeader" style="text-align:left"><egui:intnl text="reporter.common.Disk Busy" /></div>
									<img src="<%=servletURL+"&resultMapKey=DISK_USAGE_CHART"%>" />
										
								</td>
								<td style="padding-left:10px;padding-top:10px;text-align:center" valign="top">
									<div class="printOuterBoxHeader" style="text-align:left"><egui:intnl text="reporter.common.Network Usage" /></div>
									<img src="<%=servletURL+"&resultMapKey=NETWORK_USAGE_CHART"%>" />
								</td>
							</tr>
							</tbody>
						</table>
					</div>
				</td>
				<td align="center" style="padding-left:5px">
					<div class="printOuterBox" style="height:420px;">
						<table align="center" valign="middle" width="100%" style="border-spacing:0px">
							<tr>
								<td><div class="printOuterBoxHeader" style="text-align:left"><egui:intnl text="reporter.common.Server Requirement" /></div></td>
							</tr>
							<tr>
								<td height="179px">
									<table align="center" valign="middle">
										<tr>
											<td align="center">
												<div class="iconServerGray"/>
											</td>
											<td>
												<div class="newFont_bold25"><%=resultObj.get("TOTAL_SERVERS")%></div>
											</td>
										</tr>
										<tr>
											<td colspan="2">
												<div class="newFont_bold14"><egui:intnl text="reporter.common.Total Servers" /></div>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td>
								<%
									if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
									{
								%>
									<div class="iconServerGray" style="position:relative;top:70px;left:<%=102+additionalPos%>px"></div>
									<div>
										<svg width="300" height="140">
								<%
									}
									else
									{
								%>
									 <div class="iconServerGray" style="position:absolute;z-index:99;top:476px;left:<%=310+additionalPos%>px"></div>
									 <div>
										<svg width="300" height="140" style="padding-left:40px">
								<%
									}
								%>
											<g>
												<rect x="<%=35+additionalPos%>" y="13" rx="20" ry="20" width="190" height="110" style="fill:#fff;stroke:#3f51b5;stroke-width:4;opacity:1.0"></rect>
												<text x="<%=140+additionalPos%>" y="68" font-family="Roboto" font-weight="400" font-size="25" fill="#000000"><%=resultObj.get("ADDITIONAL_SERVER")%></text>
												<text x="<%=72+additionalPos%>" y="88" font-family="Roboto" font-weight="400" font-size="14" fill="#000000"><egui:intnl text="reporter.common.Additional Servers" /></text>
											</g>
										</svg>
									</div>
								</td>
							</tr>
						</table>
					</div>
				</td>
			</tr>
		</table>
	</div>
<%
			}
			else
			{
%>
	<table align="center" valign="middle" width="100%" >
		<tr>
			<td align="center"><img src='/final/images/Light/nomeasures_custom.png' /></td>
		</tr>
	</table>
<%
			}
		}
		else
		{
%>
	<table align="center" valign="middle" width="100%" >
		<tr>
			<td align="center"><img src='/final/images/Light/nomeasures_custom.png' /></td>
		</tr>
	</table>
<%
		}
	}
	else
	{
%>
	<table align="center" valign="middle" width="100%" >
		<tr>
			<td align="center"><img src='/final/images/Light/nomeasures_custom.png' /></td>
		</tr>
	</table>
<%
	}
	  

	if (!StringUtils.isNull(er_RmDispName)){
		//For Setting the PDf File Name
		er_RmDispName = er_RmDispName.replace(" ","_");
		HashMap paramVal =new HashMap();
		paramVal.put("fileName",er_RmDispName);
		session.setAttribute("parameters", paramVal);
	} else {
		//For Setting the PDf File Name
		HashMap paramVal =new HashMap();
		paramVal.put("fileName","capacity_planning_prediction_report");
		session.setAttribute("parameters", paramVal);
	}
%>	 
<%
		if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
		{%>

		<div class="printFooterText"><%=strPrintFooterText%></div>
		<%}%>
</body>
</html>
<%@ include file="ErRemoveUser.jsp"%>
<%!
	public JSONObject getGaugeChartData(String gaugeValue, String title, String color)
	{
		if(color==null || color.length()==0)
		{
			color = "#7CB5EC";
		}
		JSONObject returnObj = new JSONObject();
		try
		{
			JSONArray dataSetAry = new JSONArray();
			JSONArray jsonDataAry = new JSONArray();
			JSONObject dataSetObj = new JSONObject();
			JSONObject dataObj = new JSONObject();
			JSONObject datalabelobj = new JSONObject();
			datalabelobj.put("format","<div><span style='font-family:Roboto;font-weight:400;font-size:24px;color:#2a292a;'>"+gaugeValue+"</span><span style='font-family:Roboto-Light;font-size:14px;color:#2a292a;'> %</span></div>");
			dataObj.put("color","#e0e0e0");
			dataObj.put("y",100); // this must be max value
			dataObj.put("radius","112%");
			dataObj.put("innerRadius","88%");
			jsonDataAry.add(dataObj);
			dataSetObj.put("data",jsonDataAry);
			dataSetObj.put("name","");
			dataSetObj.put("dataLabels",datalabelobj);
			dataSetAry.add(dataSetObj);

			jsonDataAry = new JSONArray();
			dataSetObj = new JSONObject();
			dataObj = new JSONObject();
			dataObj.put("color",color);
			dataObj.put("y",Double.parseDouble(gaugeValue));
			dataObj.put("radius","112%");
			dataObj.put("innerRadius","88%");
			jsonDataAry.add(dataObj);
			
			dataSetObj.put("data",jsonDataAry);
			dataSetObj.put("dataLabels",datalabelobj);
			dataSetObj.put("name","");
			dataSetAry.add(dataSetObj);

			returnObj.put("chartType","solidgauge");
			returnObj.put("maxValueForDial",100); // this must be max value
			returnObj.put("title",title);
			returnObj.put("unit","%");
			returnObj.put("isRoundBorder",true);
			returnObj.put("startAngle",-160);
			returnObj.put("endAngle",160);
			returnObj.put("DataSet",dataSetAry);
		}
		catch(Exception ee){
			ee.printStackTrace();
		}
		return returnObj;
	}
%>