<%--
    Document   : CommonSearchInfoLOVNew
    Created on : Mar 10, 2016, 2:30:36 AM

--%>

<%@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>Common 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>


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

            String blankNA(String s) {
                return (s == null) ? "NA" : s;
            }
        %>
        <%
                    String searchString1 = "";
                    String searchString2= null;
                    String searchString3= null;
                    String screenName = "";
                    String productCode = "";
                    String loanAccount ="";
                    String lovKey = "";
                    String Counter = "";
                    String Option="";
                    String lienType="";
                    String subPacsFlag = (String) session.getAttribute("subPacsFlag");
                    String headPacsId = (String) session.getAttribute("headPacsId").toString();
                    screenName = request.getParameter("screenName");
                    lovKey = request.getParameter("lovKey");
                    String pacsId = session.getAttribute("pacsId").toString();
                    
                    String user = session.getAttribute("user").toString();

                    String headerQry = null;

                   if ((screenName.equalsIgnoreCase("AgentMapping.jsp"))&& (lovKey.equalsIgnoreCase("agntAccount"))) {


                        searchString1 = pacsId;
                        searchString2= user;
                       // searchString3=request.getParameter("customerName");

                        headerQry = "select d.key_1,(select r.first_name || nvl(r.middle_name, ' ') || nvl(r.last_name, ' ') from kyc_hdr r"
                                                        + " where r.cif_no = d.customer_no),d.avail_bal ,'DEPOSIT' accType from dep_account d where  "
                                                        + "  d.dep_prod_id in (select p.id from dds_prod_map p where p.status='ACTIVE' and p.prod_typ='DEP' and p.pacs_id='"+ searchString1+"')"
                                                        + " and d.pacs_id = '" + searchString1 + "' and d.key_1 like '%" + searchString3 + "%' "
                                                        + " union all select l.key_1, (select r.first_name || nvl(r.middle_name, ' ') || nvl(r.last_name, ' ')"
							+ " from kyc_hdr r where r.cif_no = l.customer_no), l.outst_bal,'LOAN' accType from loan_account l "
							+ " where l.loan_prod_id in  (select p.id from dds_prod_map p where p.status='ACTIVE' and p.prod_typ='LOAN' and p.pacs_id='"+ searchString1+"') and substr(l.gl_class_code,9,2)='23' "
							+ " and l.pacs_id = '" + searchString1 + "' and l.key_1 like '%" + searchString3 + "%' order by 1 ";

                        }else if (((screenName.equalsIgnoreCase("AgentMapping.jsp")) || (screenName.equalsIgnoreCase("TotalCashDepositDDS.jsp")) ) && (lovKey.equalsIgnoreCase("agntMap"))) {


                        searchString1 = pacsId;
                        searchString2= user;
                       // searchString3=request.getParameter("agentName");

                        headerQry =  "   select d.login_id,d.login_name , t.limit_amt,(t.limit_amt-t.tot_rem_amt) diff_amt from login_details d,dds_agent_limit t  "
                                    +"   where d.user_role_id ='201603000004020' and d.pacs_id=t.pacs_id and d.pacs_id='"+searchString1+"'"
                                    +"   and t.agent_id=d.login_id and to_char(d.login_id) like '%"+searchString3+"%'";
                        }else if ((screenName.equalsIgnoreCase("AgentMapping.jsp")) && (lovKey.equalsIgnoreCase("limitSetting"))) {


                        searchString1 = pacsId;
                        searchString2= user;
                       // searchString3=request.getParameter("agentName");

                        headerQry = 
                            " select d.login_id,d.login_name, t.limit_amt,(t.limit_amt-t.tot_rem_amt) diff_amt "
                            +" from login_details d,dds_agent_limit t where d.user_role_id ='201603000004020' and d.pacs_id=t.pacs_id and d.pacs_id='"+searchString1+"'"
                            +" and t.agent_id=d.login_id and to_char(d.login_id) like '%"+searchString3+"%'";

                        }
                        else if ((screenName.equalsIgnoreCase("BatchTransaction.jsp")|| (screenName.equalsIgnoreCase("BatchAuthorisation.jsp"))) && (lovKey.equalsIgnoreCase("BatchSearch"))) {


                        searchString1 = pacsId;
                        searchString2= user;
                       /*searchString3=request.getParameter("batchId");*/

                        headerQry = " select s.batch_id batchid, (sum(s.txn_amt) / 2) amt, s.status stat,nvl(to_char(s.txn_dt,'dd-Mon-yyyy'),'NA') "
                                    +" from batch_txn_details s where ";
                                               if ((screenName.equalsIgnoreCase("BatchTransaction.jsp"))) {
                                                   headerQry = headerQry + " s.status in ('ACTIVE','INACTIVE') ";
                                               } else if ((screenName.equalsIgnoreCase("BatchAuthorisation.jsp"))) {
                                                   headerQry = headerQry + " s.status='ACTIVE' ";
                                               }
                                               headerQry = headerQry + " and s.pacs_id='" + searchString1 + "'  and  s.batch_id like '%" + searchString3 + "%'"
                                                       + " group by s.batch_id,s.status,s.txn_dt order by s.txn_dt,s.status desc ";
                        }else if (screenName.equalsIgnoreCase("ChequePosting.jsp")  && (lovKey.equalsIgnoreCase("chqEnq"))) {

                        //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,p.int_cat,p.intt_cat_desc,t.avail_bal,k.photo_path,k.sig_photo "
                                     + " ,nvl((select nvl(kl.id_no,'NA') from kyc_dtl kl where kl.kyc_document_mst_id = '909201600008' and kl.cif_no = t.customer_no),'NA') PAN_ID_NO "
                                     + " from dep_account t,kyc_hdr k,dep_product p, INWARD_CHQ_DETAILS ct where k.cif_no=t.customer_no and ct.key_1=t.key_1 "
                                     + " and ct.status='PENDING' 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.curr_status <>'C' and "
                                     + " (ct.key_1 like '%" + searchString1 + "%' ) and "
                                     + " t.key_1 in (select ci.key_1 from INWARD_CHQ_DETAILS ci where ci.status='PENDING' and ci.key_1 like '%" + searchString1 + "%' ) and t.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = '" + pacsId + "')";

                       //,INWARD_CHQ_DETAILS ci 


                    } else if ((screenName.equalsIgnoreCase("DepositTransferClosure.jsp")) && (lovKey.equalsIgnoreCase("glAccount"))) {

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

                        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.gl_code like '%" + searchString1.replace(' ', '%') + "%' or gp.gl_name like upper('%" + searchString1.replace(' ', '%') + "%') or ga.key_1 like '%" + searchString1.replace(' ', '%') + "%') ";

                    }
                     else if ((screenName.equalsIgnoreCase("InsuranceAddition.jsp")) && (lovKey.equalsIgnoreCase("CifIns"))) {

                      //  searchString1 = request.getParameter("cifNumber");
                      
                        headerQry = "select r.cif_no,(r.first_name||' '||r.middle_name||' '||r.last_name) as custName,r.guardian_name,r.photo_path,r.sig_photo,"
                                   +"NVL((select trim(s.insurance_details) from kyc_ins s where s.cif_no=r.cif_no),'NA') as ins_no,"
                                   +"NVL((select trim(to_char((s.insurance_issu_date),'DD-MON-YYYY')) from kyc_ins s where s.cif_no=r.cif_no),'NA') as ins_issu_dt,"
                                   +"NVL((select trim(s.insurance_company) from kyc_ins s where s.cif_no=r.cif_no),'NA') as ins_cmpny,"
                                   +"NVL((select trim(s.status) from kyc_ins s where s.cif_no=r.cif_no),'NA') as status"
                                   +" from kyc_hdr r where r.pacs_id='"+pacsId+"' "
                                   +" and r.cif_no = '"+searchString1+"' ";

                    }else if ((screenName.equalsIgnoreCase("PrintPassbook.jsp")) && (lovKey.equalsIgnoreCase("accSrch"))) {

                        //searchString1 = request.getParameter("acc");
                        searchString2 = request.getParameter("accType");
                        searchString3 = request.getParameter("accSubType");

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

                        if (searchString2.equalsIgnoreCase("D") && searchString3.equalsIgnoreCase("SB")) {
                            headerQry = "select da.key_1, (k.first_name || ' ' || k.middle_name || ' ' || k.last_name) name, nvl(k.guardian_name,' '), dp.prod_name,k.cif_no from dep_account da, kyc_hdr k, dep_product dp where da.customer_no = k.cif_no and da.dep_prod_id = dp.id and dp.prod_code in ('1101','1017') and substr(dp.int_cat,1,1) = '1' and substr(da.GL_CLASS_CODE,9,2) in ('14','11') and upper(dp.prod_name) not like '%CURRENT%' and (upper(k.first_name) like upper('" + searchString1.replace(' ', '%') + "%') or da.key_1 like '%" + searchString1.replace(' ', '%') + "%' or da.link_accno like '%" + searchString1.replace(' ', '%') + "%' ) and da.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = '" + pacsId + "') ";
                        } else if (searchString2.equalsIgnoreCase("D") && searchString3.equalsIgnoreCase("RD")) {
                            headerQry = "select da.key_1, (k.first_name || ' ' || k.middle_name || ' ' || k.last_name) name, nvl(k.guardian_name,' '), dp.prod_name,k.cif_no from dep_account da, kyc_hdr k, dep_product dp where da.customer_no = k.cif_no and da.dep_prod_id = dp.id and dp.prod_code ='3001' and substr(dp.int_cat,1,1) = '1' and substr(da.GL_CLASS_CODE,9,2)='14' and (upper(k.first_name) like upper('" + searchString1.replace(' ', '%') + "%') or da.key_1 like '%" + searchString1.replace(' ', '%') + "%') and da.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = '" + pacsId + "') ";
                        } else if (searchString2.equalsIgnoreCase("D") && searchString3.equalsIgnoreCase("CR")) {
                            headerQry = "select da.key_1, (k.first_name || ' ' || k.middle_name || ' ' || k.last_name) name, nvl(k.guardian_name,' '), dp.prod_name,k.cif_no from dep_account da, kyc_hdr k, dep_product dp where da.customer_no = k.cif_no and da.dep_prod_id = dp.id and dp.prod_code = '1101' and substr(dp.int_cat,1,1) = '1' and substr(da.GL_CLASS_CODE,9,2)='14'  and upper(dp.prod_name) like '%CURRENT%' and (upper(k.first_name) like upper('" + searchString1.replace(' ', '%') + "%') or da.key_1 like '%" + searchString1.replace(' ', '%') + "%' or da.link_accno like '%" + searchString1.replace(' ', '%') + "%' ) and da.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = '" + pacsId + "') ";
                        } else if (searchString2.equalsIgnoreCase("D") && searchString3.equalsIgnoreCase("SHG")) {
                            headerQry = "select da.key_1, (k.first_name || ' ' || k.middle_name || ' ' || k.last_name) name, nvl(k.guardian_name,' '), dp.prod_name,k.cif_no from dep_account da, kyc_hdr k, dep_product dp where da.customer_no = k.cif_no and da.dep_prod_id = dp.id and dp.prod_code = '1102' and substr(dp.int_cat,1,1) = '1' and substr(da.GL_CLASS_CODE,9,2)='14' and (upper(k.first_name) like upper('" + searchString1.replace(' ', '%') + "%') or da.key_1 like '%" + searchString1.replace(' ', '%') + "%' or da.link_accno like '%" + searchString1.replace(' ', '%') + "%' ) and da.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = '" + pacsId + "') ";
                        } else if (searchString2.equalsIgnoreCase("L")) {
                            headerQry = "select la.key_1, (k.first_name || ' ' || k.middle_name || ' ' || k.last_name) name, nvl(k.guardian_name,' '), lp.prod_name,k.cif_no from loan_account la, kyc_hdr k, loan_product lp where la.customer_no = k.cif_no and substr(la.GL_CLASS_CODE,9,2)='23' and la.loan_prod_id = lp.id and (upper(k.first_name) like upper('" + searchString1.replace(' ', '%') + "%') or la.key_1 like '%" + searchString1.replace(' ', '%') + "%') and la.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = '" + pacsId + "')";
                        } else if (searchString2.equalsIgnoreCase("K")) {
                            headerQry = "select da.key_1, (k.first_name || ' ' || k.middle_name || ' ' || k.last_name) name, nvl(k.guardian_name,' '), dp.prod_name,k.cif_no from dep_account da, kyc_hdr k, dep_product dp where da.customer_no = k.cif_no and da.dep_prod_id = dp.id and dp.prod_code ='6001' and substr(da.GL_CLASS_CODE,9,2) ='23' and (upper(k.first_name) like upper('" + searchString1.replace(' ', '%') + "%') or da.key_1 like '%" + searchString1.replace(' ', '%') + "%' or da.link_accno like '%" + searchString1.replace(' ', '%') + "%' ) and da.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id = '" + pacsId + "')";
                        } else {
                            headerQry = "select * from dep_account where key_1='1' ";
                        }

                    } else if ((screenName.equalsIgnoreCase("CashWidrawlDeposit.jsp")) && (lovKey.equalsIgnoreCase("ddsCash"))) {


                        searchString1 = pacsId;
                        searchString3= user;
                       // searchString2=request.getParameter("accountNo");
                        String trnType = request.getParameter("trnType");
                        String searchFlag = request.getParameter("sflag");
                        if(searchFlag.equalsIgnoreCase("true")){
                            if(trnType.equalsIgnoreCase("CR")){
                        headerQry = "select d.key_1,(select r.first_name || nvl(r.middle_name, ' ') || nvl(r.last_name, ' ')"
			 +" from kyc_hdr r where r.cif_no = d.customer_no), d.avail_bal, 'DEPOSIT' accType  from dep_account d, "
			 +" dds_agent_acct a where d.pacs_id = '" + searchString1 + "'  and d.key_1=a.dds_acct and substr(d.GL_CLASS_CODE,9,2)='14' and d.curr_status='O' and d.customer_no in "
			 +" (select r.cif_no from kyc_hdr r where upper(r.first_name) like upper(  '" + searchString2 + "%' ) and r.pacs_id in (select pacs_id from pacs_master where head_pacs_id= (select head_pacs_id from pacs_master where pacs_id='" + searchString1 + "')))"
			 +" and d.dep_prod_id in (select p.id from dds_prod_map p where p.pacs_id='" + searchString1 + "' and p.prod_typ ='DEP' and p.status='ACTIVE' ) "
			 +" and a.agent_id='" + searchString3 + "'  union all "
			 +" select d.key_1,(select r.first_name || nvl(r.middle_name, ' ') || nvl(r.last_name, ' ')  from kyc_hdr r "
			 +" where r.cif_no = d.customer_no),  d.outst_bal, 'LOAN' accType  from loan_account d,dds_agent_acct a "
			 +" where a.dds_acct=d.key_1 and substr(d.GL_CLASS_CODE,9,2)='23' and d.curr_status in ('02','03') and d.loan_prod_id in  (select p.id from dds_prod_map p where p.pacs_id='" + searchString1 + "' and p.prod_typ ='LOAN' and p.status='ACTIVE' ) and d.pacs_id= '" + searchString1 + "' and  d.customer_no in (select r.cif_no from kyc_hdr r where "
			 +" upper(r.first_name) like upper( '" + searchString2 + "%' ) and r.pacs_id in (select pacs_id from pacs_master where head_pacs_id= (select head_pacs_id from pacs_master where pacs_id='" + searchString1 + "'))) "
                         +" and a.agent_id='" + searchString3 + "' "  ;

                        }else if (trnType.equalsIgnoreCase("DR")){
                        headerQry =  "select d.key_1,(select r.first_name || nvl(r.middle_name, ' ') || nvl(r.last_name, ' ')"
			 +" from kyc_hdr r where r.cif_no = d.customer_no), d.avail_bal, 'DEPOSIT' accType  from dep_account d, "
			 +" dds_agent_acct a where d.pacs_id = '" + searchString1 + "'  and d.key_1=a.dds_acct and d.curr_status='O' and substr(d.GL_CLASS_CODE,9,2)='14' and d.customer_no in "
			 +" (select r.cif_no from kyc_hdr r where  upper(r.first_name) like upper( '" + searchString2 + "%' ) and r.pacs_id in (select pacs_id from pacs_master where head_pacs_id=(select head_pacs_id from pacs_master where pacs_id='" + searchString1 + "')))"
			 +" and d.dep_prod_id in (select p.id from dds_prod_map p where p.pacs_id='" + searchString1 + "' and p.prod_typ ='DEP' and p.status='ACTIVE' ) "
			 +" and a.agent_id='" + searchString3 + "' ";
                            }
                            }
                        else
                            {
                        if(trnType.equalsIgnoreCase("CR")){
                        headerQry =   "select d.key_1,(select r.first_name || nvl(r.middle_name, ' ') || nvl(r.last_name, ' ') from kyc_hdr r"
                                                + " where r.cif_no = d.customer_no),d.avail_bal ,'DEPOSIT' accType from dep_account d, DDS_AGENT_ACCT a where d.key_1 = a.dds_acct and substr(d.GL_CLASS_CODE,9,2)='14' and d.curr_status='O' "
                                                + " and d.dep_prod_id in (select p.id from dds_prod_map p where p.pacs_id='" + searchString1 + "' and p.prod_typ ='DEP' and p.status='ACTIVE' )"
                                                + " and d.pacs_id = '" + searchString1 + "' and d.customer_no in (select r.cif_no from kyc_hdr r where r.pacs_id  in (select pacs_id from pacs_master where head_pacs_id = (select head_pacs_id from pacs_master where pacs_id = '" + searchString1 + "'))) and ( d.key_1 like '%" + searchString2 + "%'  or d.old_accno like '%" + searchString2 + "%')"
                                                + " and a.agent_id = '" + searchString3 + "'"
                                                + " union all select l.key_1, (select r.first_name || nvl(r.middle_name, ' ') || nvl(r.last_name, ' ')"
                                                + " from kyc_hdr r where r.cif_no = l.customer_no), l.outst_bal,'LOAN' accType from loan_account l, DDS_AGENT_ACCT a "
                                                + " where    l.pacs_id = '" + searchString1 + "' and substr(l.GL_CLASS_CODE,9,2)='23' and l.curr_status in ('02','03') and l.customer_no in (select r.cif_no from kyc_hdr r where r.pacs_id  in (select pacs_id from pacs_master where head_pacs_id = (select head_pacs_id from pacs_master where pacs_id = '" + searchString1 + "'))) and (l.key_1 like '%" + searchString2 + "%'  or l.old_accno like '%" + searchString2 + "%')"
                                                + " and a.agent_id = '" + searchString3 + "'"
                                                + " and l.key_1 = a.dds_acct and l.loan_prod_id in  (select p.id from dds_prod_map p where p.pacs_id='" + searchString1 + "' and p.prod_typ ='LOAN' and p.status='ACTIVE' )"
                                                + " and l.pacs_id ='" + searchString1 + "'  and a.agent_id = '" + searchString3 + "' order by 1 ";
                        }else if (trnType.equalsIgnoreCase("DR")){
                        headerQry =  "select d.key_1,(select r.first_name || nvl(r.middle_name, ' ') || nvl(r.last_name, ' ') from kyc_hdr r"
                                                        + " where r.cif_no = d.customer_no),d.avail_bal ,'DEPOSIT' accType from dep_account d, DDS_AGENT_ACCT a where d.key_1 = a.dds_acct  and substr(d.GL_CLASS_CODE,9,2)='14' and d.curr_status='O' "
                                                        + " and d.dep_prod_id in (select p.id from dds_prod_map p where p.pacs_id='" + searchString1 + "' and p.prod_typ ='DEP' and p.status='ACTIVE' )"
                                                        + " and d.pacs_id = '" + searchString1 + "' and d.customer_no in (select r.cif_no from kyc_hdr r where r.pacs_id  in (select pacs_id from pacs_master where head_pacs_id = (select head_pacs_id from pacs_master where pacs_id = '" + searchString1 + "'))) and (d.key_1 like '%" + searchString2 + "%' or d.old_accno like '%" + searchString2 + "%')"
                                                        + " and a.agent_id = '" + searchString3 + "'order by 1 ";

                          }
                         }
                        }else if (( screenName.equalsIgnoreCase("BulkFileUpload.jsp") || screenName.equalsIgnoreCase("AccountRenewalBulk.jsp") ) && (lovKey.equalsIgnoreCase("bulkReport")) ) {

                       // searchString1 = request.getParameter("fileId");
                          if(screenName.equalsIgnoreCase("BulkFileUpload.jsp")){
                        headerQry = "select file_id,file_name,trunc(POST_DATE),status from bulk_files_details where pacs_id='"+pacsId+"' and file_Id like '%" + searchString1.replace(' ', '%') + "%' and status is not NULL ";
                        }else if(screenName.equalsIgnoreCase("AccountRenewalBulk.jsp"))
                            {
                                headerQry = "select file_id,file_name,trunc(POST_DATE),status from bulk_kcc_renewal_files where pacs_id='"+pacsId+"' and file_Id like '%" + searchString1.replace(' ', '%') + "%' ";
                            }

                    }else if ((screenName.equalsIgnoreCase("AccountRenewalBulkSTB.jsp")) && (lovKey.equalsIgnoreCase("bulkReport"))) {

                        //searchString1 = request.getParameter("fileId");
                        headerQry = "select file_id, nvl((select pacs_name from pacs_master ki where ki.pacs_id = l.pacs_id),'NA') pacs_name, nvl((select file_name from bulk_kcc_renewal_files ki where ki.file_id = l.file_id and ki.pacs_id = l.pacs_id),'NA') file_name, "
                                    + "  trunc(TXN_DATE) , nvl((select ki.STATUS from bulk_kcc_renewal_files ki where ki.file_id = l.file_id and ki.pacs_id = l.pacs_id),'NA')STATUS from bank_pacs_kcc_renew l where bank_id = '"+pacsId+"' and file_Id like '%" + searchString1.replace(' ', '%') + "%' order by TXN_DATE ";

                    }else if ((screenName.equalsIgnoreCase("DepositMiscellaneousOperation.jsp")) && (lovKey.equalsIgnoreCase("TransactionNoSearch"))) {


                        //searchString1 = request.getParameter("depositAccNo");
                       // searchString2=request.getParameter("TxnNo");

                        headerQry = " select d.key_1, k.cif_no, (k.first_name || nvl2(k.middle_name, ' ' || k.middle_name, '') || nvl2(k.last_name, ' ' || k.last_name, '')), dt.cbs_ref_no, dt.txn_amt, dt.tran_ind, "
                                    + " to_char(dt.tran_date, 'DD-MON-YYYY') tran_date, to_char(dt.post_time, 'DD-MON-RR HH24:MI:SS ') || substr(dt.post_time, -2) post_time, (case when dt.pb_print_status is null then 'NOT PRINTED' "
                                    + " else 'PRINTED' end) PRINTED_ON_PASSBOOK_OR_NOT from kyc_hdr k, dep_account d, dep_txn dt where d.key_1 = dt.acct_no and d.customer_no = k.cif_no and substr(d.GL_CLASS_CODE,9,2)='14' and d.dep_prod_id in (select id from dep_product dp where substr(dp.int_cat,1,1) = '1' and substr(dp.prod_code,1,1) in ( '1','3')) and d.key_1 like '%" + searchString1.replace(' ', '%') + "%' "
                                    + " and dt.cbs_ref_no like '%" + searchString2.replace(' ', '%') + "%' and d.pacs_id = '" + pacsId + "' order by dt.acct_no,dt.tran_date, dt.post_time ";

                        }
                        
                        else if ((screenName.equalsIgnoreCase("DepositMiscellaneousOperation.jsp")) && (lovKey.equalsIgnoreCase("TransactionLoanNoSearch"))) {
                       
                       // searchString1 = request.getParameter("loanAccNo");
                        //searchString2=request.getParameter("TxnNo");
                        
                        headerQry = "SELECT D.KEY_1,K.CIF_NO,(K.FIRST_NAME|| NVL2(K.MIDDLE_NAME, ' '|| K.MIDDLE_NAME, '')|| NVL2(K.LAST_NAME, ' '|| K.LAST_NAME, '')), "
                                    + " DT.TXN_REF_NO,DT.TXN_AMT,DT.TRAN_IND,TO_CHAR(DT.TRAN_DATE, 'DD-MON-YYYY') TRAN_DATE,TO_CHAR(DT.POST_TIME, 'DD-MON-RR HH24:MI:SS ')|| SUBSTR(DT.POST_TIME, -2)  POST_TIME, "
                                    + " (CASE WHEN DT.PB_PRINT_STATUS IS NULL THEN 'NOT PRINTED' ELSE 'PRINTED' END) PRINTED_ON_PASSBOOK_OR_NOT FROM KYC_HDR K,LOAN_ACCOUNT D,LOAN_TXN  DT "
                                    + " WHERE D.KEY_1 = DT.ACCT_NO AND D.CUSTOMER_NO = K.CIF_NO AND SUBSTR(D.GL_CLASS_CODE, 9, 2)='23' "
                                    + " AND D.LOAN_PROD_ID IN (SELECT ID FROM LOAN_PRODUCT LP WHERE SUBSTR(LP.INT_CAT, 1, 1) = '1' AND SUBSTR(LP.PROD_CODE, 1, 1) IN ( '7'))"
                                    + " AND DT.TXN_REF_NO LIKE '%" + searchString2.replace(' ', '%') + "%' AND d.key_1 like '%" + searchString1.replace(' ', '%') + "%' AND D.PACS_ID = '" + pacsId + "' ORDER BY DT.ACCT_NO,DT.TRAN_DATE,DT.POST_TIME ";
            }
                    else if ((screenName.equalsIgnoreCase("farmerDetailsUpdation.jsp")) && (lovKey.equalsIgnoreCase("cifSearch"))) {

                       // searchString1 = request.getParameter("cifNumber");
                        headerQry = "select a.customer_no,(t.first_name||nvl2(t.middle_name,' '||t.middle_name,'')||nvl2(t.last_name,' '||t.last_name,'')) name,a.key_1,nvl(a.link_accno,'NA') "
                                    + " from dep_account a,kyc_details t where a.customer_no=t.cif_no and a.pacs_id= '" + pacsId + "' and "
                                    + " a.dep_prod_id in (select p.id from dep_product p where p.prod_code = '6001') and substr(a.GL_CLASS_CODE,9,2)='23' and a.customer_no = '" + searchString1.replace(' ', '%') + "' ";

                        }
                     else if ((screenName.equalsIgnoreCase("TDOperation.jsp")) && (lovKey.equalsIgnoreCase("CalcFDMaturity"))) {

                       // searchString1 = request.getParameter("termValue");
                        //int termYears = Integer.parseInt(request.getParameter("termYears"));
                        //int termMonth = Integer.parseInt(request.getParameter("termMonth"));
                        //int termDays = Integer.parseInt(request.getParameter("termDays"));
                        //String accNo = request.getParameter("accNo");

                        termMonth = termMonth + (termYears * 12);

                             headerQry = "select t.rate, (case when d.prod_code='2001' then (calcMISAmt_TD((case d.int_method when 'S' then d.intt_payout_freq else d.int_cap_freq end), t.rate, " + searchString1 + ")) else ( calcMatAmt_TD(d.int_method, (case d.int_method when 'S' then d.intt_payout_freq else d.int_cap_freq end), t.rate, " + searchString1 + ", " + termMonth + ", " + termDays + ")) end), d.prod_code,d.int_cat,d.prod_desc from td_rate_slab t, dep_product d where t.product_id=d.id and t.pacs_id='"+pacsId+"' and  d.prod_code=(select p.prod_code from dep_product p where p.id=(select a.dep_prod_id from dep_account a where a.key_1="+accNo+")) and  d.int_cat=(select p.int_cat from dep_product p where p.id=(select a.dep_prod_id from dep_account a where a.key_1="+accNo+")) and  to_number((add_months((select system_date from system_date)," + termMonth + ") + " + termDays + ") - (select system_date from system_date)) between t.term_from and t.term_to and " + searchString1 + " between t.from_amt and t.to_amt and (select system_date from system_date) between t.eff_from_date and t.eff_to_date";
            } else if ((screenName.equalsIgnoreCase("TDOperation.jsp") || (screenName.equalsIgnoreCase("RDOperation.jsp"))) && (lovKey.equalsIgnoreCase("GLAccSearchTransfer"))) {
                        if (subPacsFlag.equalsIgnoreCase("Y")) {
                            pacsId = headPacsId;
                        }
                           searchString1 = request.getParameter("accNo");
                        
                           headerQry = "select key_1,ledger_name,gl_prod_id,ledger_desc,cum_curr_val from gl_account where pacs_id='"+ pacsId +"' and  gl_prod_id = '02145002286'";
                    
                    } // Added TGL code 28.02.2024
                     else if ((screenName.equalsIgnoreCase("DepositAccountCreation.jsp")) && (lovKey.equalsIgnoreCase("CifDetails"))) {
                        if (subPacsFlag.equalsIgnoreCase("Y")) {
                            pacsId = headPacsId;
                        }
                       // searchString1 = request.getParameter("cifNumber");
                        productCode = request.getParameter("productCode");
                        if (productCode.equalsIgnoreCase("1017")) {

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

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

                    } else if ((screenName.equalsIgnoreCase("DepositAccountCreation.jsp")) && (lovKey.equalsIgnoreCase("CifDetails2"))) {
                        if (subPacsFlag.equalsIgnoreCase("Y")) {
                            pacsId = headPacsId;
                        }
                       // searchString1 = request.getParameter("cifNumber");
                        productCode = request.getParameter("productCode");
                        Counter = request.getParameter("Counter");

                        if (productCode.equalsIgnoreCase("1017")) {

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

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

                    } else if ((screenName.equalsIgnoreCase("accountAmend.jsp")) && (lovKey.equalsIgnoreCase("AccSrch"))) {
                        if (subPacsFlag.equalsIgnoreCase("Y")) {
                           // pacsId = headPacsId;
                        }
                       // searchString1 = request.getParameter("Acc");

                        headerQry = "select da.key_1,da.customer_no, upper(k.first_name || ' ' || k.middle_name || ' ' || k.last_name) custName, dp.prod_name, nvl(da.limit,'0'), da.avail_bal, nvl(da.prin_outst,'0'), nvl(da.intt_outst,'0'), nvl(da.penal_intt_outst,'0'), to_char(da.limit_exp_date, 'DD-MON-YYYY') exp_date, dp.int_cat from dep_account da, kyc_hdr k, dep_product dp "
                                    + " where da.customer_no = k.cif_no and da.dep_prod_id = dp.id and dp.prod_code ='6001' and substr(da.GL_CLASS_CODE,9,2)='23' and da.curr_status='O' and da.pacs_id='" + pacsId + "' and (upper(k.first_name) like upper('" + searchString1 + "%') or da.key_1 like '%" + searchString1 + "%' or da.customer_no like '%" + searchString1 + "%')";
                        

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

                        headerQry = "select upper(pm.pacs_name) pacs_name, da.pacs_id, da.key_1, da.customer_no, upper(k.first_name || ' ' || k.middle_name || ' ' || k.last_name) custName, dp.prod_name, (case da.curr_status when 'C' then 'Closed' else 'Open/Active' end) curr_status, nvl(da.sanction_amt, '0'), nvl(da.avail_bal, '0') avail_bal, nvl(da.prin_outst, '0'), nvl(da.intt_outst, '0'),  "
                                    + " nvl(da.penal_intt_outst, '0'), to_char(da.limit_exp_date, 'DD-MON-YYYY') exp_date, dp.int_cat from dep_account da, kyc_hdr k, dep_product dp, pacs_master pm where da.customer_no = k.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 substr(dp.int_cat,1,1) ='1' and to_number(pm.dccb_code) =  (select to_number(pa.dccb_code) "
                                    + " from pacs_master pa where pacs_id = '" + pacsId + "') and to_number(pm.cbs_br_code) = (select to_number(pa.cbs_br_code) from pacs_master pa where pacs_id = '" + pacsId + "') and da.key_1 = '" + searchString1 + "' order by pacs_name, da.pacs_id, custName ";

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

                        if (Option.equalsIgnoreCase("nremark")) {
                        headerQry =  "  select key_1 as acct, 'NA' as CBS_Acct, nvl(trim(kd.first_name), '') || ' ' || nvl(trim(kd.middle_name), '') || ' ' || nvl(trim(kd.last_name), '') as cutomer_name, nvl(trim(kd.guardian_name), 'NA') guardian_name "
                                    +" from dep_account da, kyc_hdr kd where da.key_1 in (select key_1 from bulk_acct_mark s where s.status in ('M', 'S', 'RBA', 'RBB')  and s.pacs_id = '" + pacsId + "') and da.link_accno is null "
                                    +" and da.dep_prod_id in (select id from dep_product dp where dp.prod_code in ('1101', '1102') and substr(dp.int_cat,1,1) = '1') and substr(da.GL_CLASS_CODE,9,2)='14' and kd.bank_cif is null and da.customer_no = kd.cif_no and da.key_1 like '%" +searchString1+ "%' and  da.pacs_id = '" + pacsId + "' ";
                        }
                        else if (Option.equalsIgnoreCase("eremark")) {
                        headerQry =  "  select key_1 as acct, 'NA' as CBS_Acct, nvl(trim(kd.first_name), '') || ' ' || nvl(trim(kd.middle_name), '') || ' ' || nvl(trim(kd.last_name), '') as cutomer_name, nvl(trim(kd.guardian_name), 'NA') guardian_name "
                                    +" from dep_account da, kyc_hdr kd where da.key_1 in (select key_1 from bulk_acct_mark s where s.status in ('M', 'S', 'RBA', 'RBB')  and s.pacs_id = '" + pacsId + "') and da.link_accno is null "
                                    +" and da.dep_prod_id in (select id from dep_product dp where dp.prod_code in ('1101', '1102') and substr(dp.int_cat,1,1) = '1') and substr(da.GL_CLASS_CODE,9,2)='14'and kd.bank_cif is not null and da.customer_no = kd.cif_no and da.key_1 like '%" +searchString1+ "%' and  da.pacs_id = '" + pacsId + "' ";
                        }
                        else {
                            headerQry =  "  select d.key_1, nvl(trim(d.link_accno),'NA') CBS, nvl((select trim(r.first_name) || ' ' || "
                                +" trim(r.middle_name) || ' ' || trim(r.last_name) from kyc_hdr r "
                                +"  where r.cif_no = d.customer_no),'NA') cust_name, "
                                    +" nvl((select trim(r.guardian_name) from kyc_hdr r where r.cif_no=d.customer_no and r.pacs_id=d.pacs_id),'NA') guardian_name "
                                    +" from dep_account d where d.pacs_id = '" + pacsId + "' "
                                    +" and ( d.key_1 like  '%" +searchString1+ "%' or d.link_accno like '%" +searchString1+ "%') and d.dep_prod_id in "
                                    +" (select p.id from dep_product p where p.prod_code in ('1101','1102') and substr(p.int_cat,1,1) = '1') and substr(d.GL_CLASS_CODE,9,2)='14' ";
                        }
                        } else if ((screenName.equalsIgnoreCase("ForceAccountClosure.jsp")) && (lovKey.equalsIgnoreCase("AccSrch"))) {
                        //searchString1=request.getParameter("Acc");
                                               
                        headerQry =  "  select key_1 as acctno, (select trim(dp.prod_name) from dep_product dp where dp.id = da.dep_prod_id) prod_name, nvl(trim(kd.first_name), '') || ' ' || nvl(trim(kd.middle_name), '') || ' ' || nvl(trim(kd.last_name), '') as cutomer_name, "
                                    +" nvl(trim(kd.guardian_name), 'NA') guardian_name, 'DEPOSIT ACCT' acct_type from dep_account da, kyc_hdr kd where da.dep_prod_id in (select id from dep_product dp where dp.prod_code <> '6001') and substr(da.GL_CLASS_CODE,9,2) in ('14','11')  and da.customer_no = kd.cif_no "
                                    +" and da.key_1 like '%" +searchString1+ "%' and da.avail_bal = 0 and da.curr_status in ('O', 'A', 'I') and da.pacs_id = '" + pacsId + "' "
                                    +" union all "
                                    +" select key_1 as acctno, (select trim(dp.prod_name) from dep_product dp where dp.id = da.dep_prod_id) prod_name, nvl(trim(kd.first_name), '') || ' ' || nvl(trim(kd.middle_name), '') || ' ' || "
                                    +" nvl(trim(kd.last_name), '') as cutomer_name, nvl(trim(kd.guardian_name), 'NA') guardian_name, 'KCC/CC ACCT' acct_type from dep_account da, kyc_hdr kd where da.dep_prod_id in "
                                    +" (select id from dep_product dp where dp.prod_code = '6001') and substr(da.GL_CLASS_CODE,9,2)='23' and da.customer_no = kd.cif_no and da.key_1 like '%" +searchString1+ "%' and da.prin_outst = 0 and da.curr_status in ('O', 'A', 'I') and da.pacs_id = '" + pacsId + "' "
                                    +"union all "
                                    +" select key_1 as acctno, (select trim(dp.prod_name) from loan_product dp where dp.id = da.loan_prod_id) prod_name, nvl(trim(kd.first_name), '') || ' ' || nvl(trim(kd.middle_name), '') || ' ' || nvl(trim(kd.last_name), '') as cutomer_name, "
                                    +" nvl(trim(kd.guardian_name), 'NA') guardian_name, 'LOAN ACCT' acct_type from loan_account da, kyc_hdr kd where da.loan_prod_id in (select id from loan_product dp) and substr(da.GL_CLASS_CODE,9,2)='23' and da.customer_no = kd.cif_no "
                                    +" and da.key_1 like '%" +searchString1+ "%' and da.curr_status = '01' and da.pacs_id = '" + pacsId + "' order by 5,2,3 ";
                        
                        } else if ((screenName.equalsIgnoreCase("BGLAccountCreation.jsp")) && (lovKey.equalsIgnoreCase("BGLSrch"))) {
                          //  searchString1=request.getParameter("Bgl");

                        headerQry =  " select gp.gl_code, gp.gl_name, gp.id from gl_product gp where gp.gl_code like '%" +searchString1+ "%' "
                                    +" and substr(gp.gl_code, 1, 1) in ('1', '2') and substr(gp.gl_code, 1, 2) not in ('16', '25') and gp.gl_code <>'28101' ";
                        
                        } else if ((screenName.equalsIgnoreCase("LienMarking.jsp")) && (lovKey.equalsIgnoreCase("accSearch"))) {
                         //   searchString1=request.getParameter("acc");
                            lienType=request.getParameter("type");

                            if (lienType.equalsIgnoreCase("K")) {
                            headerQry =  " select la.key_1 as loan_acct, (select lp.prod_name from loan_product lp where lp.id = la.loan_prod_id) prod_name, (select trim(kd.first_name) || ' ' || nvl(trim(kd.middle_name), '') || ' ' || trim(kd.last_name) "
                                    +" from kyc_hdr kd where kd.cif_no = la.customer_no) customer_name, (select nvl(trim(kd.guardian_name), 'NA') from kyc_hdr kd where kd.cif_no = la.customer_no) guardian_name, la.sanction_amt, nvl(la.old_accno, 'NA') as old_acct, la.customer_no as Cust_no "
                                    +" from loan_account la where la.pacs_id = '" +pacsId+ "' and substr(la.GL_CLASS_CODE,9,2)='23' and (la.teller_id is null or la.teller_id = 'MIG') and la.loan_prod_id in (select id from loan_product lp where lp.prod_code ='7001') and la.curr_status <>'04' and (la.key_1 like '%" + searchString1 + "%' or la.old_accno like '%" + searchString1 + "%') ";
                            }
                            if (lienType.equalsIgnoreCase("G")) {
                            headerQry =  " select la.key_1 as loan_acct, (select lp.prod_name from loan_product lp where lp.id = la.loan_prod_id) prod_name, (select trim(kd.first_name) || ' ' || nvl(trim(kd.middle_name), '') || ' ' || trim(kd.last_name) "
                                    +" from kyc_hdr kd where kd.cif_no = la.customer_no) customer_name, (select nvl(trim(kd.guardian_name), 'NA') from kyc_hdr kd where kd.cif_no = la.customer_no) guardian_name, la.sanction_amt, nvl(la.old_accno, 'NA') as old_acct, la.customer_no as Cust_no "
                                    +" from loan_account la where la.pacs_id = '" +pacsId+ "' and substr(la.GL_CLASS_CODE,9,2)='23' and la.loan_prod_id in (select id from loan_product lp where lp.prod_code ='7010') and la.curr_status <>'04' and (la.key_1 like '%" + searchString1 + "%' or la.old_accno like '%" + searchString1 + "%') ";
                            }
                            if (lienType.equalsIgnoreCase("D")) {
                            headerQry =  " select la.key_1 as loan_acct, (select lp.prod_name from loan_product lp where lp.id = la.loan_prod_id) prod_name, (select trim(kd.first_name) || ' ' || nvl(trim(kd.middle_name), '') || ' ' || trim(kd.last_name) from kyc_hdr kd where kd.cif_no = la.customer_no) customer_name, "
                                    +" (select nvl(trim(kd.guardian_name), 'NA') from kyc_hdr kd where kd.cif_no = la.customer_no) guardian_name, la.sanction_amt, nvl(la.old_accno, 'NA') as old_acct, la.customer_no as Cust_No from loan_account la "
                                    +" where la.pacs_id = '" +pacsId+ "' and substr(la.GL_CLASS_CODE,9,2)='23' and (la.teller_id is null or la.teller_id = 'MIG') and la.loan_prod_id in (select id from loan_product lp where lp.prod_code in ('7003', '7000')) and la.curr_status <>'04' and (la.key_1 like '%" +searchString1+ "%' or la.old_accno like '%" +searchString1+ "%') ";
                            }
                            if (lienType.equalsIgnoreCase("C")) {
                            headerQry =  " select la.key_1 as loan_acct, (select lp.prod_name from dep_product lp where lp.id = la.dep_prod_id) prod_name, (select trim(kd.first_name) || ' ' || nvl(trim(kd.middle_name), '') || ' ' || trim(kd.last_name) from kyc_hdr kd where kd.cif_no = la.customer_no)  "
                                    +" customer_name, (select nvl(trim(kd.guardian_name), 'NA') from kyc_hdr kd where kd.cif_no = la.customer_no) guardian_name, la.sanction_amt, nvl(la.old_accno, 'NA') as old_acct, la.customer_no as Cust_No "
                                    +" from dep_account la where la.pacs_id = '" +pacsId+ "' and substr(la.GL_CLASS_CODE,9,2)='23' and la.dep_prod_id in (select id from dep_product lp where lp.prod_code ='6001' and substr(lp.int_cat,1,1) <>'1' ) and la.curr_status <> 'C'and (la.key_1 like '%" +searchString1+ "%' or la.old_accno like '%" +searchString1+ "%') ";
                            }
                            if (lienType.equalsIgnoreCase("O")) {
                            headerQry =  " select la.key_1 as loan_acct, (select lp.prod_name from loan_product lp where lp.id = la.loan_prod_id) prod_name, (select trim(kd.first_name) || ' ' || nvl(trim(kd.middle_name), '') || ' ' || trim(kd.last_name) from kyc_hdr kd where kd.cif_no = la.customer_no) customer_name, "
                                    +" (select nvl(trim(kd.guardian_name), 'NA') from kyc_hdr kd where kd.cif_no = la.customer_no) guardian_name, la.sanction_amt, nvl(la.old_accno, 'NA') as old_acct, la.customer_no as Cust_No from loan_account la "
                                    +" where la.pacs_id = '" +pacsId+ "' and la.loan_prod_id in (select id from loan_product lp where lp.prod_code not in ('7003', '7000', '7001', '7010')) and substr(la.GL_CLASS_CODE,9,2)='23' and la.curr_status <>'04' and (la.key_1 like '%" +searchString1+ "%' or la.old_accno like '%" +searchString1+ "%') order by 2,3 ";
                            }

                        } else if ((screenName.equalsIgnoreCase("RemoveLien.jsp")) && (lovKey.equalsIgnoreCase("accSearch"))) {
                           // searchString1=request.getParameter("acc");

                            headerQry = " select la.key_1 as loan_acct, (select lp.prod_name from loan_product lp where lp.id = la.loan_prod_id) prod_name, (select trim(kd.first_name) || ' ' || nvl(trim(kd.middle_name), '') || ' ' || trim(kd.last_name) "
                                    +" from kyc_hdr kd where kd.cif_no = la.customer_no) customer_name, (select nvl(trim(kd.guardian_name), 'NA') from kyc_hdr kd where kd.cif_no = la.customer_no) guardian_name, la.sanction_amt, nvl(la.old_accno, 'NA') as old_acct, la.customer_no as Cust_no, "
                                    +" NVL((select trim(lak.remarks) from loan_account_auth lak where lak.new_account_no=la.key_1 and lak.status='A' and lak.pacs_id=la.pacs_id), 'NA') remarks from loan_account la where la.pacs_id = '" +pacsId+ "' and substr(la.GL_CLASS_CODE,9,2)='23' and la.loan_prod_id in (select id from loan_product lp where lp.prod_code ='7010') and la.curr_status ='04' and (la.key_1 like '%" + searchString1 + "%' or la.old_accno like '%" + searchString1 + "%') ";
                        
                        } else if ((screenName.equalsIgnoreCase("UserCreation.jsp")) && (lovKey.equalsIgnoreCase("UserSrch"))) {

                            headerQry =  " select s.role_name, s.id from sys_roles s where s.id not in ('201603000004021', '201603000004023', '201606000004042', '201603000004024', '201603000008020') ";
                        
                        } else if ((screenName.equalsIgnoreCase("LienMarking.jsp")) && (lovKey.equalsIgnoreCase("Account"))) {

                          //  searchString2 = request.getParameter("cifNumber");

                            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(p.prod_code,1,1) =  '2' or substr(p.prod_code,1,1) =  '3') and t.curr_status <> 'C' and t.customer_no = '" + searchString2 + "' 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("accountCreationReadOnly.jsp") && (lovKey.equalsIgnoreCase("PickUPCustomer"))) {

                       // searchString1 = request.getParameter("cifNumber");
                        
                        headerQry = "select cif_no,(t.first_name||nvl2(t.middle_name,' '||t.middle_name,'')||nvl2(t.last_name,' '||t.last_name,'')) name,customer_type,nvl(address_1,' '),nvl(address_2,' '), nvl(address_3,''),t.guardian_name from kyc_hdr t  where cif_no = '" + searchString1.replace(' ', '%') + "' and t.pacs_id in (select pacs_id from pacs_master where head_pacs_id=(select head_pacs_id from pacs_master where pacs_id='" + pacsId + "'))";
                        
                        } else if ((screenName.equalsIgnoreCase("tradingFinancialYearAdjustment.jsp")) && (lovKey.equalsIgnoreCase("AccountSearch"))) {

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

                            headerQry = " select g.key_1,p.gl_code,g.ledger_name,g.cum_curr_val from gl_account g, gl_product p where g.pacs_id='" + pacsId + "' and g.status='A' and p.gl_code<>'28101' and g.gl_prod_id=p.id and substr(p.gl_code, 1, 2) in ('31', '32', '33', '26', '45', '46', '47') and (g.key_1 like '%" + searchString2 + "%' or p.gl_code like upper('%" + searchString2 + "%') or p.gl_name like upper('%" + searchString2 + "%')) ";

                    } else if ((screenName.equalsIgnoreCase("tradingFinancialYearAdjustment.jsp")) && (lovKey.equalsIgnoreCase("SecondAccountSearch"))) {

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

                            headerQry = " select g.key_1,p.gl_code,g.ledger_name,g.cum_curr_val from gl_account g, gl_product p where g.pacs_id='" + pacsId + "' and g.status='A' and p.gl_code<>'28101' and g.gl_prod_id=p.id and substr(p.gl_code, 1, 2) in ('31', '32', '33', '26', '45', '46', '47') and (g.key_1 like '%" + searchString2 + "%' or p.gl_code like upper('%" + searchString2 + "%') or p.gl_name like upper('%" + searchString2 + "%')) ";

                    } else if ((screenName.equalsIgnoreCase("AccountModeOfOperation.jsp")) && (lovKey.equalsIgnoreCase("DepositAccLOV"))) {

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

                        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,k.photo_path,k.sig_photo"
                                + " 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<>'6001' and t.curr_status <>'C' and substr(t.GL_CLASS_CODE,9,2) in ('14','11') and (t.key_1 like '%" + searchString1.replace(' ', '%') + "%' or upper(k.first_name) like upper ('" + searchString1.replace(' ', '%') + "%')) and t.pacs_id= '" + pacsId + "'   ";


                    } else if ((screenName.equalsIgnoreCase("DepositTransactionOperation.jsp")) && (lovKey.equalsIgnoreCase("viewSpeci"))) {

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

                        headerQry = " select '1st Holder' Holder,t.customer_no as cif1, (k.first_name || ' ' || nvl2(k.middle_name, ' ' || k.middle_name, '') || nvl2(k.last_name, ' ' || k.last_name, '')) customer_name, nvl(k.guardian_name, 'NA') guardian_name, "
+ " k.sig_photo, k.photo_path, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600002'), 'NA') Aadhar_no, nvl((select trim(kl.id_no) "
+ " from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600008'), 'NA') Pan_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no "
+ " and kl.kyc_document_mst_id = '909201600001'), 'NA') Voter_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600007'), 'NA') Introduced_by_mem "
+ " 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 t.curr_status not in ('C', 'S') and substr(t.GL_CLASS_CODE,9,2)='14' "
+ " and (t.key_1 like '%" + searchString1 + "%' or t.link_accno like '%" + searchString1 + "%' or upper(k.first_name) like upper('" + searchString1 + "%') or "
+ " t.old_accno = '" + searchString1 + "') and t.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id in (select pm.head_pacs_id from pacs_master pm where pm.pacs_id = '" + pacsId + "')) "
+ " union all "
+ " select '2nd Holder' Holder,nvl(t.cif_no2, 'NA') as cif1, nvl((k.first_name || ' ' || nvl2(k.middle_name, ' ' || k.middle_name, '') || nvl2(k.last_name, ' ' || k.last_name, '')), 'NA') customer_name, "
+ " nvl(k.guardian_name, 'NA') guardian_name, k.sig_photo, k.photo_path, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600002'), "
+ " 'NA') Aadhar_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600008'), 'NA') Pan_no, nvl((select trim(kl.id_no) "
+ " from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600001'), 'NA') Voter_no, nvl((select trim(kl.id_no) from kyc_dtl kl "
+ " where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600007'), 'NA') Introduced_by_mem from dep_account t, kyc_hdr k, dep_product p "
+ " where k.cif_no = t.cif_no2 and t.dep_prod_id = p.id and t.curr_status not in ('C', 'S') and substr(t.GL_CLASS_CODE,9,2)='14' and (t.key_1 like '%" + searchString1 + "%' or t.link_accno "
+ " like '%" + searchString1 + "%' or upper(k.first_name) like upper('" + searchString1 + "%') or t.old_accno = '" + searchString1 + "') and t.pacs_id in (select p.pacs_id "
+ " from pacs_master p where p.head_pacs_id in (select pm.head_pacs_id from pacs_master pm where pm.pacs_id = '" + pacsId + "')) "
+ " union all "
+ " select '3rd Holder' Holder,nvl(t.cif_no3, 'NA') as cif1, nvl((k.first_name || ' ' || nvl2(k.middle_name, ' ' || k.middle_name, '') || nvl2(k.last_name, ' ' || k.last_name, '')), 'NA') customer_name, "
+ " nvl(k.guardian_name, 'NA') guardian_name, k.sig_photo, k.photo_path, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600002'), "
+ " 'NA') Aadhar_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600008'), 'NA') Pan_no, nvl((select trim(kl.id_no) "
+ " from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600001'), 'NA') Voter_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no "
+ " and kl.kyc_document_mst_id = '909201600007'), 'NA') Introduced_by_mem from dep_account t, kyc_hdr k, dep_product p where k.cif_no = t.cif_no3 and t.dep_prod_id = p.id "
+ " and t.curr_status not in ('C', 'S') and substr(t.GL_CLASS_CODE,9,2)='14' and (t.key_1 like '%" + searchString1 + "%' or t.link_accno like '%" + searchString1 + "%' or "
+ " upper(k.first_name) like upper('" + searchString1 + "%') or t.old_accno = '" + searchString1 + "') and t.pacs_id in (select p.pacs_id "
+ " from pacs_master p where p.head_pacs_id in (select pm.head_pacs_id from pacs_master pm where pm.pacs_id = '" + pacsId + "')) "
+ " union all "
+ " select '4th Holder' Holder,nvl(t.cif_no4, 'NA') as cif1, nvl((k.first_name || ' ' || nvl2(k.middle_name, ' ' || k.middle_name, '') || nvl2(k.last_name, ' ' || k.last_name, '')), 'NA') customer_name, "
+ " nvl(k.guardian_name, 'NA') guardian_name,  k.sig_photo, k.photo_path, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600002'), "
+ " 'NA') Aadhar_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600008'), 'NA') Pan_no, nvl((select trim(kl.id_no) "
+ " from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600001'), 'NA') Voter_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no "
+ " and kl.kyc_document_mst_id = '909201600007'), 'NA') Introduced_by_mem from dep_account t, kyc_hdr k, dep_product p where k.cif_no = t.cif_no4 and t.dep_prod_id = p.id "
+ " and t.curr_status not in ('C', 'S') and substr(t.GL_CLASS_CODE,9,2)='14' and (t.key_1 like '%" + searchString1 + "%' or t.link_accno like '%" + searchString1 + "%' or "
+ " upper(k.first_name) like upper('" + searchString1 + "%') or t.old_accno = '" + searchString1 + "') and t.pacs_id in (select p.pacs_id "
+ " from pacs_master p where p.head_pacs_id in (select pm.head_pacs_id from pacs_master pm where pm.pacs_id = '" + pacsId + "')) " 
 + " union all "
 + " select '5th Holder' Holder,nvl(t.cif_no5, 'NA') as cif1, nvl((k.first_name || ' ' || nvl2(k.middle_name, ' ' || k.middle_name, '') || nvl2(k.last_name, ' ' || k.last_name, '')), 'NA') customer_name, nvl(k.guardian_name, 'NA') guardian_name, "
 + " k.sig_photo, k.photo_path, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600002'), 'NA') Aadhar_no, nvl((select trim(kl.id_no) from kyc_dtl kl "
 + " where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600008'), 'NA') Pan_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600001'), 'NA') Voter_no, "
 + " nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600007'), 'NA') Introduced_by_mem from dep_account t, kyc_hdr k, dep_product p where k.cif_no = t.cif_no5 "
 + " and t.dep_prod_id = p.id  and t.curr_status not in ('C', 'S') and substr(t.GL_CLASS_CODE,9,2)='14' and (t.key_1 like '%" + searchString1 + "%' or t.link_accno like '%" + searchString1 + "%' or upper(k.first_name "
 + " ) like upper('" + searchString1 + "%') or t.old_accno = '" + searchString1 + "') and t.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id in (select pm.head_pacs_id "
 + " from pacs_master pm where pm.pacs_id = '" + pacsId + "')) "
 + " union all "
 + " select '6th Holder' Holder,nvl(t.cif_no6, 'NA') as cif1, nvl((k.first_name || ' ' || nvl2(k.middle_name, ' ' || k.middle_name, '') || nvl2(k.last_name, ' ' || k.last_name, '')), 'NA') customer_name, nvl(k.guardian_name, 'NA') guardian_name, "
 + " k.sig_photo, k.photo_path, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600002'), 'NA') Aadhar_no, nvl((select trim(kl.id_no) from kyc_dtl kl "
 + " where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600008'), 'NA') Pan_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600001'), 'NA') Voter_no, "
 + " nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600007'), 'NA') Introduced_by_mem from dep_account t, kyc_hdr k, dep_product p where k.cif_no = t.cif_no6 "
 + " and t.dep_prod_id = p.id  and t.curr_status not in ('C', 'S') and substr(t.GL_CLASS_CODE,9,2)='14' and (t.key_1 like '%" + searchString1 + "%' or t.link_accno like '%" + searchString1 + "%' or "
 + " upper(k.first_name) like upper('" + searchString1 + "%') or t.old_accno = '" + searchString1 + "') and t.pacs_id in (select p.pacs_id from pacs_master p "
 + " where p.head_pacs_id in (select pm.head_pacs_id from pacs_master pm where pm.pacs_id = '" + pacsId + "')) "
 + " union all "
 + " select '7th Holder' Holder,nvl(t.cif_no7, 'NA') as cif1, nvl((k.first_name || ' ' || nvl2(k.middle_name, ' ' || k.middle_name, '') || nvl2(k.last_name, ' ' || k.last_name, '')), 'NA') customer_name, nvl(k.guardian_name, 'NA') guardian_name, "
 + " k.sig_photo, k.photo_path, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600002'), 'NA') Aadhar_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no "
 + " and kl.kyc_document_mst_id = '909201600008'), 'NA') Pan_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600001'), 'NA') Voter_no, nvl((select trim(kl.id_no) "
 + " from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600007'), 'NA') Introduced_by_mem from dep_account t, kyc_hdr k, dep_product p where k.cif_no = t.cif_no7 and t.dep_prod_id = p.id "
 + " and t.curr_status not in ('C', 'S') and substr(t.GL_CLASS_CODE,9,2)='14' and (t.key_1 like '%" + searchString1 + "%' or t.link_accno like '%" + searchString1 + "%' or upper(k.first_name) like "
 + " upper('" + searchString1 + "%') or t.old_accno = '" + searchString1 + "') and t.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id in (select pm.head_pacs_id from pacs_master pm where pm.pacs_id = '" + pacsId + "')) "
 + " union all "
 + " select '8th Holder' Holder,nvl(t.cif_no8, 'NA') as cif1, nvl((k.first_name || ' ' || nvl2(k.middle_name, ' ' || k.middle_name, '') || nvl2(k.last_name, ' ' || k.last_name, '')), 'NA') customer_name, nvl(k.guardian_name, 'NA') guardian_name, k.sig_photo, "
 + " k.photo_path, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600002'), 'NA') Aadhar_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no "
 + " and kl.kyc_document_mst_id = '909201600008'), 'NA') Pan_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600001'), 'NA') Voter_no, nvl((select trim(kl.id_no) "
 + " from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600007'), 'NA') Introduced_by_mem from dep_account t, kyc_hdr k, dep_product p where k.cif_no = t.cif_no8 and t.dep_prod_id = p.id "
 + " and t.curr_status not in ('C', 'S') and substr(t.GL_CLASS_CODE,9,2)='14' and (t.key_1 like '%" + searchString1 + "%' or t.link_accno like '%" + searchString1 + "%' or upper(k.first_name) like "
 + " upper('" + searchString1 + "%') or t.old_accno = '" + searchString1 + "') and t.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id in (select pm.head_pacs_id from pacs_master pm where pm.pacs_id = '" + pacsId + "')) "
 + " union all "
 + " select '9th Holder' Holder,nvl(t.cif_no9, 'NA') as cif1, nvl((k.first_name || ' ' || nvl2(k.middle_name, ' ' || k.middle_name, '') || nvl2(k.last_name, ' ' || k.last_name, '')), 'NA') customer_name, nvl(k.guardian_name, 'NA') guardian_name, "
 + " k.sig_photo, k.photo_path, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600002'), 'NA') Aadhar_no, nvl((select trim(kl.id_no) from kyc_dtl kl "
 + " where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600008'), 'NA') Pan_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600001'), 'NA') Voter_no, "
 + " nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600007'), 'NA') Introduced_by_mem from dep_account t, kyc_hdr k, dep_product p where k.cif_no = t.cif_no9 "
 + " and t.dep_prod_id = p.id  and t.curr_status not in ('C', 'S') and substr(t.GL_CLASS_CODE,9,2)='14' and (t.key_1 like '%" + searchString1 + "%' or t.link_accno like '%" + searchString1 + "%' or upper(k.first_name  "
 + " ) like upper('" + searchString1 + "%') or t.old_accno = '" + searchString1 + "') and t.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id in (select pm.head_pacs_id from pacs_master pm where pm.pacs_id = '" + pacsId + "')) "
 + " union all "
 + " select '10th Holder' Holder,nvl(t.cif_no10, 'NA') as cif1, nvl((k.first_name || ' ' || nvl2(k.middle_name, ' ' || k.middle_name, '') || nvl2(k.last_name, ' ' || k.last_name, '')), 'NA') customer_name, nvl(k.guardian_name, 'NA') guardian_name, k.sig_photo, "
 + " k.photo_path, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600002'), 'NA') Aadhar_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no "
 + " and kl.kyc_document_mst_id = '909201600008'), 'NA') Pan_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600001'), 'NA') Voter_no, nvl((select trim(kl.id_no) "
 + " from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600007'), 'NA') Introduced_by_mem from dep_account t, kyc_hdr k, dep_product p where k.cif_no = t.cif_no10 and t.dep_prod_id = p.id and "
 + " t.curr_status not in ('C', 'S') and substr(t.GL_CLASS_CODE,9,2)='14' and (t.key_1 like '%" + searchString1 + "%' or t.link_accno like '%" + searchString1 + "%' or upper(k.first_name) like "
 + " upper('" + searchString1 + "%') or t.old_accno = '" + searchString1 + "') and t.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id in (select pm.head_pacs_id from pacs_master pm where pm.pacs_id = '" + pacsId + "')) "
 + " union all "
 + " select '11th Holder' Holder,nvl(t.cif_no11, 'NA') as cif1, nvl((k.first_name || ' ' || nvl2(k.middle_name, ' ' || k.middle_name, '') || nvl2(k.last_name, ' ' || k.last_name, '')), 'NA') customer_name, nvl(k.guardian_name, 'NA') guardian_name, "
 + " k.sig_photo, k.photo_path, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600002'), 'NA') Aadhar_no, nvl((select trim(kl.id_no) from kyc_dtl kl "
 + " where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600008'), 'NA') Pan_no, nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600001'), 'NA') Voter_no, "
 + " nvl((select trim(kl.id_no) from kyc_dtl kl where kl.cif_no = k.cif_no and kl.kyc_document_mst_id = '909201600007'), 'NA') Introduced_by_mem from dep_account t, kyc_hdr k, dep_product p where k.cif_no = t.cif_no11 "
 + " and t.dep_prod_id = p.id and t.curr_status not in ('C', 'S') and substr(t.GL_CLASS_CODE,9,2)='14' and (t.key_1 like '%" + searchString1 + "%' or t.link_accno like '%" + searchString1 + "%' or upper(k.first_name "
 + " ) like upper('" + searchString1 + "%') or t.old_accno = '" + searchString1 + "') and t.pacs_id in (select p.pacs_id from pacs_master p where p.head_pacs_id in "
 + " (select pm.head_pacs_id from pacs_master pm where pm.pacs_id = '" + pacsId + "')) ";


                    }   else if ((screenName.equalsIgnoreCase("TDRepayMethod.jsp")) && (lovKey.equalsIgnoreCase("TDAccLOV"))) {

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

                        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,k.photo_path,k.sig_photo"
                                + " 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 ('2001','2002','3001') and t.curr_status <>'C' and substr(t.GL_CLASS_CODE,9,2)='14' and (t.key_1 like '%" + searchString1.replace(' ', '%') + "%' or upper(k.first_name) like upper ('" + searchString1.replace(' ', '%') + "%')) and t.pacs_id= '" + pacsId + "'   ";


                    }   else if ((screenName.equalsIgnoreCase("TDRepayMethod.jsp")) && (lovKey.equalsIgnoreCase("TransferAccLOV"))) {

                       // searchString2 = request.getParameter("trfAccount");
                        //searchString3 = request.getParameter("customer");

                        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,k.photo_path,k.sig_photo"
                                + " 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 = '" +searchString3+ "' and t.curr_status <> 'C' and (t.key_1 like '%" + searchString2.replace(' ', '%') + "%' or upper(k.first_name) like upper ('" + searchString1.replace(' ', '%') + "%')) and "
                                + " t.pacs_id in (select pacs_id from pacs_master pa where pa.head_pacs_id = (select head_pacs_id from pacs_master where pacs_id= '" + pacsId + "'))   ";


                    } else if ((screenName.equalsIgnoreCase("LoanPrincipalAdjustment.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 in  ('S','C')) 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 l.loan_prod_id in "
                                    +" (select p.id from loan_product p where p.int_method in ('S','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("LoanPrincipalAdjustment.jsp")) && (lovKey.equalsIgnoreCase("bglAcc"))) {
                       // searchString1 = request.getParameter("Acc");

                        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<>'201611000001184' and ga.gl_prod_id=gp.id "
                                   +" and ga.pacs_id= '" + pacsId + "' and (gp.gl_code like '%" + searchString1.replace(' ', '%') + "%' or gp.gl_name like upper('%" + searchString1.replace(' ', '%') + "%') or ga.key_1 like '%" + searchString1.replace(' ', '%') + "%') ";

                    } else if ((screenName.equalsIgnoreCase("UserAmendment.jsp")) && (lovKey.equalsIgnoreCase("UserSrch"))) {
                         //searchString1 = request.getParameter("userId");
                        headerQry =  " select s.login_id, s.login_name,(select si.role_name from sys_roles si where si.id = s.user_role_id) as role_name, "
                                    +" s.user_role_id as id, s.ip_flag, NVL(s.static_ip,'NA')static_ip from login_details s where s.pacs_id = '" + pacsId + "' and s.login_id like '%" + searchString1 + "%' ";

                    } else if ((screenName.equalsIgnoreCase("MiscChargeDeduction.jsp")) && (lovKey.equalsIgnoreCase("prodLOV"))) {
                         searchString1 = request.getParameter("userId");
                        headerQry =  " select prod_code, int_cat, prod_name, prod_desc, INTT_CAT_DESC from dep_product dp where dp.id in "
                                    +" (select distinct dep_prod_id from dep_account da where da.pacs_id = '" + pacsId + "') and dp.prod_code in ('1101','1102','6001') order by prod_code,int_cat ";

                    } else if ((screenName.equalsIgnoreCase("UpdatePacsDetails.jsp")) && (lovKey.equalsIgnoreCase("pacsD"))) {

                        headerQry = " select pm.pacs_name, pm.addr1, pm.addr2, pm.addr3, NVL(pm.gst_no,'NA')gst_no from pacs_master pm where pm.pacs_id = '" + pacsId + "' ";

                    } else if ((screenName.equalsIgnoreCase("ChequePosting.jsp")) && (lovKey.equalsIgnoreCase("depositAccount"))) {

                       // 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,p.int_cat,p.intt_cat_desc,t.avail_bal,k.photo_path,k.sig_photo,nvl((select nvl(kl.id_no,'NA') from kyc_dtl kl where kl.kyc_document_mst_id = '909201600008' and kl.cif_no = t.customer_no),'NA') PAN_ID_NO "
                                + " 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.curr_status <>'C' and (t.key_1 like '%" + searchString1 + "%' or t.link_accno like '%" + searchString1 + "%' or upper(k.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("DepositKYCInquiry.jsp") && (lovKey.equalsIgnoreCase("PickUPKYC"))) {

                       // searchString1 = request.getParameter("kycID");
                        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, customer_type, nvl(address_1, ' '), nvl(address_2, ' '), nvl(address_3, ' '), t.guardian_name"
                                    +" from kyc_hdr t where t.cif_no in (select cif_no from kyc_dtl kl where kl.id_no = '" +searchString1+ "' and kl.cif_no = t.cif_no and kl.pacs_id in (select pacs_id from pacs_master where head_pacs_id = '" + pacsId + "')) and t.pacs_id in (select pacs_id from pacs_master where head_pacs_id = '" + pacsId + "') ";

                    } else if ((screenName.equalsIgnoreCase("PLAppropriationOperations.jsp")) && (lovKey.equalsIgnoreCase("AccountSearch"))) {

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

                            headerQry = "select g.key_1,p.gl_code,g.ledger_name,g.cum_curr_val from gl_account g, gl_product p where g.pacs_id='" + pacsId + "' and g.status='A' and g.gl_prod_id=p.id and substr(p.gl_code, 1, 2) in ('10', '11', '12') and (g.key_1 like '%" + searchString2 + "%' or p.gl_code like upper('%" + searchString2 + "%') or p.gl_name like upper('%" + searchString2 + "%'))";

                    } else if ((screenName.equalsIgnoreCase("PLAppropriationOperations.jsp")) && (lovKey.equalsIgnoreCase("SecondAccountSearch"))) {

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

                            headerQry = "select g.key_1,p.gl_code,g.ledger_name,g.cum_curr_val from gl_account g, gl_product p where g.pacs_id='" + pacsId + "' and g.status='A' and p.gl_code='65110' and g.gl_prod_id=p.id and (g.key_1 like '%" + searchString2 + "%' or p.gl_code like upper('%" + searchString2 + "%') or p.gl_name like upper('%" + searchString2 + "%'))";

                    } else if (screenName.equalsIgnoreCase("MemberDetails.jsp") && (lovKey.equalsIgnoreCase("PickUPCustomer"))) {

                       // searchString1 = request.getParameter("accNo");
                        searchString2 = request.getParameter("textIndex");
                                                
                            headerQry = " select cif_no,                                                                            "
+" (t.first_name || nvl2(t.middle_name, ' ' || t.middle_name, '') ||                         "
+" nvl2(t.last_name, ' ' || t.last_name, '')) name,                                          "
+" (case t.gender                                                                            "
+" when 'M' then                                                                             "
+" 'Male'                                                                                    "
+" when 'F' then                                                                             "
+" 'Female'                                                                                  "
+" else                                                                                      "
+" 'Other'                                                                                   "
+" end) gender,                                                                              "
+" t.birth_date,                                                                             "
+" t.guardian_name,                                                                          "
+" nvl(address_1, ' ') || ' ' || nvl(address_2, ' ') || ' ' ||                               "
+" nvl(address_3, ' ') address,                                                              "
+" (case t.religion                                                                          "
+" when '1' then                                                                             "
+" 'Hindu'                                                                                   "
+" when '2' then                                                                             "
+" 'Muslim'                                                                                  "
+" when '3' then                                                                             "
+" 'Christian'                                                                               "
+" when '4' then                                                                             "
+" 'Sikh'                                                                                    "
+" when '5' then                                                                             "
+" 'Jain'                                                                                    "
+" when '6' then                                                                             "
+" 'Buddhist'                                                                                "
+" when '7' then                                                                             "
+" 'Parsi'                                                                                   "
+" else                                                                                      "
+" 'Others'                                                                                  "
+" end) religion,                                                                            "
+" t.caste                                                                                   "
+" from kyc_hdr t where (cif_no like '%" + searchString1.replace(' ', '%') + "%' or upper(trim(first_name)) like upper('" + searchString1.replace(' ', '%') + "%')) and t.pacs_id in (select pacs_id from pacs_master where head_pacs_id=(select head_pacs_id from pacs_master where pacs_id='" + pacsId + "')) ";                         
                    
                    }  else if (screenName.equalsIgnoreCase("MemberDetails.jsp") && (lovKey.equalsIgnoreCase("PickUPCustomerAmend"))) {

                       // searchString1 = request.getParameter("accNo");
                        searchString2 = request.getParameter("textIndex");
                                                
                            headerQry = " select cif_no, (t.first_name || nvl2(t.middle_name, ' ' || t.middle_name, '') || nvl2(t.last_name, ' ' || t.last_name, '')) name, (case t.gender when 'M' then 'Male' when 'F' then 'Female' else 'Other' end) gender, t.birth_date, t.guardian_name, nvl(address_1, ' ') || ' ' || nvl(address_2, ' ') || ' ' || nvl(address_3, ' ') address, (case t.religion when '1' then 'Hindu' when '2' then 'Muslim' when '3' then 'Christian' when '4' then 'Sikh' when '5' then 'Jain' when '6' then 'Buddhist' when '7' then 'Parsi' else 'Others' end) religion, t.caste from kyc_hdr t where (cif_no like '%" + searchString1.replace(' ', '%') + "%' or upper(trim(first_name)) like upper('" + searchString1.replace(' ', '%') + "%')) and t.pacs_id in (select pacs_id from pacs_master where head_pacs_id=(select head_pacs_id from pacs_master where pacs_id='" + pacsId + "')) ";                         
                   
                    } else if (screenName.equalsIgnoreCase("EmployeeMaster.jsp") && (lovKey.equalsIgnoreCase("PickUPCustomer"))) {

                       // searchString1 = request.getParameter("accNo");
                        searchString2 = request.getParameter("textIndex");
                                                
                            headerQry = " select cif_no, (t.first_name || nvl2(t.middle_name, ' ' || t.middle_name, '') || nvl2(t.last_name, ' ' || t.last_name, '')) name, (case t.gender when 'M' then 'Male' when 'F' then 'Female' else 'Other' end) gender, t.birth_date, t.guardian_name, nvl(address_1, ' ') || ' ' || nvl(address_2, ' ') || ' ' || nvl(address_3, ' ') address, (case t.religion when '1' then 'Hindu' when '2' then 'Muslim' when '3' then 'Christian' when '4' then 'Sikh' when '5' then 'Jain' when '6' then 'Buddhist' when '7' then 'Parsi' else 'Others' end) religion, t.caste from kyc_hdr t where cif_no = '" + searchString1 + "' and t.pacs_id in (select pacs_id from pacs_master where head_pacs_id=(select head_pacs_id from pacs_master where pacs_id='" + pacsId + "')) ";
                    
                    }


                    Connection conn = DbHandler.getDBConnection();
                    PreparedStatement pstmt = null;
                    ResultSet resultSet = null;
                    String bgColor = null;
                    int flag = 1;



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

        %>

        <script type="text/javascript">
            function read(){
                window.opener.$('#siAmount').prop('disabled', true);
            }

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

            <%  if ((screenName.equalsIgnoreCase("AgentMapping.jsp")) && (lovKey.equalsIgnoreCase("agntAccount"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No account found! Close this window & 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>Account No</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Available Balance</b></th><th style="background-color: #99FF99;"><b>Account 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.cashForm.accName.value = document.getElementById('y<%=i%>').innerHTML;opener.document.cashForm.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.cashForm.accName.value = document.getElementById('y<%=i%>').innerHTML;opener.document.cashForm.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.cashForm.accName.value = document.getElementById('y<%=i%>').innerHTML;opener.document.cashForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                     <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.cashForm.accName.value = document.getElementById('y<%=i%>').innerHTML;opener.document.cashForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString("acctype")%></td>
                </tr>
                <%}%>
            </table>

            <%}
          }  else if ((screenName.equalsIgnoreCase("ChequePosting.jsp")) && (lovKey.equalsIgnoreCase("chqEnq"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Deposit A/C found! Close this window & Please recheck the A/C No. selected.</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>Available Balance</b></th><th style="background-color: #99FF99;"><b>Photograph</b></th><th style="background-color: #99FF99;"><b>Signature</b></th><th style="background-color: #99FF99;"><b>PAN_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.chequeViewForm.accNoEnq.value = document.getElementById('x<%=i%>').innerHTML;window.opener.submitformEnq();
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.chequeViewForm.accNoEnq.value = document.getElementById('x<%=i%>').innerHTML;window.opener.submitformEnq();
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.chequeViewForm.accNoEnq.value = document.getElementById('x<%=i%>').innerHTML;window.opener.submitformEnq();
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.chequeViewForm.accNoEnq.value = document.getElementById('x<%=i%>').innerHTML;window.opener.submitformEnq();
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%>:<%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.chequeViewForm.accNoEnq.value = document.getElementById('x<%=i%>').innerHTML;window.opener.submitformEnq();
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%>:<%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.chequeViewForm.accNoEnq.value = document.getElementById('x<%=i%>').innerHTML;window.opener.submitformEnq();
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.transferForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><% if ((resultSet.getString(9) == null) || resultSet.getString(9).isEmpty()) {%><img src="${pageContext.request.contextPath}/img/faceDefault - Copy.jpg" height="100" width="140" border="1px" /><%} else {%> <img src="${pageContext.request.contextPath}/UploadedFiles/<%=resultSet.getString(9)%>" height="100" width="140" border="1px" /><%}%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.transferForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><% if ((resultSet.getString(10) == null) || resultSet.getString(10).isEmpty()) {%><b align="middle">No Siganture Found</b><%} else {%> <img src="${pageContext.request.contextPath}/UploadedFiles/<%=resultSet.getString(10)%>" height="50" width="140" border="1px" /><%}%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.transferForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(11)%></td>
                    
                </tr>
                <%}%>
            </table>

            <%}
             }else if ((screenName.equalsIgnoreCase("AgentMapping.jsp")) && (lovKey.equalsIgnoreCase("agntMap"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Agent found! Close this window & 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>Agent Id</b></th><th style="background-color: #99FF99;"><b>Agent 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.cashForm.agntIdId.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.cashForm.agntIdId.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                </tr>
                <%}%>
            </table>
          <% }%>
          <% }else if ((screenName.equalsIgnoreCase("TotalCashDepositDDS.jsp")) && (lovKey.equalsIgnoreCase("agntMap"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Agent found! Close this window & 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>Agent Id</b></th><th style="background-color: #99FF99;"><b>Agent Name</b></th><th style="background-color: #99FF99;"><b>Total Limit</b></th><th style="background-color: #99FF99;"><b>Hold 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%>' onclick="opener.document.cashDepForm.agntIdId.value = document.getElementById('x<%=i%>').innerHTML;opener.document.cashDepForm.hldAmount.value = document.getElementById('p<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.cashDepForm.agntIdId.value = document.getElementById('x<%=i%>').innerHTML;opener.document.cashDepForm.hldAmount.value = document.getElementById('p<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.cashDepForm.agntIdId.value = document.getElementById('x<%=i%>').innerHTML;opener.document.cashDepForm.hldAmount.value = document.getElementById('p<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='p<%=i%>' onclick="opener.document.cashDepForm.agntIdId.value = document.getElementById('x<%=i%>').innerHTML;opener.document.cashDepForm.hldAmount.value = document.getElementById('p<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                </tr>
                <%}%>
            </table>
          <% }
          } else if ((screenName.equalsIgnoreCase("DepositTransferClosure.jsp")) && (lovKey.equalsIgnoreCase("glAccount"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No GL A/C found! Close this window & Please recheck the A/C No. selected.</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>Ledger Name</b></th><th style="background-color: #99FF99;"><b>Gl 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.transferForm.accNo_gl_to.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.transferForm.accNo_gl_to.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>

                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.transferForm.accNo_gl_to.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>

                </tr>
                <%}%>
            </table>
            <%}
             }else if ((screenName.equalsIgnoreCase("AgentMapping.jsp")) && (lovKey.equalsIgnoreCase("limitSetting"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Agent found! Close this window & 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>Agent Id</b></th><th style="background-color: #99FF99;"><b>Agent Name</b></th><th style="background-color: #99FF99;"><b>Total Limit</b></th><th style="background-color: #99FF99;"><b>Hold 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%>' onclick="opener.document.limitSettingForm.agentId.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.limitSettingForm.agentId.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.limitSettingForm.agentId.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.limitSettingForm.agentId.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                </tr>
                <%}%>
            </table>
          <% }%>
          <% }else if (((screenName.equalsIgnoreCase("BatchTransaction.jsp")) || (screenName.equalsIgnoreCase("BatchAuthorisation.jsp"))) && (lovKey.equalsIgnoreCase("BatchSearch"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Batch found! Close this window & 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>Batch Id</b></th><th style="background-color: #99FF99;"><b>Total Amount</b></th><th style="background-color: #99FF99;"><b>Status</b></th><th style="background-color: #99FF99;"><b>Transaction 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.batchForm.batchID.value = document.getElementById('x<%=i%>').innerHTML;window.opener.getBatchDetails() ;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.batchForm.batchID.value = document.getElementById('x<%=i%>').innerHTML;window.opener.getBatchDetails() ;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.batchForm.batchID.value = document.getElementById('x<%=i%>').innerHTML;window.opener.getBatchDetails() ;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.batchForm.batchID.value = document.getElementById('x<%=i%>').innerHTML;window.opener.getBatchDetails() ;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                </tr>
                <%}%>
            </table>
          <% }%>
          <% }else if ((screenName.equalsIgnoreCase("InsuranceAddition.jsp")) && (lovKey.equalsIgnoreCase("CifIns"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Customer details found! Close this window & 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>CIF No.</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Guardian Name</b></th><th style="background-color: #99FF99;"><b>Photo</b></th><th style="background-color: #99FF99;"><b>Signature</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.insuranceForm.custId.value =document.getElementById('x<%=i%>').innerHTML;opener.document.insuranceForm.custName.value =document.getElementById('y<%=i%>').innerHTML;opener.document.insuranceForm.insNoEx.value =document.getElementById('o<%=i%>').innerHTML;opener.document.insuranceForm.expDateEx.value =document.getElementById('p<%=i%>').innerHTML;opener.document.insuranceForm.comEx.value =document.getElementById('q<%=i%>').innerHTML;opener.document.insuranceForm.statusEx.value =document.getElementById('r<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.insuranceForm.custId.value =document.getElementById('x<%=i%>').innerHTML;opener.document.insuranceForm.custName.value =document.getElementById('y<%=i%>').innerHTML;opener.document.insuranceForm.insNoEx.value =document.getElementById('o<%=i%>').innerHTML;opener.document.insuranceForm.expDateEx.value =document.getElementById('p<%=i%>').innerHTML;opener.document.insuranceForm.comEx.value =document.getElementById('q<%=i%>').innerHTML;opener.document.insuranceForm.statusEx.value =document.getElementById('r<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.insuranceForm.custId.value =document.getElementById('x<%=i%>').innerHTML;opener.document.insuranceForm.custName.value =document.getElementById('y<%=i%>').innerHTML;opener.document.insuranceForm.insNoEx.value =document.getElementById('o<%=i%>').innerHTML;opener.document.insuranceForm.expDateEx.value =document.getElementById('p<%=i%>').innerHTML;opener.document.insuranceForm.comEx.value =document.getElementById('q<%=i%>').innerHTML;opener.document.insuranceForm.statusEx.value =document.getElementById('r<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='m<%=i%>' onclick="opener.document.insuranceForm.custId.value =document.getElementById('x<%=i%>').innerHTML;opener.document.insuranceForm.custName.value =document.getElementById('y<%=i%>').innerHTML;opener.document.insuranceForm.insNoEx.value =document.getElementById('o<%=i%>').innerHTML;opener.document.insuranceForm.expDateEx.value =document.getElementById('p<%=i%>').innerHTML;opener.document.insuranceForm.comEx.value =document.getElementById('q<%=i%>').innerHTML;opener.document.insuranceForm.statusEx.value =document.getElementById('r<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%if (resultSet.getString(4) == null || resultSet.getString(4).isEmpty()) {%><img src="${pageContext.request.contextPath}/img/faceDefault - Copy.jpg" height="100" width="140" border="1px" /><%} else {%> <img src="${pageContext.request.contextPath}/UploadedFiles/<%=resultSet.getString(4)%>" height="100" width="140" border="1px" /> <%}%></td>
                    <td bgcolor='<%=bgColor%>' id='n<%=i%>'  onclick="opener.document.insuranceForm.custId.value =document.getElementById('x<%=i%>').innerHTML;opener.document.insuranceForm.custName.value =document.getElementById('y<%=i%>').innerHTML;opener.document.insuranceForm.insNoEx.value =document.getElementById('o<%=i%>').innerHTML;opener.document.insuranceForm.expDateEx.value =document.getElementById('p<%=i%>').innerHTML;opener.document.insuranceForm.comEx.value =document.getElementById('q<%=i%>').innerHTML;opener.document.insuranceForm.statusEx.value =document.getElementById('r<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%if (resultSet.getString(5) == null || resultSet.getString(5).isEmpty()) {%><b align="middle">No Siganture Found</b><%} else {%> <img src="${pageContext.request.contextPath}/UploadedFiles/<%=resultSet.getString(5)%>" height="50" width="140" border="1px" /> <%}%></td>
                    <td style="display:none;" bgcolor='<%=bgColor%>' id='o<%=i%>'
                     style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td style="display:none;" bgcolor='<%=bgColor%>' id='p<%=i%>'
                     style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td style="display:none;" bgcolor='<%=bgColor%>' id='q<%=i%>'
                     style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                     <td style="display:none;" bgcolor='<%=bgColor%>' id='r<%=i%>'
                     style="cursor:pointer;"><%=resultSet.getString(9)%></td>
                </tr>
                <%}%>
            </table>
          <% }%>
          <% }else if ((screenName.equalsIgnoreCase("CashWidrawlDeposit.jsp")) && (lovKey.equalsIgnoreCase("ddsCash"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Account found! Close this window & 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>Account No</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Available Balance</b></th><th style="background-color: #99FF99;"><b>Account 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.cashForm.accName.value = document.getElementById('y<%=i%>').innerHTML;opener.document.cashForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.cashForm.avlBal.value = document.getElementById('z<%=i%>').innerHTML;opener.document.cashForm.accntTypeId.value = document.getElementById('p<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.cashForm.accName.value = document.getElementById('y<%=i%>').innerHTML;opener.document.cashForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.cashForm.avlBal.value = document.getElementById('z<%=i%>').innerHTML;opener.document.cashForm.accntTypeId.value = document.getElementById('p<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.cashForm.accName.value = document.getElementById('y<%=i%>').innerHTML;opener.document.cashForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.cashForm.avlBal.value = document.getElementById('z<%=i%>').innerHTML;opener.document.cashForm.accntTypeId.value = document.getElementById('p<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                     <td bgcolor='<%=bgColor%>' id='p<%=i%>' onclick="opener.document.cashForm.accName.value = document.getElementById('y<%=i%>').innerHTML;opener.document.cashForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.cashForm.avlBal.value = document.getElementById('z<%=i%>').innerHTML;opener.document.cashForm.accntTypeId.value = document.getElementById('p<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString("acctype")%></td>
                </tr>
                <%}%>
            </table>

            <%}
          }else if ((screenName.equalsIgnoreCase("BulkFileUpload.jsp") || screenName.equalsIgnoreCase("AccountRenewalBulk.jsp") ) && (lovKey.equalsIgnoreCase("bulkReport"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No File Details found! Close this window & 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>File Id</b></th><th style="background-color: #99FF99;"><b>File Name</b></th><th style="background-color: #99FF99;"><b>Post Date</b></th><th style="background-color: #99FF99;"><b>Status</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.BulkFileReport.fileId.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.BulkFileReport.fileId.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.BulkFileReport.fileId.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='z1<%=i%>' onclick="opener.document.BulkFileReport.fileId.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                </tr>
                <%}%>
            </table>

            <%}
          }else if ((screenName.equalsIgnoreCase("AccountRenewalBulkSTB.jsp")) && (lovKey.equalsIgnoreCase("bulkReport"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No File Details found! Close this window & 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>File Id</b></th><th style="background-color: #99FF99;"><b>Pacs Name</b></th><th style="background-color: #99FF99;"><b>File Name</b></th><th style="background-color: #99FF99;"><b>Post Date</b></th><th style="background-color: #99FF99;"><b>Status</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.BulkFileReport.fileId.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.BulkFileReport.fileId.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.BulkFileReport.fileId.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='z1<%=i%>' onclick="opener.document.BulkFileReport.fileId.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.BulkFileReport.fileId.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                </tr>
                <%}%>
            </table>

            <%}
          }else if ((screenName.equalsIgnoreCase("PrintPassbook.jsp")) && (lovKey.equalsIgnoreCase("accSrch"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No account found! Close this window & Please recheck the account number</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>Name</b></th><th style="background-color: #99FF99;"><b>Guardian Name</b></th><th style="background-color: #99FF99;"><b>Product Name</b></th><th style="background-color: #99FF99;"><b>Customer Number</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.passbookPrint.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.passbookPrint.custno.value = document.getElementById('b<%=i%>').innerHTML;opener.document.getElementById('accNo').setAttribute('readonly', true);
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.passbookPrint.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.passbookPrint.custno.value = document.getElementById('b<%=i%>').innerHTML;opener.document.getElementById('accNo').setAttribute('readonly', true);
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.passbookPrint.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.passbookPrint.custno.value = document.getElementById('b<%=i%>').innerHTML;opener.document.getElementById('accNo').setAttribute('readonly', true);
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.passbookPrint.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.passbookPrint.custno.value = document.getElementById('b<%=i%>').innerHTML;opener.document.getElementById('accNo').setAttribute('readonly', true);
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.passbookPrint.accNo.value = document.getElementById('x<%=i%>').innerHTML;opener.document.passbookPrint.custno.value = document.getElementById('b<%=i%>').innerHTML;opener.document.getElementById('accNo').setAttribute('readonly', true);
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>


                </tr>
                <%}%>
            </table>
            <%}
             } else if ((screenName.equalsIgnoreCase("DepositMiscellaneousOperation.jsp")) && (lovKey.equalsIgnoreCase("TransactionNoSearch"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Transaction found! Close this window & 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>Account No</b></th><th style="background-color: #99FF99;"><b>CIF No</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Transaction No</b></th><th style="background-color: #99FF99;"><b>Transaction Amount</b></th><th style="background-color: #99FF99;"><b>Transaction Indicator</b></th><th style="background-color: #99FF99;"><b>Transaction Date</b></th><th style="background-color: #99FF99;"><b>Post Time</b></th><th style="background-color: #99FF99;"><b>Printing Status</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.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(9)%></td>
                </tr>
                <%}%>
            </table>

            <%}
             }
else if ((screenName.equalsIgnoreCase("DepositMiscellaneousOperation.jsp")) && (lovKey.equalsIgnoreCase("TransactionLoanNoSearch"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Transaction found! Close this window & 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>Account No</b></th><th style="background-color: #99FF99;"><b>CIF No</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Transaction No</b></th><th style="background-color: #99FF99;"><b>Transaction Amount</b></th><th style="background-color: #99FF99;"><b>Transaction Indicator</b></th><th style="background-color: #99FF99;"><b>Transaction Date</b></th><th style="background-color: #99FF99;"><b>Post Time</b></th><th style="background-color: #99FF99;"><b>Printing Status</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.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.DepositMiscellaneousForm.transactionNoInpBox.value = document.getElementById('a<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(9)%></td>
                </tr>
                <%}%>
            </table>

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

            <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>CC Account No</b></th><th style="background-color: #99FF99;"><b>Linked CBS Account No.</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.farmerForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;window.opener.showInfoDiv();
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.farmerForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;window.opener.showInfoDiv();
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.farmerForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;window.opener.showInfoDiv();
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.farmerForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;window.opener.showInfoDiv();
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>

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

            <%}
            else if ((screenName.equalsIgnoreCase("TDOperation.jsp")) && (lovKey.equalsIgnoreCase("CalcFDMaturity"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No rate slab defined for this term value and term length</p>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<input type="button" value="Veiw Rate Slab" onclick="self.close();javascript:popup_FDRateSlab(600, 450);">
            </center>

            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Interest Rate</b></th><th style="background-color: #99FF99;"><b>Maturity 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%>' onclick="opener.document.transactionForm.matAmt.value = document.getElementById('y<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.transactionForm.matAmt.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>

                </tr>
                <%}%>
            </table>
            <%} }
            else if ((screenName.equalsIgnoreCase("TDOperation.jsp") || (screenName.equalsIgnoreCase("RDOperation.jsp"))) && (lovKey.equalsIgnoreCase("GLAccSearchTransfer"))) {%>
                <% if (!resultSet.isBeforeFirst()) {%>
                <center><p>No Savings A/C found! Close this window & Please recheck the A/C No. selected.</p>
                    <input type="button" value="Close Window" onclick="self.close();">
                </center>
                <% } else {%>
                <table border="2">
                    <tr><th style="background-color: #99FF99;"><b>KEY_1</b></th><th style="background-color: #99FF99;"><b>LEDGER_NAME</b></th><th style="background-color: #99FF99;"><b>GL_PROD_ID</b></th><th style="background-color: #99FF99;"><b>LEDGER_DESC</b></th><th style="background-color: #99FF99;"><b>CUM_CURR_VAL</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.transferGLAcc.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.transferGLAcc.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.transferGLAcc.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.transferGLAcc.value = document.getElementById('x<%=i%>').innerHTML;
                            self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                        <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.transactionForm.transferGLAcc.value = document.getElementById('x<%=i%>').innerHTML;
                            self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%> </td>
    
    
                    </tr>
                    <%}%>
                </table>
                <%}
            } //Added TGL code 28.02.2024
           else if ((screenName.equalsIgnoreCase("DepositAccountCreation.jsp")) && (lovKey.equalsIgnoreCase("CifDetails"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Customer found! Close this window & Please recheck the Customer Name selected.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <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.name1.value = document.getElementById('y<%=i%>').innerHTML; opener.document.getElementById('name1').style.display = 'block'; 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.name1.value = document.getElementById('y<%=i%>').innerHTML; opener.document.getElementById('name1').style.display = 'block'; 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.name1.value = document.getElementById('y<%=i%>').innerHTML; opener.document.getElementById('name1').style.display = 'block'; self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.name1.value = document.getElementById('y<%=i%>').innerHTML; opener.document.getElementById('name1').style.display = 'block'; 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.name1.value = document.getElementById('y<%=i%>').innerHTML; opener.document.getElementById('name1').style.display = 'block'; self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.name1.value = document.getElementById('y<%=i%>').innerHTML; opener.document.getElementById('name1').style.display = 'block'; self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.accCreatForm.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.name1.value = document.getElementById('y<%=i%>').innerHTML; opener.document.getElementById('name1').style.display = 'block'; self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>

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

            <%}
             } else if ((screenName.equalsIgnoreCase("DepositAccountCreation.jsp")) && (lovKey.equalsIgnoreCase("CifDetails2"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Customer found! Close this window & Please recheck the Customer Name selected.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <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";
                         }%>
                <%--Changed 'document.accCreatForm.cifNumber2.value' to 'document.accCreatForm.cifNumber2.value' by Bitan for Multiple CIF --%>
                <%--Changed 'document.accCreatForm.name2.value' to 'opener.document.accCreatForm.jt_name'+Counter+'.value' by Bitan for Multiple CIF --%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.accCreatForm.jt_cifNumber<%=Counter%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.accCreatForm.jt_name<%=Counter%>.value = document.getElementById('y<%=i%>').innerHTML; opener.document.getElementById('jt_name<%=Counter%>').style.display = 'block'; self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.accCreatForm.jt_cifNumber<%=Counter%>.value = document.getElementById('x<%=i%>').innerHTML;
                       opener.document.accCreatForm.jt_name<%=Counter%>.value = document.getElementById('y<%=i%>').innerHTML; opener.document.getElementById('jt_name<%=Counter%>').style.display = 'block'; self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.accCreatForm.jt_cifNumber<%=Counter%>.value = document.getElementById('x<%=i%>').innerHTML;
                       opener.document.accCreatForm.jt_name<%=Counter%>.value = document.getElementById('y<%=i%>').innerHTML; opener.document.getElementById('jt_name<%=Counter%>').style.display = 'block'; self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.accCreatForm.jt_cifNumber<%=Counter%>.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.jt_name<%=Counter%>.value = document.getElementById('y<%=i%>').innerHTML; opener.document.getElementById('jt_name<%=Counter%>').style.display = 'block'; self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.accCreatForm.jt_cifNumber<%=Counter%>.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.jt_name<%=Counter%>.value = document.getElementById('y<%=i%>').innerHTML; opener.document.getElementById('jt_name<%=Counter%>').style.display = 'block'; self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.accCreatForm.jt_cifNumber<%=Counter%>.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.jt_name<%=Counter%>.value = document.getElementById('y<%=i%>').innerHTML; opener.document.getElementById('jt_name<%=Counter%>').style.display = 'block'; self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.accCreatForm.jt_cifNumber<%=Counter%>.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatForm.jt_name<%=Counter%>.value = document.getElementById('y<%=i%>').innerHTML; opener.document.getElementById('jt_name<%=Counter%>').style.display = 'block'; self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                </tr>
                <%}%>
            </table>

            <%}
             } else if ((screenName.equalsIgnoreCase("accountAmend.jsp")) && (lovKey.equalsIgnoreCase("AccSrch"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Customer found! Close this window & Please recheck the Customer Name selected.</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 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>Priciple Outstanding</b></th><th style="background-color: #99FF99;"><b>Expiry 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='a<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('b<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('e<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('f<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('j<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('b<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('e<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('f<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('j<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('b<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('e<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('f<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('j<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('b<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('e<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('f<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('j<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='e<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('b<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('e<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('f<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('j<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='f<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('b<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('e<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('f<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('j<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='g<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('b<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('e<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('f<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('j<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(10)%></td>
                    <td bgcolor='<%=bgColor%>' id='h<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('b<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('e<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('f<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('j<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;display: none;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='i<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('b<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('e<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('f<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('j<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;display: none;"><%=resultSet.getString(8)%></td>
                    <td bgcolor='<%=bgColor%>' id='j<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('b<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('e<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('f<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('j<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;display: none;"><%=resultSet.getString(9)%></td>
                    <td bgcolor='<%=bgColor%>' id='k<%=i%>' style="display: none;"><%=resultSet.getString(11)%></td>

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

            <%}
            } else if ((screenName.equalsIgnoreCase("accountAmendSTB.jsp")) && (lovKey.equalsIgnoreCase("AccSrch"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Customer found! Close this window & Please recheck the Customer Name selected.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Pacs Name</b></th><th style="background-color: #99FF99;"><b>Pacs ID</b></th><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 Name</b></th><th style="background-color: #99FF99;"><b>Current Status</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>Priciple Outstanding</b></th><th style="background-color: #99FF99;"><b>Expiry 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='a<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.pacsId_PACS.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.accountAmend.pacsName.value = document.getElementById('a<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('y<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('j<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('x<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.pacsId_PACS.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.accountAmend.pacsName.value = document.getElementById('a<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('y<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('j<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('x<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.pacsId_PACS.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.accountAmend.pacsName.value = document.getElementById('a<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('y<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('j<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('x<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.pacsId_PACS.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.accountAmend.pacsName.value = document.getElementById('a<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('y<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('j<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('x<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='e<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.pacsId_PACS.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.accountAmend.pacsName.value = document.getElementById('a<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('y<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('j<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('x<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='f<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.pacsId_PACS.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.accountAmend.pacsName.value = document.getElementById('a<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('y<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('j<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('x<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='g<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.pacsId_PACS.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.accountAmend.pacsName.value = document.getElementById('a<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('y<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('j<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('x<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                    <td bgcolor='<%=bgColor%>' id='h<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.pacsId_PACS.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.accountAmend.pacsName.value = document.getElementById('a<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('d<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('y<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('j<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('x<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(9)%></td>
                    <td bgcolor='<%=bgColor%>' id='i<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.pacsId_PACS.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.accountAmend.pacsName.value = document.getElementById('a<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('y<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('j<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('x<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(10)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.pacsId_PACS.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.accountAmend.pacsName.value = document.getElementById('a<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('y<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('j<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('x<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;"><%=resultSet.getString(13)%></td>
                    <td bgcolor='<%=bgColor%>' id='j<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.pacsId_PACS.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.accountAmend.pacsName.value = document.getElementById('c<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('y<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('j<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('x<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;display: none;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.pacsId_PACS.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.accountAmend.pacsName.value = document.getElementById('a<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('y<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('j<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('x<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;display: none;"><%=resultSet.getString(12)%></td>                    
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.getElementById('intCat').value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.pacsId_PACS.value = document.getElementById('b<%=i%>').innerHTML;
                    opener.document.accountAmend.pacsName.value = document.getElementById('a<%=i%>').innerHTML;opener.document.accountAmend.accNo.value = document.getElementById('d<%=i%>').innerHTML;
                    opener.document.accountAmend.custName.value = document.getElementById('d<%=i%>').innerHTML;opener.document.accountAmend.limit.value = document.getElementById('g<%=i%>').innerHTML;opener.document.accountAmend.availBal.value = document.getElementById('h<%=i%>').innerHTML;
                    opener.document.accountAmend.prinOust.value = document.getElementById('i<%=i%>').innerHTML;opener.document.accountAmend.expDate.value = document.getElementById('y<%=i%>').innerHTML;opener.document.accountAmend.cifNo.value = document.getElementById('j<%=i%>').innerHTML;
                    opener.document.accountAmend.intOust.value = document.getElementById('k<%=i%>').innerHTML;opener.document.accountAmend.penalInt.value = document.getElementById('x<%=i%>').innerHTML;opener.$('.beforeAccSrch').show();self.close();" style="cursor:pointer;display: none;"><%=resultSet.getString(14)%></td>
                    <td bgcolor='<%=bgColor%>' id='k<%=i%>' style="display: none;"><%=resultSet.getString(11)%></td>

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

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

            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Account No</b></th><th style="background-color: #99FF99;"><b>CBS Acc No</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b> Guardian 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.CBSAccountMapping.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.CBSAccountMapping.cbsAccount.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.CBSAccountMapping.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.CBSAccountMapping.cbsAccount.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.CBSAccountMapping.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.CBSAccountMapping.cbsAccount.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.CBSAccountMapping.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.CBSAccountMapping.cbsAccount.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>

                </tr>
                <%}%>
            </table>
            <%} else if ((screenName.equalsIgnoreCase("ForceAccountClosure.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> Guardian Name</b></th><th style="background-color: #99FF99;"><b>Account TypeS</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.ForceAccountClosure.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.ForceAccountClosure.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.ForceAccountClosure.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.ForceAccountClosure.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.ForceAccountClosure.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                </tr>
                <%}%>
            </table>
            <%} else if ((screenName.equalsIgnoreCase("BGLAccountCreation.jsp")) && (lovKey.equalsIgnoreCase("BGLSrch"))) {%>

            <table border="2">
                <tr><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.BGLAccountCreation.bglCode.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.BGLAccountCreation.bglName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.BGLAccountCreation.bglProdId.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.BGLAccountCreation.bglCode.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.BGLAccountCreation.bglName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.BGLAccountCreation.bglProdId.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td style="visibility:collapse;" bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.BGLAccountCreation.bglCode.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.BGLAccountCreation.bglName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.BGLAccountCreation.bglProdId.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                </tr>
                <%}%>
            </table>
            <%} else if ((screenName.equalsIgnoreCase("LienMarking.jsp")) && (lovKey.equalsIgnoreCase("accSearch"))) {%>

            <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>Guardian Name</b></th><th style="background-color: #99FF99;"><b>Sanction Amt</b></th><th style="background-color: #99FF99;"><b>Old Acct</b></th><th style="background-color: #99FF99;"><b>Customer No</b></th></tr>
                <%int i = 0;
                     while (resultSet.next()) {
                         i++;
                         if (flag == 1) {
                             flag = 0;
                             bgColor = "#AFC7C7";
                         } else {
                             flag = 1;
                             bgColor = "#95B9C7";
                         }%>
              <%  if (lienType.equalsIgnoreCase("K")) {%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                </tr>
             <%} else if (lienType.equalsIgnoreCase("G")) {%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                </tr>
             <%} else if(lienType.equalsIgnoreCase("D") || lienType.equalsIgnoreCase("C") || lienType.equalsIgnoreCase("O")) {%>
                <tr><td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.LienMarking.cifNo.value = document.getElementById('d<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.LienMarking.cifNo.value = document.getElementById('d<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.LienMarking.cifNo.value = document.getElementById('d<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.LienMarking.cifNo.value = document.getElementById('d<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.LienMarking.cifNo.value = document.getElementById('d<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.LienMarking.cifNo.value = document.getElementById('d<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.LienMarking.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.LienMarking.cifNo.value = document.getElementById('d<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                </tr>                
                <%}%>
                <%}%>
            </table>
            <%} else if ((screenName.equalsIgnoreCase("RemoveLien.jsp")) && (lovKey.equalsIgnoreCase("accSearch"))) {%>

            <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>Guardian Name</b></th><th style="background-color: #99FF99;"><b>Sanction Amt</b></th><th style="background-color: #99FF99;"><b>Old Acct</b></th><th style="background-color: #99FF99;"><b>Customer No</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.remLien.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.remLien.description.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.remLien.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.remLien.description.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.remLien.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.remLien.description.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.remLien.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.remLien.description.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.remLien.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.remLien.description.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.remLien.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.remLien.description.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.remLien.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.remLien.description.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='e<%=i%>' onclick="opener.document.remLien.loanAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.remLien.description.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(8)%></td>    
                </tr>             
                <%}%>
            </table>
            <%} else if ((screenName.equalsIgnoreCase("UserCreation.jsp")) && (lovKey.equalsIgnoreCase("UserSrch"))) {%>

            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Role Name 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.UserCreation.userRole1.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.UserCreation.userRole.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.UserCreation.userRole1.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.UserCreation.userRole.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;display: none"><%=resultSet.getString(2)%></td>
                </tr>
                <%}%>
            </table>
            <%} else if ((screenName.equalsIgnoreCase("UserAmendment.jsp")) && (lovKey.equalsIgnoreCase("UserSrch"))) {%>

            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>User Id</b></th><th style="background-color: #99FF99;"><b>User Name</b></th><th style="background-color: #99FF99;"><b>Role 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.UserAmendment.userName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.UserAmendment.userId.value = document.getElementById('x<%=i%>').innerHTML;opener.document.UserAmendment.roleId.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.UserAmendment.ipFlag.value = document.getElementById('b<%=i%>').innerHTML;opener.document.UserAmendment.staticIP.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.UserAmendment.userName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.UserAmendment.userId.value = document.getElementById('x<%=i%>').innerHTML;opener.document.UserAmendment.roleId.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.UserAmendment.ipFlag.value = document.getElementById('b<%=i%>').innerHTML;opener.document.UserAmendment.staticIP.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.UserAmendment.userName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.UserAmendment.userId.value = document.getElementById('x<%=i%>').innerHTML;opener.document.UserAmendment.roleId.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.UserAmendment.ipFlag.value = document.getElementById('b<%=i%>').innerHTML;opener.document.UserAmendment.staticIP.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.UserAmendment.userName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.UserAmendment.userId.value = document.getElementById('x<%=i%>').innerHTML;opener.document.UserAmendment.roleId.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.UserAmendment.ipFlag.value = document.getElementById('b<%=i%>').innerHTML;opener.document.UserAmendment.staticIP.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;display: none"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.UserAmendment.userName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.UserAmendment.userId.value = document.getElementById('x<%=i%>').innerHTML;opener.document.UserAmendment.roleId.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.UserAmendment.ipFlag.value = document.getElementById('b<%=i%>').innerHTML;opener.document.UserAmendment.staticIP.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;display: none"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.UserAmendment.userName.value = document.getElementById('y<%=i%>').innerHTML;
                        opener.document.UserAmendment.userId.value = document.getElementById('x<%=i%>').innerHTML;opener.document.UserAmendment.roleId.value = document.getElementById('a<%=i%>').innerHTML;
                        opener.document.UserAmendment.ipFlag.value = document.getElementById('b<%=i%>').innerHTML;opener.document.UserAmendment.staticIP.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;display: none"><%=resultSet.getString(6)%></td>
                </tr>
                <%}%>
            </table>
            <%} else if ((screenName.equalsIgnoreCase("MiscChargeDeduction.jsp")) && (lovKey.equalsIgnoreCase("prodLOV"))) {%>

            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>Product Code</b></th><th style="background-color: #99FF99;"><b>Interest Category</b></th><th style="background-color: #99FF99;"><b>Product Name</b></th><th style="background-color: #99FF99;"><b>Product Description</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.MiscChargeDeductionForm.prodCode.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.MiscChargeDeductionForm.intCat.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.MiscChargeDeductionForm.prodCode.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.MiscChargeDeductionForm.intCat.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.MiscChargeDeductionForm.prodCode.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.MiscChargeDeductionForm.intCat.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.MiscChargeDeductionForm.prodCode.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.MiscChargeDeductionForm.intCat.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.MiscChargeDeductionForm.prodCode.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.MiscChargeDeductionForm.intCat.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                </tr>
                <%}%>
            </table>
            <%} else if (screenName.equalsIgnoreCase("accountCreationReadOnly.jsp") && (lovKey.equalsIgnoreCase("PickUPCustomer"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Customer found! Close this window & Please recheck the Customer Name selected.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <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><th style="background-color: #99FF99;"><b>Guardian 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.accCreatFormReadOnly.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatFormReadOnly.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.accCreatFormReadOnly.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatFormReadOnly.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.accCreatFormReadOnly.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatFormReadOnly.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.accCreatFormReadOnly.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatFormReadOnly.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.accCreatFormReadOnly.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatFormReadOnly.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.accCreatFormReadOnly.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatFormReadOnly.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.accCreatFormReadOnly.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.accCreatFormReadOnly.custName.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>

                </tr>
                <%}%>
            </table>
            <%}%>
            <%} else if ((screenName.equalsIgnoreCase("LienMarking.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 Code</b></th><th style="background-color: #99FF99;"><b>Product Desc</b></th><th style="background-color: #99FF99;"><b>Interest Cat</b></th><th style="background-color: #99FF99;"><b>Interest Cat Desc</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.LienMarking.dep_acc_no.value = opener.document.LienMarking.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';
					opener.document.LienMarking.currentValuation.value = Number(opener.document.LienMarking.currentValuation.value) + Number(document.getElementById('e<%=i%>').innerHTML);
					self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.LienMarking.dep_acc_no.value = opener.document.LienMarking.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';
                         opener.document.LienMarking.currentValuation.value = Number(opener.document.LienMarking.currentValuation.value) + Number(document.getElementById('e<%=i%>').innerHTML);
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.LienMarking.dep_acc_no.value = opener.document.LienMarking.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';
                         opener.document.LienMarking.currentValuation.value = Number(opener.document.LienMarking.currentValuation.value) + Number(document.getElementById('e<%=i%>').innerHTML);
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.LienMarking.dep_acc_no.value = opener.document.LienMarking.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';
                         opener.document.LienMarking.currentValuation.value = Number(opener.document.LienMarking.currentValuation.value) + Number(document.getElementById('e<%=i%>').innerHTML);
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.LienMarking.dep_acc_no.value = opener.document.LienMarking.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';
                         opener.document.LienMarking.currentValuation.value = Number(opener.document.LienMarking.currentValuation.value) + Number(document.getElementById('e<%=i%>').innerHTML);
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                        <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.LienMarking.dep_acc_no.value = opener.document.LienMarking.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';
                             opener.document.LienMarking.currentValuation.value = Number(opener.document.LienMarking.currentValuation.value) + Number(document.getElementById('e<%=i%>').innerHTML);
                            self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                     <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.LienMarking.dep_acc_no.value = opener.document.LienMarking.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';
                             opener.document.LienMarking.currentValuation.value = Number(opener.document.LienMarking.currentValuation.value) + Number(document.getElementById('e<%=i%>').innerHTML);
                            self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                     <td bgcolor='<%=bgColor%>' id='e<%=i%>' onclick="opener.document.LienMarking.dep_acc_no.value = opener.document.LienMarking.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';
                             opener.document.LienMarking.currentValuation.value = Number(opener.document.LienMarking.currentValuation.value) + Number(document.getElementById('e<%=i%>').innerHTML);
                            self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                     <td bgcolor='<%=bgColor%>' id='f<%=i%>' onclick="opener.document.LienMarking.dep_acc_no.value = opener.document.LienMarking.dep_acc_no.value + document.getElementById('x<%=i%>').innerHTML + '#';
                             opener.document.LienMarking.currentValuation.value = Number(opener.document.LienMarking.currentValuation.value) + Number(document.getElementById('e<%=i%>').innerHTML);
                            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("tradingFinancialYearAdjustment.jsp")) && (lovKey.equalsIgnoreCase("AccountSearch"))) {%>
            <% 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>GL Account No.</b></th><th style="background-color: #99FF99;"><b>GL Code</b></th><th style="background-color: #99FF99;"><b>GL Ledger Name</b></th><th style="background-color: #99FF99;"><b>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.tradingForm.accNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.tradingForm.searched.value ='1';
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.tradingForm.accNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.tradingForm.searched.value ='1';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.tradingForm.accNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.tradingForm.searched.value ='1';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.tradingForm.accNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.tradingForm.searched.value ='1';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                </tr>
                <%}%>
            </table>
            <%}
             } else if ((screenName.equalsIgnoreCase("tradingFinancialYearAdjustment.jsp")) && (lovKey.equalsIgnoreCase("SecondAccountSearch"))) {%>
            <% 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>GL Account No.</b></th><th style="background-color: #99FF99;"><b>GL Code</b></th><th style="background-color: #99FF99;"><b>GL Ledger Name</b></th><th style="background-color: #99FF99;"><b>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.tradingForm.secAccNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.tradingForm.searchedTwo.value ='1';self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.tradingForm.secAccNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.tradingForm.searchedTwo.value ='1';self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.tradingForm.secAccNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.tradingForm.searchedTwo.value ='1';self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.tradingForm.secAccNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.tradingForm.searchedTwo.value ='1';self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                </tr>
                <%}%>
            </table>
            <%}
             } else if ((screenName.equalsIgnoreCase("DepositTransactionOperation.jsp")) && (lovKey.equalsIgnoreCase("viewSpeci"))) {%>
            <% 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>Holder</b></th><th style="background-color: #99FF99;"><b>Customer No.</b></th><th style="background-color: #99FF99;"><b>Customer Name</b></th><th style="background-color: #99FF99;"><b>Guardian Name</b></th><th style="background-color: #99FF99;"><b>Photo</b></th><th style="background-color: #99FF99;"><b>Signature</b></th><th style="background-color: #99FF99;"><b>Aadhar No</b></th><th style="background-color: #99FF99;"><b>PAN No</b></th><th style="background-color: #99FF99;"><b>Voter No</b></th><th style="background-color: #99FF99;"><b>Introduced By Member</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.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.transactionForm.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.transactionForm.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.transactionForm.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='x<%=i%>' onclick="opener.document.transactionForm.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%if (resultSet.getString(6) == null || resultSet.getString(6).isEmpty()) {%><img src="${pageContext.request.contextPath}/img/faceDefault - Copy.jpg" height="100" width="140" border="1px" /><%} else {%> <img src="${pageContext.request.contextPath}/UploadedFiles/<%=resultSet.getString(6)%>" height="100" width="140" border="1px" /> <%}%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.transactionForm.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%if (resultSet.getString(5) == null || resultSet.getString(5).isEmpty()) {%><img src="${pageContext.request.contextPath}/img/faceDefault - Copy.jpg" height="100" width="140" border="1px" /><%} else {%> <img src="${pageContext.request.contextPath}/UploadedFiles/<%=resultSet.getString(5)%>" height="100" width="140" border="1px" /> <%}%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.transactionForm.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.transactionForm.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.transactionForm.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(9)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.transactionForm.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(10)%></td>
                </tr>
                <%}%>
            </table>
            <%}
             } else if ((screenName.equalsIgnoreCase("AccountModeOfOperation.jsp")) && (lovKey.equalsIgnoreCase("DepositAccLOV"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No A/C found! Close this window & Please recheck the input provided.</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</b></th><th style="background-color: #99FF99;"><b>Photo</b></th><th style="background-color: #99FF99;"><b>Signature</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.AccountModeOfOperationForm.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.AccountModeOfOperationForm.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.AccountModeOfOperationForm.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.AccountModeOfOperationForm.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%>:<%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.AccountModeOfOperationForm.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><% if ((resultSet.getString(6) == null) || resultSet.getString(6).isEmpty()) {%><img src="${pageContext.request.contextPath}/img/faceDefault - Copy.jpg" height="100" width="140" border="1px" /><%} else {%> <img src="${pageContext.request.contextPath}/UploadedFiles/<%=resultSet.getString(6)%>" height="100" width="140" border="1px" /> <%}%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.AccountModeOfOperationForm.depositAccSearch.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><% if ((resultSet.getString(7) == null) || resultSet.getString(7).isEmpty()) {%><b align="middle">No Siganture Found</b><%} else {%> <img src="${pageContext.request.contextPath}/UploadedFiles/<%=resultSet.getString(7)%>" height="50" width="140" border="1px" /> <%}%></td>

                </tr>
                <%}%>
            </table>
            <%}
             }   else if ((screenName.equalsIgnoreCase("TDRepayMethod.jsp")) && (lovKey.equalsIgnoreCase("TDAccLOV"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No A/C found! Close this window & Please recheck the input provided.</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</b></th><th style="background-color: #99FF99;"><b>Photo</b></th><th style="background-color: #99FF99;"><b>Signature</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.TDRepayMethodForm.depAccount.value = document.getElementById('x<%=i%>').innerHTML;opener.document.TDRepayMethodForm.customer.value = document.getElementById('z<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.TDRepayMethodForm.depAccount.value = document.getElementById('x<%=i%>').innerHTML;opener.document.TDRepayMethodForm.customer.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.TDRepayMethodForm.depAccount.value = document.getElementById('x<%=i%>').innerHTML;opener.document.TDRepayMethodForm.customer.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.TDRepayMethodForm.depAccount.value = document.getElementById('x<%=i%>').innerHTML;opener.document.TDRepayMethodForm.customer.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%>:<%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.TDRepayMethodForm.depAccount.value = document.getElementById('x<%=i%>').innerHTML;opener.document.TDRepayMethodForm.customer.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><% if ((resultSet.getString(6) == null) || resultSet.getString(6).isEmpty()) {%><img src="${pageContext.request.contextPath}/img/faceDefault - Copy.jpg" height="100" width="140" border="1px" /><%} else {%> <img src="${pageContext.request.contextPath}/UploadedFiles/<%=resultSet.getString(6)%>" height="100" width="140" border="1px" /> <%}%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.TDRepayMethodForm.depAccount.value = document.getElementById('x<%=i%>').innerHTML;opener.document.TDRepayMethodForm.customer.value = document.getElementById('z<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><% if ((resultSet.getString(7) == null) || resultSet.getString(7).isEmpty()) {%><b align="middle">No Siganture Found</b><%} else {%> <img src="${pageContext.request.contextPath}/UploadedFiles/<%=resultSet.getString(7)%>" height="50" width="140" border="1px" /> <%}%></td>

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

            <%}
             }  else if ((screenName.equalsIgnoreCase("TDRepayMethod.jsp")) && (lovKey.equalsIgnoreCase("TransferAccLOV"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No A/C found! Close this window & Please recheck the input provided.</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</b></th><th style="background-color: #99FF99;"><b>Photo</b></th><th style="background-color: #99FF99;"><b>Signature</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.TDRepayMethodForm.trfAccount.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.TDRepayMethodForm.trfAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.TDRepayMethodForm.trfAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.TDRepayMethodForm.trfAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%>:<%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.TDRepayMethodForm.trfAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><% if ((resultSet.getString(6) == null) || resultSet.getString(6).isEmpty()) {%><img src="${pageContext.request.contextPath}/img/faceDefault - Copy.jpg" height="100" width="140" border="1px" /><%} else {%> <img src="${pageContext.request.contextPath}/UploadedFiles/<%=resultSet.getString(6)%>" height="100" width="140" border="1px" /> <%}%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.TDRepayMethodForm.trfAccount.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><% if ((resultSet.getString(7) == null) || resultSet.getString(7).isEmpty()) {%><b align="middle">No Siganture Found</b><%} else {%> <img src="${pageContext.request.contextPath}/UploadedFiles/<%=resultSet.getString(7)%>" height="50" width="140" border="1px" /> <%}%></td>

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

            <%}
             } else if ((screenName.equalsIgnoreCase("LoanPrincipalAdjustment.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.loanPrinAdj.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.loanPrinAdj.curPrincipal.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.loanPrinAdj.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.loanPrinAdj.curPrincipal.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.loanPrinAdj.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.loanPrinAdj.curPrincipal.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.loanPrinAdj.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.loanPrinAdj.curPrincipal.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.loanPrinAdj.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.loanPrinAdj.curPrincipal.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.loanPrinAdj.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.loanPrinAdj.curPrincipal.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.loanPrinAdj.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.loanPrinAdj.curPrincipal.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='e<%=i%>' onclick="opener.document.loanPrinAdj.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.loanPrinAdj.curPrincipal.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                    <td bgcolor='<%=bgColor%>' id='f<%=i%>' onclick="opener.document.loanPrinAdj.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.loanPrinAdj.curPrincipal.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(9)%></td>
                    <td bgcolor='<%=bgColor%>' id='g<%=i%>' onclick="opener.document.loanPrinAdj.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.loanPrinAdj.curPrincipal.value = document.getElementById('c<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(10)%></td>

                </tr>
                <%}%>
            </table>
            <%} else if ((screenName.equalsIgnoreCase("LoanPrincipalAdjustment.jsp")) && (lovKey.equalsIgnoreCase("bglAcc"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No GL A/C found! Close this window & Please recheck the A/C No. selected.</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>Ledger Name</b></th><th style="background-color: #99FF99;"><b>Gl 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.loanPrinAdj.bglAccNo.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.loanPrinAdj.bglAccNo.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.loanPrinAdj.bglAccNo.value = document.getElementById('x<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>

                </tr>
                <%}%>
            </table>
            <%}
             } else if ((screenName.equalsIgnoreCase("ChequePosting.jsp")) && (lovKey.equalsIgnoreCase("depositAccount"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Deposit A/C found! Close this window & Please recheck the A/C No. selected.</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>Available Balance</b></th><th style="background-color: #99FF99;"><b>Photograph</b></th><th style="background-color: #99FF99;"><b>Signature</b></th><th style="background-color: #99FF99;"><b>PAN_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.transferForm.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.transferForm.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.transferForm.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.transferForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%>:<%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.transferForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%>:<%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.transferForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(8)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.transferForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><% if ((resultSet.getString(9) == null) || resultSet.getString(9).isEmpty()) {%><img src="${pageContext.request.contextPath}/img/faceDefault - Copy.jpg" height="100" width="140" border="1px" /><%} else {%> <img src="${pageContext.request.contextPath}/UploadedFiles/<%=resultSet.getString(9)%>" height="100" width="140" border="1px" /><%}%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.transferForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><% if ((resultSet.getString(10) == null) || resultSet.getString(10).isEmpty()) {%><b align="middle">No Siganture Found</b><%} else {%> <img src="${pageContext.request.contextPath}/UploadedFiles/<%=resultSet.getString(10)%>" height="50" width="140" border="1px" /><%}%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.transferForm.accNo.value = document.getElementById('x<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(11)%></td>

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

            <%}
             } else if (screenName.equalsIgnoreCase("DepositKYCInquiry.jsp") && (lovKey.equalsIgnoreCase("PickUPKYC"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Customer found! Close this window & Please recheck the Customer Name selected.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <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><th style="background-color: #99FF99;"><b>Guardian 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.customerEnquiry.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.customerEnquiry.cifName.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.customerEnquiry.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.customerEnquiry.cifName.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.customerEnquiry.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.customerEnquiry.cifName.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.customerEnquiry.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.customerEnquiry.cifName.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.customerEnquiry.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.customerEnquiry.cifName.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.customerEnquiry.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.customerEnquiry.cifName.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.customerEnquiry.cifNumber.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.customerEnquiry.cifName.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(7)%></td>

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

            <%}
             } else if ((screenName.equalsIgnoreCase("UpdatePacsDetails.jsp")) && (lovKey.equalsIgnoreCase("pacsD"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No GL A/C found! Close this window & Please recheck the A/C No. selected.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>PACS Name</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.PacsDetForm.pacsName.value = document.getElementById('x<%=i%>').innerHTML;opener.document.PacsDetForm.add1.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.PacsDetForm.add2.value = document.getElementById('z<%=i%>').innerHTML;opener.document.PacsDetForm.add3.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.PacsDetForm.gstin.value = document.getElementById('b<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.PacsDetForm.pacsName.value = document.getElementById('x<%=i%>').innerHTML;opener.document.PacsDetForm.add1.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.PacsDetForm.add2.value = document.getElementById('z<%=i%>').innerHTML;opener.document.PacsDetForm.add3.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.PacsDetForm.gstin.value = document.getElementById('b<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.PacsDetForm.pacsName.value = document.getElementById('x<%=i%>').innerHTML;opener.document.PacsDetForm.add1.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.PacsDetForm.add2.value = document.getElementById('z<%=i%>').innerHTML;opener.document.PacsDetForm.add3.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.PacsDetForm.gstin.value = document.getElementById('b<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.PacsDetForm.pacsName.value = document.getElementById('x<%=i%>').innerHTML;opener.document.PacsDetForm.add1.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.PacsDetForm.add2.value = document.getElementById('z<%=i%>').innerHTML;opener.document.PacsDetForm.add3.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.PacsDetForm.gstin.value = document.getElementById('b<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.PacsDetForm.pacsName.value = document.getElementById('x<%=i%>').innerHTML;opener.document.PacsDetForm.add1.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.PacsDetForm.add2.value = document.getElementById('z<%=i%>').innerHTML;opener.document.PacsDetForm.add3.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.PacsDetForm.gstin.value = document.getElementById('b<%=i%>').innerHTML;
                    self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(5)%></td>

                </tr>
                <%}%>
            </table>
            <%}
            } else if ((screenName.equalsIgnoreCase("PLAppropriationOperations.jsp")) && (lovKey.equalsIgnoreCase("AccountSearch"))) {%>
            <% 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>GL Account No.</b></th><th style="background-color: #99FF99;"><b>GL Code</b></th><th style="background-color: #99FF99;"><b>GL Ledger Name</b></th><th style="background-color: #99FF99;"><b>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.PLForm.accNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.PLForm.searched.value ='1';
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.PLForm.accNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.PLForm.searched.value ='1';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.PLForm.accNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.PLForm.searched.value ='1';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.PLForm.accNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.PLForm.searched.value ='1';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>

                </tr>
                <%}%>
            </table>
            <%}
            } else if ((screenName.equalsIgnoreCase("PLAppropriationOperations.jsp")) && (lovKey.equalsIgnoreCase("SecondAccountSearch"))) {%>
            <% 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>GL Account No.</b></th><th style="background-color: #99FF99;"><b>GL Code</b></th><th style="background-color: #99FF99;"><b>GL Ledger Name</b></th><th style="background-color: #99FF99;"><b>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.PLForm.secAccNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.PLForm.searchedTwo.value ='1';
                    self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.PLForm.secAccNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.PLForm.searchedTwo.value ='1';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.PLForm.secAccNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.PLForm.searchedTwo.value ='1';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.PLForm.secAccNo<%=searchString1%>.value = document.getElementById('x<%=i%>').innerHTML;
                    opener.document.PLForm.searchedTwo.value ='1';
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(4)%></td>

                </tr>
                <%}%>
            </table>
            
            <%}%>             
             <%} else if (screenName.equalsIgnoreCase("MemberDetails.jsp") && (lovKey.equalsIgnoreCase("PickUPCustomer"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Customer found! Close this window & Please recheck the Customer Name selected.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <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></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.MemberDetailsform.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membername<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.gender<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dob<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardianname<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.address<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religion<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.caste<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.MemberDetailsform.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membername<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.gender<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dob<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardianname<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.address<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religion<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.caste<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.MemberDetailsform.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membername<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.gender<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dob<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardianname<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.address<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religion<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.caste<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.MemberDetailsform.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membername<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.gender<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dob<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardianname<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.address<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religion<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.caste<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.MemberDetailsform.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membername<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.gender<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dob<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardianname<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.address<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religion<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.caste<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; "><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.MemberDetailsform.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membername<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.gender<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dob<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardianname<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.address<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religion<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.caste<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.MemberDetailsform.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membername<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.gender<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dob<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardianname<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.address<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religion<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.caste<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='e<%=i%>' onclick="opener.document.MemberDetailsform.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membername<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.gender<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dob<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardianname<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.address<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religion<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.caste<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(8)%></td>

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

            <%}%>
             <%} else if (screenName.equalsIgnoreCase("MemberDetails.jsp") && (lovKey.equalsIgnoreCase("PickUPCustomerAmend"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Customer found! Close this window & Please recheck the Customer Name selected.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <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></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.MemberDetailsform.cifAmend<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membernameAmend<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.genderAmend<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dobAmend<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardiannameAmend<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.addressAmend<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religionAmend<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.casteAmend<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.MemberDetailsform.cifAmend<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membernameAmend<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.genderAmend<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dobAmend<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardiannameAmend<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.addressAmend<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religionAmend<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.casteAmend<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.MemberDetailsform.cifAmend<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membernameAmend<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.genderAmend<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dobAmend<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardiannameAmend<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.addressAmend<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religionAmend<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.casteAmend<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.MemberDetailsform.cifAmend<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membernameAmend<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.genderAmend<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dobAmend<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardiannameAmend<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.addressAmend<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religionAmend<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.casteAmend<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.MemberDetailsform.cifAmend<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membernameAmend<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.genderAmend<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dobAmend<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardiannameAmend<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.addressAmend<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religionAmend<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.casteAmend<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; "><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.MemberDetailsform.cifAmend<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membernameAmend<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.genderAmend<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dobAmend<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardiannameAmend<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.addressAmend<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religionAmend<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.casteAmend<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.MemberDetailsform.cifAmend<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membernameAmend<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.genderAmend<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dobAmend<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardiannameAmend<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.addressAmend<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religionAmend<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.casteAmend<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='e<%=i%>' onclick="opener.document.MemberDetailsform.cifAmend<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;opener.document.MemberDetailsform.membernameAmend<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.genderAmend<%=searchString2%>.value = document.getElementById('z<%=i%>').innerHTML;opener.document.MemberDetailsform.dobAmend<%=searchString2%>.value = document.getElementById('a<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.guardiannameAmend<%=searchString2%>.value = document.getElementById('b<%=i%>').innerHTML;opener.document.MemberDetailsform.addressAmend<%=searchString2%>.value = document.getElementById('c<%=i%>').innerHTML;
                    opener.document.MemberDetailsform.religionAmend<%=searchString2%>.value = document.getElementById('d<%=i%>').innerHTML;opener.document.MemberDetailsform.casteAmend<%=searchString2%>.value = document.getElementById('e<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(8)%></td>

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

            <%}%>
             <%}  else if (screenName.equalsIgnoreCase("EmployeeMaster.jsp") && (lovKey.equalsIgnoreCase("PickUPCustomer"))) {%>
            <% if (!resultSet.isBeforeFirst()) {%>
            <center><p>No Customer found! Close this window & Please recheck the Customer Name selected.</p>
                <input type="button" value="Close Window" onclick="self.close();">
            </center>
            <% } else {%>
            <table border="2">
                <tr><th style="background-color: #99FF99;"><b>CIF Number</b></th><th style="background-color: #99FF99;"><b>Employee Name</b></th><th style="background-color: #99FF99;"><b>Guardian 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.formPayroll.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.formPayroll.ename<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(1)%></td>
                    <td bgcolor='<%=bgColor%>' id='y<%=i%>' onclick="opener.document.formPayroll.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.formPayroll.ename<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer;"><%=resultSet.getString(2)%></td>
                    <td bgcolor='<%=bgColor%>' id='z<%=i%>' onclick="opener.document.formPayroll.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.formPayroll.ename<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(3)%></td>
                    <td bgcolor='<%=bgColor%>' id='a<%=i%>' onclick="opener.document.formPayroll.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.formPayroll.ename<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(4)%></td>
                    <td bgcolor='<%=bgColor%>' id='b<%=i%>' onclick="opener.document.formPayroll.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.formPayroll.ename<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; "><%=resultSet.getString(5)%></td>
                    <td bgcolor='<%=bgColor%>' id='c<%=i%>' onclick="opener.document.formPayroll.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.formPayroll.ename<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(6)%></td>
                    <td bgcolor='<%=bgColor%>' id='d<%=i%>' onclick="opener.document.formPayroll.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.formPayroll.ename<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(7)%></td>
                    <td bgcolor='<%=bgColor%>' id='e<%=i%>' onclick="opener.document.formPayroll.cif<%=searchString2%>.value = document.getElementById('x<%=i%>').innerHTML;
                        opener.document.formPayroll.ename<%=searchString2%>.value = document.getElementById('y<%=i%>').innerHTML;
                        self.close();" style="cursor:pointer; display:none;"><%=resultSet.getString(8)%></td>

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

            <%}%>
             <%}%>

        </form>
    </body>
    <%
                } catch (Exception ex) {
                 
                } finally {
                    if (resultSet != null) {
                        resultSet.close();
                    }
                    if (pstmt != null) {
                        pstmt.close();
                    }
                    if (conn != null) {
                        conn.close();
                    }
                }
    %>

</html>
