<!DOCTYPE html>

<%@ include file = "EgTrackerA.jsp" %>
<%@ include file="listSearchJson.jsp" %>
<%@ taglib prefix = "egui" uri = "../WEB-INF/eg-taglib.tld"%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>


<%@ page import = "java.io.*"%>
<%@ page import = "com.eg.*"%>
<%@ page import="java.net.InetAddress"%>

<%@ page import = "com.egurkha.ini.IniUI"%>
<%@ page import = "java.util.TimeZone"%>
<%@ page import = "java.util.Calendar"%>
<%@ page import = "java.text.SimpleDateFormat"%>
<%@ page import = "java.text.DateFormat"%>
<%@ page import = "com.egurkha.util.DateUtil"%>
<%@ page import = "com.egurkha.*"%>
<%
	response.setHeader("Cache-Control","no-store");
	response.setHeader("Pragma","no-cache");
	response.setDateHeader("Expires", -1);

	String uiFile = "eg_ui.ini";
	String s_iniFile_dir = EgInstallInfo.getInstallDir()+ "/manager/config/";
	IniFile egUI = new IniFile(s_iniFile_dir + uiFile);
	String currentDateFormat = egUI.getValue("CURRENT_DATE_FORMAT","selectedDateFormat");
	String fromUserType = "";
	InetAddress thisIp = InetAddress.getLocalHost();
	String ipaddress=thisIp.getHostAddress();
	String iphost=thisIp.getHostName();
	boolean isNamedUsers = EgInstallInfo.isnamedUserLicense;
	boolean isConcUsers = EgInstallInfo.isconcurrentUserLicense;
	String userLanguage = trackerLanguage;
	String from = request.getParameter("from");
	if(isConcUsers)
	{
		fromUserType = "ConcurrentUser";
	}
	else if(isNamedUsers)
	{
		fromUserType = "NamedUsers";
	}
	String errorMsg = _mapping.getTextDescription("admin.license.No Data Found");
	// To show user count in license usage page despite server based license
	if (!isNamedUsers && !isConcUsers) // Server based license
	{
	//	IniFile uiIni = new IniFile(EgInstallInfo.getInstallDir() + "/manager/config/eg_ui.ini");
		String showUsersCount = egUI.getValue("User_Cert","ShowUsersCountInUI");
		if (showUsersCount != null && (showUsersCount.equalsIgnoreCase("yes") || showUsersCount.equalsIgnoreCase("true")))
		{
			IniFile servicesIni = new IniFile(EgInstallInfo.getInstallDir() + "/manager/config/eg_services.ini");
			String namedAlwaysRun = egUI.getValue("User_Cert","CalculateTotalAlways");
			String ccUsrAlwaysRun = servicesIni.getValue("ConcurrentUsers_Report","RunAlways");
			if (namedAlwaysRun != null && (namedAlwaysRun.equalsIgnoreCase("yes") || namedAlwaysRun.equalsIgnoreCase("true")))
			{
				isNamedUsers = true;
			}
			else if (ccUsrAlwaysRun != null && (ccUsrAlwaysRun.equalsIgnoreCase("yes") || ccUsrAlwaysRun.equalsIgnoreCase("true")))
			{
				isConcUsers = true;
			}
		}
	}

	EgRoleInfo egRoleInfo = EgRoleInfo.getInstance(session.getId(),(String)session.getAttribute("sess_userid"));
	com.eg.EgCertUsage userCert = new com.eg.EgCertUsage();
	EgUuidInfo uuidInfo = new EgUuidInfo();
	String userId = _user.getLoginID();
	ArrayList usersList = userCert.getAllLimitedCompAccessUsers(true);
	boolean isLimitedAdmin = (usersList.contains(userId));
	boolean isUser = uuidInfo.isUser(userId);
	boolean isOrg = uuidInfo.isOrg(userId);
	boolean isShareRoleUser = (uuidInfo.isUser(userId) && uuidInfo.hasOURole(userId));

	boolean isNonSharedUser = (!isOrg && !isShareRoleUser);

	String orgName = (uuidInfo.isUser(userId) && uuidInfo.hasOURole(userId)) ? uuidInfo.getDirectDependentOU(userId) : userId;

	boolean isMspModel = EgUuidInfo.isMspModel();
	String orgUnitName = "Organizational Unit";
	if (isMspModel)
	{
		orgUnitName = "Organization/ Organizational Unit";
	}

	EgUsersInfo usersInfo = new EgUsersInfo();
	String namedUserOrVm = "Named Users";
	String concUserOrVm = "Concurrent Users";
	String includeDesktop = egUI.getValue("User_Cert","IncludeDesktopNames");
	if (includeDesktop != null && (includeDesktop.equalsIgnoreCase("yes") || includeDesktop.equalsIgnoreCase("true")))
	{
		namedUserOrVm = "Named Users/VMs" ;
		concUserOrVm = "Concurrent Users/VMs";
	}
	
	boolean usrWiseCertEnabled = usersInfo.userWiseUsageFlag;
	boolean zonWiseCertEnabled = usersInfo.zoneWiseUsageFlag;
	//boolean showUsersTab = ((orgName != null || orgName.length() > 0) && usrWiseCertEnabled);
	boolean showUsersTab = (usrWiseCertEnabled && (isOrg || (isUser && !isLimitedAdmin) || (isShareRoleUser))) ? true : false;

	ArrayList peakUsageData = usersInfo.getPeakUsageValuesForPreviusMonth();
	InetAddress[] addresses = InetAddress.getAllByName(iphost);
	IniFile servicesIni = new IniFile(EgConfigInfo.egMgrConfigDir+"eg_services.ini");
	String vdiUsrsSplitUp = servicesIni.getValue("ZoneAndUserCertUsage","VDIUsersSplitup");
	boolean showVDIUsersSplitUp = false;
	if (vdiUsrsSplitUp != null && (vdiUsrsSplitUp.equalsIgnoreCase("yes") || vdiUsrsSplitUp.equalsIgnoreCase("true")))
	{
		showVDIUsersSplitUp = true;
	}
	if(addresses.length > 1)
	{
		String ipformat=EgInstallInfo.getInstallDir() + "/manager/config/eg_external.ini";
		IniFile infos = new IniFile(ipformat);
		String mgrIP[] = infos.getVariables("Eg_External_Agents");
		String origi = mgrIP[0];
		if(origi != null)
			origi = origi.trim();
		for(int k = 0; k< addresses.length; k++)
		{
			InetAddress ipadd = addresses[k];
			String address = ipadd.getHostAddress();
			if(address.equalsIgnoreCase(origi))
			{
				ipaddress = address;
			}
		}
	}

	if (ipaddress.equals("127.0.0.1") || 
		ipaddress.equals("::1") || 
		ipaddress.equals("0:0:0:0:0:0:0:1"))
	{
		EgSpecsInfo specsInfo = new EgSpecsInfo("manager");
		ipaddress = specsInfo.getEGServer();
	}
	UserRegistry reg = UserRegistry.getInstance();
	User user = reg.getUser(session.getId());

	IniUI iniUI = IniUI.getInstance();
	String timezoneOffsetValue ="";
	EgDateInfo tracker_tdateInfo = new EgDateInfo();
	TimeZone tracker_tz = null;
	Calendar cal = Calendar.getInstance();
	java.util.Date local_date = new java.util.Date(tracker_tdateInfo.egetUTCDate());
	cal.setTime(local_date);
	cal.setTimeZone(tracker_tdateInfo.getRealTimeZone());
	String temp1 = (cal.get(cal.MONTH)+1) + "/" + cal.get(cal.DAY_OF_MONTH) + "/" +cal.get(cal.YEAR);
	String mgr_time = cal.get(cal.HOUR_OF_DAY)+":"+cal.get(cal.MINUTE)+":"+cal.get(cal.SECOND);
	String trac_currentDateFormat = iniUI.getValue("CURRENT_DATE_FORMAT","selectedDateFormat");
	String dispDate = DateUtil.changeDateFormat(temp1,"MM/dd/yyyy",trac_currentDateFormat);
	EgTimeZoneConverter tracker_timeZoneConverter = new EgTimeZoneConverter(dispDate+" "+mgr_time,user);
	tracker_tz = tracker_timeZoneConverter.getTimeZone();

	long timezoneinMins = (Math.abs((tracker_tz.getRawOffset() / (60 * 1000))));
	long daylighttime = (tracker_tz.getDSTSavings() / (60 * 1000));
	timezoneOffsetValue = String.valueOf(Math.abs(timezoneinMins-daylighttime));

	Calendar cal3 = GregorianCalendar.getInstance(tracker_tz);
	int offsetInMillis = tracker_tz.getOffset(cal3.getTimeInMillis());
	int offsetmin = 0;
	if(offsetInMillis<0)
		offsetmin =(Math.abs(offsetInMillis)/1000)/60;
	else
		offsetmin = (offsetInMillis/1000)/60;
	
	String offset = String.valueOf(offsetmin);
	if(tracker_tz.getRawOffset()>=0)
		timezoneOffsetValue="-"+offset;
	else
		timezoneOffsetValue="+"+offset;
	String peakUsgMsg = "";
	String peakdate = "";
	String peakdateForUserNames = "";
	String peakCount = "";
	boolean peakUsers = false;
	String graphPeakDate = "";
	if(peakUsageData != null && peakUsageData.size() >= 2)
	{
		String peakUsgCnt = peakUsageData.get(0).toString();
		String peakUsgDate = peakUsageData.get(1).toString();
		if (peakUsgCnt != null && peakUsgCnt.trim().length() > 0 && peakUsgDate != null && peakUsgDate.trim().length() > 0)
		{
			int dotIdx = peakUsgCnt.indexOf(".");
			if (dotIdx > -1)
			{
				peakUsgCnt = peakUsgCnt.substring(0,dotIdx);
				peakCount = peakUsgCnt;
			}
			else
			{
				peakCount = peakUsgCnt;
			}
			DateFormat formatDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			Date peakdateparse = formatDate.parse(peakUsgDate);
			Calendar cal_temp_obj = new GregorianCalendar();
			cal_temp_obj.setTime(peakdateparse);
			cal_temp_obj.add(Calendar.DATE,1);
			java.util.Date dt_temp = cal_temp_obj.getTime();
			peakdateForUserNames = formatDate.format(dt_temp);
			peakdateForUserNames = DateUtil.changeDateFormat(peakdateForUserNames,"yyyy-MM-dd HH:mm:ss","EEE MMM dd yyyy HH:mm:ss");
			graphPeakDate = DateUtil.changeDateFormat(peakUsgDate,"yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm:ss");
			peakUsgDate = DateUtil.changeDateFormat(peakUsgDate,"yyyy-MM-dd HH:mm:ss",trac_currentDateFormat);
			peakdate = peakUsgDate;
			graphPeakDate = graphPeakDate+"^"+peakdate;
			peakUsgMsg="&nbsp;&nbsp";
			if (isNamedUsers)
			{
				peakUsgMsg += "Peak usage last month was on "+peakUsgDate+". The peak value on this day was "+peakUsgCnt+" named users.";
				peakUsers = true;
			}
			else
			{
				peakUsgMsg += "Peak usage last month was on "+peakUsgDate+". The peak value on this day was "+peakUsgCnt+" concurrent users.";
				peakUsers = true;
			}
		}
	}
	int count_AllowedCount_str = 0;
	int peakCntInt = 0;
	ArrayList aListData = usersInfo.getRemoteUserCount();
	String AllowedCount = "";
	if(peakUsers)
	{
		
		if (aListData == null || aListData.size() ==0)
		{
			aListData = usersInfo.getRemoteUserCount(true);
		}
		if(aListData!=null && aListData.size()>0)
		{
			 AllowedCount = (String)aListData.get(1);
			if (AllowedCount!=null && !AllowedCount.equals("-") && AllowedCount!="")
			{
				 count_AllowedCount_str =Integer.parseInt(AllowedCount);
			}
		}
		peakCntInt = Integer.parseInt(peakCount);
	}
%>

<html>
<head>
	<meta charset="utf-8">
	<title>License Information</title>

	<!--Skin color--------->
	<egui:skin ui = "admin"/>

<style>
.groupHeaderLeftAlign .x-column-header-inner,
.groupHeaderLeftAlign .x-column-header-over{
text-align:left !important;
}
.gridSkin .x-grid-rowwrap-div .x-grid-cell{
	border-width:0px 0px 0px 0px !important;
}
.gridSkin .x-column-header-inner .x-column-header-text  {
	white-space: normal;
	word-break: break-word;
}
</style>
	<!---Components, icons, skin and Core ext script--->
	<script type="text/javascript" src="../extjs/ext-all.js"></script>

	<!-- Fancy Scroll-->
	<script src="/final/jquery/jquery.js"></script>
	<script src="/final/styles/jscrollpane/jquery.jscrollpane.js" ></script>
	<script src="/final/styles/jscrollpane/jquery.mousewheel.js" ></script>
	<script src="/final/styles/jscrollpane/mwheelIntent.js" ></script>
	<link rel="stylesheet" href="/final/styles/jscrollpane/jquery.jscrollpane.css"/>
	<script language="JavaScript1.2" src="/final/Highcharts/js/highstock.js"></script>
	<script src="/final/monitor/eg_scripts/EgHighChart.js"></script>
	<script src="/final/Highcharts/js/highcharts-more.js"></script>
	<script src="/final/scripts/utilities/EncodeDecodeParams.js"></script>

	<script language="JavaScript1.2" src="/final/scripts/eg_DateUtil.js"></script>
	<script language="JavaScript1.2" src="../scripts/<%=script_src%>"></script>
	<script language="javascript">
	var csrfToken = '<%=strCsrfToken%>';
	var mgrDateFormat = getExtjsDateFormat('<%=currentDateFormat%>');
	Ext.onReady(function(){
		Ext.Ajax.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};
		Ext.data.Connection.prototype.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};
		Ext.data.ScriptTagProxy.prototype.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};

		Ext.Ajax.on('requestexception', function (conn, response, options) {
			var errorStr = response.responseText;
			if (errorStr != undefined && errorStr != 'undefined' && errorStr.indexOf("customerror") != -1)
			{
				if (errorStr.indexOf("user-session-invalid") != -1)
				{
					callWindow(1);
				}
				else if (errorStr.indexOf("user-deleted") != -1)
				{
					callWindow(2);
				}
				else if (errorStr.indexOf("user-timedout") != -1)
				{
					callWindow(3);
				}
			}
			else
			{
				if (response.status == 302 || (response.timedout != undefined && response.timedout == true))
				{
					Ext.Msg.show({
						title : errorTitle,
						msg : requestTimeOut,
						buttons : Ext.Msg.OK,
						icon : 'iconError'
					});
				}
				else
				{
					console.log(response.responseText);
					Ext.Msg.show({
						title : errorTitle,
						msg : probsErrorMessage,
						buttons : Ext.Msg.OK,
						icon : 'iconError'
					});
				}
			}
		});
	});

	
	</script>
	
	<!-- Application folder -->
	<script type="text/javascript" src="License/app/app.js"></script>
	<Script language="JavaScript1.2">
	var peakUsgDate='<%=peakdate%>';
	var peakdate = '<%=peakdateForUserNames%>';
	var peakdateForUserNames = new Date(peakdate);
	var graphPeakDate='<%=graphPeakDate%>';
	var strSkin="Light";
	strSkin='<%=admin_Skin%>';
	var highChart = null;
	var highChartIns = null;
	var drillDownHighChartIns = null;
	var timeZoneOffsetVal='<%=timezoneOffsetValue%>';
	var pageTitle = '<egui:intnl text="admin.title.LICENSE INFORMATION"/>';
	var pageTitle2 = '<egui:intnl text="admin.title.NAMED USERS REPORT"/>';
	var pageTitle3 = '<egui:intnl text="admin.title.LICENSE USAGE REPORT"/>';
	var pageTitle4 = '<egui:intnl text="admin.title.CONCURRENT USERS REPORT"/>';
	var pageDesc = '<egui:intnl description="EgLicenseInfo.jsp"/>';
	var pageDesc2 = '<egui:intnl description="EgLicenseInfo2.jsp"/>';
	var pageDesc3 = '<egui:intnl description="EgLicenseInfo3.jsp"/>';
	var agentStatus = '<egui:intnl text="admin.license.Agent Status"/>';
	var ctrler;
	var publicJSON = '';
	var certInfo = '<egui:intnl text="admin.license.License Information"/>';
	var certDetail = '<egui:intnl text="admin.license.License Details for eG Enterprise Installed on"/>';
	var certDetail2 = '<egui:intnl text="admin.license.with IP Address"/>';
	var product = '<egui:intnl text="admin.license.Product"/>';
	var version = '<egui:intnl text="admin.license.Version"/>';
	var ipAddr = '<egui:intnl text="admin.license.IP Address"/>';
	var hostID = '<egui:intnl text="admin.license.Host ID"/>';
	var expDate = '<egui:intnl text="admin.license.Expiry Date"/>';
	var certValid = '<egui:intnl text="admin.license.License is valid for"/>';
	//var mailSender = '<egui:intnl text="admin.license.Mail Sender ID"/>';
	var mailId = '<egui:intnl text="admin.license.Mail ID"/>';
	var companyName = '<egui:intnl text="admin.license.Company Name"/>';
	var clusType = '<egui:intnl text="admin.license.Cluster Type"/>';
	var ic = '<egui:intnl text="admin.license.Integration Console"/>';
	var ttMgr = '<egui:intnl text="admin.license.Trouble Ticket Manager"/>';
	var dd = '<egui:intnl text="admin.license.Detailed Diagnosis"/>';
	var extSuperMgr = '<egui:intnl text="admin.license.External Supermanager"/>';
	var egSuperMgr = '<egui:intnl text="admin.license.eG Supermanager Support"/>';
	var egReporter = '<egui:intnl text="admin.license.eG Reporter"/>';
	var remCtrlActs = '<egui:intnl text="admin.license.Remote Control Activities"/>';
	var smsAlerts = '<egui:intnl text="admin.license.SMS Alerts"/>';
	var dateAlert = '<egui:intnl text="admin.license.From date should be lesser than To date"/>';
	var configMgmt = '<egui:intnl text="admin.license.Configuration Management"/>';
	var metricAgg = '<egui:intnl text="admin.license.Metric Aggregation"/>';
	var agentPerSys = '<egui:intnl text="admin.license.Agent Per System"/>';
	var clntEmul = '<egui:intnl text="admin.license.Client Emulation"/>';
	var certUsage = '<egui:intnl text="admin.license.Total License Usage"/>';
	var csvfilename = '<egui:intnl text="admin.license.NamedUsersReport"/>';
	var attribute = '<egui:intnl text="admin.license.Attribute"/>';
	var allowed = '<egui:intnl text="admin.license.Allowed"/>';
	var used = '<egui:intnl text="admin.license.Currently Used"/>';
	var advAnalytics = '<egui:intnl text="admin.license.Advance Analytics"/>';
	var LicenseID = '<egui:intnl text="admin.license.License ID"/>';
	var user4VDIUsrs = used;
	var userWidth = 80;
	if ('<%=showVDIUsersSplitUp%>' == 'true')
	{
		user4VDIUsrs += " (Citrix / VDI / Terminal)";
		userWidth += 100;
	}
	var available = '<egui:intnl text="admin.license.Available"/>';
	var usage = '<egui:intnl text="admin.license.Current Usage"/>';
	var run = '<egui:intnl text="admin.license.Running"/>';
	var notRun = '<egui:intnl text="admin.license.Not Running"/>';
	var totNamedUsrs = '<egui:intnl text="admin.license.Total Named Users Report"/>';
	var totUsrs = '<egui:intnl text="admin.license.Total Named users"/>';
	var namedUserOrVm = '<%=namedUserOrVm%>';
	var concUserOrVm = '<%=concUserOrVm%>';
	var usersCert = '<egui:intnl text="admin.license.'+namedUserOrVm+'"/>';
	var monUser = '<egui:intnl text="admin.title.Monitor Users"/>';
	var back = '<egui:intnl text="admin.common.Back"/>';
	var backHref = '<%=backHref%>';
	var isNamedUsers = '<%=isNamedUsers%>';
	var from = '<%=from%>';
	var userWiseCertUsg = '<%=usrWiseCertEnabled%>';
	var zoneWiseCertUsg = '<%=zonWiseCertEnabled%>';
	var showUsersTab = '<%=showUsersTab%>';
	var noUsersFound = '<egui:intnl text="admin.license.No users found for your current search"/>';
	var noZonesFound = '<egui:intnl text="admin.license.No zones found for your current search"/>';
	var noUsers = '<egui:intnl text="admin.license.No users found"/>';
	var noZones = '<egui:intnl text="admin.license.No zones found"/>';
	var concUsrGrTitle = '<egui:intnl text="admin.license.Concurrent users report for"/>';
	var isLimitedAdmin = '<%=isLimitedAdmin%>';
	var fromUserType = '<%=fromUserType%>';
	var orgUnitName = "<%=orgUnitName%>";
	var isMspModel = <%=isMspModel%>;
	
	

	if('<%=isConcUsers%>' == 'true')
	{
		totNamedUsrs = '<egui:intnl text="admin.license.Total Concurrent Users Report"/>';
		//usersCert = '<egui:intnl text="admin.license.Concurrent Users"/>';
		usersCert = '<egui:intnl text="admin.license.'+concUserOrVm+'"/>';
	}
	if('<%=isConcUsers%>' == 'true')
	{
		csvfilename = '<egui:intnl text="admin.license.ConcurrentUsersReport"/>';
		pageTitle2 = '<egui:intnl text="admin.title.CONCURRENT USERS REPORT"/>';
		pageDesc2 =  '<egui:intnl description="EgLicenseInfo4.jsp"/>';
	}
	if('<%=peakUsers%>'== 'true')
	{
		var peakUsageCaption3  = '';
		var peakUsgCnt = '<%=peakCount%>'; 
		var peakUsageCaption = "Peak usage last month was on ";
		var peakUsageCaption2 = ". The peak value on this day was ";
		
		if(<%=count_AllowedCount_str%> !=0 && <%=peakCntInt%> > <%=count_AllowedCount_str%>)
		{
			peakUsageCaption3 = " Usage on this day was more than the allowed limit.";
		}
	}
	else
	{
		peakUsageCaption = '';
		peakUsageCaption2 = '';
		peakUsgCnt = '';
		peakUsageCaption3 = '';
	}
	var usrWiseUsg ='<egui:intnl text="admin.license.Usage by Users"/>';
	var zonWiseUsg ='<egui:intnl text="admin.license.Usage by Zones"/>';
	var users ='<egui:intnl text="admin.license.Users"/>';
	var zones ='<egui:intnl text="admin.license.Zones"/>';
	var totMons = '<egui:intnl text="admin.license.Total Monitors"/>';
	var preMons = '<egui:intnl text="admin.license.Premium Monitors"/>';
	var basMons = '<egui:intnl text="admin.license.Basic Monitors"/>';
	var extAgns = '<egui:intnl text="admin.license.External Agents"/>';
	var monTrgs = '<egui:intnl text="admin.license.Monitored Targets"/>';
	var apps = '<egui:intnl text="admin.license.Applications"/>';
	var nwDevs = '<egui:intnl text="admin.license.Network Devices"/>';
	var servcs = '<egui:intnl text="admin.license.Services"/>';
	var segmns = '<egui:intnl text="admin.license.Segments"/>';
	var clusterDetails = '<egui:intnl text="admin.license.Cluster Details"/>';
	var manager = '<egui:intnl text="admin.license.MANAGER"/>';
	var url = '<egui:intnl text="admin.license.URL"/>';
	var primary = '<egui:intnl text="admin.license.Primary"/>';
	var secondary = '<egui:intnl text="admin.license.Secondary"/>';
	var searchLbl = '<egui:intnl text="admin.title.Search Org/OU"/>';

	var heading = certDetail+' <%=iphost%> ('+certDetail2+' <%=ipaddress%>)';
	var userLanguage = '<%=userLanguage%>';
	var disDate = '<%=dispDate%>'

	var tab6Label = '<egui:intnl text="admin.eguserlicense.Usage by OU"/>';
	var tab6Title = '<egui:intnl text="admin.eguserlicense.Usage by organizational unit"/>';
	var noUserAlert = '<egui:intnl text="admin.eguserlicense.No organizational unit found with license limit"/>';
	var noUserSearchAlert = '<egui:intnl text="admin.eguserlicense.No organizational unit found for your current search"/>';
	if (isMspModel)
	{
		tab6Label = '<egui:intnl text="admin.eguserlicense.Usage by Org/OU"/>';
		tab6Title = '<egui:intnl text="admin.eguserlicense.Usage by organization/organizational unit"/>';
		noUserAlert = '<egui:intnl text="admin.eguserlicense.No organization/organizational unit found"/>';
		noUserSearchAlert = '<egui:intnl text="admin.eguserlicense.No organization/organizational unit found for your current search"/>';
	}
	var LoadAlert1 = '<div class="egFlexCenterByColumnWise" style="height:100%"><div class="iconInformation"></div><div class="commonErrorMsgText" id="noCompAlrtDiv">'+noUserAlert+'</div></div>';
	var LoadSearchAlert = '<div class="egFlexCenterByColumnWise" style="height:100%"><div class="iconInformation"></div><div class="commonErrorMsgText" id="noCompAlrtDiv">'+noUserSearchAlert+'</div></div>';

	var probsErrorMessage = '<egui:intnl text="admin.error.Problem encountered while loading the user interface"/>';
	var requestTimeOut = '<egui:intnl text="admin.error.Response timed out"/>';
	var errorTitle = '<egui:intnl text="admin.user.Error"/>';
	var errorMsg ='<%=errorMsg%>';
	var isNonSharedUser =<%=isNonSharedUser%>;
	function resizeHighChart(id,adjWidth,adjHeight)
	{
		if( highChartIns != null )
		{
			var hCHart = highChartIns.highchart.chart;
			var renderTo = hCHart.renderTo;
			hCHart.width = adjWidth;
			hCHart.height = adjHeight;
			highChartIns.drawChart();
		}
	}
	function resizeDrillDownHighChart(id,adjWidth,adjHeight)
	{
		if(drillDownHighChartIns != null)
		{
			var hCHart = drillDownHighChartIns.highchart.chart;
			var renderTo = hCHart.renderTo;
			hCHart.width = adjWidth;
			hCHart.height = adjHeight;
			drillDownHighChartIns.drawChart();
		}
	}
	</Script>
</head>
<BODY>
	<div id="loadmask" class="x-mask-msg x-layer x-mask-msg-default" style="z-index: 19001;left:45%;top:35%;"><div class="x-mask-loading" style="position:relative">Loading...</div></div>
</BODY>
</html>
<%
	if(request.getQueryString()!=null)
	{
		session.setAttribute("adminLastAccessedURL","/final/admin/EgLicenseInfo.jsp?"+request.getQueryString()+"&showtree=discoverytree");
	}
	else
	{
		session.setAttribute("adminLastAccessedURL","/final/admin/EgLicenseInfo.jsp?showtree=discoverytree");
	}
%>



