<%-- 
    Document   : mark_unmark_NPA_Operations
    Created on : Mar 22, 2016, 12:37:45 PM
    Author     : Shubhrangshu
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<html>
    <head>
        <title>Mark/Unmark NPA</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>
    </head>
    <body  onload="noBack()">
        <script type="text/javascript">
            function noBack()
            {
                window.history.forward();
            }
           <%-- function checkSubmit(npaOperation)
            {
                if (npaOperation.accountNumber.value == "")
                {
                    alert("!! All fields must be filled !!");
                    npaOperation.accountNumber.focus();
                    return false;
                }
                if (npaOperation.checkOperation.value == "")
                {
                    alert("!! All fields must be filled !!");
                    npaOperation.checkOperation.focus();
                    return false;
                }


                re = /^\d+$/; //this checks whether field contains digits
                if (!re.test(npaOperation.accountNumber.value))
                {
                    alert("!! Account Number could only contain numbers !!");
                    npaOperation.accountNumber.focus();
                    return false;
                }
            }--%>
            // added by bisnu
            function submitform(){
                
                if(validateForm()){
                    document.mark_unmark_NPA_Operations.action = '/PacsApplication/Mark_Unmark_NPAOperationsServlet';
                    document.mark_unmark_NPA_Operations.submit();
                }                
            }
            function ShowParent()
            {
                document.forms[0].action = "mark_unmark_NPA_Operations.jsp";
                document.forms[0].submit();
            }
            function validateForm(){

                if(document.getElementById("accountNumber").value == "") {   
                    alert("Account Number cannot be blank.");
                    return false;
                }
               if(document.getElementById("checkOperation").value == "") {   
                    alert("Please Select Account as.");
                    return false;
                }               
                    return true;                
                
            }
            
            function popup_depAccount(width, height, accNo) {
                if (window.innerWidth) {
                    LeftPosition = (window.innerWidth - width) / 2;
                    TopPosition = ((window.innerHeight - height) / 2) - 20;
                }
                else {
                    LeftPosition = (parseInt(window.screen.width) - width) / 2;
                    TopPosition = ((parseInt(window.screen.height) - height) / 2) - 20;
                }
                attr = 'resizable=yes,scrollbars=yes,width=' + width + ',height=' +
                        height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
                        TopPosition + '';
                var screenName = "mark_unmark_NPA_Operations.jsp";
                var lovKey = "depositAccount"
                popWin = open('CommonSearchInformationLOV.jsp?accNo=' + accNo + '&screenName=' + screenName + '&lovKey=' + lovKey, 'depositAccount', attr);
                popWin.focus();

            }

            // to restrict back button
            history.pushState(null, null, location.href);
            window.addEventListener('popstate', function(event) {
                history.pushState(null, null, location.href);
            });
            
        </script>
        <jsp:include page="MenuHead.jsp" flush="true" />
        <br>
        <%!
            String blankNull(String s) {
                return (s == null) ? "" : s;
            }
        %>

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

        <br>
        <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">Mark/Unmark as NPA Operation</legend>

                <%if (!error_msg.equalsIgnoreCase("")) {%>
                <center><div class="info" id="errorMessage"><center><%= error_msg%></center></div></center>       
                            <% }%>
                <form name="mark_unmark_NPA_Operations" id="mark_unmark_NPA_Operations" action="" method="post"
                <%-- action="Mark_Unmark_NPAOperationsServlet" method="post" name="npaOperation" onsubmit="checkSubmit(this)">--%>

                <br>
                <br>
                <center>
                    <table >
                        <tbody>
                            <tr>
                                <td>Enter Account Number<font color="red" >*</font>:</td>
                                <td><input type="text" name="accountNumber" id="accountNumber" value="" style="text-align:right;" onkeypress='return event.charCode >= 48 && event.charCode <= 57' /></td>
                                <td><input type="button" name="accNoSearch" id="accNoSearch" value="Search" onclick="javascript:popup_depAccount(500, 300,$('#accountNumber').val());"/></td>
                            </tr>
                            <tr>
                                <td><br></td>
                            </tr>
                            <tr>
                                <td>Select Account as<font color="red" >*</font></td>
                                <td><select id="checkOperation" name="checkOperation" >
                                        <option value="" selected style="display:none;" > --Select-- </option>
                                        <option value="1" >1:Standard</option>
                                        <option value="4" >4:Substandard</option>
                                        <option value="5" >5:Doubtful Asset 1</option>
                                        <option value="6" >6:Doubtful Asset 2</option>
                                        <option value="7" >7:Doubtful Asset 3</option>
                                        <option value="8" >8:Lost Asset</option>
                                    </select></td>
                            </tr>
                            <tr>
                                <td><br><input type="hidden" id="screenName" name="screenName" value="mark_unmark_NPA_Operations"></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td><input type="submit" value="Submit" onclick="submitform()"/>
                                    <input type="button" value="Reset" name="reset" onclick="ShowParent();" /></td>
                            </tr>

                        </tbody>
                    </table>
                </center>
            </form>
        </fieldset>
    </body>

</html>
