<%--
    Document   : accountCreation
    Created on : Mar 8, 2016, 1:20:58 PM
    Author     : Tcs Helpdesk10
--%>

<%@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.DepositAccountCreationBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.UUID" %>
<%String uuid = UUID.randomUUID().toString();%>
<% try {
%>

<html>
    <head>
       
        <title>Deposit Account 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>



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




            function Approveform(accCreatFormReadonly)
            {
                if (document.forms[0].AuthComment.value==""||document.forms[0].AuthComment.value==null){

                    alert("Comments Required");
                    return false;

                }
                document.forms[0].handle_id.value="AuthorizeAccOpen";
                document.forms[0].action = '/PacsApplication/TransactionAuthorizationServlet';
                document.forms[0].submit();

            }

            function Rform(accCreatFormReadonly)
            {
                if (document.forms[0].AuthComment.value==""||document.forms[0].AuthComment.value==null){

                    alert("Comments Required");
                    return false;

                }
                document.forms[0].handle_id.value="RejectAccOpen";
                document.forms[0].action = '/PacsApplication/TransactionAuthorizationServlet';
                document.forms[0].submit();

            }

            // to restrict back button
            history.pushState(null, null, location.href);
            window.addEventListener('popstate', function(event) {
                history.pushState(null, null, location.href);
            });

        </script>


        <%
                    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();
                    }
        %>


        <%
                    Object DepositAccountCreationBeanObj = request.getAttribute("oDepositAccountCreationBean");
                    DepositAccountCreationBean oDepositAccountCreationBean = new DepositAccountCreationBean();

                    if (DepositAccountCreationBeanObj != null) {
                        oDepositAccountCreationBean = (DepositAccountCreationBean) request.getAttribute("oDepositAccountCreationBean");

                    }
        %>

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

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

            String blankNA(String s) {
                return (s == null) ? "NA" : s;
            }
        %>

        <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">DEPOSIT ACCOUNT AUTHORIZATION</legend>

            <form name="accCreatFormReadonly" method="post"  action="">

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

                <%if (displayFlag.equalsIgnoreCase("Y")) {%>
                <div id="create" align="left">

                    <table>
                        <tr><td><hr></td></tr>
                        <tr><td><h3>Account Information :</h3></td></tr>
                        <tr>
                            <td><lable>Product Code :</lable></td>
                        <td><input type="text" id="productCodeDetails" name="productCodeDetails" readonly value="<%=blankNull(oDepositAccountCreationBean.getProductName())%>" ></td>


                        </tr>
                        <tr>
                            <td><lable>Intt Category :</lable></td>
                        <td><input type="text" id="inttCatDetails" name="inttCatDetails" readonly="true" value="<%=blankNull(oDepositAccountCreationBean.getInttDescription())%>"></td>
                        </tr>

                        <tr>
                            <td><lable>Segment Code :</lable></td>
                        <td>
                            <select id="segmentCode" name="segmentCode" disabled>
                                <option value="" disabled <%if (blankNull(oDepositAccountCreationBean.getSegmentCode()).equals("")) {%> selected <%}%> style="display:none;">--Select--</option>
                                <option value="0706" <%if (blankNull(oDepositAccountCreationBean.getSegmentCode()).equals("0706")) {%> selected <%}%>>0706:INDIVIDUAL</option>
                                <option value="0306" <%if (blankNull(oDepositAccountCreationBean.getSegmentCode()).equals("0306")) {%> selected <%}%>>0306:STAFF</option>
                                <option value="5003" <%if (blankNull(oDepositAccountCreationBean.getSegmentCode()).equals("5003")) {%> selected <%}%>>5003:SENIOR CITIZEN</option>
                                <option value="5010" <%if (blankNull(oDepositAccountCreationBean.getSegmentCode()).equals("5010")) {%> selected <%}%>>5010:SHG</option>
                                <option value="5000" <%if (blankNull(oDepositAccountCreationBean.getSegmentCode()).equals("5000")) {%> selected <%}%>>5000:BANKS</option>
                                <option value="5009" <%if (blankNull(oDepositAccountCreationBean.getSegmentCode()).equals("5009")) {%> selected <%}%>>5009:INSTITUTIONS</option>
                                <option value="5050" <%if (blankNull(oDepositAccountCreationBean.getSegmentCode()).equals("5050")) {%> selected <%}%>>5050:OTHERS</option>
                                <option value="5007" <%if (blankNull(oDepositAccountCreationBean.getSegmentCode()).equals("5007")) {%> selected <%}%>>5007:SOCIETY</option>
                                <option value="5011" <%if (blankNull(oDepositAccountCreationBean.getSegmentCode()).equals("5011")) {%> selected <%}%>>5011:GOV/SEMI GOV</option>
                                <option value="5012" <%if (blankNull(oDepositAccountCreationBean.getSegmentCode()).equals("5012")) {%> selected <%}%>>5012:PACS</option>
                                <option value="5013" <%if (blankNull(oDepositAccountCreationBean.getSegmentCode()).equals("5013")) {%> selected <%}%>>5013:UCB</option>
                                <option value="5014" <%if (blankNull(oDepositAccountCreationBean.getSegmentCode()).equals("5014")) {%> selected <%}%>>5014:SCB</option>
                                <option value="5015" <%if (blankNull(oDepositAccountCreationBean.getSegmentCode()).equals("5015")) {%> selected <%}%>>5015:CCB</option>
                            </select>
                        </td>
                        </tr>
                        <tr>
                            <td><lable>Primary CIF Number:</lable></td>
                        <td><input type="text" id="cifNumber" name="cifNumber" value="<%=blankNull(oDepositAccountCreationBean.getCifNumber())%>" readonly></td>

                        </tr>
                        <tr>
                            <td><lable>Primary Customer Name:</lable></td>
                        <td><input type="text" id="cifName1" name="cifName1" value="<%=blankNull(oDepositAccountCreationBean.getCifName())%>" disabled readonly></td>

                        </tr>
                        <%--<tr>
                            <td><lable>Secondary CIF Number :</lable></td>
                        <td><input type="text" id="cifNumber2" name="cifNumber2" value="<%=blankNA(oDepositAccountCreationBean.getCifNumber2())%>" readonly></td>

                        </tr>
                        <tr>
                            <td><lable>Secondary Customer Name:</lable></td>
                        <td><input type="text" id="cifName2" name="cifName2" value="<%=blankNA(oDepositAccountCreationBean.getCifName2())%>" disabled readonly></td>

                        </tr>--%>
                        <%--Start Changes By Bitan For Multiple CIF Changes--%>
                        <tr>
                            <td><lable>Secondary CIF Number#1:</lable></td>
                         <td><input type="text" id="cifNumber2" name="cifNumber2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifNumber1())%>" readonly>
                         <input type="text" id="cifName2" name="cifName2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifName1())%>" disabled readonly></td>
                        </tr>
                        <tr>
                            <td><lable>Secondary CIF Number#2:</lable></td>
                         <td><input type="text" id="cifNumber2" name="cifNumber2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifNumber2())%>" readonly>
                         <input type="text" id="cifName2" name="cifName2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifName2())%>" disabled readonly></td>
                        </tr>
                        <tr>
                            <td><lable>Secondary CIF Number#3:</lable></td>
                         <td><input type="text" id="cifNumber2" name="cifNumber2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifNumber3())%>" readonly>
                         <input type="text" id="cifName2" name="cifName2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifName3())%>" disabled readonly></td>
                        </tr>
                        <tr>
                            <td><lable>Secondary CIF Number#4:</lable></td>
                         <td><input type="text" id="cifNumber2" name="cifNumber2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifNumber4())%>" readonly>
                         <input type="text" id="cifName2" name="cifName2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifName4())%>" disabled readonly></td>
                        </tr>
                        <tr>
                            <td><lable>Secondary CIF Number#5:</lable></td>
                         <td><input type="text" id="cifNumber2" name="cifNumber2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifNumber5())%>" readonly>
                         <input type="text" id="cifName2" name="cifName2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifName5())%>" disabled readonly></td>
                        </tr>
                        <tr>
                            <td><lable>Secondary CIF Number#6:</lable></td>
                         <td><input type="text" id="cifNumber2" name="cifNumber2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifNumber6())%>" readonly>
                         <input type="text" id="cifName2" name="cifName2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifName6())%>" disabled readonly></td>
                        </tr>
                        <tr>
                            <td><lable>Secondary CIF Number#7:</lable></td>
                         <td><input type="text" id="cifNumber2" name="cifNumber2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifNumber7())%>" readonly>
                         <input type="text" id="cifName2" name="cifName2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifName7())%>" disabled readonly></td>
                        </tr>
                        <tr>
                            <td><lable>Secondary CIF Number#8:</lable></td>
                         <td><input type="text" id="cifNumber2" name="cifNumber2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifNumber8())%>" readonly>
                         <input type="text" id="cifName2" name="cifName2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifName8())%>" disabled readonly></td>
                        </tr>
                        <tr>
                            <td><lable>Secondary CIF Number#9:</lable></td>
                         <td><input type="text" id="cifNumber2" name="cifNumber2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifNumber9())%>" readonly>
                         <input type="text" id="cifName2" name="cifName2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifName9())%>" disabled readonly></td>
                        </tr>
                        <tr>
                            <td><lable>Secondary CIF Number#10:</lable></td>
                         <td><input type="text" id="cifNumber2" name="cifNumber2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifNumber10())%>" readonly>
                         <input type="text" id="cifName2" name="cifName2" value="<%=blankNA(oDepositAccountCreationBean.getJt_cifName10())%>" disabled readonly></td>
                        </tr>
<%--END Changes By Bitan For Multiple CIF Changes--%>
                        <tr>
                            <td><lable>Nominee:</lable></td>
                        <td><input type="text" id="nomineeCif" name="nomineeCif" value="<%=blankNA(oDepositAccountCreationBean.getNominee())%>" readonly>

                        <input type="text" id="nomineeName" name="nomineeName" value="<%=blankNA(oDepositAccountCreationBean.getNomineeName())%>" disabled readonly></td>

                        </tr>

                        <tr>
                            <td>Account Open Date :</td>
                            <td><input type="text" id="accOpenDate" name="accOpenDate" readonly="true" value="<%=blankNull(oDepositAccountCreationBean.getAccOpenDate())%>"></td>
                        </tr>
                        <tr>
                            <td>OD Limit:</td>
                            <td><input type="text" id="ODlimit" name="ODlimit" readonly value="<%=blankNull(oDepositAccountCreationBean.getODlimit())%>"></td>
                        </tr>


                        <tr><td><hr></td></tr>
                        <tr><td><h3>Additional Information :</h3></td></tr>

                        <tr>
                            <td><lable>Activity Code :</lable></td>
                        <td>
                            <select id="activityCode" name="activityCode" disabled>
                                <option value="" disabled selected style="display:none;">--Select--</option>
                                <option value="1"<%if (blankNull(oDepositAccountCreationBean.getActivityCode()).equals("1")) {%> selected <%}%>>Direct Agriculture</option>
                                <option value="2"<%if (blankNull(oDepositAccountCreationBean.getActivityCode()).equals("2")) {%> selected <%}%>>Indirect Agriculture</option>
                                <option value="3"<%if (blankNull(oDepositAccountCreationBean.getActivityCode()).equals("3")) {%> selected <%}%>>Agricultural Service Units</option>
                                <option value="4"<%if (blankNull(oDepositAccountCreationBean.getActivityCode()).equals("4")) {%> selected <%}%>>Farm Irrigation</option>
                                <option value="5"<%if (blankNull(oDepositAccountCreationBean.getActivityCode()).equals("5")) {%> selected <%}%>>Fruits & Vegetables</option>
                                <option value="6"<%if (blankNull(oDepositAccountCreationBean.getActivityCode()).equals("6")) {%> selected <%}%>>Non-Agriculture</option>
                            </select>
                        </td>
                        </tr>
                        <tr>
                            <td><lable>Customer Type :</lable></td>
                        <td>
                            <select id="customerType" name="customerType" disabled>
                                <option value="" disabled selected style="display:none;">--Select--</option>
                                <option value="I"<%if (blankNull(oDepositAccountCreationBean.getCustomerType()).equals("I")) {%> selected <%}%>>Individual</option>
                                <option value="C"<%if (blankNull(oDepositAccountCreationBean.getCustomerType()).equals("C")) {%> selected <%}%>>Corporate</option>
                            </select>
                        </td>
                        </tr>
                        <tr>
                            <td>Intt Repay Method</td>
                            <td><select id="inttrepmethod" name="inttrepmethod" disabled>
                                    <option value="" disabled selected style="display:none;">--Select--</option>
                                    <option value="T"<%if (blankNull(oDepositAccountCreationBean.getInttrepmethod()).equals("T")) {%> selected <%}%>>Transfer</option>
                                    <option value="TR"<%if (blankNull(oDepositAccountCreationBean.getInttrepmethod()).equals("TR")) {%> selected <%}%>>Transfer and Renew</option>
                                    <option value="R"<%if (blankNull(oDepositAccountCreationBean.getInttrepmethod()).equals("R")) {%> selected <%}%>>Auto-renew</option>
                                    <option value="F"<%if (blankNull(oDepositAccountCreationBean.getInttrepmethod()).equals("F")) {%> selected <%}%>>Freeze</option>
                                </select></td>
                        </tr>
                        <tr>
                            <td>Intt Transfer Account:</td>
                            <td><input type="text" id="intttransacc" name="intttransacc" readonly value="<%=blankNull(oDepositAccountCreationBean.getIntttransacc())%>"></td>
                        </tr>
                        <tr>
                        <tr><td>Term Value:</td><td><input type="text" readonly id="termValue" name="termValue" value="<%=blankNA(oDepositAccountCreationBean.getTermValue())%>"></td></tr>

                        <% if (blankNull(oDepositAccountCreationBean.getProductName()).substring(0, 1).equalsIgnoreCase("3")){%>
                        <tr><td>Installment Amount:</td><td><input type="text" size="4" readonly id="instAmt" name="instAmt" value="<%=blankNA(oDepositAccountCreationBean.getInstAmt())%>"></td></tr>
                        <tr><td>Term Length (In Months):</td><td><input type="text" size="2" readonly id="termMonth" name="termMonth" value="<%=blankNA(oDepositAccountCreationBean.getTermMonth())%>"></td></tr>
                        <%} else {%>
                        <tr><td>Term Length:</td><td><input type="text" size="1" readonly id="termYears" name="termYears" value="<%=blankNA(oDepositAccountCreationBean.getTermYears())%>"><label> Years</label><input type="text" size="1" readonly id="termMonth" name="termMonth" value="<%=blankNA(oDepositAccountCreationBean.getTermMonth())%>"><label> Months</label><input type="text" size="1" readonly id="termDays" name="termDays" value="<%=blankNA(oDepositAccountCreationBean.getTermDays())%>"><label> Days</label></td></tr>
                        <%}%>

                            <td><lable>Membership Number :</lable></td>
                        <td><input type="text" id="memberno" name="memberno" value="<%=blankNull(oDepositAccountCreationBean.getMemberno())%>" readonly></td>
                    </tr>
                        <tr>
                        <td>Authorizer's Comment:</td>
                        <td>
                            <textarea  name="AuthComment" id="AuthComment"></textarea>
                        </td>
                        </tr>
                    </table>
                    <center>
                        <input type="button" value="Authorize" onclick="javascript:Approveform(accCreatFormReadonly);" />
                        <input type="button" value="Reject" name="reset" onclick="javascript:Rform(accCreatFormReadonly);" />
                    </center>
                    <tr><td><br></td></tr>
                    <tr><td><br></td></tr>
                    <label style=" font-family: Berlin Sans FB; font-weight:normal; ">All fields are mandatory</label>
                </div>
                <%}%>
                <input type="hidden" name="handle_id" id="handle_id" value="" />
                <input type="hidden" name="AuthActivity" value="DEPOSIT_ACCOUNT" />
                <input type="hidden" name="SearchID" id="SearchID" value="<%=blankNull(oDepositAccountCreationBean.getId())%>" />
            </form>
        </fieldset>
    </body>
</html>
<% 	} catch (Exception e) {
                
            }
%>
