<%@ page errorPage="errorPage.jsp" language="java" session="true" contentType="text/html;charset=ISO-8859-2" %>
<%@ page pageEncoding="UTF-8"%>
<%@ page import="com.etixpert.evolution.gui.servlets.*"%>
<%@ page import="java.util.*"%>
<%@ page import="com.etixpert.evolution.gui.servlets.*"%>
<%@ include file="header.jsp" %>
<%@ include file="check.jsp" %>
<%!
public String getVal(String name, HttpSession session) {
	Map m = (Map)session.getAttribute("download_files.jsp");
	if (m == null) return "";
	String[] vals = (String[])m.get(name);
	if (vals != null && vals.length>0 && vals[0] != null) return vals[0];
	return "";
}
%>
<%
	if (request.getParameter("id_from")!=null) session.setAttribute("id_from", request.getParameter("id_from"));
	if (request.getParameter("id_to")!=null) {
		
		session.setAttribute("id_to", request.getParameter("id_to"));
	}

%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link href="main_stat.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
<!-- JavaScript code hiding
	function simpleLink(origLink) {
		parent.mainFrame.location = origLink;
	}


	function link(origLink){
		if (top.mainFrame.document.forms.length == 0) {
			simpleLink(origLink);
			return;
		}
		else {
			if (top.mainFrame.document.forms[0].saveState == null) {
				simpleLink(origLink);
				return;
			}
			top.mainFrame.document.forms[0].saveState.value = top.mainFrame.self.location.pathname;
			top.mainFrame.document.forms[0].link.value = origLink;
			top.mainFrame.document.forms[0].submit();
		}
	}
// -->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
</SCRIPT>
</head>
<body>
<form action="process/distributor_search.jsp" method="post">
<input type="hidden" name="saveState"/>
<input type="hidden" name="link" value="process/distributor_search.jsp"/>
<input type="hidden" name="distID"/>
<input type="hidden" name="levelID"/>
<input type="hidden" name="pageAction">
<table width="800" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="600" height="30">&nbsp;</td>
  </tr>
  </table>
<label for="dateFrom"><fmt:message key="DATE_FROM"/>:</label>
<input name="dateFrom" value="<%=(!getVal("dateFrom", session).equals(""))?getVal("dateFrom", session):FormHelper.getDefaultDateForDownloadFiles2()%>"/><br>
<label for="dateTo"><fmt:message key="DATE_TO"/>:</label>
<input name="dateTo" value="<%=getVal("dateTo", session)%>"/><br>
<label for="search"><a href="javascript:top.mainFrame.document.forms[0].pageAction.value='download_files';link('process/download_files.jsp')"><fmt:message key="SEARCH"/></a></label><br>
<table width="800" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="600" height="30">&nbsp;</td>
  </tr>
  <tr>
    <td height="142" align="center" valign="top">
      <DIV STYLE="overflow: auto; width: 820px; height: 500px;
            border-left: 0px gray solid; border-bottom: 0px gray solid;
            padding:0px; margin: 0px">
          <table width="800" border="1" id="mainTable" class="sortable">
        <col width="300"><col width="100"><col width="100"><col width="200">
               <tr>
          <td id="accountTableHeaderContent"><fmt:message key="NAME"/></td>
          <td id="accountTableHeaderContent"><fmt:message key="DOWNLOAD_FILE"/></td>
          <td id="accountTableHeaderContent"><fmt:message key="PRINT_OUT"/></td>
          <td id="accountTableHeaderContent"><fmt:message key="LAST_DOWNLOAD"/></td>
        </tr>
       <%= FormHelper.generateDownloadRows(pageContext)%>
       </tr></table></div>
      </td>
  </tr>
  <tr>
    <td height="78">&nbsp;</td>
  </tr>
</table>
</form>
</body>
</html>
