<%--
    Document   : DepositMiscellaneousOperation
    Created on : Sep 27, 2016, 1:18:55 PM
    Author     : 986137
    Updated On : Apr 30,2024
    Author     : 1121947
--%>

<%@page import="DataEntryBean.RepayLoanBean"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="DataEntryBean.DepositMiscellaneousBean"%>
<%@page import="LoginDb.DbHandler"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.io.*"%>
<%@page import="java.util.*"%>
<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@page import="java.util.UUID" %>
<%String uuid = UUID.randomUUID().toString();%>
<% try {
%>

<html>
    <head>
        <title>Miscellaneous 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>
     
    </head>
    <body  onload="noBack()">
        
        <script>
            
         $(document).ready(function(){
             $("#transactionType").change(function(){
                 var selectedOption = $(this).val();
                 if (selectedOption == "Deposit") {
                     $("#depositAccount").show();
                     $("#loanAccount").hide();
                 }else if (selectedOption == "Loan"){
                     $("#depositAccount").hide();
                     $("#loanAccount").show();
                 }else{
                     $("#depositAccount").hide();
                     $("#loanAccount").hide();
                 }
             });
         });
        </script>
        

        <script type="text/javascript">
            function noBack()
            {
                window.history.forward();
            }

            function popup_DepositAccLOB(width, height, depositAccSearch) {
                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 = "DepositMiscellaneousOperation.jsp";
                var  lovKey="DepositAccLOB";
                popWin = open('${pageContext.request.contextPath}/CommonSearchInformationDepositLOV.jsp?depositAccSearch=' + depositAccSearch + '&screenName=' + screenName+'&lovKey='+lovKey, 'DepositAccLOB', attr);
                popWin.focus();

            }
          // Added by P.Pahari on 25th April,2024 for loan account reset functionality.  
             function popup_LonAccLOB(width, height, loanAccSearch) {
                
                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 = "DepositMiscellaneousOperation.jsp";
                var  lovKey="LonAccLOB";
                popWin = open('${pageContext.request.contextPath}/CommonSearchInformationLoanLOV.jsp?loanAccSearch=' + loanAccSearch + '&screenName=' + screenName+'&lovKey='+lovKey, 'LonAccLOB', attr);
                popWin.focus();

            }

            function popup_TransactionNo(width,height,txn_no,acc_no){
                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 = "DepositMiscellaneousOperation.jsp";
                var  lovKey="TransactionNoSearch";
                popWin = open('${pageContext.request.contextPath}/CommonSearchInfoLOVNew.jsp?depositAccNo=' + acc_no + '&TxnNo=' + txn_no + '&screenName=' + screenName+'&lovKey='+lovKey, 'DepositAccLOB', attr);
                popWin.focus();
            }           
            
// Added by p.pahari on 3rd May,2024 for loan transaction

    function popup_LoanTransactionNo(width,height,txn_no,acc_no){
                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 = "DepositMiscellaneousOperation.jsp";
                var  lovKey="TransactionLoanNoSearch";
                popWin = open('${pageContext.request.contextPath}/CommonSearchInfoLOVNew.jsp?loanAccNo=' + acc_no + '&TxnNo=' + txn_no + '&screenName=' + screenName+'&lovKey='+lovKey, 'LonAccLOB', attr);
                popWin.focus();
                     
            }

            function popup_SecondCifLOB(width, height, secondCifSearch ,lovkey) {
                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 = "DepositMiscellaneousOperation.jsp";
                var  lovKey=lovkey;
                popWin = open('${pageContext.request.contextPath}/CommonSearchInformationDepositLOV.jsp?depositAccSearch=' + secondCifSearch + '&screenName=' + screenName+'&lovKey='+lovKey, 'DepositAccLOB', attr);
                popWin.focus();

            }

            function submitform(DepositMiscellaneousForm)
            {
                // Changed here on 2nd May,2024 and added loan level details.
                re = /^\d+$/;
                const transactionType = document.getElementById("transactionType").value;
                //alert(transactionType);
               
                if (DepositMiscellaneousForm.depositAccSearch.value === "" && transactionType === "Deposit")
                {
                    alert("Please enter deposit Account Number.");
                    DepositMiscellaneousForm.depositAccSearch.focus();
                    return false;
                }
               // re = /^\d+$/; //this checks whether field contains digits
                if ((!re.test(document.getElementById("depositAccSearch").value)) && transactionType === "Deposit")
                {
                    alert("Deposit Account could only contain numbers.");
                    DepositMiscellaneousForm.depositAccSearch.focus();
                    return false;
                }
                
                 if (DepositMiscellaneousForm.loanAccSearch.value === "" && transactionType === "Loan")
                {
                    alert("Please enter Loan Account Number.");
                    DepositMiscellaneousForm.loanAccSearch.focus();
                    return false;
                }
               // re = /^\d+$/; //this checks whether field contains digits
                if ((!re.test(document.getElementById("loanAccSearch").value)) && transactionType === "Loan")
                {
                    alert("Loan Account could only contain numbers.");
                    DepositMiscellaneousForm.loanAccSearch.focus();
                    return false;
                }

                document.forms[0].handle_id.value = "Search";
                document.forms[0].action = '/PacsApplication/DepositMiscellaneousOperationServlet';
                document.forms[0].submit();

            }
            
            
            function submitOperation(DepositMiscellaneousForm)
            {
                if (DepositMiscellaneousForm.operation_type.value == "Not")
                {
                    alert("Please select operation.");
                    DepositMiscellaneousForm.operation_type.focus();
                    return false;
                }
                if (DepositMiscellaneousForm.operation_type.value == "HOLD" && DepositMiscellaneousForm.holdAmt.value == "")
                {
                    alert("Please provide Hold Amount.");
                    DepositMiscellaneousForm.holdAmt.focus();
                    return false;
                }

                if (DepositMiscellaneousForm.operation_type.value == "STOP" && DepositMiscellaneousForm.stopReson.value == "")
                {
                    alert("Please select STOP Account Reason.");
                    DepositMiscellaneousForm.stopReson.focus();
                    return false;
                }

                if (DepositMiscellaneousForm.operation_type.value == "RS" && DepositMiscellaneousForm.rem_stopReson.value == "")
                {
                    alert("Please select Remove STOP Account Reason.");
                    DepositMiscellaneousForm.rem_stopReson.focus();
                    return false;
                }

                if (DepositMiscellaneousForm.operation_type.value == "M2H" && DepositMiscellaneousForm.modCif2TxtArea.value == "")
                {
                    alert("Please Provide Modify Reason.");
                    DepositMiscellaneousForm.modCif2TxtArea.focus();
                    return false;
                }

                if (DepositMiscellaneousForm.operation_type.value == "M2H" && DepositMiscellaneousForm.secondCifSearch.value == DepositMiscellaneousForm.cifNo.value)
                {
                    alert("1st CIF and 2nd CIF Cannot Be Same.");
                    DepositMiscellaneousForm.secondCifSearch.focus();
                    return false;
                }

                if (DepositMiscellaneousForm.operation_type.value == "M2H" && DepositMiscellaneousForm.secondCifSearch.value == DepositMiscellaneousForm.cif2No.value)
                {
                    alert("2nd CIF and New Modified CIF Cannot Be Same.");
                    DepositMiscellaneousForm.secondCifSearch.focus();
                    return false;
                }

                if (DepositMiscellaneousForm.operation_type.value == "M2H" && DepositMiscellaneousForm.secondCifSearchFlag.value != 'Y' && DepositMiscellaneousForm.secondCifSearch.value != '' )
                {
                    alert(DepositMiscellaneousForm.operation_type.value);
                    alert(DepositMiscellaneousForm.secondCifSearchFlag.value);
                    alert(DepositMiscellaneousForm.secondCifSearchFlag.value);
                    alert("Kindly Search The 2nd CIF.");
                    DepositMiscellaneousForm.secondCifSearch.focus();
                    return false;
                }
                //added by rajdip
                if (DepositMiscellaneousForm.operation_type.value == "RST" || DepositMiscellaneousForm.operation_type.value == "SPT" )
                {
                    if( document.getElementById("radio1").checked && DepositMiscellaneousForm.transactionNoInpBox.value == ""){
                        alert("Please select and option provide the transaction no.");
                        return false;
                    }
                }

                if (DepositMiscellaneousForm.operation_type.value == "NOM")
                {
                    if( document.getElementById("radio1").checked && DepositMiscellaneousForm.nomId.value == ""){
                        alert("Please enter the nominee name.");
                        return false;
                    }
                }
                re = /^\d+$/;
                if(document.getElementById("displayFlag").value == "Y" && document.getElementById("operation_type").value == "NOM") {
                    if (!re.test(document.getElementById("nomId").value))
                    {
                        alert("Please enter nominee CIF correctly.");
                        document.getElementById("nomId").focus();
                        return false;
                    }
                    if(document.getElementById("secondCifSearchFlag").value == "") {
                        alert("Please search the nominee CIF to proceed.");
                        document.getElementById("nomId").focus();
                        return false;
                    }
                }
                //added by Bisnu
                if ( DepositMiscellaneousForm.operation_type.value == "SPT" && DepositMiscellaneousForm.print_date.value == "" )
                {
                        alert("Skip Print Upto Date can not be null.");
                        document.getElementById("print_date").focus();
                        return false;
                }

                document.forms[0].handle_id.value = "SubmitOperation";
                document.forms[0].action = '/PacsApplication/DepositMiscellaneousOperationServlet';
                document.forms[0].submit();

            }

            function ShowParent()
            {
                document.forms[0].action="${pageContext.request.contextPath}/Deposit/DepositMiscellaneousOperation.jsp";
                document.forms[0].submit();
            }
            
            $(document).ready(function () {
                $('select#operation_type').change(function () {
                    var shouldEnable = $(this).val();
                    //added by rajdip
                    document.getElementById("transactionInputBox").style.display='none';
                    document.getElementById("accountInputBox").style.display='none';
                    document.getElementById("rseetDate").style.display='none';
                    document.getElementById("radio1").checked = false;
                    document.getElementById("radio2").checked = false;
                    document.getElementById("radio3").checked = false;
                    //upto this
                    switch(shouldEnable)
                    {
                        case 'HOLD':
                            $('#holdAmtTr').show(200);
                            $('#stopResonTr').hide(200);
                            $('#rmvLien').hide();
                            $('#rem_stopReasonTr').show(200);
                            $('#modHolderTr1').hide();
                            $('#modHolderTr2').hide();
                            $('#resetTransactionRadio').hide(); //added by rajdip
                            $('#nom').hide();
                            $('#openCalendar').hide();
                            break;

                        case 'STOP':
                            $('#holdAmtTr').hide(200);
                            $('#stopResonTr').show(200);
                            $('#rmvLien').hide();
                            $('#rem_stopReasonTr').hide(200);
                            $('#modHolderTr1').hide();
                            $('#modHolderTr2').hide();
                            $('#resetTransactionRadio').hide(); //added by rajdip
                            $('#nom').hide();
                            $('#openCalendar').hide();
                            break;
                        case 'RS':
                            $('#holdAmtTr').hide();
                            $('#stopResonTr').hide();
                            $('#rmvLien').hide();
                            $('#rem_stopReasonTr').show(200);
                            $('#modHolderTr1').hide();
                            $('#modHolderTr2').hide();
                            $('#resetTransactionRadio').hide(); //added by rajdip
                            $('#nom').hide();
                            $('#openCalendar').hide();
                            break;
                        case 'RL':
                            $('#rmvLien').show(200);
                            $('#holdAmtTr').hide();
                            $('#stopResonTr').hide();
                            $('#rem_stopReasonTr').hide();
                            $('#modHolderTr1').hide();
                            $('#modHolderTr2').hide();
                            $('#resetTransactionRadio').hide(); //added by rajdip
                            $('#nom').hide();
                            $('#openCalendar').hide();
                            break;
                        case 'M2H':
                            $('#modHolderTr1').show(200);
                            $('#modHolderTr2').show(200);
                            $('#holdAmtTr').hide();
                            $('#stopResonTr').hide();
                            $('#rem_stopReasonTr').hide();
                            $('#rmvLien').hide();
                            $('#resetTransactionRadio').hide(); //added by rajdip
                            $('#nom').hide();
                            $('#openCalendar').hide();
                            break;
                        case 'RST': //added by rajdip
                            $('#resetTransactionRadio').show(200);
                            $('#modHolderTr1').hide();
                            $('#modHolderTr2').hide();
                            $('#holdAmtTr').hide();
                            $('#stopResonTr').hide();
                            $('#rem_stopReasonTr').hide();
                            $('#rmvLien').hide();
                            $('#nom').hide();
                            $('#openCalendar').hide();
                            break;
                        case 'NOM': //added by rajdip
                            $('#nom').show(200);
                            $('#resetTransactionRadio').hide();
                            $('#modHolderTr1').hide();
                            $('#modHolderTr2').hide();
                            $('#holdAmtTr').hide();
                            $('#stopResonTr').hide();
                            $('#rem_stopReasonTr').show(200);
                            $('#rmvLien').hide();
                            $('#openCalendar').hide();
                            break;
                        case 'SPT':
                            $('#resetTransactionRadio').hide();
                            $('#modHolderTr1').hide();
                            $('#modHolderTr2').hide();
                            $('#holdAmtTr').hide();
                            $('#stopResonTr').hide();
                            $('#rem_stopReasonTr').hide();
                            $('#rmvLien').hide();
                            $('#nom').hide();
                            $('#openCalendar').show();
                            break;
                        case 'RH':
                            $('#holdAmtTr').hide();
                            $('#stopResonTr').hide();
                            $('#rmvLien').hide();
                            $('#rem_stopReasonTr').show(200);
                            $('#modHolderTr1').hide();
                            $('#modHolderTr2').hide();
                            $('#resetTransactionRadio').hide(); //added by rajdip
                            $('#nom').hide();
                            $('#openCalendar').hide();
                            break;
                        case 'ADR':
                            $('#holdAmtTr').hide();
                            $('#stopResonTr').hide();
                            $('#rmvLien').hide();
                            $('#rem_stopReasonTr').show(200);
                            $('#modHolderTr1').hide();
                            $('#modHolderTr2').hide();
                            $('#resetTransactionRadio').hide(); //added by rajdip
                            $('#nom').hide();
                            $('#openCalendar').hide();
                            break;
                        case 'RDR':
                            $('#holdAmtTr').hide();
                            $('#stopResonTr').hide();
                            $('#rmvLien').hide();
                            $('#rem_stopReasonTr').show(200);
                            $('#modHolderTr1').hide();
                            $('#modHolderTr2').hide();
                            $('#resetTransactionRadio').hide(); //added by rajdip
                            $('#nom').hide();
                            $('#openCalendar').hide();
                            break;    
                        default:
                            $('#holdAmtTr').hide();
                            $('#rmvLien').hide();
                            $('#stopResonTr').hide();
                            $('#rem_stopReasonTr').hide();
                            $('#modHolderTr1').hide();
                            $('#modHolderTr2').hide();
                            $('#resetTransactionRadio').hide(); //added by rajdip
                            $('#nom').hide();
                            $('#openCalendar').hide();
                            break;
                    }
                    
                });
            });
            
             //Added here for Loan operation
            
            function submitLoanOperation(DepositMiscellaneousForm)
            {
                if(DepositMiscellaneousForm.operation_type_loan.value === "Not")
                {
                    alert("Please select operation.");
                    DepositMiscellaneousForm.operation_type_loan.focus();
                    return false;
                }
                 if (DepositMiscellaneousForm.operation_type_loan.value === "RST" || DepositMiscellaneousForm.operation_type_loan.value === "SPT" )
                {
                    if( document.getElementById("radio1").checked && DepositMiscellaneousForm.transactionNoInpBox.value === ""){
                        alert("Please select and option provide the transaction no.");
                        return false;
                    }
                }
                document.forms[0].handle_id.value = "SubmitLoanOperation";
                document.forms[0].action = '/PacsApplication/DepositMiscellaneousOperationServlet';
                document.forms[0].submit();
            }
            
            
             // Added here for Loan operation
            $(document).ready(function() {
                $('select#operation_type_loan').change(function() {
                    var Enable = $(this).val();
                    document.getElementById("transactionInputBox").style.display='none';
                    document.getElementById("accountInputBox").style.display='none';
                    document.getElementById("rseetDate").style.display='none';
                    document.getElementById("radio1").checked = false;
                    document.getElementById("radio2").checked = false;
                    document.getElementById("radio3").checked = false;
                    //upto this
                    switch(Enable)
                    {
                        case 'RST': //added by Paramita 
                        $('#resetTransactionLoanRadio').show(200);
                        break
                    }
                });
            });       
                        
            
             function onRadioClick(temp)
            {
                if (temp == 1){
                    document.getElementById("transactionInputBox").style.display='block';
                    document.getElementById("accountInputBox").style.display='none';
                    document.getElementById("rseetDate").style.display='none';
                    document.getElementById("radio1").value='txn';
                }
                else if(temp == 2){
                    document.getElementById("accountInputBox").style.display='block';
                    document.getElementById("transactionInputBox").style.display='none';
                    document.getElementById("rseetDate").style.display='none';
                    document.getElementById("radio2").value='accnt';
                }
                else if(temp == 3){
                    document.getElementById("rseetDate").style.display='block';
                    document.getElementById("accountInputBox").style.display='none';
                    document.getElementById("transactionInputBox").style.display='none';
                    document.getElementById("radio3").value='reset';
                }
            }
            
            // to restrict back button
            history.pushState(null, null, location.href);
            window.addEventListener('popstate', function(event) {
                history.pushState(null, null, location.href);
            });

        </script>

        </script>
        <jsp:include page="MenuHead_Deposit.jsp" flush="true" />
        <br>

        <%

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

        <%
             String displayFlag = "N";
             Object display = request.getAttribute("displayFlag");
             if (display != null) {
                 displayFlag = display.toString();
                 System.out.println(displayFlag);
             }
        %>

        <%
             Object oDepositMiscellaneousBeanObj = request.getAttribute("oDepositMiscellaneousBeanObj");
             DepositMiscellaneousBean oDepositMiscellaneousBean = new DepositMiscellaneousBean();
             if (oDepositMiscellaneousBeanObj != null) {
                 oDepositMiscellaneousBean = (DepositMiscellaneousBean) request.getAttribute("oDepositMiscellaneousBeanObj");
             }
        %>
        
        <%
            Object oRepayLoanBeanObj = request.getAttribute("oRepayLoanBeanObj");
            RepayLoanBean oRepayLoanBean = new RepayLoanBean();
            if(oRepayLoanBeanObj != null){
                oRepayLoanBean = (RepayLoanBean) request.getAttribute("oRepayLoanBeanObj");
            }
         %>

        <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">Miscellaneous Operation</legend>
            <form name="DepositMiscellaneousForm" id="DepositMiscellaneousForm" action="" method="post">


                <%if (!error_msg.equalsIgnoreCase("")) {%>
                <center><div class="info" id="errorMessage"><center><%= error_msg%></center></div></center>
                <% }%>
                <br>
                <br>
                
                <center>
                    <table class="numbersOnly">
                        <tr><td style="text-align:left;">Select Transaction<font color="red" >*</font>:</td><td></td><td><select id="transactionType" name="transactionType"><option value=""> --select-- </option><option value="Deposit">Deposit</option><option value="Loan">Loan</option></select></td></tr>
                        <tr id ="depositAccount" style ="display:none;">
                            <td>Enter Deposit Account <font color="red" >*</font>:</td>
                            <td></td>
                            <td><input type="text"  maxlength="25" name="depositAccSearch" id="depositAccSearch" style="text-align:right;" onkeypress='return event.charCode >= 48 && event.charCode <= 57' value="<%=blankNull(oDepositMiscellaneousBean.getDepositAccountNumber())%>"/><input type="button" value="Search" onclick="javascript:popup_DepositAccLOB(900, 350, document.DepositMiscellaneousForm.depositAccSearch.value);"/></td></tr>
                        <tr id ="loanAccount" style ="display:none;">
                            <td>Enter Loan Account <font color="red" >*</font>:</td>
                            <td></td>
                            <td><input type="text"  maxlength="25" name="loanAccSearch" id="loanAccSearch" style="text-align:right;" onkeypress='return event.charCode >= 48 && event.charCode <= 57' value="<%=blankNull(oRepayLoanBean.getLoanAcc())%>"/><input type="button" value="Search" onclick="javascript:popup_LonAccLOB(900, 350, document.DepositMiscellaneousForm.loanAccSearch.value);"/></td></tr>
                        <tr></tr>
                        <tr></tr>
                        <tr></tr>
                        <tr></tr>
                        <tr></tr>
                        <tr></tr>

                    </table>
                    <br>
                    <input type="button" value="Get Details" id="Submit" onclick="javascript:submitform(DepositMiscellaneousForm)"/>
                    <input type="button" value="Reset" id="Reset" onclick="ShowParent();" />
                </center>
                <br>

                <%!
                    String blankNull(String s) {
                        return (s == null) ? "" : s;
                    }
                %>
                <%

                     if (displayFlag.equalsIgnoreCase("FY")) {

                %>
                <div id="lonDetails" align ="left">
                  <br>
                    <center>
                        <table>
                            <thead>
                            </thead>
                            <tbody>
                                    <tr>
                                        <td style="text-align:right;">Loan Account No: </td>
                                        <td><input type="text" name="loanid" id="loanid" readonly="true" style="text-align:center;" style="width: 260px" value="<%=blankNull(oRepayLoanBean.getLoanAcc())%>"/></td><td></td>
                                        <td style="text-align:right;">Customer Name: </td>
                                        <td><input type="text" name="custName" id="custName" readonly="true" style="text-align:center;" style="width: 260px" value="<%=blankNull(oRepayLoanBean.getCustName())%>"/></td>
                                    </tr>
                                    <tr></tr>
                                    <tr>
                                        <td style="text-align:right;">Sanctioned Amount: </td>
                                        <td><input type="text" name="sancAmt" id="sancAmt" readonly="true" style="text-align:center;" style="width: 260px" value="<%=blankNull(oRepayLoanBean.getSancAmt())%>"/></td><td></td>
                                        <td style="text-align:right;">Sanctioned Date: </td>
                                        <td><input type ="text" name=sancDt" id="sancDt" rreadonly="true" style="text-align:center;" style="text-align:center;" style="width: 260px" value="<%=blankNull(oRepayLoanBean.getSancDt())%>"/></td>
                                    </tr>
                                    <tr></tr>
                                    <tr>
                                        <td>Outstanding Principle: </td>
                                        <td><input type="text" name="oustPrin" id="oustPrin" readonly="true" style="text-align:center;" style="width: 260px" value="<%=blankNull(oRepayLoanBean.getOustPrin())%>"/></td><td></td>
                                        <td>Interest Outstanding: </td>
                                        <td><input type="text" name="oustInt" id="oustInt" readonly="true" style="text-align:center;" style="width: 260px" value="<%=blankNull(oRepayLoanBean.getOustInt())%>"/></td>
                                    </tr>
                                    <tr></tr>
                                    <tr>
                                        <td style="text-align:right;">Last Transaction Date: </td>
                                        <td><input type ="text" name ="lstTran" id="lstTran" readonly="true"  style="text-align:center;" style="width: 260px" value="<%=blankNull(oRepayLoanBean.getLstRepayDt())%>"/></td><td></td>
                                        <td style="text-align:right;"> Product Code: </td>
                                        <td><input type ="text" name="prodCode" id="prodCode" readonly="true" style="text-align:center;" style="width: 260px" value="<%=blankNull(oRepayLoanBean.getProdCode())%>" /></td>                                       
                                    </tr>
                                    <tr>
                                        <td>Outstanding Balance: </td>
                                        <td><input type="text" name="oustBal" id="oustBal" readonly="true" style="text-align:center;" style="width: 260px" value="<%=blankNull(oRepayLoanBean.getOustBal())%>" /></td><td></td>
                                        <td style="text-align:right;">EMI: </td>
                                        <td><input type="text" name="emi" id="emi" readonly="true" style="text-align:center;" style="width: 260px" value="<%=blankNull(oRepayLoanBean.getEmi())%>"/></td>
                                    </tr>
                                    <tr><td colspan="5"><hr></td></tr>

                                </tbody>
                            </table>                       
                        </center>
                        
                        <center>
                            <table> <tr>
                                    <td>Select Operation<font color="red" >*</font>:</td>
                                    <td>
                                        <select name="operation_type_loan" id="operation_type_loan">
                                            <option value="Not"> --Select-- </option>
                                            <option value="RST">Reset Passbook Transactions (Re-Print)</option>
                                        </select></td></tr>
                                 <tr id="resetTransactionLoanRadio" style="display:none;">
                                    <td>
                                        <label class="radio-inline">
                                            <input type="radio" name="optradio" id="radio1"onclick="onRadioClick(1)">Re-Print from transaction No
                                        </label>
                                    </td>
                                    <td>
                                        <label class="radio-inline">
                                            <input type="radio" name="optradio" id="radio2" onclick="onRadioClick(2)">Re-Print for account No
                                        </label>
                                    </td>
                                    <td>
                                        <label class="radio-inline">
                                            <input type="radio" name="optradio" id="radio3" onclick="onRadioClick(3)">Re-Print from Date
                                        </label>
                                    </td>
                                </tr>
                            </table>
                            <table>
                                <tr id="transactionInputBox" style="display:none;">
                                    <td>Enter Transaction ID:</td>
                                    <td><input type="text"  maxlength="25" name="transactionNoInpBox" id="transactionNoInpBox" style="text-align:right;" onkeypress='return event.charCode >= 48 && event.charCode <= 57' /></td>
                                    <td><input type="button" id="transactionSearch" value="Search" onclick="javascript:popup_LoanTransactionNo(900,350,document.DepositMiscellaneousForm.transactionNoInpBox.value,document.DepositMiscellaneousForm.loanAccSearch.value)" /></td>
                                </tr>
                                <tr id="accountInputBox" style="display:none;">
                                    <td></td>
                                    <td>Account Number:</td>
                                    <td><input type="text"  maxlength="25" name="accountNoInpBox" id="accountNoInpBox" value="<%=blankNull(oRepayLoanBean.getLoanAcc())%>" readonly/></td>
                                </tr>
                                <tr id="rseetDate" style="display:none;">
                                    <td style=" font-family: Berlin Sans FB; font-weight:  normal;">Re-Print Transactions from Date:</td>
                                    <td><input type="text" style="text-align:center;" id="reset_date" name="reset_date" resize="yes" readonly="true">&nbsp;<a href="#" onclick="return getCalendar(document.forms[0].reset_date);"><img src="${pageContext.request.contextPath}/img/calendar.jpg" name="imgr" border="0" width="25" height="20" /></a></td>
                                </tr>
                            </table>
                 <center>
                        <input type="button" value="Submit" id="Submit" onclick="javascript:submitLoanOperation(DepositMiscellaneousForm)"/></center>                  </center>
                        <!--Start for Deposit-->                                    
                <%}else if (displayFlag.equalsIgnoreCase("Y")) {
                %>
                <div id="show" align="left" >
                    <br>
                    <center>
                        <table>
                            <thead>
                            </thead>
                            <tbody>

                                <tr>
                                    <td style="font:large;">Deposit Account Number:</td>
                                    <td><input type="text" readonly="true" name="depositAccountNumber"  id="depositAccountNumber" style="text-align:right;" style="width: 260px" value="<%=blankNull(oDepositMiscellaneousBean.getDepositAccountNumber())%>" /></td>
                                    <td></td><td></td><td></td>
                                    <td>Account Balance:</td>
                                    <td><input type="text" readonly="true" name="accBalance"  id="accBalance" style="text-align:right;" style="width: 260px" value="<%=blankNull(oDepositMiscellaneousBean.getAccBalance())%>" /></td>
                                </tr>
                                <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
                                <tr>
                                    <td> 1st CIF Number:</td>
                                    <td><input type="text" readonly="true" name="cifNo"  id="cifNo" style="text-align:right;" style="width: 260px" value="<%=blankNull(oDepositMiscellaneousBean.getCifNo())%>" /></td>
                                    <td></td><td></td><td></td>
                                    <td> 1st A/C Holder:</td>
                                    <td><input type="text" readonly="true" name="cifName"  id="cifName" style="text-align:right;" style="width: 260px" value="<%=blankNull(oDepositMiscellaneousBean.getCustomer1Name())%>" /></td>
                                </tr>
                                <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
                                <tr>
                                    <td> 2nd CIF Number</td>
                                    <td><input type="text" readonly="true" name="cif2No"  id="cif2No" style="text-align:right;" style="width: 260px" value="<%=blankNull(oDepositMiscellaneousBean.getCif2No())%>" /></td>
                                    <td></td><td></td><td></td>
                                    <td> 2nd A/C Holder:</td>
                                    <td><input type="text" readonly="true" name="cif2Name"  id="cif2Name" style="text-align:right;" style="width: 260px" value="<%=blankNull(oDepositMiscellaneousBean.getCustomer2Name())%>" /></td>
                                </tr>
                                <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
                                <tr>
                                    <td>Account Status:</td>
                                    <td><input type="text" readonly name="accStat" style="width: 260px" id="accStat" value="<%=blankNull(oDepositMiscellaneousBean.getAccStat())%>"/></td>
                                    <td></td><td></td><td></td>
                                    <td>Nominee CIF:</td>
                                    <td><input type="text" readonly name="nomCif" style="text-align:right;" style="width: 260px" id="nomCif" value="<%=blankNull(oDepositMiscellaneousBean.getNomCif())%>"/></td>
                                </tr>

                                <tr><td colspan="10"><hr></td></tr>
                            </tbody>
                        </table>
                        <center>
                            <table> <tr>
                                    <td>Select Operation<font color="red" >*</font>:</td>
                                    <td>
                                        <select name="operation_type" id="operation_type">
                                            <option value="Not"> --Select-- </option>
                                            <option value="HOLD">Apply Hold</option>
                                            <option value="RH">Remove Hold</option>
                                            <option value="STOP">Stop Account</option>
                                            <option value="RS">Remove Stop</option>
                                            <option value="RL">Remove Lien</option>
                                            <option value="M2H">Modify 2nd Holder</option>
                                            <option value="RST">Reset Passbook Transactions (Re-Print)</option>
                                            <option value="NOM">Update Nominee</option>
                                            <option value="ADR">Apply Dormant</option>
                                            <option value="RDR">Remove Dormant</option>
                                            <option value="SPT">Set Passbook Transactions (Skip-Print)</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr id="holdAmtTr" style="display:none;">
                                    <td>Hold Amount:</td>
                                    <td><input type="text" name="holdAmt" style="text-align:right;" onkeypress='return event.charCode >= 46 && event.charCode <= 57' /></td>
                                </tr>

                                <tr id="rmvLien" style="display:none;">
                                    <td>Reason for removing lien:</td>
                                    <td><textarea id="rmvLienRsn" size="12" name="rmvLienRsn"></textarea></td>
                                </tr>

                                <tr id="stopResonTr" style="display:none;">
                                    <td>Specify Stop Reason:</td>
                                    <td><textarea id="stopReson" size="12" name="stopReson"></textarea></td>
                                    <%--<td><select name="stopReson" id="stopReson">
                                            <option value="">Please select</option>
                                            <option value="Stop Reason 1">Stop Reason 1</option>
                                            <option value="Stop Reason 2">Stop Reason 2</option>
                                            <option value="Stop Reason 3">Stop Reason 3</option>
                                        </select>
                                        </td>--%>
                                </tr>

                                <tr id="rem_stopReasonTr" style="display:none;">
                                    <td>Specify Reason:</td>
                                    <td><textarea id="rem_stopReson" size="12" name="rem_stopReson"></textarea></td>
                                    <%--<td><select name="rem_stopReson" id="rem_stopReson">
                                            <option value="">Please select</option>
                                            <option value="Remove Stop Reason 1">Remove Stop Reason 1</option>
                                            <option value="Remove Stop Reason 2">Remove Stop Reason 2</option>
                                            <option value="Remove Stop Reason 3">Remove Stop Reason 3</option>
                                        </select>
                                    </td>--%>
                                </tr>

                                <tr id="modHolderTr1" style="display:none;">
                                    <td>Enter 2nd A/C Holder:</td><td><input type="text"  maxlength="25" name="secondCifSearch" id="secondCifSearch" style="text-align:right;" onkeypress='return event.charCode >= 48 && event.charCode <= 57' /><input type="button" value="Search" onclick="javascript:popup_SecondCifLOB(350, 300, document.DepositMiscellaneousForm.secondCifSearch.value,'SecondCifLOB');"/></td>
                                </tr>

                                <tr id="modHolderTr2" style="display:none;">
                                    <td>Specify Modify Reason:</td>
                                    <td><textarea id="modCif2TxtArea" size="12" name="modCif2TxtArea"></textarea></td>
                                </tr>
                                <tr id="nom" style="display:none;">
                                    <td>Enter Nominee CIF:</td><td><input type="text"  maxlength="25" name="nomName" id="nomId" style="text-align:right;" onkeypress='return event.charCode >= 48 && event.charCode <= 57' /><input type="button" value="Search" onclick="javascript:popup_SecondCifLOB(350, 300, document.DepositMiscellaneousForm.nomId.value,'nomineeLov');"/></td>
                                </tr>

                                <tr id="resetTransactionRadio" style="display:none;">
                                    <td>
                                        <label class="radio-inline">
                                            <input type="radio" name="optradio" id="radio1"onclick="onRadioClick(1)">Re-Print from transaction No
                                        </label>
                                    </td>
                                    <td>
                                        <label class="radio-inline">
                                            <input type="radio" name="optradio" id="radio2" onclick="onRadioClick(2)">Re-Print for account No
                                        </label>
                                    </td>
                                    <td>
                                        <label class="radio-inline">
                                            <input type="radio" name="optradio" id="radio3" onclick="onRadioClick(3)">Re-Print from Date
                                        </label>
                                    </td>
                                </tr>

                                <tr id="transactionInputBox" style="display:none;">
                                    <td>Enter Transaction ID:</td>
                                    <td><input type="text"  maxlength="25" name="transactionNoInpBox" id="transactionNoInpBox" style="text-align:right;" onkeypress='return event.charCode >= 48 && event.charCode <= 57' /></td>
                                    <td><input type="button" id="transactionSearch" value="Search" onclick="javascript:popup_TransactionNo(900,350,document.DepositMiscellaneousForm.transactionNoInpBox.value,document.DepositMiscellaneousForm.depositAccSearch.value)" /></td>
                                </tr>
                                <tr id="accountInputBox" style="display:none;">
                                    <td>Account Number:</td>
                                    <td><input type="text"  maxlength="25" name="accountNoInpBox" id="accountNoInpBox" value="<%=blankNull(oDepositMiscellaneousBean.getDepositAccountNumber())%>" readonly/></td>
                                </tr>
                                <tr id="rseetDate" style="display:none;">
                                    <td style=" font-family: Berlin Sans FB; font-weight:  normal;">Re-Print Transactions from Date:</td>
                                    <td><input type="text" style="text-align:center;" id="reset_date" name="reset_date" resize="yes" readonly="true">&nbsp;<a href="#" onclick="return getCalendar(document.forms[0].reset_date);"><img src="${pageContext.request.contextPath}/img/calendar.jpg" name="imgr" border="0" width="25" height="20" /></a></td>
                                </tr>
                                <tr id="openCalendar" style ="display:none;">
                                    <td style=" font-family: Berlin Sans FB; font-weight:  normal;">Skip Print Upto Date:</td>
                                    <td><input type="text" style="text-align:center;" id="print_date" name="print_date" resize="yes" readonly="true">&nbsp;<a href="#" onclick="return getCalendar(document.forms[0].print_date);"><img src="${pageContext.request.contextPath}/img/calendar.jpg" name="imgr" border="0" width="25" height="20" /></a></td>
                                </tr>

                            </table>
                        </center>

                    </center>
                    <br>
                    <center>
                        <input type="button" value="Submit" id="Submit" onclick="javascript:submitOperation(DepositMiscellaneousForm)"/></center>
                </div>
                <%}%>

                <input type="hidden" name="handle_id" value="" >
                <input type="hidden" name="secondCifSearchFlag" id="secondCifSearchFlag" value="">
                <input type="hidden" name="displayFlag" id="displayFlag" value="<%=displayFlag%>" >
                
            </form>
        </fieldset>
    </body>
    <script>
        //make all inputs whole numbers only
        /*$('table.numbersOnly').on('keydown','#depositAccSearch', function(event) {
            if (event.shiftKey == true) {
                event.preventDefault();
            }

            if ((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 96 && event.keyCode <= 105) || event.keyCode == 8  || event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 46) {

            } else {
                event.preventDefault();
            }
        });*/
    </script>
</html>
<% 	} catch (Exception e) {
              
            }
%>