<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- $Id: viewPerfReports.jsp,v 1.29.4.7.2.7 2005/01/27 12:25:05 gnanasekar Exp $ -->
<%@ taglib prefix="html" uri="http://jakarta.apache.org/struts/tags-html" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@include file="/webclient/common/jspf/commonIncludes.jspf" %>

<link href="/webclient/common/css/calendar-win2k-cold-1.css" rel="stylesheet" type="text/css" >
<html>
<head>
<title>AdventNet Web NMS </title>

<meta http-equiv="content-type" content="text/xml; charset=utf-8" />
<script type="text/javascript" src="/webclient/common/js/calendar.js"></script>
<script type="text/javascript" src="/webclient/common/js/calendar-en.js"></script>
<script type="text/javascript" src="/webclient/common/js/calendar-setup.js"></script>


<script>
var showVal = false;
function popupWin(field, action)
{
    // set index for custom option
    document.ReportViewForm.period.selectedIndex = 3;
    doCustomPeriodSelectAction(document.ReportViewForm);
    var obj = new DateObject(field, action);
    obj.popup();
}

startDateMessage = '<fmt:message key="webclient.performance.reports.period.startdate.message"/>';
endDateMessage = '<fmt:message key="webclient.performance.reports.period.enddate.message"/>';
invalidDateMessage = '<fmt:message key="webclient.performance.reports.period.invaliddate.message"/>';
noagentmsg = '<fmt:message key="webclient.performance.reports.required"><fmt:param><fmt:message key="webclient.performance.reports.managedobject.required"/></fmt:param></fmt:message>';

function doCustomPeriodSelectAction(form)
{
	if (form.period.selectedIndex != 3)
	{
		form.startDate.value="";
		form.startDate.className = "formStyleDisabled";
		form.endDate.value="";
		form.endDate.className="formStyleDisabled";
        document.getElementById('startTrigger').style.visibility='hidden';
        document.getElementById('endTrigger').style.visibility='hidden';
		Calendar.prototype.isShowPopup = false;
	}
	else
	{
		form.startDate.className = "formStyle";
		form.endDate.className = "formStyle";
        document.getElementById('startTrigger').style.visibility='visible';
        document.getElementById('endTrigger').style.visibility='visible';
		Calendar.prototype.isShowPopup = true;

	}
}

function init()
{
<c:if test='${empty param.period || param.period != "custom"}'>
   document.ReportViewForm.startDate.className = "formStyleDisabled";
   document.ReportViewForm.endDate.className = "formStyleDisabled";
   document.getElementById('startTrigger').style.visibility='hidden';
   document.getElementById('endTrigger').style.visibility='hidden';
   document.getElementById('endTrigger').style.cursor="help";
   document.ReportViewForm.elements[0].focus();
</c:if>
	if (document.ReportViewForm.period.selectedIndex == 3)
		Calendar.prototype.isShowPopup = true;
 
}
</script>
</head>
<html:javascript formName="ReportViewForm"/>

<body onload="init()">

	<html:form action="/ReportViewAction.do" method="post" onsubmit="return validateReportViewForm(this)">
  
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td>&nbsp;</td>
      <td height=30 valign=bottom><span class="header1">
		<c:choose>
		<c:when test="${empty param.name}">
			<c:out value="${param.displayName}"/>
		</c:when>
		<c:otherwise>
		<fmt:message key="webclient.performance.reports.header">
		<fmt:param><c:out value="${requestScope.reportHeader}"/></fmt:param>
		<fmt:param><c:out value="${param.name}"/></fmt:param>
		</fmt:message>
		</c:otherwise>
		</c:choose> </span>
      </td>
      <td>&nbsp;</td>
      </tr>

      <tr> 
        <td width="10" height="1"><img src="/webclient/common/images/trans.gif" width="1" height="1"></td>
        <td height="1" colspan="2" class="hline"><img src="/webclient/common/images/trans.gif" width="1" height="1"></td>
      </tr>      
      <tr> 
        <td colspan="3" height="10"><img src="/webclient/common/images/trans.gif" width="1" height="1"></td>
      </tr>       
      
      <tr>
      <td>&nbsp;</td>
      <td valign="top">
      	<table width="520" border="0" cellspacing="0" cellpadding="0">
	<tr> 
	<td align="center" valign="top">
	<span class="errorText"><html:errors/></span>
	<c:if test="${!empty param.name}">
	<c:if test="${!empty requestScope.reportPath}">
	<span class="header2"><c:out value="${requestScope.periodRange}" escapeXml="false"/></span><p>&nbsp;</p>
	<c:import url="${reportPath}" charEncoding="UTF-8"/>
	</c:if>

	<c:if test="${!empty requestScope.graphPath}">
        <c:forEach  var="GraphPath" items="${graphPath}" varStatus="status">
        <table cellspacing =0 cellpadding=1 border=0 class="homeTableDarkBorder">
        <tr class="homeHeader" align="center" nowrap><td class="boldWhiteText" height="24">
<c:choose>
        <c:when test="${empty GraphPath.value}">
        <c:out value="${param.reportType}"/>
        </c:when>
        <c:otherwise>
        <c:out value="Interface - ${GraphPath.value} ${param.reportType}"/>
        </c:otherwise>
</c:choose>

</td></tr>
        <tr><td>
		<img src='<c:out value="${GraphPath.key}"/>' border="0">
        </td></tr></table>
        <br>
        </c:forEach>
        <td align="center" valign="top" width="50%">
        <%@ include file="../jspf/reportOptions.jspf"%>
        </td>
	        </c:if>
		</c:if>

	<c:if test="${empty requestScope.graphPath}">
        <table cellspacing =0 cellpadding=10 border=0 width=500 align=left>
        <tr>
        <td height=70 class=text> 
       	<ol><li><fmt:message key='webclient.perf.reports.nodata.text1'/></li>
       	<li><fmt:message key='webclient.perf.reports.nodata.text2'/></li>
       	<li><fmt:message key='webclient.perf.reports.nodata.text3'/></li>
       	</ol>
        <%@ include file="../jspf/reportOptions.jspf"%>
        </td>
        </tr>
        </table>
        </c:if>
		</td>
		</tr>
  	</table> 

  	</td>
<%--
		<c:if test="${!empty requestScope.graphPath}">
		<td align="center" valign="top" width="50%">
		<%@ include file="../jspf/reportOptions.jspf"%>
		</td>
       </c:if>
--%>
	<c:if test="${!empty tableCol}">
	<tr><td> &nbsp; </td></tr>
  	<tr  valign=top>
		<%
			int count = 0;
			java.util.Vector value = (java.util.Vector)request.getAttribute("tableCol");
			if( value != null )
				count = value.size();
		%>

      	<table width="350" border=0 cols=<%=count%> valign="top">
      	<tr>
		<% int i = 0; %>
     	    <c:forEach var="prop1" items="${tableCol}">
      	      	<td valign="top" align="center">
		<%
			value = (java.util.Vector)request.getAttribute("tableCol");
			String heading = null;
			if( value != null && value instanceof java.util.Vector)
			{
				java.util.Vector val = (java.util.Vector)value.get(i);
				heading = (String)val.remove(0);
				i++;
			}
		%>

      	   	<table border=0 class="htableborder">
<%--
		<tr class="header2Bg">
      		    <td nowrap colspan="3" height="22" align="center"><span class="header2"><%=heading %></span></td>
                </tr>  
--%>
      	<tr>

      		<tr class="header2Bg">
      		    <td width="33%" height="22" align="center" nowrap><span class="header2"><fmt:message key='webclient.performance.reports.header.date'/></span></td>
      		    <td width="33%" height="22" align="center" nowrap><span class="header2"><fmt:message key='webclient.performance.reports.header.time'/></span></td>
      		    <td width="34%" height="22" align="center" nowrap><span class="header2"><fmt:message key='webclient.performance.reports.header.responsetime'/></span></td>
                </tr>
                <tr>
      		    <c:forEach var="prop2" items="${prop1}" varStatus="status">
      		    <c:choose>		
      		    <c:when test="${status.count%2 == 0}" > 		
      		    <TR class="reportsOddRow" >
      		    </c:when>
      		    <c:otherwise>
                <%--
      		    <TR class="rowEven" >
                --%>
      		    </c:otherwise>
      		    </c:choose> 
                
                        <c:forEach var="prop3" items="${prop2}" >
             		    <td class="text" align="center" ><c:out value='${prop3}'/></td>
                        </c:forEach> 
                    </tr>
      	    	    </tr>
      		    </c:forEach>
      	   	</table>

      	  	</td>
      		</c:forEach>
     	</tr> 
     	</table>
      
      </tr>
      </tr>
      <tr>
	</c:if>
</tr>
 
</table>
</html:form>
</body>
</html>
