<%--
    Document   : DepositAccountEnquiry
    Created on : Sep 13, 2016, 2:23:35 PM
    Author     :
--%>
<%@page import="LoginDb.DbHandler"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.util.ArrayList"%>
<%@page import="DataEntryBean.EnquiryBean"%>
<%@page import="java.util.Date"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<% try {
%>


<html>
    <head>
        <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())%>" />
        <title>Deposit Account Enquiry</title>
        <link rel="shortcut icon" href="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>
        <style>
            .underline_on_hover:hover{
                text-decoration: underline;
                color: teal;
                cursor: pointer;
            }
        </style>
        <script type="text/javascript">
            function noBack()
            {
                window.history.forward();
            }
            
            history.pushState(null, null, location.href);
            window.addEventListener('popstate', function(event) {
                history.pushState(null, null, location.href);
            });
            
            function accountsubmitform(enquiryForm)
            {
                if(!checkdate()){

                    alert("Please select valid date range");
                    return false;
                }
                <%--if( document.forms[0].accountNo.value == "" ){
                    alert("Please provide value in Account Number.");
                    document.forms[0].accountNo.focus();
                    return false;
                }--%>
                if( document.forms[0].productName.value == ""){
                    alert("Please enter Product Name.");
                    document.forms[0].productName.focus();
                    return false;
                }
                document.forms[0].totalRecordCount.value=0;
                document.forms[0].action = '/PacsApplication/EnquiryServlet';
                document.forms[0].submit();
            }


            ///added Later
            function checkdate()
            {
                var s1 = document.getElementById("fromDate").value;
                var s2 = document.getElementById("toDate").value;
                var dateParts1 = s1.split("/");
                var dateParts2 = s2.split("/");

                var dateObject1 = new Date(dateParts1[2], dateParts1[1] - 1, dateParts1[0]);
                var dateObject2 = new Date(dateParts2[2], dateParts2[1] - 1, dateParts2[0]);

                if (dateObject1>dateObject2){

                    return false;
                }

                return true;

            }

            function ShowParent()
            {
                document.forms[0].action = "${pageContext.request.contextPath}/Deposit/DepositAccountEnquiry.jsp";
                document.forms[0].submit();
            }


            function excelDownload() {

                document.forms[0].action = '/PacsApplication/ExcelReportServlet';
                document.forms[0].submit();
            }

            function callNextPage()
            {
                var totalRecordCount=document.forms[0].totalRecordCount.value;
                var recordCount=document.forms[0].recordCount.value;

                if (totalRecordCount==recordCount){

                    alert("No more record to display");
                    return false;

                }

                document.forms[0].but_type.value = 'N';
                document.forms[0].action = '/PacsApplication/EnquiryServlet';
                document.forms[0].submit();
            }

            function callPrevPage()
            {
                var totalRecordCount= document.forms[0].totalRecordCount.value;
                var noOfRecords= document.forms[0].noOfRecords.value;
                document.forms[0].totalRecordCount.value= Number(totalRecordCount) - Number(noOfRecords)-10;
                document.forms[0].but_type.value = 'P';
                document.forms[0].action = '/PacsApplication/EnquiryServlet';
                document.forms[0].submit();
            }

            function dnldReport(){
                document.forms[0].reportPath.value = "/Reports/DepAcctStmt";
                document.forms[0].reportName.value = "ACCOUNT STATEMENT REPORT";
                document.forms[0].DOWNLOAD.value = "P";
                document.forms[0].action = '/PacsApplication/ExcelReportServlet';
                document.forms[0].submit();
            }

            function blank_NA(s) {
                return (s == "null") ? "NA" : s;
            }

           function checkBlank(s){
                return (s == "null") ? false : true;
            }

            function getSecondaryCIFTable(cifNumber1 ,  cifName1 ,
            cifNumber2  , cifName2  ,
            cifNumber3 ,  cifName3  ,
            cifNumber4 ,  cifName4  ,
            cifNumber5 ,  cifName5  ,
            cifNumber6 ,  cifName6  ,
            cifNumber7 ,  cifName7  ,
            cifNumber8 ,  cifName8  ,
            cifNumber9 ,  cifName9  ,
            cifNumber10 ,  cifName10 ){

                //alert( cifNumber1)
            var msg = '<table id="ShowSecondaryCIF"  border="2" cellspacing="1" cellpadding="1" style="text-align: center ;overflow-y: scroll; font-size: 15px; width: 25%;">'+
                        '<thead class="CSSTableGenerator">'+
                        '<tr>'+
                        '<td>CIF Number</td>'+
                        '<td>Customer Name</td>'+
                        '</tr>'+
                        '</thead>';
                        if(checkBlank(cifNumber1)){
                        msg=msg+' <tr>'+
                        ' <td>'+blank_NA(cifNumber1)+'</td>'+
                        ' <td>'+blank_NA(cifName1)+'</td>'+
                        ' </tr>';
                        }
                        if(checkBlank(cifNumber2)){
                            msg=msg+' <tr>'+
                        ' <td>'+blank_NA(cifNumber2)+'</td>'+
                        ' <td>'+blank_NA(cifName2)+'</td>'+
                        ' </tr>';
                        }
                        if(checkBlank(cifNumber3)){
                            msg=msg+' <tr>'+
                        ' <td>'+blank_NA(cifNumber3)+'</td>'+
                        ' <td>'+blank_NA(cifName3)+'</td>'+
                        ' </tr>';
                        }
                        if(checkBlank(cifNumber4)){
                            msg=msg+' <tr>'+
                        ' <td>'+blank_NA(cifNumber4)+'</td>'+
                        ' <td>'+blank_NA(cifName4)+'</td>'+
                        ' </tr>';
                        }
                        if(checkBlank(cifNumber5)){
                            msg=msg+' <tr>'+
                        ' <td>'+blank_NA(cifNumber5)+'</td>'+
                        ' <td>'+blank_NA(cifName5)+'</td>'+
                        ' </tr>';
                        }
                        if(checkBlank(cifNumber6)){
                            msg=msg+' <tr>'+
                        ' <td>'+blank_NA(cifNumber6)+'</td>'+
                        ' <td>'+blank_NA(cifName6)+'</td>'+
                        ' </tr>';
                        }
                        if(checkBlank(cifNumber7)){
                            msg=msg+' <tr>'+
                        ' <td>'+blank_NA(cifNumber7)+'</td>'+
                        ' <td>'+blank_NA(cifName7)+'</td>'+
                        ' </tr>';
                        }
                        if(checkBlank(cifNumber8)){
                            msg=msg+' <tr>'+
                        ' <td>'+blank_NA(cifNumber8)+'</td>'+
                        ' <td>'+blank_NA(cifName8)+'</td>'+
                        ' </tr>';
                        }
                        if(checkBlank(cifNumber9)){
                            msg=msg+' <tr>'+
                        ' <td>'+blank_NA(cifNumber9)+'</td>'+
                        ' <td>'+blank_NA(cifName9)+'</td>'+
                        ' </tr>';
                        }
                        if(checkBlank(cifNumber10)){
                            msg=msg+' <tr>'+
                        ' <td>'+blank_NA(cifNumber10)+'</td>'+
                        ' <td>'+blank_NA(cifName10)+'</td>'+
                        ' </tr>';
                        }
                        msg=msg+'</table>';
                        //alert(msg);
                        var timeOut = 7
                        //jQuery('#SecondaryCIF').text(msg).fadeIn()
                        jQuery('#SecondaryCIF').after().html(msg).fadeIn()
                        jQuery('#SecondaryCIF').css("display", "block")
                        setTimeout(function() {
                        jQuery('#SecondaryCIF').fadeOut()
                        jQuery('#SecondaryCIF').css("display", "none")
                        }, timeOut * 1000);
           }
           
           // 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 displayFlag = "";
             Object display = request.getAttribute("displayFlag");
             if (display != null) {
                 displayFlag = display.toString();
             }
        %>

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

        <%
             String error_msg = "";
             Object error = request.getAttribute("message");
             if (error != null) {
                 error_msg = 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);
             }
        %>

        <%
             int flag2 = 1;
             int curPage = 0;
             try {
                 curPage = Integer.parseInt(request.getAttribute("currentPage").toString());
             } catch (Exception e) {
                 curPage = 1;
             }
             if (alEnquiryBean.size() > 0) {
                 flag2 = 2;
             }
             int totalRecordCount = 0;
             int recordCount = 0;
             int noOfRecords =0;

             try {
                 totalRecordCount = Integer.parseInt(request.getAttribute("totalRecordCount").toString());
                 recordCount = Integer.parseInt(request.getAttribute("recordCount").toString());
             } catch (Exception e) {
                 totalRecordCount = 0;
                 recordCount = 0;
             }
             totalRecordCount = totalRecordCount + alEnquiryBean.size();

        %>
        <%String subPacsFlag = (String) session.getAttribute("subPacsFlag");
        %>

            <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 Enquiry Details</legend>
                <form id="enquiryForm" name="enquiryForm" method="post" action="">


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

                <div id="filterDiv" >
                   <%-- <center>--%>
                        <table>
                            <tr>
                                <td style="text-align: right">Account Number: </td>
                                <td><input type="text" style="text-align:right;" name="accountNo" id="accountNo" value="<%=blankNull(oEnquiryBean.getAccountNo())%>" onkeypress='return event.charCode >= 48 && event.charCode <= 57' /></td>
                                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                <td style="text-align: right">Product Name<font color="red" >*</font>: </td>
                                <td><select id="productName" name="productName" >
                                        <%if (oEnquiryBean.getProductName() == null) {%>
                                        <option value="" disabled selected style="display:none;">--Select--</option>
                                        <%
                                            Connection connection = null;
                                            ResultSet rs = null;
                                            Statement statement = null;
                                            connection = DbHandler.getDBConnection();
                                            try {
                                                statement = connection.createStatement();
                                                rs = statement.executeQuery("select id, prod_name from dep_product where to_number(substr(prod_code,1,1))<6 and pacs_id like '%" + pacsId + "#%'");
                                                while (rs.next()) {%>
                                        <option value="<%=rs.getString(1)%>"><%=rs.getString(2)%></option>
                                        <%}
                                               // statement.close();
                                               // connection.close();
                                            } catch (Exception e) {
                System.out.println("Error occurred during processing.");
            } finally {
                try {
                    if(statement !=null)
                        statement.close();
                    if (connection != null)
                    connection.close();

            } catch (Exception e) {               
               System.out.println("Error Occurred during connection close.");
            }

            }
                                        } else {%>
                                        <option value="<%=blankNull(oEnquiryBean.getProductId())%>" selected style="display:none;"><%=blankNull(oEnquiryBean.getProductName())%></option>
                                        <%
                                            Connection connection = null;
                                            ResultSet rs = null;
                                            Statement statement = null;
                                            connection = DbHandler.getDBConnection();
                                            try {
                                                statement = connection.createStatement();
                                                rs = statement.executeQuery("select id, prod_name from dep_product where to_number(substr(prod_code,1,1))<6 and id!='" + oEnquiryBean.getProductId() + "' and pacs_id like '%" + pacsId + "#%'");
                                                while (rs.next()) {%>
                                        <option value="<%=rs.getString(1)%>"><%=rs.getString(2)%></option>
                                        <%}
                                                    // statement.close();
                                                    // connection.close();
                                                 } catch (Exception e) {
                System.out.println("Error occurred during processing.");
            } finally {
                try {
                    if(statement !=null)
                        statement.close();
                    if (connection != null)
                    connection.close();

            } catch (Exception e) {               
               System.out.println("Error Occurred during connection close.");
            }

            }
                                             }%>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td><br></td>
                            </tr>
                            <tr>
                                <td style="text-align: right">From Date: </td>
                                <td><input value="<%=blankNull(oEnquiryBean.getFromDate())%>" type="text" id="fromDate" style="text-align:center;" name="fromDate" readonly />&nbsp;<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>
                                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                <td style="text-align: right">To Date: </td>
                                <td><input value="<%=blankNull(oEnquiryBean.getToDate())%>" type="text" id="toDate" style="text-align:center;" name="toDate" readonly />&nbsp;<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><br></td>
                            </tr>
                            <tr>
                                <td style="text-align: right">From Amount: </td>
                                <td><input value="<%=blankNull(oEnquiryBean.getFromAmount())%>" type="text" style="text-align:right;" name="fromAmount" onkeypress='return event.charCode >= 46 && event.charCode <= 57'/></td>
                                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                <td style="text-align: right">To Amount: </td>
                                <td><input value="<%=blankNull(oEnquiryBean.getToAmount())%>" type="text" style="text-align:right;" name="toAmount" onkeypress='return event.charCode >= 46 && event.charCode <= 57' /></td>
                            </tr>
                            <tr>
                                <td><br></td>
                            </tr>
                            <tr>
                                <td style="text-align: right">Search By CIF: </td>
                                <td colspan="2"><input value="<%=blankNull(oEnquiryBean.getSrchByCIF())%>" type="text" style="text-align:right;" name="srchByCIF" onkeypress='return event.charCode >= 48 && event.charCode <= 57' /></td>
                                <td style="text-align: right">Sub-PACS Name: </td>
                                <td><select id="subpacs_id" name="subpacs_id" >
                                        <%if (oEnquiryBean.getSubpacs_id() == null) {%>
                                        <option value="" disabled selected style="display:none;">--Select--</option>
                                        <%if (subPacsFlag.equalsIgnoreCase("N")) {%>
                                            <option value="<%=pacsId%>">Own Pacs</option>
                                            <% }%>
                                        <%
                                            Connection connection = null;
                                            ResultSet rs = null;
                                            Statement statement = null;
                                            connection = DbHandler.getDBConnection();
                                            try {
                                                statement = connection.createStatement();
                                                rs = statement.executeQuery("select m.pacs_id,m.pacs_name from pacs_master m where m.head_pacs_id = '" + pacsId + "' and m.pacs_id <> '" + pacsId + "'");
                                                if(!rs.isBeforeFirst()){%>
                                                <option value="" selected>No Item to Select</option>
                                                <%}
                                                else{
                                                while (rs.next()) {%>
                                        <option value="<%=rs.getString(1)%>"><%=rs.getString(2)%></option>
                                        <%}
                                                }
                                               // statement.close();
                                               // connection.close();
                                            } catch (Exception e) {
                System.out.println("Error occurred during processing.");
            } finally {
                try {
                    if(statement !=null)
                        statement.close();
                    if (connection != null)
                    connection.close();

            } catch (Exception e) {               
               System.out.println("Error Occurred during connection close.");
            }

            }
                                        } else {%>
                                        <option value="<%=blankNull(oEnquiryBean.getSubpacs_id())%>" selected style="display:none;"><%=blankNull(oEnquiryBean.getSubpacs_name())%></option>
                                        <%if (subPacsFlag.equalsIgnoreCase("N")) {%>
                                            <option value="<%=pacsId%>">Own Pacs</option>
                                            <% }%>
                                        <%
                                            Connection connection = null;
                                            ResultSet rs = null;
                                            Statement statement = null;
                                            connection = DbHandler.getDBConnection();
                                            try {
                                                statement = connection.createStatement();
                                                rs = statement.executeQuery("select m.pacs_id,m.pacs_name from pacs_master m where m.head_pacs_id = '" + pacsId + "' and m.pacs_id <> m.head_pacs_id ");
                                                if(!rs.isBeforeFirst()){%>
                                                <option value="" selected>No Item to Select</option>
                                                <%}
                                                else{
                                                while (rs.next()) {%>
                                        <option value="<%=rs.getString(1)%>"><%=rs.getString(2)%></option>
                                        <%}
                                                }
                                                    // statement.close();
                                                    // connection.close();
                                                 } catch (Exception e) {
                System.out.println("Error occurred during processing.");
            } finally {
                try {
                    if(statement !=null)
                        statement.close();
                    if (connection != null)
                    connection.close();

            } catch (Exception e) {               
               System.out.println("Error Occurred during connection close.");
            }

            }
                                             }%>
                                    </select></td>
                            </tr>
                            <tr>
                                <td><br></td>
                            </tr>
                            <tr>
                                 <td style="text-align: right">Old CIF Number:</td>
                                <td><input value="<%=blankNull(oEnquiryBean.getOldCifNo())%>" type="text" style="text-align:right;" name="oldCifNo" onkeypress='return event.charCode >= 48 && event.charCode <= 57' /></td>
                            <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                <td>Old A/C or Link CBS A/C:</td>
                                <td><input value="<%=blankNull(oEnquiryBean.getOldAccNo())%>" type="text" style="text-align:right;" name="oldAccNo" /></td>
                                
                               </tr>
                            <%--<tr>
                                <td>Mode Of Account :</td>
                                <td>
                                    <select id="modOfAcc" name="modOfAcc" >
                                        <%if (oEnquiryBean.getModOfAcc() == null || oEnquiryBean.getModOfAcc() == "") {%>
                                    <option value="" selected >--Select--</option>
                                    <option value="S" >Single Account</option>
                                    <option value="J" >Joint Account</option>
                                    <%} else {%>
                                    <%if (oEnquiryBean.getModOfAcc().equalsIgnoreCase("J")) {%>
                                    <option value="S" >Single Account</option>
                                    <option value="J" selected >Joint Account</option>
                                    <%}%>
                                    <%if (oEnquiryBean.getModOfAcc().equalsIgnoreCase("S")) {%>
                                    <option value="S" selected >Single Account</option>
                                    <option value="J" >Joint Account</option>
                                    <%}}%>

                                    </select>--%>
                                <tr>
                                <td><br></td>
                            </tr>
                            <tr><td style="text-align: right">Customer Name:</td><td><input value="<%=blankNull(oEnquiryBean.getCustomerName())%>" type="text" name="custName"/></td>
                                </tr>
                            <tr>
                            <br>

                            </tr>
                        </table>
                        <br><br>
                     <center>
                        <input type="button" value="Submit" onclick="javascript:accountsubmitform(enquiryForm)">
                        <input type="button" value="Reset" name="reset" onclick="ShowParent();" />
                    </center>
                </div><br><br>
                <input type="hidden" value="DepositAccountEnquiry" name="screenName" />
                <input name="handle_id" id="handle_id" type="hidden" value="" />
                <input name="reportname" id="reportname" type="hidden" value="DEPOSIT_ACCOUNT_ENQUIRY_REPORT" />
                <input type="hidden" name="page" value="<%=request.getAttribute("currentPage")%>">
                <input type="hidden" name="but_type" >
                <input type="hidden" name="totalRecordCount" id="totalRecordCount" value="<%=totalRecordCount%>">
                <input type="hidden" name="recordCount" id="recordCount" value="<%=recordCount%>">
                <input type="hidden" name="noOfRecords" id="noOfRecords" value="<%=noOfRecords%>">
                <input type="hidden" name="accno" id="accno" />
                <input type="hidden" name="reportPath" value=""/>
                <input type="hidden" name="reportName" value=""/>
                <input type="hidden" name="DOWNLOAD" value=""/>

            </form>
<div id="SecondaryCIF" align="Center"></div>
            <%if (displayFlag.equalsIgnoreCase("Y")) {%>
            <center>
                <div id="displayDiv">
                    <div style="overflow:scroll; width: 1000px;">
                        <table border="2" cellspacing="1" cellpadding="1" style="text-align: center ;overflow-y: scroll; font-size: 15px; width: 100%;">
                            <thead class="CSSTableGenerator">
                                <tr>
                                    <td>Pacs ID</td>
                                    <td>Account Number</td>
                                    <td>CBS Account Number</td>
                                    <td>Primary Customer Number</td>
                                    <td>Primary Customer Name</td>
                                    <%--<td>Secondary Customer Number</td>
                                    <td>Secondary Customer Name</td>--%>
                                    <td>Secondary CIF Details</td>
                                    <td>Nominee Name</td>
                                    <td>Product Name</td>
                                    <td>Opening Date</td>
                                    <td>Account Status</td>
                                    <td>Available Balance</td>
                                    <td>Interest Rate</td>
                                    <td>Interest Available</td>
                                    <td>Interest From Date</td>
                                    <td>Interest To Date</td>
                                    <td>Term Value</td>
                                    <td>Maturity Value</td>
                                    <td>Maturity Date</td>
                                    <td>Term From Date</td>
                                    <td>Term To Date</td>
                                    <td>Interest Projected</td>
                                    <td>Capitalized Interest</td>
                                    <td>Installment Amount</td>
                                    <td>No.of Installments Paid</td>
                                    <td>Next Installment Due Date</td>
                                    <td>RD Penal Count</td>
                                    <td>Hold Value</td>
                                    <td>Term Length</td>
                                    <td>Int Repay Method</td>
                                    <td>Old Account Number</td>
                                    <td>Mode Of Account</td>
                                    <td>Account Statement of The Day</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>
                                    <td><%=blankNull(oEnquiryBean.getPacs_id())%></td>
                                    <td><input id="accno<%=i%>" style="border: none; text-align: center" size="20" type="text" readonly value="<%=blankNull(oEnquiryBean.getAccountNo())%>" /></td>
                                    <td><%=blankNull(oEnquiryBean.getLinkAccNo())%></td>
                                    <td><%=blankNull(oEnquiryBean.getCustomerNo())%></td>
                                    <td><%=blankNull(oEnquiryBean.getCustomerName())%></td>

                                    <%--<td><%=blankNA(oEnquiryBean.getCif_no2())%></td>
                                    <td><%=blankNA(oEnquiryBean.getSec_cust_name())%></td>--%>

                                   <%--<td><input id="show_cif" type="button" value="Show Popup" onclick="showSecondary(<%=i%>)"/></td>--%>

                                   <%if( blankNA(oEnquiryBean.getJt_cifNumber1()).equals("NA")  || oEnquiryBean.getJt_cifNumber1()==null){%>
                                   <td>NA</td>
                                   <%}
                                   else {%>
                                   <td><input id="show_cif" type="button" value="Show CIF" onclick="getSecondaryCIFTable('<%=oEnquiryBean.getJt_cifNumber1()%>', '<%=oEnquiryBean.getJt_cifName1()%>',
                                                    '<%=oEnquiryBean.getJt_cifNumber2()%>','<%=oEnquiryBean.getJt_cifName2() %>',
                                                    '<%=oEnquiryBean.getJt_cifNumber3()%>', '<%=oEnquiryBean.getJt_cifName3() %>',
                                                    '<%=oEnquiryBean.getJt_cifNumber4()%>', '<%=oEnquiryBean.getJt_cifName4() %>',
                                                    '<%=oEnquiryBean.getJt_cifNumber5()%>', '<%=oEnquiryBean.getJt_cifName5() %>',
                                                    '<%=oEnquiryBean.getJt_cifNumber6()%>', '<%=oEnquiryBean.getJt_cifName6() %>',
                                                    '<%=oEnquiryBean.getJt_cifNumber7()%>', '<%=oEnquiryBean.getJt_cifName7() %>',
                                                    '<%=oEnquiryBean.getJt_cifNumber8()%>', '<%=oEnquiryBean.getJt_cifName8() %>',
                                                    '<%=oEnquiryBean.getJt_cifNumber9()%>', '<%=oEnquiryBean.getJt_cifName9() %>',
                                                    '<%=oEnquiryBean.getJt_cifNumber10()%>','<%= oEnquiryBean.getJt_cifName10()%>')"/>
                                       </td>
                                   <% } %>

                                    <td><%=blankNA(oEnquiryBean.getNomineeName())%></td>
                                    <td><%=blankNull(oEnquiryBean.getProductNameDisplay())%></td>
                                    <td><%=blankNull(oEnquiryBean.getAccountOpenDate())%></td>
                                    <td><%=blankNull(oEnquiryBean.getCurr_Status())%></td>
                                    <td><%=blankNull(oEnquiryBean.getAvailBalance())%></td>
                                    <td><%=blankNull(oEnquiryBean.getInttrate())%></td>
                                    <td><%=blankNull(oEnquiryBean.getInttAvail())%></td>
                                    <td><%=blankNull(oEnquiryBean.getInttfroDt())%></td>
                                    <td><%=blankNull(oEnquiryBean.getInttToDt())%></td>
                                    <td><%=blankNA(oEnquiryBean.getTermValue())%></td>
                                    <td><%=blankNA(oEnquiryBean.getMaturityValue())%></td>
                                    <td><%=blankNA(oEnquiryBean.getMaturityDt())%></td>
                                    <td><%=blankNA(oEnquiryBean.getTerm_from_date())%></td>
                                    <td><%=blankNA(oEnquiryBean.getTerm_to_date())%></td>
                                    <td><%=blankNA(oEnquiryBean.getInttProjected())%></td>
                                    <td><%=blankNA(oEnquiryBean.getIntt_capptalized())%></td>
                                    <td><%=blankNA(oEnquiryBean.getInstllAmt())%></td>
                                    <td><%=blankNA(oEnquiryBean.getInstallPaidNo())%></td>
                                    <td><%=blankNA(oEnquiryBean.getInstllDueDate())%></td>
                                    <td><%=blankNA(oEnquiryBean.getPenalCnt())%></td>
                                    <td><%=blankNull(oEnquiryBean.getHoldValue())%></td>
                                    <td><%=blankNull(oEnquiryBean.getTermLen())%></td>
                                    <td><%=blankNull(oEnquiryBean.getIntRepayMethod())%></td>
                                    <td><%=blankNull(oEnquiryBean.getOldAccNo())%></td>
                                    <td><%=blankNull(oEnquiryBean.getModOfAcc())%></td>
                                    <td><input type="button" value="Download" onclick="document.getElementById('accno').value=document.getElementById('accno<%=i%>').value;javascript:dnldReport();"/></td>

                                </tr>

                                <%}%>
                            </tbody>

                        </table>
                    </div>
                    <br><br>

                    <%--For displaying Previous link except for the 1st page --%>

                    <table align="right" colspan="2">
                        <% if (curPage > 1 && flag2 == 2) {%>
                        <td><input type="button"  name="nextPage" value="Previous" onclick="callPrevPage()"><input type="button"  name="nextPage" value="Next" onclick="callNextPage()">
                            <% }%>
                            <% if (flag2 == 2) {%>

                            <% if (curPage == 1) {%>
                        <td><input type="button"  name="nextPage" value="Next" onclick="callNextPage()">
                            <% }
                                }%>

                    </table><br><br>

                    <input type="button" value="Export Result" onclick="javascript:excelDownload()">

                </div>
            </center>
            <%}%>
        </fieldset>

    </body>
</html>
<% 	} catch (Exception e) {
                
            }
%>





