<%--
    Document   : CommonSearchInformationLoanLOV
    Created on : Mar 10, 2016, 2:30:36 AM
    Author     : SUBHAM
   Modified by : PARAMITA
--%>

<%@page import="java.sql.PreparedStatement"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@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"%>


<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Customer Information Search</title>
        <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon"/>
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/ButtonAndText.css"/>
        <script src="${pageContext.request.contextPath}/jquery-ui-1.10.4.custom/development-bundle/jquery-1.10.2.js"></script>
        <script>function min_matdt(){if(opener.document.accCreatForm.mat_dt.value==""){opener.document.accCreatForm.mat_dt.value=document.getElementById('mat_dt').value;return;}if(opener.document.accCreatForm.mat_dt.value>document.getElementById('mat_dt').value){opener.document.accCreatForm.mat_dt.value=document.getElementById('mat_dt').value;}}function fixDropDown(passed_value){var firstChar=passed_value.substr(0,4);if(firstChar==="7001"){window.opener.$('#collateralType').prop('disabled',true);window.opener.$('#collateralType').val('K');window.opener.$('#collateralType').change();}if(firstChar==="7010"){window.opener.$('#collateralType').prop('disabled',true);window.opener.$('#collateralType').val('G');window.opener.$('#collateralType').change();}if(firstChar==="7003" || firstChar==="7000"){window.opener.$('#collateralType').prop('disabled',true);window.opener.$('#collateralType').val('D');window.opener.$('#collateralType').change();}}function ShowDivs(Garvalue,SecValue){if(Garvalue=="Yes"&&SecValue=="Yes"){window.opener.$('#guarantorDiv').show();window.opener.$('#securityDiv').show();}else if(Garvalue=="Yes"&&SecValue=="No"){window.opener.$('#guarantorDiv').show();window.opener.$('#securityDiv').hide();}else if(Garvalue=="No"&&SecValue=="Yes"){window.opener.$('#guarantorDiv').hide();window.opener.$('#securityDiv').show();}else if(Garvalue=="No"&&SecValue=="No"){window.opener.$('#guarantorDiv').hide();window.opener.$('#securityDiv').hide();}else{}}</script>
        <%
                    String searchString1 = "";
                    String screenName = "";
                    String searchString2 = "";
                    String lovKey = "";
                    String textIndex = "";
                    String reportType = "";

                    screenName = request.getParameter("screenName");
                    lovKey = request.getParameter("lovKey");
                    String pacsId = session.getAttribute("pacsId").toString();
                    textIndex = request.getParameter("textIndex");
                    String subPacsFlag = (String) session.getAttribute("subPacsFlag");
                    String headPacsId = (String) session.getAttribute("headPacsId").toString();

                    String headerQry = null;

                    if ((screenName.equalsIgnoreCase("LoanAccountCreation.jsp")) && (lovKey.equalsIgnoreCase("CifDetails"))) {

                        //searchString1 = request.getParameter("cifNumber");
                        if(subPacsFlag.equalsIgnoreCase("Y")){
                        pacsId = headPacsId;
                        }
                        headerQry = "select t.cif_no,(t.first_name||nvl2(t.middle_name,' '||t.middle_name,'')||nvl2(t.last_name,' '||t.last_name,'')) name,nvl(t.customer_type,' '),nvl(t.address_1,' '),nvl(t.address_2,' '), nvl(t.address_3,''), nvl(t.GUARDIAN_NAME,'NA') from kyc_hdr t"
                                + " where t.cif_no = '" + searchString1.replace(' ', '%') + "' and t.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = (select head_pacs_id from pacs_master where pacs_id='" + pacsId + "'))  ";


                    } else if ((screenName.equalsIgnoreCase("LoanAccountCreation.jsp")) && (lovKey.equalsIgnoreCase("CustNameDetails"))) {

                       // searchString1 = request.getParameter("customerName");
                        if(subPacsFlag.equalsIgnoreCase("Y")){
                        pacsId = headPacsId;
                        }
                        headerQry = "select t.cif_no,(t.first_name||nvl2(t.middle_name,' '||t.middle_name,'')||nvl2(t.last_name,' '||t.last_name,'')) name,nvl(t.customer_type,' '),nvl(t.address_1,' '),nvl(t.address_2,' '), nvl(t.address_3,'') from kyc_hdr t"
                                + " where upper(t.first_name) like upper('" + searchString1.replace(' ', '%') + "%') and t.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = (select head_pacs_id from pacs_master where pacs_id='" + pacsId + "')) ";


                    }

                    else if ((screenName.equalsIgnoreCase("LoanAccountCreation.jsp")) && (lovKey.equalsIgnoreCase("productCodeSearch"))) {

                       // searchString1 = request.getParameter("productCodeDetails");
                        if (searchString1.equalsIgnoreCase("")) {
                            headerQry = "select prod_code,prod_desc,int_cat,intt_cat_desc,decode(GUARANTOR,'Y','Yes','N','No'),decode(security,'Y','Yes','N','No') , nvl((select gp.gl_code from gl_product gp where gp.id = gl_id_intt_rcvbl), 'NA') RCVBL_GL, nvl((select gp.gl_code from gl_product gp "
                                        +" where gp.id = gl_id_intt_rcvd), 'NA') RCVBD_GL from loan_product where pacs_id like '%" + pacsId + "#%'";
                        } else {
                            headerQry = "select prod_code,prod_desc,int_cat,intt_cat_desc,decode(GUARANTOR,'Y','Yes','N','No'),decode(security,'Y','Yes','N','No') , nvl((select gp.gl_code from gl_product gp where gp.id = gl_id_intt_rcvbl), 'NA') RCVBL_GL, nvl((select gp.gl_code from gl_product gp "
                                        +" where gp.id = gl_id_intt_rcvd), 'NA') RCVBD_GL from loan_product  where PROD_CODE like '%" + searchString1.substring(0, 4).replace(' ', '%') + "%' and pacs_id like '%" + pacsId + "#%'";
                        }


                    } else if ((screenName.equalsIgnoreCase("LoanDisbursement.jsp")) && (lovKey.equalsIgnoreCase("LoanAcctSearch"))) {

                        //searchString1 = request.getParameter("loanAcc");

                        headerQry = "select h.key_1,(t.first_name||nvl2(t.middle_name,' '||t.middle_name,'')||nvl2(t.last_name,' '||t.last_name,'')) name,p.prod_desc,h.appl_amt,p.intt_cat_desc from loan_account h,kyc_hdr t,loan_product p where h.customer_no = t.cif_no and substr(h.GL_CLASS_CODE,9,2)='23' and  h.loan_prod_id = p.id and h.pacs_id = '" + pacsId + "' and (h.key_1 like '%" + searchString1.replace(' ', '%') + "%' or upper(t.first_name) like upper('" + searchString1.replace(' ', '%') + "%'))";

                    }
                    else if ((screenName.equalsIgnoreCase("LoanModify.jsp")) && (lovKey.equalsIgnoreCase("LoanAcctSearch"))) {

                        //searchString1 = request.getParameter("loanAcc");

                        headerQry = "select h.key_1,(t.first_name||nvl2(t.middle_name,' '||t.middle_name,'')||nvl2(t.last_name,' '||t.last_name,'')) name,p.prod_desc,h.sanction_amt,p.intt_cat_desc from loan_account h,kyc_hdr t,loan_product p where h.customer_no = t.cif_no and substr(h.GL_CLASS_CODE,9,2)='23' and h.loan_prod_id = p.id and h.pacs_id = '" + pacsId + "' and h.key_1 like '%" + searchString1.replace(' ', '%') + "%'  union all select h.key_1,(t.first_name || nvl2(t.middle_name, ' ' || t.middle_name, '') || nvl2(t.last_name, ' ' || t.last_name, '')) name , p.prod_desc,h.sanction_amt,p.intt_cat_desc from dep_account h, kyc_hdr t, dep_product p  where h.customer_no = t.cif_no  and p.prod_code='6001' and substr(h.GL_CLASS_CODE,9,2)='23' and h.dep_prod_id = p.id and h.pacs_id = '" + pacsId + "' and h.key_1 like '%" + searchString1.replace(' ', '%') + "%'";

                    }
                    else if ((screenName.equalsIgnoreCase("LoanRepayment.jsp")) && (lovKey.equalsIgnoreCase("LoanAcctSearch"))) {

                       // searchString1 = request.getParameter("loanAcc");

                        headerQry = "select h.key_1,(t.first_name||nvl2(t.middle_name,' '||t.middle_name,'')||nvl2(t.last_name,' '||t.last_name,'')) name,p.prod_desc,h.sanction_amt,h.term,p.intt_cat_desc, to_char(h.DUE_DT,'YYYY/MM/DD'),(select count(*) from loan_repay_schedule l where l.accno= h.key_1) from loan_account h,kyc_hdr t,loan_product p where h.customer_no = t.cif_no and substr(h.GL_CLASS_CODE,9,2)='23' and h.loan_prod_id = p.id and p.loan_type='E' and h.pacs_id = '" + pacsId + "' and (h.key_1 like '%" + searchString1.replace(' ', '%') + "%' or upper(t.first_name) like upper('" + searchString1.replace(' ', '%') + "%'))";

                    }  else if ((screenName.equalsIgnoreCase("LoanTransactionOperation.jsp")) && (lovKey.equalsIgnoreCase("LoanAcctSearchfor_Transaction"))) {

                       // searchString1 = request.getParameter("accNo");

                        if(subPacsFlag.equalsIgnoreCase("Y")){
                        pacsId = headPacsId;
                        }

                        headerQry = "select h.key_1,(t.first_name||nvl2(t.middle_name,' '||t.middle_name,'')||nvl2(t.last_name,' '||t.last_name,'')) name,p.prod_desc,h.SANCTION_AMT,p.intt_cat_desc,p.prod_code,h.customer_no,(select count(m.member_id) from basic_info b, member_information m where b.shg_id = m.shg_id and b.cif = t.cif_no) memberCount from loan_account h,kyc_hdr t,loan_product p where h.customer_no = t.cif_no and substr(h.GL_CLASS_CODE,9,2)='23' and h.loan_prod_id = p.id and h.curr_status in ('01','02') and h.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = '" + pacsId + "') and (h.key_1 like '%" + searchString1 + "%' or upper(t.first_name) like upper('" + searchString1 + "%'))";

                    } else if ((screenName.equalsIgnoreCase("LoanInquiry.jsp")) && (lovKey.equalsIgnoreCase("CifDetails"))) {

                       // searchString1 = request.getParameter("cifNumber");
                        if(subPacsFlag.equalsIgnoreCase("Y")){
                        pacsId = headPacsId;
                        }

                        headerQry = "select t.cif_no,(t.first_name||nvl2(t.middle_name,' '||t.middle_name,'')||nvl2(t.last_name,' '||t.last_name,'')) name,nvl(t.customer_type,' '),nvl(t.address_1,' '),nvl(t.address_2,' '), nvl(t.address_3,'') from kyc_hdr t"
                                + " where (t.cif_no like '%" + searchString1.replace(' ', '%') + "%' or upper(t.first_name) like upper('" + searchString1 + "%')) and t.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = '" + pacsId + "')   ";


                    } else if ((screenName.equalsIgnoreCase("RepayLoan.jsp")) && (lovKey.equalsIgnoreCase("LoanAcctSearch"))) {

                       // searchString1 = request.getParameter("loanAcc");
                        searchString2 = request.getParameter("repayType");

                        if(subPacsFlag.equalsIgnoreCase("Y") && searchString2.equalsIgnoreCase("R")){
                        pacsId = headPacsId;
                        }

                        if(searchString2.equalsIgnoreCase("R"))
                        headerQry = "select la.key_1,(k.first_name||nvl2(k.middle_name,' '||k.middle_name,'')||nvl2(k.last_name,' '||k.last_name,'')) name,la.sanction_amt,to_char(la.sanc_dt,'Mon DD, YYYY'),nvl(to_char(la.lst_txn_dt,'Mon DD, YYYY'), 'NA'),la.prin_outst,(la.intt_outst + la.penal_intt_outst + la.npa_intt_outst),(abs(la.prin_outst) + (abs(la.intt_outst) + abs(la.penal_intt_outst) + abs(la.npa_intt_outst)))*-1,nvl(to_char(la.emi), 'NA'),l.PROD_CODE,l.PROD_DESC,l.INT_CAT,l.intt_cat_desc,k.guardian_name,la.customer_no,(select count(m.member_id)from basic_info b, member_information m where b.shg_id = m.shg_id and b.cif = k.cif_no) memberCount from loan_account la, kyc_hdr k ,loan_product l where la.customer_no = k.cif_no and curr_status in ('02','03')  and substr(la.GL_CLASS_CODE,9,2)='23' and l.id=la.loan_prod_id and la.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = '" + pacsId + "')  and (la.key_1 like '%" + searchString1 + "%' or upper(k.first_name) like upper('" + searchString1 + "%') or la.old_accno='" + searchString1 + "')";
                        else if(searchString2.equalsIgnoreCase("C"))
                            headerQry = "select la.key_1,(k.first_name||nvl2(k.middle_name,' '||k.middle_name,'')||nvl2(k.last_name,' '||k.last_name,'')) name,la.sanction_amt,to_char(la.sanc_dt,'Mon DD, YYYY'),nvl(to_char(la.lst_txn_dt,'Mon DD, YYYY'), 'NA'),la.prin_outst,(la.intt_outst + la.penal_intt_outst + la.npa_intt_outst + round(nvl(la.intt_accr, 0)) + round(nvl(la.penal_intt_accr, 0)) + round(nvl(la.npa_intt_accr, 0))),round((abs(la.prin_outst) + (abs(la.intt_outst) + abs(la.penal_intt_outst) + abs(la.npa_intt_outst)) + abs(round(nvl(la.intt_accr, 0)) + round(nvl(la.penal_intt_accr, 0)) + round(nvl(la.npa_intt_accr, 0))))),nvl(to_char(la.emi), 'NA'),l.PROD_CODE,l.PROD_DESC,l.INT_CAT,l.intt_cat_desc,k.guardian_name,la.customer_no,(select count(m.member_id)from basic_info b, member_information m where b.shg_id = m.shg_id and b.cif = k.cif_no) memberCount from loan_account la, kyc_hdr k ,loan_product l where la.customer_no = k.cif_no and curr_status in ('02','03')  and substr(la.GL_CLASS_CODE,9,2)='23' and l.id=la.loan_prod_id and la.pacs_id = '" + pacsId + "'  and (la.key_1 like '%" + searchString1 + "%' or upper(k.first_name) like upper('" + searchString1 + "%') or la.old_accno='" + searchString1 + "')";
                         else
                             headerQry = "select * from loan_account where 1=2";


                    } 
             //Added by P.Pahari on 25th April,2024
                    else if ((screenName.equalsIgnoreCase("DepositMiscellaneousOperation.jsp")) && (lovKey.equalsIgnoreCase("LonAccLOB"))) {

                       // searchString1 = request.getParameter("loanAccSearch");
                        if(subPacsFlag.equalsIgnoreCase("Y")){
                        pacsId = headPacsId;
                        }

                        headerQry = "select h.key_1,(t.first_name||nvl2(t.middle_name,' '||t.middle_name,'')||nvl2(t.last_name,' '||t.last_name,'')) name,p.prod_desc,h.SANCTION_AMT,p.intt_cat_desc,p.prod_code,h.customer_no,(select count(m.member_id) from basic_info b, member_information m where b.shg_id = m.shg_id and b.cif = t.cif_no) memberCount from loan_account h,kyc_hdr t,loan_product p where h.customer_no = t.cif_no and substr(h.GL_CLASS_CODE,9,2)='23' and h.loan_prod_id = p.id and h.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = '" + pacsId + "') and (h.key_1 like '%" + searchString1 + "%' or upper(t.first_name) like upper('" + searchString1 + "%'))";
            }
                    else if ((screenName.equalsIgnoreCase("RepayLoan.jsp")) && (lovKey.equalsIgnoreCase("transferAccSrch"))) {
                    
                      //  searchString1 = request.getParameter("loanAcc");
                        if(subPacsFlag.equalsIgnoreCase("Y")){
                        pacsId = headPacsId;
                        }

                        headerQry = "select d.customer_no,d.key_1,(h.first_name||nvl2(h.middle_name,' '||h.middle_name,'')||nvl2(h.last_name,' '||h.last_name,'')) Customer_Name,p.prod_code,p.prod_desc,p.int_cat,p.intt_cat_desc,d.avail_bal from dep_account d,dep_product p,kyc_hdr h where d.dep_prod_id =p.id and substr(d.GL_CLASS_CODE,9,2)='14' and d.curr_status not in ('C','S') and d.customer_no = h.cif_no and p.prod_code in ('1101','1102') and d.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = '" + pacsId + "') and (d.customer_no in (select la.customer_no from loan_account la where la.key_1 = '" + searchString1 + "') or d.cif_no2 in (select la.customer_no from loan_account la where la.key_1 = '" + searchString1 + "') )";


                    } else if ((screenName.equalsIgnoreCase("LoanTransactionOperation.jsp")) && (lovKey.equalsIgnoreCase("SavingsAccSearchTransfer"))) {

                       // searchString1 = request.getParameter("accNo");
                        if(subPacsFlag.equalsIgnoreCase("Y")){
                        pacsId = headPacsId;
                        }
                        headerQry = "select t.key_1,(k.first_name||nvl2(k.middle_name,' '||k.middle_name,'')||nvl2(k.last_name,' '||k.last_name,'')),t.customer_no,p.prod_code,p.prod_desc"
                                + " from dep_account t,kyc_hdr k,dep_product p where k.cif_no=t.customer_no and t.dep_prod_id = p.id and p.prod_code in ('1101','1102') and substr(p.int_cat,1,1) = '1' and substr(t.GL_CLASS_CODE,9,2)='14'  and (t.customer_no = (select customer_no from loan_account where key_1 = '" + searchString1 + "') or t.cif_no2 = (select customer_no from loan_account where key_1 = '" + searchString1 + "')) and t.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = '" + pacsId + "')  and t.curr_status not in ('C','S')  ";

                    } else if (screenName.equalsIgnoreCase("LoanProductCreation.jsp") && (lovKey.equalsIgnoreCase("ParameterPdAmend"))) {

                        //searchString1 = request.getParameter("productcodeSearch");
                        //searchString2 = request.getParameter("intcatSearch");

                        if (searchString1.equalsIgnoreCase("") && searchString2.equalsIgnoreCase("")) {
                            headerQry = "select dp.prod_code,dp.prod_desc,dp.int_cat,dp.intt_cat_desc from loan_product dp";
                        } else if (searchString1.equalsIgnoreCase("") && !searchString2.equalsIgnoreCase("")) {
                            headerQry = "select dp.prod_code,dp.prod_desc,dp.int_cat,dp.intt_cat_desc from loan_product dp where dp.int_cat like '%" + searchString2.replace(' ', '%') + "%'";
                        } else if (!searchString1.equalsIgnoreCase("") && searchString2.equalsIgnoreCase("")) {
                            headerQry = "select dp.prod_code,dp.prod_desc,dp.int_cat,dp.intt_cat_desc from loan_product dp where dp.prod_code like '%" + searchString1.replace(' ', '%') + "%'";
                        } else {
                            headerQry = "select dp.prod_code,dp.prod_desc,dp.int_cat,dp.intt_cat_desc from loan_product dp where dp.prod_code like '%" + searchString1.replace(' ', '%') + "%' and dp.int_cat like '%" + searchString2.replace(' ', '%') + "%'";
                        }
                    } else if ((screenName.equalsIgnoreCase("mark_unmark_npa_loan.jsp")) && (lovKey.equalsIgnoreCase("loanAccount"))) {

                       // searchString1 = request.getParameter("accountNumber");

                        headerQry = "select t.key_1,(k.first_name||nvl2(k.middle_name,' '||k.middle_name,'')||nvl2(k.last_name,' '||k.last_name,'')),t.customer_no  "
                                + " from loan_account t,kyc_hdr k where k.cif_no=t.customer_no and substr(t.GL_CLASS_CODE,9,2)='23'  and t.key_1 like '%" + searchString1.replace(' ', '%') + "%' and t.pacs_id= '" + pacsId + "'   ";

                    }else if ((screenName.equalsIgnoreCase("LoanAccountCreation.jsp")) && (lovKey.equalsIgnoreCase("Account"))) {

                        //searchString1 = request.getParameter("dep_acc_no");
                        //searchString2 = request.getParameter("cifNumber");
                        if (subPacsFlag.equalsIgnoreCase("Y")) {
                            pacsId = headPacsId;
                        }

                        headerQry = " select t.key_1, (k.first_name || nvl2(k.middle_name, ' ' || k.middle_name, '') ||nvl2(k.last_name, ' ' || k.last_name, '')) as Customer_Name, t.customer_no, p.prod_code, p.prod_desc, p.int_cat, p.intt_cat_desc, t.avail_bal, to_char(t.mat_dt,'DD-MON-YYYY') from dep_account t, kyc_hdr k, dep_product p where k.cif_no = t.customer_no and t.dep_prod_id = p.id and substr(t.GL_CLASS_CODE,9,2)='14' and substr(p.prod_code,1,1) in ('2','3')  and t.curr_status <>'C' and t.customer_no like '%" + searchString2.replace(' ', '%') + "%' and t.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = '" + pacsId + "') order by t.mat_dt";

                    }else if (screenName.equalsIgnoreCase("LoanProductCreation.jsp") && (lovKey.equalsIgnoreCase("glCodeInttPAYABLESearchLOVKey"))) {

                        //searchString1 = request.getParameter("acc_gl_to_cash");

                        headerQry = "select gl_code,gl_name,id from gl_product";
                    } else if (screenName.equalsIgnoreCase("LoanProductCreation.jsp") && (lovKey.equalsIgnoreCase("glCodeInttPAYABLESearchLOVKeyAmend"))) {

                        //searchString1 = request.getParameter("acc_gl_to_cash");

                        headerQry = "select gl_code,gl_name,id from gl_product";
                    } else if (screenName.equalsIgnoreCase("LoanProductCreation.jsp") && (lovKey.equalsIgnoreCase("glCodeInttPAIDSearchLOVKey"))) {

                        //searchString1 = request.getParameter("acc_gl_to_cash");

                        headerQry = "select gl_code,gl_name,id from gl_product";
                    } else if (screenName.equalsIgnoreCase("LoanProductCreation.jsp") && (lovKey.equalsIgnoreCase("glCodeInttPAIDSearchLOVKeyAmend"))) {

                        //searchString1 = request.getParameter("acc_gl_to_cash");

                        headerQry = "select gl_code,gl_name,id from gl_product";
                    } else if ((screenName.equalsIgnoreCase("RepayLoan.jsp")) && (lovKey.equalsIgnoreCase("glAccSrch"))) {

                       // searchString1 = request.getParameter("glAcc");

                        headerQry = "select ga.key_1, ga.ledger_name,gp.gl_code,gp.id,gp.gl_name from gl_account ga, gl_product gp where ga.gl_prod_id=gp.id  and gp.id <> '201611000001184' and ga.pacs_id= '" + pacsId + "' and (gp.id like '%" + searchString1.replace(' ', '%') + "%' or gp.gl_name like upper('%" + searchString1.replace(' ', '%') + "%') or ga.key_1 like '%" + searchString1.replace(' ', '%') + "%') ";

                    }else if ((screenName.equalsIgnoreCase("LoanTransactionOperation.jsp")) && (lovKey.equalsIgnoreCase("loanShgMember"))) {

                       // searchString1 = request.getParameter("accNo");
                        if (subPacsFlag.equalsIgnoreCase("Y")) {
                            pacsId = headPacsId;
                        }

                        headerQry = "select m.member_id,m.member_name from member_information m,basic_info b,kyc_hdr k where b.shg_id=m.shg_id and k.cif_no=b.cif and k.cif_no like '%" + searchString1 + "%' and k.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id in (select head_pacs_id from pacs_master where pacs_id='" + pacsId + "'))   ";


                    }

                    else if ((screenName.equalsIgnoreCase("RepayLoan.jsp")) && (lovKey.equalsIgnoreCase("loanShgMember"))) {

                       // searchString1 = request.getParameter("accNo");
                        if (subPacsFlag.equalsIgnoreCase("Y")) {
                            pacsId = headPacsId;
                        }

                        headerQry = "select m.member_id,m.member_name from member_information m,basic_info b,kyc_hdr k where b.shg_id=m.shg_id and k.cif_no=b.cif and k.cif_no like '%" + searchString1 + "%' and k.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id in (select head_pacs_id from pacs_master where pacs_id='" + pacsId + "'))   ";
                    }

                    else if ((screenName.equalsIgnoreCase("LoanAccountCreationReadOnly.jsp")) && (lovKey.equalsIgnoreCase("view_collateral"))) {

                       // searchString1 = request.getParameter("refno");
                        headerQry = "select n.ref_no,to_char(n.open_dt,'DD-MON-YYYY'),to_char(n.exp_dt,'DD-MON-YYYY'),n.amt from nsc_collateral n where n.q_no='" + searchString1 + "' and n.status='P'";

                    } else if ((screenName.equalsIgnoreCase("LoanAccountCreationReadOnly.jsp")) && (lovKey.equalsIgnoreCase("view_collateral_Gold"))) {

                       // searchString1 = request.getParameter("refno");
                        headerQry = "select n.bond_no,n.gross_weight,n.net_weight from gold_COLLATERAL n where n.q_no='" + searchString1 + "' and n.status='P' ";

                    } else if ((screenName.equalsIgnoreCase("RemoveLien.jsp")) && (lovKey.equalsIgnoreCase("view_Gold"))) {

                       // searchString1 = request.getParameter("acc");
                        headerQry = "select n.bond_no,n.gross_weight,n.net_weight from gold_COLLATERAL n where n.acc_no='" + searchString1 + "' and n.status='A' ";

                    } else if ((screenName.equalsIgnoreCase("amendInterest.jsp")) && (lovKey.equalsIgnoreCase("AccSrch"))) {
                       // searchString1 = request.getParameter("Acc");

                        headerQry = " select d.key_1,(select p.prod_name from dep_product p where p.id=d.dep_prod_id) prod_name, "
                                    +" (select trim(r.first_name) || ' ' || trim(r.middle_name) || ' ' || trim(r.last_name) "
                                    +" from kyc_hdr r where r.cif_no = d.customer_no) cust_name, d.limit, d.avail_bal, d.prin_outst, "
                                    +" d.intt_outst cur_int, d.penal_intt_outst penal_int , d.npa_intt_outst npa_int,(d.intt_outst + d.penal_intt_outst + d.npa_intt_outst) tot_int from dep_account d "
                                    +" where d.pacs_id = '" + pacsId + "' and d.dep_prod_id in (select p.id from dep_product p "
                                    +" where p.prod_code ='6001' and p.int_method = 'S') and substr(d.GL_CLASS_CODE,9,2)='23' and d.curr_status = 'O' and d.key_1 like '%" + searchString1 + "%'"
                                    +" union all "
                                    +" select l.key_1, (select p.prod_name from loan_product p where p.id=l.loan_prod_id) prod_name, "
                                    +" (select trim(r.first_name) || ' ' || trim(r.middle_name) || ' ' || trim(r.last_name) "
                                    +" from kyc_hdr r where r.cif_no = l.customer_no) cust_name, l.sanction_amt, l.outst_bal, l.prin_outst, "
                                    +" l.intt_outst cur_int , l.penal_intt_outst penal_int , l.npa_intt_outst npa_int, (l.intt_outst + l.penal_intt_outst + l.npa_intt_outst) tot_int from loan_account l "
                                    +" where l.pacs_id = '" + pacsId + "' and substr(l.GL_CLASS_CODE,9,2)='23' and l.loan_prod_id in "
                                    +" (select p.id from loan_product p where p.int_method in ('S','C')) and l.curr_status != '04' and l.key_1 like '%" + searchString1 + "%'";

                    }

                    else if ((screenName.equalsIgnoreCase("ForceDebitCapitalisation.jsp")) && (lovKey.equalsIgnoreCase("AccSrch"))) {                        
                       // searchString1 = request.getParameter("Acc");

                        headerQry = " select l.key_1, (select p.prod_name from loan_product p where p.id=l.loan_prod_id) prod_name, "
                                    +" (select trim(r.first_name) || ' ' || trim(r.middle_name) || ' ' || trim(r.last_name) "
                                    +" from kyc_hdr r where r.cif_no = l.customer_no) cust_name, l.sanction_amt, l.outst_bal, l.prin_outst, "
                                    +" l.intt_outst cur_int , l.penal_intt_outst penal_int , l.npa_intt_outst npa_int, (l.intt_outst + l.penal_intt_outst + l.npa_intt_outst) tot_int, "
                                    +" (nvl(l.intt_accr,0)+nvl(l.penal_intt_accr,0)+nvl(l.npa_intt_accr,0) ) accrd_int from loan_account l "
                                    +" where l.pacs_id = '" + pacsId + "' and l.loan_prod_id in "
                                    +" (select p.id from loan_product p where p.int_method = 'C') and substr(l.GL_CLASS_CODE,9,2)='23' and l.curr_status != '04' and l.key_1 like '%" + searchString1 + "%'";

                    }
                    else if ((screenName.equalsIgnoreCase("AccountStatement_Report.jsp")) && (lovKey.equalsIgnoreCase("searchReport"))) {

                       // searchString1 = request.getParameter("accno");
                        reportType = request.getParameter("reportType");

                        if (reportType.equalsIgnoreCase("DEP")) {
                            headerQry = " select da.key_1 as account_no, dp.prod_desc, (CASE WHEN da.cif_no2 = '' or da.cif_no2 is null THEN kh.first_name || ' ' || kh.middle_name || ' ' || kh.last_name ELSE (select kh.first_name || ' ' || kh.middle_name || ' ' || kh.last_name || ' && ' || khh.first_name || ' ' || khh.middle_name || ' ' || khh.last_name "
                                        +" from kyc_hdr khh where khh.cif_no = da.cif_no2) END) as cust_name, kh.cif_no from dep_account da, kyc_hdr kh, pacs_master pm, dep_product dp where da.customer_no = kh.cif_no and da.pacs_id = pm.pacs_id and da.dep_prod_id = dp.id and dp.prod_code<>'6001' and substr(da.GL_CLASS_CODE,9,2) in ('14','11') and (da.key_1 like '%" + searchString1.replace(' ', '%') + "%' or da.link_accno like upper('%" + searchString1.replace(' ', '%') + "%')) and da.pacs_id = '"+ pacsId +"' ";
                        } else if (reportType.equalsIgnoreCase("KCC")) {
                            headerQry = " select da.key_1 as account_no, dp.prod_desc, (CASE WHEN da.cif_no2 = '' or da.cif_no2 is null THEN kh.first_name || ' ' || kh.middle_name || ' ' || kh.last_name ELSE (select kh.first_name || ' ' || kh.middle_name || ' ' || kh.last_name || ' && ' || khh.first_name || ' ' || khh.middle_name || ' ' || khh.last_name "
                                        +" from kyc_hdr khh where khh.cif_no = da.cif_no2) END) as cust_name, kh.cif_no from dep_account da, kyc_hdr kh, pacs_master pm, dep_product dp where da.customer_no = kh.cif_no and da.pacs_id = pm.pacs_id and da.dep_prod_id = dp.id and dp.prod_code='6001' and substr(da.GL_CLASS_CODE,9,2)='23' and da.key_1 like '%" + searchString1.replace(' ', '%') + "%' and da.pacs_id = '"+ pacsId +"' ";
                        } else if (reportType.equalsIgnoreCase("LOAN")) {
                            headerQry = " select da.key_1 as account_no, dp.prod_desc, kh.first_name || ' ' || kh.middle_name || ' ' || kh.last_name cust_name, kh.cif_no from loan_account da, kyc_hdr kh, "
                                        +" pacs_master pm, loan_product dp where da.customer_no = kh.cif_no and da.pacs_id = pm.pacs_id and da.loan_prod_id = dp.id and substr(da.GL_CLASS_CODE,9,2)='23' and da.key_1 like '%" + searchString1.replace(' ', '%') + "%' and da.pacs_id = '" + pacsId + "' ";
                        } else if (reportType.equalsIgnoreCase("GL")) {
                            headerQry = " select da.key_1 as account_no, dp.gl_name, dp.gl_desc, dp.gl_code from gl_account da , pacs_master pm, gl_product dp "
                                        +" where  da.pacs_id = pm.pacs_id and da.gl_prod_id = dp.id and da.key_1 like '%" + searchString1.replace(' ', '%') + "%' and da.pacs_id = '" + pacsId + "' ";
                        }
                    }

                    else if ((screenName.equalsIgnoreCase("KCCForceCapitalisation.jsp")) && (lovKey.equalsIgnoreCase("AccSrch"))) {
                       // searchString1 = request.getParameter("Acc");

                        headerQry = " select l.key_1,(select p.prod_name from dep_product p where p.id = l.dep_prod_id) prod_name, "
                                    +" (select trim(r.first_name) || ' ' || trim(r.middle_name) || ' ' || trim(r.last_name) "
                                    +" from kyc_hdr r where r.cif_no = l.customer_no) cust_name, nvl(l.sanction_amt,0) sanction_amt, "
                                    +" l.prin_outst outst_bal, l.prin_outst, 0 cur_int, 0 penal_int, 0 npa_int, 0 tot_int, "
                                    +" (nvl(l.intt_outst, 0) + nvl(l.penal_intt_outst, 0) + nvl(l.npa_intt_outst, 0)) accrd_int from dep_account l "
                                    +" where l.pacs_id = '" + pacsId + "' and l.dep_prod_id in (select p.id from dep_product p where p.int_method = 'C' and p.prod_code='6001') "
                                    +" and l.curr_status != 'C' and substr(l.GL_CLASS_CODE,9,2)='23' and l.key_1 like '%" + searchString1 + "%'";

                    }

                    else if ((screenName.equalsIgnoreCase("CustomerNetWorth_Report.jsp")) && (lovKey.equalsIgnoreCase("searchReport"))) {

                       // searchString1 = request.getParameter("accno");

                        headerQry = " select kh.cif_no, kh.first_name || ' ' || kh.middle_name || ' ' || kh.last_name as cust_name from  kyc_hdr kh "
                                  + " where  kh.cif_no = '" + searchString1 + "' and kh.pacs_id in (select pacs_id from pacs_master p where p.head_pacs_id=(select head_pacs_id from pacs_master pk where pk.pacs_id='" +pacsId+ "')) ";

                    }

                    Connection conn = DbHandler.getDBConnection();
                    PreparedStatement pstmt = null;

                    ResultSet resultSet = null;
                    String bgColor = null;
                    int flag = 1;

                    try {
                        pstmt = conn.prepareStatement(headerQry);
                        resultSet = pstmt.executeQuery();
                        System.out.println(headerQry);

        %>
    </head>
    <body style="background-image: url('/PacsApplication/img/download.jpg');">
        <form name="commonSearch" action="">


            <% if ((screenName.equalsIgnoreCase("LoanAccountCreation.jsp")) && (lovKey.equalsIgnoreCase("CifDetails"))) {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>CIF Number</b></th><th style="background-color: #99FF99;"><b>Name</b></th><th style="background-color: #99FF99;"><b>Guardian Name</b></th><th style="background-color: #99FF99;"><b>Customer Type</b></th><th style="background-color: #99FF99;"><b>Address1</b></th><th style="background-color: #99FF99;"><b>Address2</b></th><th style="background-color: #99FF99;"><b>Address3</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.accCreatForm.customerName.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.accCreatForm.customerType.value = document.getElementById('z<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerType.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerType.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerType.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerType.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerType.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerType.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>

                </tr>
                <%}%>
            </table>

            <%}else if((screenName.equalsIgnoreCase("LoanTransactionOperation.jsp")) && (lovKey.equalsIgnoreCase("loanShgMember"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Member found! Close this window & Please retry!.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Member ID</b></th><th style="background-color: #99FF99;"><b>Member Name</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.transactionForm.memberName.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.transactionForm.memberId.value= document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.transactionForm.memberName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.transactionForm.memberId.value= document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                </tr>
                <%}}%>
            </table>

            <%}else if((screenName.equalsIgnoreCase("RepayLoan.jsp")) && (lovKey.equalsIgnoreCase("loanShgMember"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Member found! Close this window & Please retry!.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Member ID</b></th><th style="background-color: #99FF99;"><b>Member Name</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.RepayLoan.memberName.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.RepayLoan.memberId.value= document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.RepayLoan.memberName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.RepayLoan.memberId.value= document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                </tr>
                <%}}%>
            </table>


            <%} 
// Added by P.pahari for Loan accouny reset
else if ((screenName.equalsIgnoreCase("DepositMiscellaneousOperation.jsp")) && (lovKey.equalsIgnoreCase("LonAccLOB"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No A/C found! Close this window & Please retry!.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Loan Account No.</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Customer Code</b></th><th style="background-color: #99FF99;"><b>Product Description</b></th><th style="background-color: #99FF99;"><b>Loan Sanctioned Amount</b></th><th style="background-color: #99FF99;"><b>Interest Category Desc</b></th><th style="background-color: #99FF99;"><b>Product Code</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.DepositMiscellaneousForm.loanAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.DepositMiscellaneousForm.loanAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.DepositMiscellaneousForm.loanAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.DepositMiscellaneousForm.loanAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.DepositMiscellaneousForm.loanAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.DepositMiscellaneousForm.loanAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.DepositMiscellaneousForm.loanAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>

                </tr>
                <%}%>
            </table>
            
            <%}
             }else if ((screenName.equalsIgnoreCase("LoanAccountCreation.jsp")) && (lovKey.equalsIgnoreCase("productCodeSearch"))) {%>

            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Product Code</b></th><th style="background-color: #99FF99;"><b>Description</b></th><th style="background-color: #99FF99;"><b>Interest Category</b></th><th style="background-color: #99FF99;"><b>Description</b></th><th style="background-color: #99FF99;"><b>Guarantor Required</b></th><th style="background-color: #99FF99;"><b>Security Required</b></th><th style="background-color: #99FF99;"><b>RCVBL_GL</b></th><th style="background-color: #99FF99;"><b>RCVBD_GL</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.accCreatForm.productCodeDetails.value = document.getElementById('x<%=i%>').innerHTML + ':' + document.getElementById('y<%=i%>').innerHTML;
                    opener.document.accCreatForm.inttCatDetails.value = document.getElementById('z<%=i%>').innerHTML + ':' + document.getElementById('a<%=i%>').innerHTML;
                    opener.document.accCreatForm.productCode.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.accCreatForm.inttCategory.value = document.getElementById('z<%=i%>').innerHTML;
                    opener.document.accCreatForm.guarantorFlag.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.accCreatForm.securityFlag.value = document.getElementById('c<%=i%>').innerHTML;fixDropDown(document.getElementById('x<%=i%>').innerHTML);
                    ShowDivs($(this).parents('tr:first').find('td:nth-child(5)').text(),$(this).parents('tr:first').find('td:nth-child(6)').text());
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.accCreatForm.productCodeDetails.value = document.getElementById('x<%=i%>').innerHTML + ':' + document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.inttCatDetails.value = document.getElementById('z<%=i%>').innerHTML + ':' + document.getElementById('a<%=i%>').innerHTML;
                        opener.document.accCreatForm.productCode.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.inttCategory.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.accCreatForm.guarantorFlag.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.accCreatForm.securityFlag.value = document.getElementById('c<%=i%>').innerHTML;fixDropDown(document.getElementById('x<%=i%>').innerHTML);
                        ShowDivs($(this).parents('tr:first').find('td:nth-child(5)').text(),$(this).parents('tr:first').find('td:nth-child(6)').text());
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.accCreatForm.productCodeDetails.value = document.getElementById('x<%=i%>').innerHTML + ':' + document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.inttCatDetails.value = document.getElementById('z<%=i%>').innerHTML + ':' + document.getElementById('a<%=i%>').innerHTML;
                        opener.document.accCreatForm.productCode.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.inttCategory.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.accCreatForm.guarantorFlag.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.accCreatForm.securityFlag.value = document.getElementById('c<%=i%>').innerHTML;fixDropDown(document.getElementById('x<%=i%>').innerHTML);
                        ShowDivs($(this).parents('tr:first').find('td:nth-child(5)').text(),$(this).parents('tr:first').find('td:nth-child(6)').text());
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.accCreatForm.productCodeDetails.value = document.getElementById('x<%=i%>').innerHTML + ':' + document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.inttCatDetails.value = document.getElementById('z<%=i%>').innerHTML + ':' + document.getElementById('a<%=i%>').innerHTML;
                        opener.document.accCreatForm.productCode.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.inttCategory.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.accCreatForm.guarantorFlag.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.accCreatForm.securityFlag.value = document.getElementById('c<%=i%>').innerHTML;fixDropDown(document.getElementById('x<%=i%>').innerHTML);
                        ShowDivs($(this).parents('tr:first').find('td:nth-child(5)').text(),$(this).parents('tr:first').find('td:nth-child(6)').text());
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.accCreatForm.productCodeDetails.value = document.getElementById('x<%=i%>').innerHTML + ':' + document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.inttCatDetails.value = document.getElementById('z<%=i%>').innerHTML + ':' + document.getElementById('a<%=i%>').innerHTML;
                        opener.document.accCreatForm.productCode.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.inttCategory.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.accCreatForm.guarantorFlag.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.accCreatForm.securityFlag.value = document.getElementById('c<%=i%>').innerHTML;fixDropDown(document.getElementById('x<%=i%>').innerHTML);
                        ShowDivs($(this).parents('tr:first').find('td:nth-child(5)').text(),$(this).parents('tr:first').find('td:nth-child(6)').text());
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.accCreatForm.productCodeDetails.value = document.getElementById('x<%=i%>').innerHTML + ':' + document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.inttCatDetails.value = document.getElementById('z<%=i%>').innerHTML + ':' + document.getElementById('a<%=i%>').innerHTML;
                        opener.document.accCreatForm.productCode.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.inttCategory.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.accCreatForm.guarantorFlag.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.accCreatForm.securityFlag.value = document.getElementById('c<%=i%>').innerHTML;fixDropDown(document.getElementById('x<%=i%>').innerHTML);
                        ShowDivs($(this).parents('tr:first').find('td:nth-child(5)').text(),$(this).parents('tr:first').find('td:nth-child(6)').text());
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.accCreatForm.productCodeDetails.value = document.getElementById('x<%=i%>').innerHTML + ':' + document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.inttCatDetails.value = document.getElementById('z<%=i%>').innerHTML + ':' + document.getElementById('a<%=i%>').innerHTML;
                        opener.document.accCreatForm.productCode.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.inttCategory.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.accCreatForm.guarantorFlag.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.accCreatForm.securityFlag.value = document.getElementById('c<%=i%>').innerHTML;fixDropDown(document.getElementById('x<%=i%>').innerHTML);
                        ShowDivs($(this).parents('tr:first').find('td:nth-child(5)').text(),$(this).parents('tr:first').find('td:nth-child(6)').text());
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='e<%=i%>' onclick="opener.document.accCreatForm.productCodeDetails.value = document.getElementById('x<%=i%>').innerHTML + ':' + document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.inttCatDetails.value = document.getElementById('z<%=i%>').innerHTML + ':' + document.getElementById('a<%=i%>').innerHTML;
                        opener.document.accCreatForm.productCode.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.inttCategory.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.accCreatForm.guarantorFlag.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.accCreatForm.securityFlag.value = document.getElementById('c<%=i%>').innerHTML;fixDropDown(document.getElementById('x<%=i%>').innerHTML);
                        ShowDivs($(this).parents('tr:first').find('td:nth-child(5)').text(),$(this).parents('tr:first').find('td:nth-child(6)').text());
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>

                </tr>
                <%}%>
            </table>

            <%} else if ((screenName.equalsIgnoreCase("LoanDisbursement.jsp")) && (lovKey.equalsIgnoreCase("LoanAcctSearch"))) {%>

            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Loan Account No.</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Product Description</b></th><th style="background-color: #99FF99;"><b>Loan Applied Amount</b></th><th style="background-color: #99FF99;"><b>Interest Category Desc</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.LoanDisburseForm.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.LoanDisburseForm.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.LoanDisburseForm.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.LoanDisburseForm.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.LoanDisburseForm.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>

                </tr>
                <%}%>
            </table>
            <!--Added by bitan for loan interest rate modify-->

            <%} else if ((screenName.equalsIgnoreCase("LoanModify.jsp")) && (lovKey.equalsIgnoreCase("LoanAcctSearch"))) {%>

            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Loan Account No.</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Product Description</b></th><th style="background-color: #99FF99;"><b>Loan Applied Amount</b></th><th style="background-color: #99FF99;"><b>Interest Category Desc</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.loanModifyForm.accountNo.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.loanModifyForm.accountNo.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.loanModifyForm.accountNo.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.loanModifyForm.accountNo.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.loanModifyForm.accountNo.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>

                </tr>
                <%}%>
            </table>

            <%} else if ((screenName.equalsIgnoreCase("LoanRepayment.jsp")) && (lovKey.equalsIgnoreCase("LoanAcctSearch"))) {%>

            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Loan Account No.</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Loan Product Description</b></th><th style="background-color: #99FF99;"><b>Sanctioned Amount</b></th><th style="background-color: #99FF99;"><b>Loan Term</b></th><th style="background-color: #99FF99;"><b>Interest Category Desc</b></th><th style="background-color: #99FF99;"><b>Due Date (YYYY/MM/DD)</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.LoanRepayScheduleForm.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;

                    self.close();opener.document.LoanRepayScheduleForm.sanctionedAmt.value = document.getElementById('a<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.loanTerms.value = document.getElementById('b<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.dueDate.value = document.getElementById('d<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.counter.value = document.getElementById('e<%=i%>').innerHTML;" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.LoanRepayScheduleForm.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;

                        self.close();opener.document.LoanRepayScheduleForm.sanctionedAmt.value = document.getElementById('a<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.loanTerms.value = document.getElementById('b<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.dueDate.value = document.getElementById('d<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.counter.value = document.getElementById('e<%=i%>').innerHTML;" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.LoanRepayScheduleForm.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();opener.document.LoanRepayScheduleForm.sanctionedAmt.value = document.getElementById('a<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.loanTerms.value = document.getElementById('b<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.dueDate.value = document.getElementById('d<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.counter.value = document.getElementById('e<%=i%>').innerHTML;" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.LoanRepayScheduleForm.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();opener.document.LoanRepayScheduleForm.sanctionedAmt.value = document.getElementById('a<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.loanTerms.value = document.getElementById('b<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.dueDate.value = document.getElementById('d<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.counter.value = document.getElementById('e<%=i%>').innerHTML;" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.LoanRepayScheduleForm.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();opener.document.LoanRepayScheduleForm.sanctionedAmt.value = document.getElementById('a<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.loanTerms.value = document.getElementById('b<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.dueDate.value = document.getElementById('d<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.counter.value = document.getElementById('e<%=i%>').innerHTML;" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.LoanRepayScheduleForm.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();opener.document.LoanRepayScheduleForm.sanctionedAmt.value = document.getElementById('a<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.loanTerms.value = document.getElementById('b<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.dueDate.value = document.getElementById('d<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.counter.value = document.getElementById('e<%=i%>').innerHTML;" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.LoanRepayScheduleForm.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();opener.document.LoanRepayScheduleForm.sanctionedAmt.value = document.getElementById('a<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.loanTerms.value = document.getElementById('b<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.dueDate.value = document.getElementById('d<%=i%>').innerHTML;opener.document.LoanRepayScheduleForm.counter.value = document.getElementById('e<%=i%>').innerHTML;" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='e<%=i%>' style=" display: none;"><%=resultSet.getString(8)%></td>

                </tr>
                <%}%>
            </table>

            <%}  else if ((screenName.equalsIgnoreCase("LoanTransactionOperation.jsp")) && (lovKey.equalsIgnoreCase("LoanAcctSearchfor_Transaction"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No A/C found! Close this window & Please retry!.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Loan Account No.</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Customer Code</b></th><th style="background-color: #99FF99;"><b>Product Description</b></th><th style="background-color: #99FF99;"><b>Loan Sanctioned Amount</b></th><th style="background-color: #99FF99;"><b>Interest Category Desc</b></th><th style="background-color: #99FF99;"><b>Product Code</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.transactionForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.transactionForm.product_code.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.transactionForm.cust_no.value = document.getElementById('d<%=i%>').innerHTML;
                    opener.document.transactionForm.member_count.value=<%=resultSet.getString(8)%>;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.transactionForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.transactionForm.product_code.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.transactionForm.cust_no.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.transactionForm.member_count.value=<%=resultSet.getString(8)%>;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.transactionForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.transactionForm.product_code.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.transactionForm.cust_no.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.transactionForm.member_count.value=<%=resultSet.getString(8)%>;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.transactionForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.transactionForm.product_code.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.transactionForm.cust_no.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.transactionForm.member_count.value=<%=resultSet.getString(8)%>;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.transactionForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.transactionForm.product_code.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.transactionForm.cust_no.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.transactionForm.member_count.value=<%=resultSet.getString(8)%>;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.transactionForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.transactionForm.product_code.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.transactionForm.cust_no.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.transactionForm.member_count.value=<%=resultSet.getString(8)%>;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.transactionForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.transactionForm.product_code.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.transactionForm.cust_no.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.transactionForm.member_count.value=<%=resultSet.getString(8)%>;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>

                </tr>
                <%}%>
            </table>

            <%}
             } else if ((screenName.equalsIgnoreCase("LoanAccountCreation.jsp")) && (lovKey.equalsIgnoreCase("CustNameDetails"))) {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>CIF Number</b></th><th style="background-color: #99FF99;"><b>Name</b></th><th style="background-color: #99FF99;"><b>Customer Type</b></th><th style="background-color: #99FF99;"><b>Address1</b></th><th style="background-color: #99FF99;"><b>Address2</b></th><th style="background-color: #99FF99;"><b>Address3</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.accCreatForm.customerName.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.accCreatForm.customerType.value = document.getElementById('z<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerType.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerType.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerType.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerType.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.accCreatForm.customerType.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>

                </tr>
                <%}%>
            </table>
            <%} else if ((screenName.equalsIgnoreCase("LoanInquiry.jsp")) && (lovKey.equalsIgnoreCase("CifDetails"))) {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>CIF Number</b></th><th style="background-color: #99FF99;"><b>Name</b></th><th style="background-color: #99FF99;"><b>Customer Type</b></th><th style="background-color: #99FF99;"><b>Address1</b></th><th style="background-color: #99FF99;"><b>Address2</b></th><th style="background-color: #99FF99;"><b>Address3</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.enquiryForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.enquiryForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                            self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.enquiryForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.enquiryForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.enquiryForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                            self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.enquiryForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>

                </tr>
                <%}%>
            </table>
            <%} else if ((screenName.equalsIgnoreCase("RepayLoan.jsp")) && (lovKey.equalsIgnoreCase("LoanAcctSearch"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No such account found.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Loan Account No.</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Customer Number</b></th><th style="background-color: #99FF99;"><b>Guardian Name</b></th><th style="background-color: #99FF99;"><b>Sanction Amount</b></th><th style="background-color: #99FF99;"><b>Sanction Date</b></th><th style="background-color: #99FF99;"><b>Last Repay Date</b></th><th style="background-color: #99FF99;"><b>Principle Outstanding</b></th><th style="background-color: #99FF99;"><b>Total Interest Outstanding</b></th><th style="background-color: #99FF99;"><b>Outstanding Balance</b></th><th style="background-color: #99FF99;"><b>EMI</b></th><th style="background-color: #99FF99;"><b>Product Details</b></th><th style="background-color: #99FF99;"><b>Interest Detail</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.RepayLoan.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.RepayLoan.custName.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.RepayLoan.sancAmt.value = document.getElementById('z<%=i%>').innerHTML;
                    opener.document.RepayLoan.sancDt.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.RepayLoan.lstRepayDt.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.RepayLoan.oustPrin.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.RepayLoan.oustInt.value = document.getElementById('d<%=i%>').innerHTML;
                    opener.document.RepayLoan.oustBal.value = document.getElementById('e<%=i%>').innerHTML;
                    opener.document.RepayLoan.emi.value = document.getElementById('f<%=i%>').innerHTML;
                    opener.document.RepayLoan.product_code.value=<%=resultSet.getString(10)%>;
                    opener.document.RepayLoan.cust_no.value=document.getElementById('i<%=i%>').innerHTML;
                    opener.document.getElementById('lonDetails').style.display = 'block';
                    opener.document.RepayLoan.member_count.value=<%=resultSet.getString(16)%>;
                    <%if(searchString2.equalsIgnoreCase("C")) {%>opener.document.RepayLoan.repayAmt.value = document.getElementById('e<%=i%>').innerHTML; opener.document.RepayLoan.closeAmt.value = document.getElementById('e<%=i%>').innerHTML;<%}%>
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.RepayLoan.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.RepayLoan.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancAmt.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancDt.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.RepayLoan.lstRepayDt.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustPrin.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustInt.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustBal.value = document.getElementById('e<%=i%>').innerHTML;
                        opener.document.RepayLoan.emi.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.RepayLoan.product_code.value=<%=resultSet.getString(10)%>;
                        opener.document.RepayLoan.cust_no.value=document.getElementById('i<%=i%>').innerHTML;
                        opener.document.getElementById('lonDetails').style.display = 'block';
                        opener.document.RepayLoan.member_count.value=<%=resultSet.getString(16)%>;
                        <%if(searchString2.equalsIgnoreCase("C")) {%>opener.document.RepayLoan.repayAmt.value = document.getElementById('e<%=i%>').innerHTML; opener.document.RepayLoan.closeAmt.value = document.getElementById('e<%=i%>').innerHTML;<%}%>
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='i<%=i%>' onclick="opener.document.RepayLoan.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.RepayLoan.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancAmt.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancDt.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.RepayLoan.lstRepayDt.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustPrin.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustInt.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustBal.value = document.getElementById('e<%=i%>').innerHTML;
                        opener.document.RepayLoan.emi.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.RepayLoan.product_code.value=<%=resultSet.getString(10)%>;
                        opener.document.RepayLoan.cust_no.value=document.getElementById('i<%=i%>').innerHTML;
                        opener.document.RepayLoan.member_count.value=<%=resultSet.getString(16)%>;
                        <%if(searchString2.equalsIgnoreCase("C")) {%>opener.document.RepayLoan.repayAmt.value = document.getElementById('e<%=i%>').innerHTML; opener.document.RepayLoan.closeAmt.value = document.getElementById('e<%=i%>').innerHTML;<%}%>
                        opener.document.getElementById('lonDetails').style.display = 'block';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(15)%></td>
                    <td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.RepayLoan.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.RepayLoan.custName.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.RepayLoan.sancAmt.value = document.getElementById('z<%=i%>').innerHTML;
                    opener.document.RepayLoan.sancDt.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.RepayLoan.lstRepayDt.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.RepayLoan.oustPrin.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.RepayLoan.oustInt.value = document.getElementById('d<%=i%>').innerHTML;
                    opener.document.RepayLoan.oustBal.value = document.getElementById('e<%=i%>').innerHTML;
                    opener.document.RepayLoan.emi.value = document.getElementById('f<%=i%>').innerHTML;
                    opener.document.RepayLoan.product_code.value=<%=resultSet.getString(10)%>;
                    opener.document.RepayLoan.cust_no.value=document.getElementById('i<%=i%>').innerHTML;
                    opener.document.getElementById('lonDetails').style.display = 'block';
                    opener.document.RepayLoan.member_count.value=<%=resultSet.getString(16)%>;
                    <%if(searchString2.equalsIgnoreCase("C")) {%>opener.document.RepayLoan.repayAmt.value = document.getElementById('e<%=i%>').innerHTML; opener.document.RepayLoan.closeAmt.value = document.getElementById('e<%=i%>').innerHTML;<%}%>
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(14)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.RepayLoan.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.RepayLoan.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancAmt.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancDt.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.RepayLoan.lstRepayDt.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustPrin.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustInt.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustBal.value = document.getElementById('e<%=i%>').innerHTML;
                        opener.document.RepayLoan.emi.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.RepayLoan.product_code.value=<%=resultSet.getString(10)%>;
                        opener.document.RepayLoan.cust_no.value=document.getElementById('i<%=i%>').innerHTML;
                        opener.document.RepayLoan.member_count.value=<%=resultSet.getString(16)%>;
                        <%if(searchString2.equalsIgnoreCase("C")) {%>opener.document.RepayLoan.repayAmt.value = document.getElementById('e<%=i%>').innerHTML; opener.document.RepayLoan.closeAmt.value = document.getElementById('e<%=i%>').innerHTML;<%}%>
                        opener.document.getElementById('lonDetails').style.display = 'block';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.RepayLoan.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.RepayLoan.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancAmt.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancDt.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.RepayLoan.lstRepayDt.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustPrin.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustInt.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustBal.value = document.getElementById('e<%=i%>').innerHTML;
                        opener.document.RepayLoan.emi.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.RepayLoan.product_code.value=<%=resultSet.getString(10)%>;
                        opener.document.RepayLoan.member_count.value=<%=resultSet.getString(16)%>;
                        opener.document.RepayLoan.cust_no.value=document.getElementById('i<%=i%>').innerHTML;
                        <%if(searchString2.equalsIgnoreCase("C")) {%>opener.document.RepayLoan.repayAmt.value = document.getElementById('e<%=i%>').innerHTML; opener.document.RepayLoan.closeAmt.value = document.getElementById('e<%=i%>').innerHTML;<%}%>
                        opener.document.getElementById('lonDetails').style.display = 'block';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.RepayLoan.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.RepayLoan.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancAmt.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancDt.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.RepayLoan.lstRepayDt.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustPrin.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustInt.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustBal.value = document.getElementById('e<%=i%>').innerHTML;
                        opener.document.RepayLoan.emi.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.RepayLoan.product_code.value=<%=resultSet.getString(10)%>;
                        opener.document.RepayLoan.member_count.value=<%=resultSet.getString(16)%>;
                        opener.document.RepayLoan.cust_no.value=document.getElementById('i<%=i%>').innerHTML;
                        <%if(searchString2.equalsIgnoreCase("C")) {%>opener.document.RepayLoan.repayAmt.value = document.getElementById('e<%=i%>').innerHTML; opener.document.RepayLoan.closeAmt.value = document.getElementById('e<%=i%>').innerHTML;<%}%>
                        opener.document.getElementById('lonDetails').style.display = 'block';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.RepayLoan.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.RepayLoan.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancAmt.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancDt.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.RepayLoan.lstRepayDt.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustPrin.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustInt.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustBal.value = document.getElementById('e<%=i%>').innerHTML;
                        opener.document.RepayLoan.emi.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.RepayLoan.product_code.value=<%=resultSet.getString(10)%>;
                        opener.document.RepayLoan.cust_no.value=document.getElementById('i<%=i%>').innerHTML;
                        opener.document.RepayLoan.member_count.value=<%=resultSet.getString(16)%>;
                        <%if(searchString2.equalsIgnoreCase("C")) {%>opener.document.RepayLoan.repayAmt.value = document.getElementById('e<%=i%>').innerHTML; opener.document.RepayLoan.closeAmt.value = document.getElementById('e<%=i%>').innerHTML;<%}%>
                        opener.document.getElementById('lonDetails').style.display = 'block';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.RepayLoan.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.RepayLoan.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancAmt.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancDt.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.RepayLoan.lstRepayDt.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustPrin.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustInt.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustBal.value = document.getElementById('e<%=i%>').innerHTML;
                        opener.document.RepayLoan.emi.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.RepayLoan.product_code.value=<%=resultSet.getString(10)%>;
                        opener.document.RepayLoan.cust_no.value=document.getElementById('i<%=i%>').innerHTML;
                        opener.document.RepayLoan.member_count.value=<%=resultSet.getString(16)%>;
                        <%if(searchString2.equalsIgnoreCase("C")) {%>opener.document.RepayLoan.repayAmt.value = document.getElementById('e<%=i%>').innerHTML; opener.document.RepayLoan.closeAmt.value = document.getElementById('e<%=i%>').innerHTML;<%}%>
                        opener.document.getElementById('lonDetails').style.display = 'block';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='e<%=i%>' onclick="opener.document.RepayLoan.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.RepayLoan.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancAmt.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancDt.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.RepayLoan.lstRepayDt.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustPrin.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustInt.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustBal.value = document.getElementById('e<%=i%>').innerHTML;
                        opener.document.RepayLoan.emi.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.RepayLoan.product_code.value=<%=resultSet.getString(10)%>;
                        opener.document.RepayLoan.cust_no.value=document.getElementById('i<%=i%>').innerHTML;
                        opener.document.RepayLoan.member_count.value=<%=resultSet.getString(16)%>;
                        <%if(searchString2.equalsIgnoreCase("C")) {%>opener.document.RepayLoan.repayAmt.value = document.getElementById('e<%=i%>').innerHTML; opener.document.RepayLoan.closeAmt.value = document.getElementById('e<%=i%>').innerHTML;<%}%>
                        opener.document.getElementById('lonDetails').style.display = 'block';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                    <td bgcolor='<%=bgColor%>' id='f<%=i%>' onclick="opener.document.RepayLoan.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.RepayLoan.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancAmt.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancDt.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.RepayLoan.lstRepayDt.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustPrin.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustInt.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustBal.value = document.getElementById('e<%=i%>').innerHTML;
                        opener.document.RepayLoan.emi.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.RepayLoan.product_code.value=<%=resultSet.getString(10)%>;
                        opener.document.RepayLoan.cust_no.value=document.getElementById('i<%=i%>').innerHTML;
                        opener.document.RepayLoan.member_count.value=<%=resultSet.getString(16)%>;
                        <%if(searchString2.equalsIgnoreCase("C")) {%>opener.document.RepayLoan.repayAmt.value = document.getElementById('e<%=i%>').innerHTML; opener.document.RepayLoan.closeAmt.value = document.getElementById('e<%=i%>').innerHTML;<%}%>
                        opener.document.getElementById('lonDetails').style.display = 'block';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(9)%></td>
                    <td bgcolor='<%=bgColor%>' id='g<%=i%>' onclick="opener.document.RepayLoan.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.RepayLoan.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancAmt.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancDt.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.RepayLoan.lstRepayDt.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustPrin.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustInt.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustBal.value = document.getElementById('e<%=i%>').innerHTML;
                        opener.document.RepayLoan.emi.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.RepayLoan.product_code.value=<%=resultSet.getString(10)%>;
                        opener.document.RepayLoan.cust_no.value=document.getElementById('i<%=i%>').innerHTML;
                        opener.document.RepayLoan.member_count.value=<%=resultSet.getString(16)%>;
                        <%if(searchString2.equalsIgnoreCase("C")) {%>opener.document.RepayLoan.repayAmt.value = document.getElementById('e<%=i%>').innerHTML; opener.document.RepayLoan.closeAmt.value = document.getElementById('e<%=i%>').innerHTML;<%}%>
                        opener.document.getElementById('lonDetails').style.display = 'block';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(10)%> : <%=resultSet.getString(11)%></td>
                    <td bgcolor='<%=bgColor%>' id='h<%=i%>' onclick="opener.document.RepayLoan.loanAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.RepayLoan.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancAmt.value = document.getElementById('z<%=i%>').innerHTML;
                        opener.document.RepayLoan.sancDt.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.RepayLoan.lstRepayDt.value = document.getElementById('b<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustPrin.value = document.getElementById('c<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustInt.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.RepayLoan.oustBal.value = document.getElementById('e<%=i%>').innerHTML;
                        opener.document.RepayLoan.emi.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.RepayLoan.product_code.value=<%=resultSet.getString(10)%>;
                        opener.document.RepayLoan.cust_no.value=document.getElementById('i<%=i%>').innerHTML;
                        opener.document.RepayLoan.member_count.value=<%=resultSet.getString(16)%>;
                        <%if(searchString2.equalsIgnoreCase("C")) {%>opener.document.RepayLoan.repayAmt.value = document.getElementById('e<%=i%>').innerHTML; opener.document.RepayLoan.closeAmt.value = document.getElementById('e<%=i%>').innerHTML;<%}%>
                        opener.document.getElementById('lonDetails').style.display = 'block';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(12)%> : <%=resultSet.getString(13)%></td>

                </tr>
                <%}%>
            </table>
            <%}%>

            <%} else if ((screenName.equalsIgnoreCase("RepayLoan.jsp")) && (lovKey.equalsIgnoreCase("transferAccSrch"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No savings account for this CIF found.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Account Number:</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Product Description</b></th><th style="background-color: #99FF99;"><b>Available Balance</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.RepayLoan.transAcc.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.RepayLoan.transAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.RepayLoan.transAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%>:<%=resultSet.getString(6)%>-<%=resultSet.getString(5)%> <%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.RepayLoan.transAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                </tr>
                <%}
                     }%>
            </table>
            <%} else if ((screenName.equalsIgnoreCase("RepayLoan.jsp")) && (lovKey.equalsIgnoreCase("glAccSrch"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No such GL Account found.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Account Number:</b></th><th style="background-color: #99FF99;"><b>Ledger Name</b></th><th style="background-color: #99FF99;"><b>GL Code</b></th><th style="background-color: #99FF99;"><b>GL Name</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.RepayLoan.glAcc.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.RepayLoan.glAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.RepayLoan.glAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.RepayLoan.transAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                </tr>
                <%}
                     }%>
            </table>
            <%} else if ((screenName.equalsIgnoreCase("mark_unmark_npa_loan.jsp")) && (lovKey.equalsIgnoreCase("loanAccount"))) {%>

            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Account No.</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Customer No.</b></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                        <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.npaOperation.accountNumber.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                        <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.npaOperation.accountNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                        <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.npaOperation.accountNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>




                </tr>
                <%}%>
            </table>


            <%} else if ((screenName.equalsIgnoreCase("LoanTransactionOperation.jsp")) && (lovKey.equalsIgnoreCase("SavingsAccSearchTransfer"))) {%>
            <%if (!resultSet.isBeforeFirst()) {%>
            <center><p>No savings a/c found for this customer</p>
                <input type="button" value="Close Window" onclick="self.close();"></center><%} else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Account No.</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Customer No.</b></th><th style="background-color: #99FF99;"><b>Product Type</b></th></tr>
                <%int i = 0;

                    while (resultSet.next()) {

                        i++;

                        if (flag == 1) {
                            flag = 0;
                            bgColor = "#AFC7C7";
                        } else {
                            flag = 1;
                            bgColor = "#95B9C7";
                        }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.transactionForm.transferAcc.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.transactionForm.transferAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.transactionForm.transferAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.transactionForm.transferAcc.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%>:<%=resultSet.getString(5)%></td>

                </tr>
                <%} }%>
            </table>
            <%} else if ((screenName.equalsIgnoreCase("LoanAccountCreation.jsp")) && (lovKey.equalsIgnoreCase("Account"))) {%>
            <%if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Deposit a/c found for this customer</p>
                <input type="button" value="Close Window" onclick="self.close();"></center><%} else {%>
            <table border="2">
      <tr><th style="background-color: #99FF99;"><b>Account No.</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Customer No.</b></th><th style="background-color: #99FF99;"><b>Product Details</b></th><th style="background-color: #99FF99;"><b>Interest Category</b></th><th style="background-color: #99FF99;"><b>Avail Bal</b></th><th style="background-color: #99FF99;"><b>Maturity Date</b></th></tr>                <%int i = 0;

                    while (resultSet.next()) {

                        i++;

                        if (flag == 1) {
                            flag = 0;
                            bgColor = "#AFC7C7";
                        } else {
                            flag = 1;
                            bgColor = "#95B9C7";
                        }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.accCreatForm.dep_acc_no.value = opener.document.accCreatForm.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';

                   opener.document.accCreatForm.currentValuation.value = Number(opener.document.accCreatForm.currentValuation.value) + Number(document.getElementById('c<%=i%>').innerHTML);
                   document.getElementById('mat_dt').value=Date.parse('<%=resultSet.getString(9)%>');min_matdt();
                   self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.accCreatForm.dep_acc_no.value = opener.document.accCreatForm.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';
                         opener.document.accCreatForm.currentValuation.value = Number(opener.document.accCreatForm.currentValuation.value) + Number(document.getElementById('c<%=i%>').innerHTML);
                         document.getElementById('mat_dt').value=Date.parse('<%=resultSet.getString(9)%>');min_matdt();
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.accCreatForm.dep_acc_no.value = opener.document.accCreatForm.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';
                         opener.document.accCreatForm.currentValuation.value = Number(opener.document.accCreatForm.currentValuation.value) + Number(document.getElementById('c<%=i%>').innerHTML);
                         document.getElementById('mat_dt').value=Date.parse('<%=resultSet.getString(9)%>');min_matdt();
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.accCreatForm.dep_acc_no.value = opener.document.accCreatForm.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';
                         opener.document.accCreatForm.currentValuation.value = Number(opener.document.accCreatForm.currentValuation.value) + Number(document.getElementById('c<%=i%>').innerHTML);
                         document.getElementById('mat_dt').value=Date.parse('<%=resultSet.getString(9)%>');min_matdt();
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%>:<%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.accCreatForm.dep_acc_no.value = opener.document.accCreatForm.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';
                         opener.document.accCreatForm.currentValuation.value = Number(opener.document.accCreatForm.currentValuation.value) + Number(document.getElementById('c<%=i%>').innerHTML);
                         document.getElementById('mat_dt').value=Date.parse('<%=resultSet.getString(9)%>');min_matdt();
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%>:<%=resultSet.getString(7)%></td>
                        <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.accCreatForm.dep_acc_no.value = opener.document.accCreatForm.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';
                             opener.document.accCreatForm.currentValuation.value = Number(opener.document.accCreatForm.currentValuation.value) + Number(document.getElementById('c<%=i%>').innerHTML);
                             document.getElementById('mat_dt').value=Date.parse('<%=resultSet.getString(9)%>');min_matdt();
                            self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                     <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.accCreatForm.dep_acc_no.value = opener.document.accCreatForm.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';
                             opener.document.accCreatForm.currentValuation.value = Number(opener.document.accCreatForm.currentValuation.value) + Number(document.getElementById('c<%=i%>').innerHTML);
                             document.getElementById('mat_dt').value=Date.parse('<%=resultSet.getString(9)%>');min_matdt();
                            self.close();" style="cursor:pointer;"><%=resultSet.getString(9)%></td>

                </tr>
                <%}%>
                <input type="hidden" name="mat_dt" id="mat_dt" value=""/>
            </table>

            <%}%>
            <%} else if (screenName.equalsIgnoreCase("LoanProductCreation.jsp") && (lovKey.equalsIgnoreCase("ParameterPdAmend"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Result found! Please try again.</p>
                <input type="button" value="Close Window" onclick="self.close();opener.document.loanProductCreation.productcodeSearch.value ='';opener.document.loanProductCreation.intcatSearch.value ='';">
            </center>

            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Product Code</b></th><th style="background-color: #99FF99;"><b>Product Description</b></th><th style="background-color: #99FF99;"><b>Interest Category</b></th><th style="background-color: #99FF99;"><b>Interest Description</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.loanProductCreation.productcodeSearch.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.loanProductCreation.intcatSearch.value = document.getElementById('z<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.loanProductCreation.productcodeSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.loanProductCreation.intcatSearch.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.loanProductCreation.productcodeSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.loanProductCreation.intcatSearch.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.loanProductCreation.productcodeSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.loanProductCreation.intcatSearch.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                </tr>
                <%}%>
            </table>
            <%}
             }else if (screenName.equalsIgnoreCase("LoanProductCreation.jsp") && (lovKey.equalsIgnoreCase("glCodeInttPAYABLESearchLOVKey"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Result found! Please try again.</p>
                <input type="button" value="Close Window" onclick="">
            </center>

            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>GL Code</b></th><th style="background-color: #99FF99;"><b>GL Description</b></th><th style="display:none"><b>ID</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.loanProductCreation.glCodeInttReceivableShow.value = document.getElementById('x<%=i%>').innerHTML +' : ' + document.getElementById('y<%=i%>').innerHTML;
                    opener.document.loanProductCreation.glCodeInttReceivable.value = document.getElementById('z<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.loanProductCreation.glCodeInttReceivableShow.value = document.getElementById('x<%=i%>').innerHTML +' : ' + document.getElementById('y<%=i%>').innerHTML;
                        opener.document.loanProductCreation.glCodeInttReceivable.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="self.close();" style="display:none"><%=resultSet.getString(3)%></td>
                </tr>
                <%}%>
            </table>
            <%}
             }else if (screenName.equalsIgnoreCase("LoanProductCreation.jsp") && (lovKey.equalsIgnoreCase("glCodeInttPAYABLESearchLOVKeyAmend"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Result found! Please try again.</p>
                <input type="button" value="Close Window" onclick="">
            </center>

            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>GL Code</b></th><th style="background-color: #99FF99;"><b>GL Description</b></th><th style="display:none"><b>ID</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.loanProductCreation.glCodeInttReceivableAmendShow.value = document.getElementById('x<%=i%>').innerHTML +' : ' + document.getElementById('y<%=i%>').innerHTML;
                    opener.document.loanProductCreation.glCodeInttReceivableAmend.value = document.getElementById('z<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.loanProductCreation.glCodeInttReceivableAmendShow.value = document.getElementById('x<%=i%>').innerHTML +' : ' + document.getElementById('y<%=i%>').innerHTML;
                        opener.document.loanProductCreation.glCodeInttReceivableAmend.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="self.close();" style="display:none"><%=resultSet.getString(3)%></td>
                </tr>
                <%}%>
            </table>
            <%}
             }else if (screenName.equalsIgnoreCase("LoanProductCreation.jsp") && (lovKey.equalsIgnoreCase("glCodeInttPAIDSearchLOVKey"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Result found! Please try again.</p>
                <input type="button" value="Close Window" onclick="">
            </center>

            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>GL Code</b></th><th style="background-color: #99FF99;"><b>GL Description</b></th><th style="display:none"><b>ID</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.loanProductCreation.glCodeInttReceivedShow.value = document.getElementById('x<%=i%>').innerHTML +' : ' + document.getElementById('y<%=i%>').innerHTML;
                    opener.document.loanProductCreation.glCodeInttReceived.value = document.getElementById('z<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.loanProductCreation.glCodeInttReceivedShow.value = document.getElementById('x<%=i%>').innerHTML +' : ' + document.getElementById('y<%=i%>').innerHTML;
                        opener.document.loanProductCreation.glCodeInttReceived.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="self.close();" style="display:none"><%=resultSet.getString(3)%></td>
                </tr>
                <%}%>
            </table>
            <%}
             }else if (screenName.equalsIgnoreCase("LoanProductCreation.jsp") && (lovKey.equalsIgnoreCase("glCodeInttPAIDSearchLOVKeyAmend"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Result found! Please try again.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>

            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>GL Code</b></th><th style="background-color: #99FF99;"><b>GL Description</b></th><th style="display:none"><b>ID</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.loanProductCreation.glCodeInttReceivedAmendShow.value = document.getElementById('x<%=i%>').innerHTML +' : ' + document.getElementById('y<%=i%>').innerHTML;
                    opener.document.loanProductCreation.glCodeInttReceivedAmend.value = document.getElementById('z<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.loanProductCreation.glCodeInttReceivedAmendShow.value = document.getElementById('x<%=i%>').innerHTML +' : ' + document.getElementById('y<%=i%>').innerHTML;
                        opener.document.loanProductCreation.glCodeInttReceivedAmend.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="self.close();" style="display:none"><%=resultSet.getString(3)%></td>
                </tr>
                <%}%>
            </table>
            <%}
             }else if (screenName.equalsIgnoreCase("LoanAccountCreationReadOnly.jsp") && (lovKey.equalsIgnoreCase("view_collateral"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Result found! Please try again.</p>
                <input type="button" value="Close Window" onclick="">
            </center>

            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Ref No</b></th><th style="background-color: #99FF99;"><b>Open Date</b></th><th style="background-color: #99FF99;"><b>Expiry Date</b></th><th style="background-color: #99FF99;"><b>Amount</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>'><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>'><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>'><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>'><%=resultSet.getString(4)%></td>
                    
                </tr>
                <%}%>
            </table>
            <center>
                <p><input type="button" value="Close Window" onclick="self.close();"></p>
            </center>
           <%}
             }
             else if (screenName.equalsIgnoreCase("LoanAccountCreationReadOnly.jsp") && (lovKey.equalsIgnoreCase("view_collateral_Gold"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Result found! Please try again.</p>
                <input type="button" value="Close Window" onclick="">
            </center>

            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Bond No</b></th><th style="background-color: #99FF99;"><b>Gross Weight</b></th><th style="background-color: #99FF99;"><b>Net Weight</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>'><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>'><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>'><%=resultSet.getString(3)%></td>
                    
                </tr>
                <%}%>
            </table>
            <center>
                <p><input type="button" value="Close Window" onclick="self.close();"></p>
            </center>
           <%}
             } else if (screenName.equalsIgnoreCase("RemoveLien.jsp") && (lovKey.equalsIgnoreCase("view_Gold"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Result found! Please try again.</p>
                <input type="button" value="Close Window" onclick="">
            </center>

            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Bond No</b></th><th style="background-color: #99FF99;"><b>Gross Weight</b></th><th style="background-color: #99FF99;"><b>Net Weight</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>'><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>'><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>'><%=resultSet.getString(3)%></td>
                    
                </tr>
                <%}%>
            </table>
            <center>
                <p><input type="button" value="Close Window" onclick="self.close();"></p>
            </center>
           <%}
             } else if ((screenName.equalsIgnoreCase("amendInterest.jsp")) && (lovKey.equalsIgnoreCase("AccSrch"))) {%>

            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Account No</b></th><th style="background-color: #99FF99;"><b>Product Name</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Limit</b></th><th style="background-color: #99FF99;"><b>Available Balance</b></th><th style="background-color: #99FF99;"><b>Principle Outstanding</b></th><th style="background-color: #99FF99;"><b>Current Interest</b></th><th style="background-color: #99FF99;"><b>Penal Interest</b></th><th style="background-color: #99FF99;"><b>NPA Interest</b></th><th style="background-color: #99FF99;"><b>Total Interest</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.amendInterest.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.amendInterest.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.amendInterest.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.amendInterest.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.amendInterest.totalInterest.value = document.getElementById('g<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.amendInterest.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.amendInterest.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.amendInterest.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.amendInterest.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.amendInterest.totalInterest.value = document.getElementById('g<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.amendInterest.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.amendInterest.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.amendInterest.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.amendInterest.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.amendInterest.totalInterest.value = document.getElementById('g<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.amendInterest.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.amendInterest.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.amendInterest.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.amendInterest.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.amendInterest.totalInterest.value = document.getElementById('g<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.amendInterest.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.amendInterest.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.amendInterest.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.amendInterest.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.amendInterest.totalInterest.value = document.getElementById('g<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.amendInterest.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.amendInterest.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.amendInterest.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.amendInterest.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.amendInterest.totalInterest.value = document.getElementById('g<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.amendInterest.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.amendInterest.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.amendInterest.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.amendInterest.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.amendInterest.totalInterest.value = document.getElementById('g<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='e<%=i%>' onclick="opener.document.amendInterest.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.amendInterest.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.amendInterest.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.amendInterest.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.amendInterest.totalInterest.value = document.getElementById('g<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                    <td bgcolor='<%=bgColor%>' id='f<%=i%>' onclick="opener.document.amendInterest.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.amendInterest.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.amendInterest.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.amendInterest.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.amendInterest.totalInterest.value = document.getElementById('g<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(9)%></td>
                    <td bgcolor='<%=bgColor%>' id='g<%=i%>' onclick="opener.document.amendInterest.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.amendInterest.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.amendInterest.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.amendInterest.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.amendInterest.totalInterest.value = document.getElementById('g<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(10)%></td>

                </tr>
                <%}%>
            </table>
            <%}
            
            else if ((screenName.equalsIgnoreCase("ForceDebitCapitalisation.jsp")) && (lovKey.equalsIgnoreCase("AccSrch"))) {%>

            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Account No</b></th><th style="background-color: #99FF99;"><b>Product Name</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Sanction Amtt</b></th><th style="background-color: #99FF99;"><b>Outstanding Balance</b></th><th style="background-color: #99FF99;"><b>Principle Outstanding</b></th><th style="background-color: #99FF99;"><b>Current Interest</b></th><th style="background-color: #99FF99;"><b>Penal Interest</b></th><th style="background-color: #99FF99;"><b>NPA Interest</b></th><th style="background-color: #99FF99;"><b>Total Interest</b></th><th style="background-color: #99FF99;"><b>Accr Interest</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.ForceDebitCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.ForceDebitCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.ForceDebitCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.ForceDebitCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.ForceDebitCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.ForceDebitCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.ForceDebitCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='e<%=i%>' onclick="opener.document.ForceDebitCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                    <td bgcolor='<%=bgColor%>' id='f<%=i%>' onclick="opener.document.ForceDebitCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(9)%></td>
                    <td bgcolor='<%=bgColor%>' id='g<%=i%>' onclick="opener.document.ForceDebitCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(10)%></td>
                    <td bgcolor='<%=bgColor%>' id='h<%=i%>' onclick="opener.document.ForceDebitCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.ForceDebitCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.ForceDebitCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(11)%></td>

                </tr>
                <%}%>
            </table>
            <%}

            else if ((screenName.equalsIgnoreCase("KCCForceCapitalisation.jsp")) && (lovKey.equalsIgnoreCase("AccSrch"))) {%>

            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Account No</b></th><th style="background-color: #99FF99;"><b>Product Name</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Sanction Amtt</b></th><th style="background-color: #99FF99;"><b>Outstanding Balance</b></th><th style="background-color: #99FF99;"><b>Principle Outstanding</b></th><th style="background-color: #99FF99;"><b>Current Interest</b></th><th style="background-color: #99FF99;"><b>Penal Interest</b></th><th style="background-color: #99FF99;"><b>NPA Interest</b></th><th style="background-color: #99FF99;"><b>Total Interest</b></th><th style="background-color: #99FF99;"><b>Accr Interest</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.KCCForceCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.KCCForceCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.KCCForceCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.KCCForceCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.KCCForceCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.KCCForceCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.KCCForceCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='e<%=i%>' onclick="opener.document.KCCForceCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                    <td bgcolor='<%=bgColor%>' id='f<%=i%>' onclick="opener.document.KCCForceCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(9)%></td>
                    <td bgcolor='<%=bgColor%>' id='g<%=i%>' onclick="opener.document.KCCForceCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(10)%></td>
                    <td bgcolor='<%=bgColor%>' id='h<%=i%>' onclick="opener.document.KCCForceCapitalisation.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.curInterest.value = document.getElementById('d<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.penalInterest.value = document.getElementById('e<%=i%>').innerHTML;opener.document.KCCForceCapitalisation.npaInterest.value = document.getElementById('f<%=i%>').innerHTML;
                        opener.document.KCCForceCapitalisation.accural.value = document.getElementById('h<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(11)%></td>

                </tr>
                <%}%>
            </table>
            <%}
            else if (screenName.equalsIgnoreCase("AccountStatement_Report.jsp") && (lovKey.equalsIgnoreCase("searchReport"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Result found! Please try again.</p>
                <input type="button" value="Close Window" onclick="">
            </center>

            <%} else {%>
            <table border="2">
                <%if (reportType.equalsIgnoreCase("GL")) {%>
                <tr><th style="background-color: #99FF99;"><b>Account No.</b></th><th style="background-color: #99FF99;"><b>GL Number</b></th><th style="background-color: #99FF99;"><b>GL Desc</b></th><th style="background-color: #99FF99;"><b>GL Code</b></th></tr>
                <%} else {%>
                <tr><th style="background-color: #99FF99;"><b>Account No.</b></th><th style="background-color: #99FF99;"><b>Product Desc</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>CIF NO</b></th></tr>
                <%}%>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
              <% if (reportType.equalsIgnoreCase("GL")) {%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.AccountStatement_Report.accno.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.AccountStatement_Report.accno.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.AccountStatement_Report.accno.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.AccountStatement_Report.accno.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                </tr>
                <%} else {%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.AccountStatement_Report.accno.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.AccountStatement_Report.accno.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.AccountStatement_Report.accno.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.AccountStatement_Report.accno.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                </tr>
                <%}%>
                <%}%>
            </table>          
            <%}
            }
            else if (screenName.equalsIgnoreCase("CustomerNetWorth_Report.jsp") && (lovKey.equalsIgnoreCase("searchReport"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Result found! Please try again.</p>
                <input type="button" value="Close Window" onclick="">
            </center>
            <%} else {%>
            <table border="2">               
                <tr><th style="background-color: #99FF99;"><b>CIF Number</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.CustomerNetWorth_Report.accno.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.CustomerNetWorth_Report.accno.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>                 
                </tr>
                <%}%>
                </table>
      <%}%>
  <%}%>
      
        </form>
    </body>
    <%
                } catch (Exception ex) {
                   // System.out.println(ex);
                } finally {
                    if (resultSet != null) {
                        resultSet.close();
                    }
                    if (pstmt != null) {
                        pstmt.close();
                    }
                    if (conn != null) {
                        conn.close();
                    }
                }
    %>

</html>
