
<%--
    Document   : PACS_REPORT
    Created on : Sep 17, 2015, 12:59:59 PM
    Author     : 454222
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList" %>
<% try {
%>
<html>
    <head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="${pageContext.request.contextPath}/js/Calendar.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/TableCSSCode.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <link rel="shortcut icon" href="${pageContext.request.contextPath}/img/favicon.ico?pacs=<%=((new java.util.Date()).getTime())%>" type="image/x-icon" />
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/styles.css?pacs=<%=((new java.util.Date()).getTime())%>"/>
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/ButtonAndText.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/info.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-ui-1.10.4.custom/development-bundle/jquery-1.10.2.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <script type="text/javascript" src="/PacsApplication/chromejs/chrome.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <script type="text/javascript" src="/PacsApplication/js/iFrame_killer.js"></script>
        <script>

            function downloadFiles() {

                if (document.forms[0].toDate.value == "")
                {
                    alert("!! Date Cannot Be Empty !!");
                    document.forms[0].txn_date.focus();
                    return false;
                }


                if (document.forms[0].fromDate.value == "")
                {
                    alert("!! Date Cannot Be Empty !!");
                    document.forms[0].txn_date.focus();
                    return false;
                }

                var e = document.getElementById("reportSelection");

                if (e.options[e.selectedIndex].value == "")
                {
                    alert("!! Report Name Cannot Be Empty !!");
                    document.forms[0].reportSelection.focus();
                    return false;
                }

                switch (e.options[e.selectedIndex].value) {

                    case "1" :

                        document.forms[0].reportPath.value = "/Reports/pds_profitability";
                        document.forms[0].reportName.value = "PDS PROFITABILITY REPORT";
                        document.forms[0].DOWNLOAD.value = "P";
                        break;

                    case "2" :

                        document.forms[0].reportPath.value = "/Reports/pds_sales_report";
                        document.forms[0].reportName.value = "PDS SALES REPORT";
                        document.forms[0].DOWNLOAD.value = "P";
                        break;

                        case "3" :

                        document.forms[0].reportPath.value = "/Reports/pds_stockl_expiry_update";
                        document.forms[0].reportName.value = "PDS STOCK EXPIRY UPDATE REPORT";
                        document.forms[0].DOWNLOAD.value = "P";
                        break;

                        case "4" :

                        document.forms[0].reportPath.value = "/Reports/pds_ration_ledger_report";
                        document.forms[0].reportName.value = "PDS RATION LEDGER REPORT";
                        document.forms[0].DOWNLOAD.value = "P";
                        break;

                        case "5" :

                        document.forms[0].reportPath.value = "/Reports/pds_customer_report";
                        document.forms[0].reportName.value = "PDS CUSTOMER REPORT";
                        document.forms[0].DOWNLOAD.value = "P";
                        break;



                    default :

                        null;

                }

                document.forms[0].action = '/PacsApplication/ExcelReportServlet';
                document.forms[0].submit();

            }

        </script>

        <title>PACS Report</title>
    </head>
    <body  onload="noBack();">
        <script type="text/javascript">
            function noBack()
            {
                window.history.forward();
            }
        </script>
        <jsp:include page="MenuHead_PDS.jsp" flush="true" />
        <br>
        <div style="top:500px">
            <fieldset style="border-color: black; background-image: url('/PacsApplication/img/download.jpg'); border-width: 3px">
                <legend style="padding: 8px; border-radius: 20px; background-color: #006600; color: white">PACS REPORT</legend>

                <form name="pacsreport" method="post" action="/PacsApplication/DownloadPacsReport">
                    <br>

                    <table>
                        <%if (request.getAttribute("error") != null) {%>
                        <tr><td colspan="2" align="center"><%=request.getAttribute("error").toString()%></td></tr>
                        <%}%>

                        <tr></tr>
                        <tr></tr>
                        <tr></tr>
                        <tr></tr>
                        <tr></tr>
                        <tr></tr>
                        <tr></tr>
                        <tr></tr>

                        <tr>
                            <td style=" font-family: Berlin Sans FB; font-weight:  normal;">From Date: <input type="text" style="text-align:center;" name="fromDate" maxlength="11" resize="yes" readonly="true"><a href="#" onclick="return getCalendar(document.forms[0].fromDate);"><img src="${pageContext.request.contextPath}/img/calendar.gif" name="imgr" border="0" width="15" height="20" /></a></td>
                            <td style=" font-family: Berlin Sans FB; font-weight:  normal;">To Date: <input type="text" style="text-align:center;" name="toDate" maxlength="11" resize="yes" readonly="true"><a href="#" onclick="return getCalendar(document.forms[0].toDate);"><img src="${pageContext.request.contextPath}/img/calendar.gif" name="imgr" border="0" width="15" height="20" /></a></td>

                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td style=" font-family: Berlin Sans FB; font-weight:normal; ">Report Name: </td>
                            <td> <select id="reportSelection" name="reportSelection" >
                                    <option value="" disabled selected style="display:none;" >--Select--</option>
                                    <option value="1">PDS Profitability Report</option>
                                    <option value="2">PDS Sales Report</option>
                                    <option value="3">PDS Stock Expiry Report</option>
                                    <option value="4">PDS Ration Ledger Report</option>
                                    <option value="5">PDS Customer Report</option>


                                </select></td>
                        </tr>
                    </table><br><br><br><br>
                    <center>



                        <input type="button" value="FETCH REPORT" onclick="javascript:downloadFiles();">

                    </center>

                    <input type="hidden" name="reportPath" value=""/>
                    <input type="hidden" name="reportName" value=""/>
                    <input type="hidden" name="DOWNLOAD" value=""/>


                </form>
            </fieldset>
        </div>
    </body>
</html>
<% 	} catch (Exception e) {
               
            }
%>

