<%-- 
    Document   : CashDrawerCloseOperation
    Created on : Nov 9, 2016, 1:32:58 PM
    Author     : 986137
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.UUID" %>
<%String uuid = UUID.randomUUID().toString();%>
<% try {
%>
<html>
    <head>
        <title>Cash Drawer Close/Open Operation</title>
        <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 type="text/javascript">
            function noBack()
            {
                window.history.forward();
            }

            
            function checkSubmit(closeCashDrawerForm)
            {
                
                if (closeCashDrawerForm.drawercoperationFlag.value == "Not")
                {
                    alert("!! Please select operation !!");
                    closeCashDrawerForm.drawercoperationFlag.focus();
                    return false;
                }
                document.forms[0].action='/PacsApplication/CloseCashDrawerServlet';
                document.forms[0].submit();


            }
            
            // to restrict back button
            history.pushState(null, null, location.href);
            window.addEventListener('popstate', function(event) {
                history.pushState(null, null, location.href);
            });
            
        </script>
    </head>
    <body onload="noBack()">
        <jsp:include page="MenuHead_Deposit.jsp" flush="true" />
        <br>

        <%
            String error_msg = "";
            Object error = request.getAttribute("message");
            if (error != null) {
                error_msg = error.toString();
            }
        %>

        <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">
                CLOSE CASH DRAWER
            </legend>
            <form action="" method="post" name="closeCashDrawerForm">

                <%if (!error_msg.equalsIgnoreCase("")) {%>
                <center><div class="info" id="errorMessage"><center><%= error_msg%></center></div></center>
                            <% }%>

                <center>
                    <table>
                        <tbody>
                           
                            <tr></tr>
                            <tr></tr>
                            <tr></tr>
                            <tr></tr>
                            <tr></tr>
                            <tr></tr>
                            <tr></tr>
                            <tr>
                                <td>Select Operation :</td>
                                <td><select style="width: 171px;" id="drawercoperationFlag" name="drawercoperationFlag">
                                        <option disabled selected value="Not">-------Please select-------</option><option value="O">Open</option><option value="C">Close</option>
                                    </select></td>
                            </tr>
                        <input type="hidden" id="regid" name="regid">


                        </tbody>
                    </table>
                    <br><br>
                </center>
                <center>
                    <input type="button" value="Submit" onclick="javascript:checkSubmit(closeCashDrawerForm)">
                    <input type="button" value="Reset" name="reset" onclick="ShowParent();" />
                </center>
                <script>
                    function ShowParent()
                    {
                        document.forms[0].action = "${pageContext.request.contextPath}/Deposit/CashDrawerCloseOperation.jsp";
                        document.forms[0].submit();
                    }
                </script>
            </form>
        </fieldset>
    </body>
</html>
<% 	} catch (Exception e) {
               
            }
%>

