<%--
    Document   : accountCreationReadOnly
    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.AccountCreationBean"%>
<html>
    <head>
        <title>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 submitform(accCreatFormReadOnly)
            {
                if (checkDiv(accCreatFormReadOnly))
                {
                    accCreatFormReadOnly.submit();
                }
            }
            function popup_CIF(width, height, cifNumber) {

                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 = "accountCreationReadOnly.jsp";
                var  lovKey="PickUPCustomer";
                popWin = open('${pageContext.request.contextPath}/CommonSearchInfoLOVNew.jsp?cifNumber=' + cifNumber + '&screenName=' + screenName+'&lovKey='+lovKey, 'PickUPCustomer', attr);
                popWin.focus();
            }

            function ShowParent()
            {
                document.forms[0].action = "accountCreation.jsp";
                document.forms[0].submit();
            }

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

            }

        </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 AccountCreationBeanObj = request.getAttribute("oAccountCreationBean");
                    AccountCreationBean oAccountCreationBean = new AccountCreationBean();

                    if (AccountCreationBeanObj != null) {
                        oAccountCreationBean = (AccountCreationBean) request.getAttribute("oAccountCreationBean");

                    }
        %>

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

        <%!
            String blankNull(String s) {
                return (s == null) ? "" : 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">ACCOUNT CREATION</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(oAccountCreationBean.getProductName())%>"></td>

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

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

                        </tr>
                        <tr>
                            <td><lable>Customer Name :</lable></td>
                        <td><input type="text" id="custName" name="custName" value="" disabled readonly></td>

                        </tr>
                        <tr>
                            <td><lable>Linked CBS Savings Account :</lable></td>
                        <td><input type="text" id="cbsSavingsAccount" name="cbsSavingsAccount" readonly="true" value="<%=blankNull(oAccountCreationBean.getCbsSavingsAccount())%>" readonly></td>
                        </tr>

                        <tr><td><hr></td></tr>
                        <tr><td><h3>Limit Information</h3></td></tr>

                        <tr>
                            <td><lable>Total Limit/Sanction Amt :</lable></td>
                        <td><input type="text" id="limit" name="limit" value="<%=blankNull(oAccountCreationBean.getLimit())%>" readonly></td>
                        </tr>

                        <tr>
                            <td><lable>Limit in Kind :</lable></td>
                        <td><input type="text" id="limit_kind" name="limit_kind" value="<%=blankNull(oAccountCreationBean.getLimit_kind())%>" readonly></td>
                        <td><lable>%</lable></td>
                        </tr>

                        <tr>
                            <td><lable>Loan Due Date :</lable></td>
                        <td><input type="text" id="limitExpiryDate" name="limitExpiryDate" readonly="true" value="<%=blankNull(oAccountCreationBean.getLimitExpiryDate())%>" readonly></td>
                        </tr>

                        <tr><td><hr></td></tr>
                        <tr><td><h3>Collateral Information :</h3></td></tr>
                        <tr>
                            <td><lable>Collateral Type :</lable></td>
                        <td>
                            <select id="collateralType" name="collateralType" disabled="true">
                                <option value="" disabled selected style="display:none;">--Select--</option>
                                <option value="L" <%if (oAccountCreationBean.getCollateralType().equals("L")) {%> selected <%}%>>Land</option>
                                <option value="O" <%if (oAccountCreationBean.getCollateralType().equals("O")) {%> selected <%}%>>Others</option>
                            </select>
                        </td>
                        </tr>
                        <tr>
                            <td><lable>Land in Acres :</lable></td>
                        <td><input type="text" id="landinAcres" name="landinAcres" value="<%=blankNull(oAccountCreationBean.getLandinAcres())%>" readonly></td>
                        </tr>
                        <tr>
                            <td><lable>Description :</lable></td>
                        <td><textarea readonly id="description" name="description" style="width : 150px"><%=blankNull(oAccountCreationBean.getDescription())%></textarea></td>
                        </tr>
                        <tr>
                            <td><lable>Current Valuation (in Rs.):</lable></td>
                        <td><input type="text" id="currentValuation" name="currentValuation" value="<%=blankNull(oAccountCreationBean.getCurrentValuation())%>" readonly/></td>
                        </tr>
                        <tr>
                            <td><lable>Safe Lending Margin :</lable></td>
                        <td><input type="text" id="safeLendingMargin" name="safeLendingMargin" value="<%=blankNull(oAccountCreationBean.getSafeLendingMargin())%>" readonly /></td>
                        <td><lable>%</lable></td>
                        </tr>
                        
                        <tr><td><hr></td></tr>
                        <tr><td><h3>Interest Information:</h3></td></tr>
                        <tr>
                        <td><lable>Interest Rate<font color="red" >*</font>:</lable></td>
                        <td><input type="text" id="intRate" name="intRate" value="<%=blankNull(oAccountCreationBean.getIntRate())%>" readonly></td>
                        </tr>
                        <tr>
                        <td><lable>Penal Interest Rate<font color="red" >*</font>:</lable></td>
                        <td><input type="text" id="penIntRate" name="penIntRate" value="<%=blankNull(oAccountCreationBean.getPenIntRate())%>" readonly></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="true">
                                <option value="" disabled selected style="display:none;">--Select--</option>
                                <option value="1"<%if (oAccountCreationBean.getActivityCode().equals("1")) {%> selected <%}%>>Direct Agriculture</option>
                                <option value="2"<%if (oAccountCreationBean.getActivityCode().equals("2")) {%> selected <%}%>>Indirect Agriculture</option>
                                <option value="3"<%if (oAccountCreationBean.getActivityCode().equals("3")) {%> selected <%}%>>Agricultural Service Units</option>
                                <option value="4"<%if (oAccountCreationBean.getActivityCode().equals("4")) {%> selected <%}%>>Farm Irrigation</option>
                                <option value="5"<%if (oAccountCreationBean.getActivityCode().equals("5")) {%> selected <%}%>>Fruits & Vegetables</option>
                            </select>
                        </td>
                        </tr>
                        <tr>
                            <td><lable>Customer Type :</lable></td>
                        <td>
                            <select id="customerType" name="customerType" disabled="true">
                                <option value="" disabled selected style="display:none;">--Select--</option>
                                <option value="I"<%if (oAccountCreationBean.getCustomerType().equals("I")) {%> selected <%}%>>Individual</option>
                                <option value="C"<%if (oAccountCreationBean.getCustomerType().equals("C")) {%> selected <%}%>>Corporate</option>
                            </select>
                        </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" value="" />
                <input type="hidden" name="AuthActivity" value="KCC_ACCOUNT" />
                <input type="hidden" name="SearchID" id="SearchID" value="<%=blankNull(oAccountCreationBean.getId())%>" />

            </form>
        </fieldset>
    </body>
</html>
