<%-- 
    Document   : StandingInstructionCreation
    Created on : Dec 28, 2016, 4:36:14 PM
    Author     : 986137
--%>

<%@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 import="DataEntryBean.StandingInstructionBean" %>
<%@page import="DataEntryBean.BatchProcessingBean"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.sql.SQLException"%>
<%@page import="java.lang.Math" %>
<%@page import="DataEntryBean.EnquiryBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%String uuid = UUID.randomUUID().toString();%>
<% try {
%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Standing Instruction Creation</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 ShowParent()
            {

                document.forms[0].action = "${pageContext.request.contextPath}/StandingInstructionCreation.jsp";
                document.forms[0].submit();
            }
            function popup_AccFrom(width, height, fromAcc, opsType) {
                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 = "StandingInstructionCreation.jsp";
                var  lovKey="SIAccFroms";
                popWin = open('/PacsApplication/CommonSearchInformationLOV.jsp?fromAcc=' + fromAcc + '&opsType=' + opsType + '&screenName=' + screenName +'&lovKey='+lovKey, 'SIAccFroms', attr);
                popWin.focus();

            }
            function popup_AccFromSearch(width, height, fromAccSearch, opsTypeSearch) {
                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 = "StandingInstructionCreation.jsp";
                var  lovKey="SIAccFromsSearch";
                popWin = open('/PacsApplication/CommonSearchInformationLOV.jsp?fromAccSearch=' + fromAccSearch + '&opsTypeSearch=' + opsTypeSearch + '&screenName=' + screenName +'&lovKey='+lovKey, 'SIAccFromsSearch', attr);
                popWin.focus();

            }

            function popup_AccTo(width, height, toAcc, opsType) {
                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 = "StandingInstructionCreation.jsp";
                var  lovKey="SIAccTos";
                popWin = open('/PacsApplication/CommonSearchInformationLOV.jsp?toAcc=' + toAcc + '&opsType=' + opsType + '&screenName=' + screenName +'&lovKey='+lovKey, 'SIAccTos', attr);
                popWin.focus();

            }
            function popup_AccToSearch(width, height, toAccSearch, opsTypeSearch) {
                if(opsTypeSearch == ""){
                    alert("Please select Operation Type!");
                }else {
                    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 = "StandingInstructionCreation.jsp";
                var  lovKey="SIAccTosSearch";
                popWin = open('/PacsApplication/CommonSearchInformationLOV.jsp?toAccSearch=' + toAccSearch + '&opsTypeSearch=' + opsTypeSearch + '&screenName=' + screenName +'&lovKey='+lovKey, 'SIAccTosSearch', attr);
                popWin.focus();
                }
                
            }
            function popup_searchDiv(width, height, accSearch) {
                    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 = "StandingInstructionCreation.jsp";
                var  lovKey="SIAccSearchDiv";
                popWin = open('/PacsApplication/CommonSearchInformationLOV.jsp?accSearch=' + accSearch + '&screenName=' + screenName +'&lovKey='+lovKey, 'SIAccSearchDiv', attr);
                popWin.focus();
                }

            $(document).ready(function () {
                $('select#checkOption').change(function () {
                    $('#dontDisplayFirst').hide();
                    $('#opsType').val('');
                    $('#fromAcc').val('');
                    $('#toAcc').val('');
                    $('#freqOption').val('');
                    $('#fromDate').val('');
                    $('#toDate').val('');
                    $('#siAmount').val('');
                    
                    var shouldEnable = $(this).val();
                    switch(shouldEnable)
                    {
                        case 'create':
                            $('div#createDiv').show(500);
                            $('div#amendDiv').hide();
                            $('div#searchDiv').hide();
                            document.forms[0].handle_id.value = 'Create';
                            break;
                        case 'amend':
                            $('div#createDiv').hide();
                            $('div#searchDiv').hide();
                            $('div#amendDiv').show(500);
                            document.forms[0].handle_id.value = 'Amend';
                            break;
                       case 'search':
                            $('div#createDiv').hide();
                            $('div#amendDiv').hide();
                            $('div#searchDiv').show(500);
                            document.forms[0].handle_id.value = 'Amend';
                            break;

                        default:
                            $('div#createDiv').hide(500);
                            $('div#amendDiv').hide();
                            document.forms[0].handle_id.value = '';
                            break;
                    }
                });
            });

            $(document).ready(function () {
                $('select#opsType').change(function () {
                    $('#siAmount').val('');
                    var shouldEnable = $(this).val();
                    switch(shouldEnable)
                    {
                        case 's2s':
                            $('#toAccRow').show();
                            break;
                        case 's2r':
                            $('#toAccRow').show();
                           // $("#siAmount").attr("readonly", true);
                            break;
                        case 's2l':
                            $('#toAccRow').show();
                            break;
                        default:
                            $('#toAccRow').hide();
                            break;
                    }
                });
            });
            $(document).ready(function () {
                $('select#opsTypeAmend').change(function () {
                    var shouldEnable = $(this).val();
                    switch(shouldEnable)
                    {
                        case 's2s':
                            $('#toAccRowAmend').show();
                            break;
                        case 's2r':
                            $('#toAccRowAmend').show();
                            break;
                        case 's2l':
                            $('#toAccRowAmend').show();
                            break;
                        default:
                            $('#toAccRowAmend').hide();
                            break;
                    }
                });
            });

            $(document).ready(function () {
                $('select#freqOption,select#freqOptionAmend').change(function () {
                    var shouldEnable = $(this).val();
                    switch(shouldEnable)
                    {
                        case 'D':
                            $('#chaseDay,#chaseDayAmend').val('0');
                            break;

                        default:
                            $('#chaseDay,#chaseDayAmend').val('10');
                            break;
                    }
                });
            });

            function submitform(SIOperationForm)
            {
                if (checkDiv(SIOperationForm))
                {

                    document.SIOperationForm.action = '/PacsApplication/StandingInstructionServlet';
                    document.SIOperationForm.submit();
                }
            }
            function submitformAmend(SIOperationForm)
            {
                if (checkDivAmend(SIOperationForm))
                {
                    document.forms[0].handle_id.value = 'AmendUpdate';
                    document.SIOperationForm.action = '/PacsApplication/StandingInstructionServlet';
                    document.SIOperationForm.submit();
                }
            }
            function submitformSearch(SIOperationForm)
            {
                if (SIOperationForm.opsTypeSearch.value == "")
                {
                    alert("Please select the Operation type.");
                    SIOperationForm.opsTypeSearch.focus();
                    return false;
                }
                if (SIOperationForm.fromAccSearch.value == "")
                {
                    alert("Please select the FROM A/C Number.");
                    SIOperationForm.fromAccSearch.focus();
                    return false;
                }
                if (SIOperationForm.toAccSearch.value == "")
                {
                    alert("Please select the TO A/C Number.");
                    SIOperationForm.toAccSearch.focus();
                    return false;
                }

                    document.SIOperationForm.action = '/PacsApplication/StandingInstructionServlet';
                    document.SIOperationForm.submit();              
            }
            $(document).ready(function () {
                $('#siAmount,#siAmountAmend').keydown(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();
                    }
                });
            });

            function checkDiv(SIOperationForm)
            {
                if (SIOperationForm.opsType.value == "")
                {
                    alert("Please select the Operation type.");
                    SIOperationForm.opsType.focus();
                    return false;
                }
                if (SIOperationForm.fromAcc.value == "")
                {
                    alert("Please select the FROM A/C Number.");
                    SIOperationForm.fromAcc.focus();
                    return false;
                }
                if (SIOperationForm.toAcc.value == "")
                {
                    alert("Please select the TO A/C Number.");
                    SIOperationForm.toAcc.focus();
                    return false;
                }
                if (parseInt(SIOperationForm.fromAcc.value) == parseInt(SIOperationForm.toAcc.value))
                {
                    alert("From A/C & To A/C can not be same.");
                    return false;
                }
                if (SIOperationForm.freqOption.value == "")
                {
                    alert("Please select the frequency.");
                    SIOperationForm.freqOption.focus();
                    return false;
                }
                if (SIOperationForm.fromDate.value == "")
                {
                    alert("Please select start date.");
                    SIOperationForm.fromDate.focus();
                    return false;
                }
                if (SIOperationForm.toDate.value == "")
                {
                    alert("Please select end date.");
                    SIOperationForm.toDate.focus();
                    return false;
                }
                if (SIOperationForm.siAmount.value == "")
                {
                    alert("Please enter the standing instruction amount.");
                    SIOperationForm.siAmount.focus();
                    return false;
                }
                var edateInput = document.getElementById("fromDate").value.split("/");
                var fromDate = new Date(edateInput[2],edateInput[1]-1,edateInput[0]).getTime();
                var spdate = new Date();
                var today = new Date(spdate.getFullYear()-0,spdate.getMonth(),spdate.getDate()).getTime();

                if(fromDate < today)
                {
                    alert("Please provide appropriate Start Date.");
                    return false;
                }

                var edateInput2 = document.getElementById("toDate").value.split("/");
                var toDate = new Date(edateInput2[2],edateInput2[1]-1,edateInput2[0]).getTime();
                var spdate2 = new Date();
                var today2 = new Date(spdate2.getFullYear()-0,spdate2.getMonth(),spdate2.getDate()).getTime();

                if(toDate < today2)
                {
                    alert("Please provide appropriate End Date.");
                    return false;
                }
                if(toDate < fromDate)
                {
                    alert("Start Date can not be greater than End Date.");
                    return false;
                }
                if(toDate == fromDate)
                {
                    alert("Start Date can not be same as End Date.");
                    return false;
                }
                return true;
            }
            function checkDivAmend(SIOperationForm)
            {
                if (SIOperationForm.opsTypeAmend.value == "")
                {
                    alert("Please select the Operation type.");
                    SIOperationForm.opsTypeAmend.focus();
                    return false;
                }
                if (SIOperationForm.fromAccAmend.value == "")
                {
                    alert("Please select the FROM A/C Number.");
                    SIOperationForm.fromAccAmend.focus();
                    return false;
                }
                if (SIOperationForm.toAccAmend.value == "")
                {
                    alert("Please select the TO A/C Number");
                    SIOperationForm.toAccAmend.focus();
                    return false;
                }
                if (SIOperationForm.freqOptionAmend.value == "")
                {
                    alert("Please select the frequency.");
                    SIOperationForm.freqOptionAmend.focus();
                    return false;
                }
                if (SIOperationForm.fromDateAmend.value == "")
                {
                    alert("Please select start date.");
                    SIOperationForm.fromDateAmend.focus();
                    return false;
                }
                if (SIOperationForm.toDateAmend.value == "")
                {
                    alert("Please select end date.");
                    SIOperationForm.toDateAmend.focus();
                    return false;
                }
                if (SIOperationForm.siAmountAmend.value == "")
                {
                    alert("Please enter the standing instruction amount.");
                    SIOperationForm.siAmountAmend.focus();
                    return false;
                }
                var edateInput = document.getElementById("fromDateAmend").value.split("/");
                var fromDate = new Date(edateInput[2],edateInput[1]-1,edateInput[0]).getTime();
                var spdate = new Date();
                var today = new Date(spdate.getFullYear()-0,spdate.getMonth(),spdate.getDate()).getTime();

                /*if(fromDate < today)
                {
                    alert("Please provide appropriate Start Date!");
                    return false;
                }*/

                var edateInput2 = document.getElementById("toDateAmend").value.split("/");
                var toDate = new Date(edateInput2[2],edateInput2[1]-1,edateInput2[0]).getTime();
                var spdate2 = new Date();
                var today2 = new Date(spdate2.getFullYear()-0,spdate2.getMonth(),spdate2.getDate()).getTime();

                if(toDate < today2)
                {
                    alert("Please provide appropriate End Date.");
                    return false;
                }
                if(toDate < fromDate)
                {
                    alert("Start Date can not be greater than End Date.");
                    return false;
                }
                if(toDate == fromDate)
                {
                    alert("Start Date can not be same as End Date.");
                    return false;
                }
                return true;
            }
            
            // 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()">

        <%
             String error_msg = "";
             Object error = request.getAttribute("message");
             if (error != null) {
                 error_msg = error.toString();
             }
        %>
        <%
             String displayFlag = "";
             Object display = request.getAttribute("displayFlag");
             if (display != null) {
                 displayFlag = display.toString();
             }
        %>
        <%!
            String blankNull(String s) {
                return (s == null) ? "" : s;
            }
        %>
        <%
             String ModuleName = new String();

             ModuleName = (String) session.getAttribute("moduleName");
        %>

        <%
             Object StandingInstructionBeanobj = request.getAttribute("oStandingInstructionBeanObj");
             StandingInstructionBean oStandingInstructionBean = new StandingInstructionBean();
             if (StandingInstructionBeanobj != null) {
                 oStandingInstructionBean = (StandingInstructionBean) request.getAttribute("oStandingInstructionBeanObj");

             }
        %>

        <%
             int count = 1;             

             Object alBatchProcessingBeanObj = request.getAttribute("alBatchProcessingBean");
             ArrayList<BatchProcessingBean> alBatchProcessingBean = new ArrayList<BatchProcessingBean>();
             BatchProcessingBean oBatchProcessingBean = new BatchProcessingBean();
             if (alBatchProcessingBeanObj != null) {
                 alBatchProcessingBean = (ArrayList<BatchProcessingBean>) request.getAttribute("alBatchProcessingBean");

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

      <%  Object alEnquiryBeanObj = request.getAttribute("alEnquiryBean");
                    ArrayList<EnquiryBean> alEnquiryBean = new ArrayList<EnquiryBean>();
                    if (alEnquiryBeanObj != null) {
                        alEnquiryBean = (ArrayList<EnquiryBean>) request.getAttribute("alEnquiryBean");
                    }
        %>
        <%
                    String pacsId = (String) session.getAttribute("pacsId");
                    Object oEnquiryBeanSearchObj = request.getAttribute("oEnquiryBeanSearchObj");
                    EnquiryBean oEnquiryBean = new EnquiryBean();
                    EnquiryBean oEnquiryBeanSearch = new EnquiryBean();
                    if (oEnquiryBeanSearchObj != null) {
                        oEnquiryBean = (EnquiryBean) request.getAttribute("oEnquiryBeanSearchObj");
                        session.setAttribute("oEnquiryBeanSearchObj", oEnquiryBeanSearchObj);
                    }
          %>

        <%if (ModuleName.equalsIgnoreCase("Deposit")) {%>
        <jsp:include page="/Deposit/MenuHead_Deposit.jsp" flush="true" />
        <%} else if (ModuleName.equalsIgnoreCase("Loan")) {%>
        <jsp:include page="/Loan/MenuHead_Loan.jsp" flush="true" />
        <%}else if (ModuleName.equalsIgnoreCase("SpecialBothKcc")) {%>
        <jsp:include page="/MenuHead.jsp" flush="true" />
        <%}else if (ModuleName.equalsIgnoreCase("SpecialBothDep")) {%>
        <jsp:include page="/Deposit/MenuHead_Deposit.jsp" flush="true" />
        <%}else if (ModuleName.equalsIgnoreCase("SpecialBoth")) {%>
        <jsp:include page="/Deposit/MenuHead_Deposit.jsp" flush="true" />
        <%}%>
        <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">Standing Instruction Operation</legend>
            <form name="SIOperationForm" method="post">

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

                <center><lable style=" font-family: Berlin Sans FB; font-weight:  normal;">Operation Selection:</lable>
                    <select name="checkOption" id="checkOption">
                        <option value=""> --select-- </option>
                        <option value="create">Create</option>
                        <option value="amend">Amend</option>
                        <%--<option value="search">Search</option>--%>

                    </select>
                </center>
                <br>

                <div id="createDiv" style="display: none;">
                    <table>
                        <tr>
                            <td><label>Operation Type<font color="red" >*</font>:</label>&nbsp;</td>
                            <td><select name="opsType" id="opsType">
                                    <option value="" selected disabled > --Select-- </option>
                                    <option value="s2s">Savings to Savings</option>
                                    <option value="s2r">Savings to RD</option>
                                    <option value="s2l">Savings to Loan</option>
                                </select></td>
                        </tr>
                        <tr>
                            <td><label>From Account<font color="red" >*</font>:</label>&nbsp;</td>
                            <td><input type="text" name="fromAcc" id="fromAcc" style="text-align:right;" onkeypress='return event.charCode >= 48 && event.charCode <= 57' />&nbsp;<input type="button" value="Search" onclick="javascript:popup_AccFrom(920, 480, document.SIOperationForm.fromAcc.value,document.SIOperationForm.opsType.value);"/></td>
                        </tr>
                        <tr id="toAccRow" style="display:none">
                            <td><label>To Account<font color="red" >*</font>:</label>&nbsp;</td>
                            <td><input type="text" name="toAcc" id="toAcc" style="text-align:right;" onkeypress='return event.charCode >= 48 && event.charCode <= 57' />&nbsp;<input type="button" value="Search" onclick="javascript:popup_AccTo(920, 480, document.SIOperationForm.toAcc.value,document.SIOperationForm.opsType.value);"/></td>
                        </tr>
                        <tr>
                            <td><label>Frequency<font color="red" >*</font>:</label>&nbsp;</td>
                            <td><select name="freqOption" id="freqOption">
                                    <option value=""> --Select-- </option>
                                    <option value="D">Daily</option>
                                    <option value="M">Monthly</option>
                                    <option value="Q">Quarterly</option>
                                    <option value="H">Half-Yearly</option>
                                    <option value="Y">Yearly</option>
                                </select></td>
                        </tr>
                        <tr>
                            <td>Start Date<font color="red" >*</font>: </td>
                            <td><input type="text" id="fromDate" name="fromDate" readonly style="text-align:center;" /> <a href="#" onclick="return getCalendar(document.forms[0].fromDate);"><img src="${pageContext.request.contextPath}/img/calendar.jpg" name="imgr" border="0" width="25" height="20" /></a></td>
                        </tr>
                        <tr>
                            <td>End Date<font color="red" >*</font>: </td>
                            <td><input type="text" id="toDate" name="toDate" readonly style="text-align:center;" /> <a href="#" onclick="return getCalendar(document.forms[0].toDate);"><img src="${pageContext.request.contextPath}/img/calendar.jpg" name="imgr" border="0" width="25" height="20" /></a></td>
                        </tr>
                        <tr>
                            <td>Amount<font color="red" >*</font>: </td>
                            <td><input type="text" id="siAmount" name="siAmount" style="text-align:right;" /></td>
                        </tr>
                        <tr>
                            <td>Chase Days: </td>
                            <td><input type="text" readonly id="chaseDay" name="chaseDay" value="10" style="text-align:right;" /></td>
                        </tr>
                    </table>
                    <center>
                        <input type="button" value="Submit" onclick="javascript:submitform(SIOperationForm)">
                        <input type="button" value="Reset" name="reset" onclick="ShowParent();" />
                    </center>
                </div>

                <div id="amendDiv" style="display: none;">
                    <center>
                        <table>
                            <tr>
                                <td><label>Operation Type<font color="red" >*</font>:</label>&nbsp;</td>
                                <td><select name="opsTypeSearch" id="opsTypeSearch">
                                        <option value="" selected disabled > --Select-- </option>
                                        <option value="s2s">Savings to Savings</option>
                                        <option value="s2r">Savings to RD</option>
                                        <option value="s2l">Savings to Loan</option>
                                    </select></td>
                            </tr>
                            <tr>
                                <td><label>From Account<font color="red" >*</font>:</label>&nbsp;</td>
                                <td><input type="text" name="fromAccSearch" id="fromAccSearch" style="text-align:right;" onkeypress='return event.charCode >= 48 && event.charCode <= 57' />&nbsp;<input type="button" value="Search" onclick="javascript:popup_AccFromSearch(920, 480, document.SIOperationForm.fromAccSearch.value,document.SIOperationForm.opsTypeSearch.value);"/></td>
                            </tr>
                            <tr>
                                <td><label>To Account<font color="red" >*</font>:</label>&nbsp;</td>
                                <td><input type="text" name="toAccSearch" id="toAccSearch" style="text-align:right;" onkeypress='return event.charCode >= 48 && event.charCode <= 57' />&nbsp;<input type="button" value="Search" onclick="javascript:popup_AccToSearch(920, 480, document.SIOperationForm.toAccSearch.value,document.SIOperationForm.opsTypeSearch.value);"/></td>
                            </tr>
                        </table>
                    </center>
                    <br>
                    <center>
                        <input type="button" value="Submit" onclick="javascript:submitformSearch(SIOperationForm)">
                        <input type="button" value="Reset" name="reset" onclick="ShowParent();" />
                    </center>
                </div>

                <div id="searchDiv" style="display: none;">
                    <center>
                        <table>
                            <tr>
                                <td><td><td><label>From Account:</label>&nbsp;</td>
                                <td><input type="text" name="accSearch" id="accSearch"/>&nbsp;<input type="button" value="Search" onclick="javascript:popup_searchDiv(920, 480, document.SIOperationForm.accSearch.value);"/></td>
                            </tr>
                        </table>
                    </center>
                    <br>

                    <div align="center">
                        <table id="searchData" name="searchData" border="2" width="auto" cellspacing="1" cellpadding="1" style="text-align: center ;overflow-y: scroll; font-size: 15px">
                            <thead class="CSSTableGenerator">
                                <tr>                                    
                                    <td>ID</td>
                                    <td>Form Account</td>
                                    <td>To Account</td>
                                    <td>Amount</td>
                                    <td>OP Type</td>
                                    <td>Start Date</td>
                                    <td>End Date</td>
                                    <td>Active Flag</td>
                                </tr>
                            </thead>
                            <tbody style="background-color: white; font-size: 15px">
                                <%
                                oEnquiryBean = null;

                                for (int i = 0; i < alEnquiryBean.size(); i++) {
                                    oEnquiryBean = alEnquiryBean.get(i);
                            %>
                                <tr class="tRow">
                                    <td><input type="hidden" name="SI_ID<%=count%>" id="SI_ID<%=count%>" /></td>
                                    <td><input type="text" name="From_Acct<%=count%>" id="From_Acct<%=count%>" /></td>
                                    <td><input type="text" name="To_Acct<%=count%>" id="To_Acct<%=count%>" /></td>
                                    <td><input type="text" name="SI_Amount<%=count%>" id="SI_Amount<%=count%>" /></td>
                                    <td><input type="text" name="OP_Type<%=count%>" id="OP_Type<%=count%>" /></td>
                                    <td><input type="text" name="Start_Date<%=count%>" id="Start_Date<%=count%>" /></td>
                                    <td><input type="text" name="End_Date<%=count%>" id="End_Date<%=count%>" /></td>
                                    <%--<td><input type="text" name="Active_Flag<%=count%>" id="Active_Flag<%=count%>" /></td>--%>
                                    <td><input type="button" value="Download" onclick="document.getElementById('accno').value=document.getElementById('SI_ID<%=i%>').value;javascript:dnldReport();"/></td>

                                </tr>
                                <%}%>
                            </tbody>
                        </table>
                        <br><br><br>
                    </div>

                    <center>
                        <input type="button" value="Submit" onclick="javascript:submitformSearch(SIOperationForm)">
                        <input type="button" value="Reset" name="reset" onclick="ShowParent();" />
                    </center>
                </div> 
                <% if (displayFlag.equalsIgnoreCase("Y")) {%>
                <div id="dontDisplayFirst">
                    <table>
                        <tr>
                            <td><label>Operation Type:</label>&nbsp;</td>
                            <td><select name="opsTypeAmend" id="opsTypeAmend" disabled >
                                    <option value="" disabled selected style="display:none;" <%if (blankNull(oStandingInstructionBean.getFreqOption()).equals("")) {%> selected <%}%> >Please select</option>
                                    <option value="s2s" <%if (blankNull(oStandingInstructionBean.getOpsType()).equals("s2s")) {%> selected <%}%>>Savings to Savings</option>
                                    <option value="s2r" <%if (blankNull(oStandingInstructionBean.getOpsType()).equals("s2r")) {%> selected <%}%>>Savings to RD</option>
                                    <option value="s2l" <%if (blankNull(oStandingInstructionBean.getOpsType()).equals("s2l")) {%> selected <%}%>>Savings to Loan</option>
                                </select></td>
                        </tr>
                        <tr>
                            <td><label>From Account:</label>&nbsp;</td>
                            <td><input type="text" readonly name="fromAccAmend" id="fromAccAmend" style="text-align:right;" value="<%=blankNull(oStandingInstructionBean.getFromAcc())%>"/>&nbsp;</td>
                        </tr>
                        <tr>
                            <td><label>To Account:</label>&nbsp;</td>
                            <td><input type="text" readonly name="toAccAmend" id="toAccAmend" style="text-align:right;" value="<%=blankNull(oStandingInstructionBean.getToAcc())%>"/>&nbsp;</td>
                        </tr>
                        <tr>
                            <td><label>Frequency:</label>&nbsp;</td>
                            <td><select name="freqOptionAmend" id="freqOptionAmend" >
                                    <option value="" disabled selected style="display:none;" <%if (blankNull(oStandingInstructionBean.getFreqOption()).equals("")) {%> selected <%}%>>Please select</option>
                                    <option value="D" <%if (blankNull(oStandingInstructionBean.getFreqOption()).equals("D")) {%> selected <%}%>>Daily</option>
                                    <option value="M" <%if (blankNull(oStandingInstructionBean.getFreqOption()).equals("M")) {%> selected <%}%>>Monthly</option>
                                    <option value="Q" <%if (blankNull(oStandingInstructionBean.getFreqOption()).equals("Q")) {%> selected <%}%>>Quaterly</option>
                                    <option value="H" <%if (blankNull(oStandingInstructionBean.getFreqOption()).equals("H")) {%> selected <%}%>>Half-Yearly</option>
                                    <option value="Y" <%if (blankNull(oStandingInstructionBean.getFreqOption()).equals("Y")) {%> selected <%}%>>Yearly</option>
                                </select></td>
                        </tr>
                        <tr>
                            <td>Start Date: </td>
                            <td><input type="text" id="fromDateAmend" name="fromDateAmend" style="text-align:center;"readonly value="<%=blankNull(oStandingInstructionBean.getFromDate())%>" /> <a href="#" onclick="return getCalendar(document.forms[0].fromDateAmend);"><img src="${pageContext.request.contextPath}/img/calendar.jpg" name="imgr" border="0" width="25" height="20" /></a></td>
                        </tr>
                        <tr>
                            <td>End Date: </td>
                            <td><input type="text" id="toDateAmend" name="toDateAmend" readonly style="text-align:center;" value="<%=blankNull(oStandingInstructionBean.getToDate())%>" /> <a href="#" onclick="return getCalendar(document.forms[0].toDateAmend);"><img src="${pageContext.request.contextPath}/img/calendar.jpg" name="imgr" border="0" width="25" height="20" /></a></td>
                        </tr>
                        <tr>
                            <td>Amount: </td>
                            <td><input type="text" id="siAmountAmend" name="siAmountAmend" style="text-align:right;" value="<%=blankNull(oStandingInstructionBean.getSiAmount())%>"/></td>
                        </tr>
                        <tr>
                            <td>Chase Days: </td>
                            <td><input type="text" readonly id="chaseDayAmend" name="chaseDayAmend" style="text-align:right;" value="<%=blankNull(oStandingInstructionBean.getChaseDay())%>"/></td>
                        </tr>
                    </table>
                    <center>
                        <input type="button" value="Update" onclick="javascript:submitformAmend(SIOperationForm)">
                        <input type="button" value="Reset" name="reset" onclick="ShowParent();" />
                    </center>
                </div>
                <%}%>

                <input type="hidden" name="handle_id"/>
                <input type="hidden" name="moduleName" value="<%=ModuleName%>"/>
            </form>
        </fieldset>
    </body>
</html>

<% 	} catch (Exception e) {
               
            }
%>