Anda di halaman 1dari 124

--------------------------------------------------------------------------------

---------------------------
Pastsession.jsp
<%@page import="javax.servlet.*,javax.servlet.http.*,java.sql.*,java.text.*,java
.io.*,java.util.*,com.base64.Base64,com.arcmentor.*"%>
<%@ taglib uri="WEB-INF/tld/taglibs-log.tld" prefix="log" %>
<log:debug category="PastSession.jsp">-------------Entered PastSession.jsp------
----------</log:debug>
<%
String User="",User1="",Keyword="",Keyword1="",Search="",NAS="",SER="",menu="",E
NTKEY="",PSELUK="",CurrentSeaaion="",IM="",NOUSRSEL="",INDT="",INT="",IMT="",US=
"",AL="",S="",BVMIE="";
String DT="",AD="",SDR="",MM="",DD="",YY="",FDT="",TDT="",T="",HH="",AT="",STR="
",FT="",TT="",confses="",selconf="",oto="",conf="";
HttpSession ses1=null;
if(session.getAttribute("user") == null)
{
HttpSession ses2 = request.getSession(true);
ses2.setAttribute("Timeout","true");
response.sendRedirect("index.jsp");
}
else
{
ses1 = request.getSession();
Locale loc = (Locale)ses1.getAttribute("lang");
CurrentSeaaion =ResourceBundle.getBundle("ArcLabels",loc).getString("CSESS");
NAS =ResourceBundle.getBundle("ArcLabels",loc).getString("NAS");
Keyword=ResourceBundle.getBundle("ArcLabels",loc).getString("KWD");
Keyword1=Keyword;
User =ResourceBundle.getBundle("ArcLabels",loc).getString("U");
User1=User;
Search =ResourceBundle.getBundle("ArcLabels",loc).getString("SER");
S= ResourceBundle.getBundle("ArcLabels",loc).getString("S");
menu = ResourceBundle.getBundle("ArcLabels",loc).getString("MENU");
IM = ResourceBundle.getBundle("ArcLabels",loc).getString("IM");
IMT= ResourceBundle.getBundle("ArcLabels",loc).getString("IMT");
US= ResourceBundle.getBundle("ArcLabels",loc).getString("US");
AL= ResourceBundle.getBundle("ArcLabels",loc).getString("AL");
ENTKEY = ResourceBundle.getBundle("ArcLabels1",loc).getString("ENTKEY");
PSELUK = ResourceBundle.getBundle("ArcLabels1",loc).getString("PSELUK");
NOUSRSEL = ResourceBundle.getBundle("ArcLabels1",loc).getString("NOUSRSEL");
INDT = ResourceBundle.getBundle("ArcLabels1",loc).getString("INDT");
INT = ResourceBundle.getBundle("ArcLabels1",loc).getString("INT");
DT= ResourceBundle.getBundle("ArcLabels",loc).getString("DT");
AD= ResourceBundle.getBundle("ArcLabels",loc).getString("AD");
SDR= ResourceBundle.getBundle("ArcLabels",loc).getString("SDR");
MM= ResourceBundle.getBundle("ArcLabels",loc).getString("MM");
DD= ResourceBundle.getBundle("ArcLabels",loc).getString("DD");
YY= ResourceBundle.getBundle("ArcLabels",loc).getString("YY");
FDT= ResourceBundle.getBundle("ArcLabels",loc).getString("FDT");
TDT= ResourceBundle.getBundle("ArcLabels",loc).getString("TDT");
T= ResourceBundle.getBundle("ArcLabels",loc).getString("T");
HH= ResourceBundle.getBundle("ArcLabels",loc).getString("HH");
AT= ResourceBundle.getBundle("ArcLabels",loc).getString("AT");
STR= ResourceBundle.getBundle("ArcLabels",loc).getString("STR");
FT= ResourceBundle.getBundle("ArcLabels",loc).getString("FT");
TT= ResourceBundle.getBundle("ArcLabels",loc).getString("TT");
confses= ResourceBundle.getBundle("ArcLabels",loc).getString("confses");
selconf= ResourceBundle.getBundle("ArcLabels",loc).getString("selconf");
oto= ResourceBundle.getBundle("ArcLabels",loc).getString("oto");
conf= ResourceBundle.getBundle("ArcLabels",loc).getString("conf");
BVMIE =ResourceBundle.getBundle("ArcLabels",loc).getString("BVMIE");
}
// System.out.println("---------------------Inside PastSession.jsp-----------
-------------");
java.util.Date ndt = new java.util.Date();
SimpleDateFormat s1 = new SimpleDateFormat("yyyy-MM-dd");
String dt = s1.format(ndt);
int todayMonth = ndt.getMonth()+1;
int todayDate = ndt.getDate();
int todayYear = ndt.getYear()+1900;
int todayHour = ndt.getHours();
int todayMin = ndt.getMinutes();

Statement stmt1=null;
Statement stmt2=null;
Statement stmt3=null;
Statement stmt4=null;
java.sql.Connection connection=null;
DBConnection dbcon;
dbcon= new DBConnection();
try{
connection = dbcon.getConnection();
} catch (Exception e){%>
<log:error category="PastSession.jsp"> driver class not found+<%=e%></lo
g:error>
<% }
String s="";
String query1="";
String query="select DISTINCT imtype from IM_USERS order by IMTYPE asc";
String insertCriteria="";
int IMCNT=0;
String SELIM="";
ResultSet rs1=null;
ResultSet rs2=null;

String height="225px";
String width="530px";
try
{
if(!(request.getParameter("imtype")==null)){
SELIM=request.getParameter("imtype");
//SELIM.length() > 0 when IM type selected
}
stmt1=connection.createStatement();
stmt2=connection.createStatement();
rs1=stmt1.executeQuery(query);
while(rs1.next())
{
IMCNT++;
}
//System.out.println("IMCNT:- "+IMCNT);
rs1.beforeFirst();
}catch(Exception s22)
{ %>
<log:error category="PastSession.jsp"> Exception 1 in PastSession.jsp
:+<%=s22%></log:error>
<%}%>
<html>
<head>
<!--************************** Support Files for the Drop Down Menu ********
******************-->
<script type="text/javascript" language="javascript" src="resources/sniffer.
js"></script>
<script type="text/javascript" language="javascript1.2" src="resources/<%=me
nu%>"></script>
<script type="text/javascript" language="javascript1.2" src="resources/style
.js"></script>
<!-- ***********************************************************************
******************-->
<script language="JavaScript1.2">
function Toggle(chkno)
{
if(chkno==0)
{
if(document.form.SelRadio0[1].checked==true)
{
document.form.cmbSingle1.disabled=false;
}else if(document.form.SelRadio0[0].checked==true)
{
document.form.cmbSingle1.disabled=true;
}
}//if chkno==0;

if(chkno==1)
{
if(document.form.SelRadio1[1].checked==true)
{
document.form.cmbFromMonth.disabled=false;
document.form.cmbFromDate.disabled=false;
document.form.cmbFromYear.disabled=false;
document.form.cmbToMonth.disabled=false;
document.form.cmbToDate.disabled=false;
document.form.cmbToYear.disabled=false;
}else if(document.form.SelRadio1[0].checked==true)
{
document.form.cmbFromMonth.disabled=true;
document.form.cmbFromDate.disabled=true;
document.form.cmbFromYear.disabled=true;
document.form.cmbToMonth.disabled=true;
document.form.cmbToDate.disabled=true;
document.form.cmbToYear.disabled=true;
}
}//if chkno==1;

if(chkno==2)
{
if(document.form.SelRadio2[1].checked==true)
{
document.form.cmbFromHour.disabled=false;
document.form.cmbFromMin.disabled=false;
document.form.cmbToHour.disabled=false;
document.form.cmbToMin.disabled=false;
}else if(document.form.SelRadio2[0].checked==true)
{
document.form.cmbFromHour.disabled=true;
document.form.cmbFromMin.disabled=true;
document.form.cmbToHour.disabled=true;
document.form.cmbToMin.disabled=true;
}
}//if chkno==2;

} //function Toggle();

function fnSearch1()
{
document.form.action.value='';
var r = new Array();
for (var i = 0; i < document.form.cmbSingle1.options.length; i++)
{
if (document.form.cmbSingle1.options[i].selected)
{
r[r.length] = "'"+document.form.cmbSingle1.options[i].text+"'";
}
}
if((document.form.SelRadio0[1].checked==true)&&(document.form.SelRadio1[
1].checked==true)&&(document.form.SelRadio2[1].checked==true)) //if search crit
eria user+date+time
{
//alert('in user+date+time');
var sub=0;
document.form.whichCriteria.value=4;
document.form.imtype.value= document.form.cmbSingle.value;
if(document.form.cmbSingle1.value=='')
{
alert('<%=NOUSRSEL%>');
sub=1;
}
if( ((parseInt(document.form.cmbToYear.value)) < (parseInt(document.form
.cmbFromYear.value))) || ((parseInt(document.form.cmbToMonth.value)) < (parseInt
(document.form.cmbFromMonth.value))) && ((parseInt(document.form.cmbToDate.value
)) < (parseInt(document.form.cmbFromDate.value))) )
{
alert('<%=INDT%>');
sub=1;
}
if( ((parseInt(document.form.cmbToHour.value)) < (parseInt(document.
form.cmbFromHour.value))) || ((parseInt(document.form.cmbToMin.value)) < (parseI
nt(document.form.cmbFromMin.value))) )
{
alert('<%=INT%>');
sub=1;
}
if(document.form.SelRadio3[0].checked==true)
{
document.form.conference.value="All";
}
else if(document.form.SelRadio3[1].checked==true)
{
document.form.conference.value="onetoone";
}else if(document.form.SelRadio3[2].checked==true)
{
document.form.conference.value="conf";
}
if(sub==0)
{
//alert("parameter1");
document.form.parameter.value= r+";"+document.form.cmbFromYear.v
alue+"-"+document.form.cmbFromMonth.value+"-"+document.form.cmbFromDate.value+";
"+document.form.cmbToYear.value+"-"+document.form.cmbToMonth.value+"-"+document.
form.cmbToDate.value+";"+document.form.cmbFromHour .value+":"+document.form.cmbF
romMin.value+":"+"00"+";"+document.form.cmbToHour.value+":"+document.form.cmbToM
in.value+":"+"00"+";";
document.form.action="ArcmentorController?caller=PasAuditShow";
document.form.submit();
}
}
else if((document.form.SelRadio1[1].checked==true)&&(document.form.SelRa
dio2[1].checked==true))
//if search criteria in date+time
{
//alert('in date+time');
var sub1=0;
document.form.whichCriteria.value=5;
document.form.imtype.value= document.form.cmbSingle.value;
if( ( parseInt(document.form.cmbToYear.value) < parseInt(document.fo
rm.cmbFromYear.value) ) || (parseInt(document.form.cmbToMonth) < parseInt(docum
ent.form.cmbFromMonth) ) || (parseInt(document.form.cmbToDate) < parseInt(docume
nt.form.cmbFromDate) ) )
{
alert('<%=INDT%>');
sub1=1;
}

else if( ((parseInt(document.form.cmbToHour.value)) < (parseInt(docum


ent.form.cmbFromHour.value))) || ((parseInt(document.form.cmbToMin.value)) < (p
arseInt(document.form.cmbFromMin.value))) )
{
alert('<%=INT%>');
sub1=1;
}
if(document.form.SelRadio3[0].checked==true)
{
document.form.conference.value="All";
}
else if(document.form.SelRadio3[1].checked==true)
{
document.form.conference.value="onetoone";
}else if(document.form.SelRadio3[2].checked==true)
{
document.form.conference.value="conf";
}
if(sub1==0)
{
//alert("parameter2");
document.form.parameter.value= document.form.cmbFromYear.value+"
-"+document.form.cmbFromMonth.value+"-"+document.form.cmbFromDate.value+";"+docu
ment.form.cmbToYear.value+"-"+document.form.cmbToMonth.value+"-"+document.form.c
mbToDate.value+";"+document.form.cmbFromHour .value+":"+document.form.cmbFromMin
.value+":"+"00"+";"+document.form.cmbToHour.value+":"+document.form.cmbToMin.val
ue+":"+"00"+";";
document.form.action="ArcmentorController?caller=PasAuditShow";
document.form.submit();
}
}
else if((document.form.SelRadio0[1].checked==true)&&(document.form.SelRa
dio1[1].checked==true))
//if search criteria is USERID+date
{
//alert('in user+date');
var sub2=0;
document.form.whichCriteria.value=6;
document.form.imtype.value= document.form.cmbSingle.value;
if(document.form.cmbSingle1.value=='')
{
alert('<%=NOUSRSEL%>');
sub2=1;
}
if( ((parseInt(document.form.cmbToYear.value)) < (parseInt(document.form
.cmbFromYear.value))) || ((parseInt(document.form.cmbToMonth.value)) < (parseInt
(document.form.cmbFromMonth.value))) && ((parseInt(document.form.cmbToDate.value
)) < (parseInt(document.form.cmbFromDate.value))) )
{
alert('<%=INDT%>');
sub2=1;
}
if(document.form.SelRadio3[0].checked==true)
{
document.form.conference.value="All";
}
else if(document.form.SelRadio3[1].checked==true)
{
document.form.conference.value="onetoone";
}else if(document.form.SelRadio3[2].checked==true)
{
document.form.conference.value="conf";
}
if(sub2==0)
{
// alert("parameter3");
document.form.parameter.value= r+";"+document.form.cmbFromYear.v
alue+"-"+document.form.cmbFromMonth.value+"-"+document.form.cmbFromDate.value+";
"+document.form.cmbToYear.value+"-"+document.form.cmbToMonth.value+"-"+document.
form.cmbToDate.value+";";
document.form.action="ArcmentorController?caller=PasAuditShow";
document.form.submit();
}
}
else if((document.form.SelRadio0[1].checked==true)&&(document.form.SelRa
dio2[1].checked==true)) //if search criteria is USERID+time
{
// alert('in user+time');
var sub3=0;
document.form.whichCriteria.value=7;
document.form.imtype.value= document.form.cmbSingle.value;
if(document.form.cmbSingle1.value=='')
{
alert('<%=NOUSRSEL%>');
sub3=1;
}
if( ((parseInt(document.form.cmbToHour.value)) < (parseInt(document.form
.cmbFromHour.value))) || ((parseInt(document.form.cmbToMin.value)) < (parseInt(d
ocument.form.cmbFromMin.value))) )
{
alert('<%=INT%>');
sub3=1;
}
if(document.form.SelRadio3[0].checked==true)
{
document.form.conference.value="All";
}
else if(document.form.SelRadio3[1].checked==true)
{
document.form.conference.value="onetoone";
}else if(document.form.SelRadio3[2].checked==true)
{
document.form.conference.value="conf";
}
if(sub3==0)
{
// alert("parameter4");
document.form.parameter.value= r+";"+document.form.cmbFromHour .
value+":"+document.form.cmbFromMin.value+":"+"00"+";"+document.form.cmbToHour.va
lue+":"+document.form.cmbToMin.value+":"+"00"+";";
document.form.action="ArcmentorController?caller=PasAuditShow";
document.form.submit();
}
}
else if(document.form.SelRadio0[1].checked==true)
//if search cr
iteria is USERID
{
var sub4=0;
// alert('in user');
document.form.whichCriteria.value=1;
document.form.imtype.value= document.form.cmbSingle.value;
if(document.form.cmbSingle1.value=='')
{
alert('<%=NOUSRSEL%>');
sub4=1;
}
if(document.form.SelRadio3[0].checked==true)
{
document.form.conference.value="All";
}
else if(document.form.SelRadio3[1].checked==true)
{
document.form.conference.value="onetoone";
}else if(document.form.SelRadio3[2].checked==true)
{
document.form.conference.value="conf";
}
if(sub4==0)
{
// alert("..3..sub4="+sub4);
document.form.parameter.value= r;
document.form.action="ArcmentorController?caller=PasAuditShow";
document.form.submit();
}
}
else if(document.form.SelRadio1[1].checked==true)
{
//alert("in severity");
var sub5=0;
//if search criteria is date only
//alert('in date');
document.form.whichCriteria.value=2;
document.form.imtype.value= document.form.cmbSingle.value;
//alert('before date value');
if( ((parseInt(document.form.cmbToYear.value)) < (parseInt(document.form
.cmbFromYear.value))) && ((parseInt(document.form.cmbToMonth.value)) < (parseInt
(document.form.cmbFromMonth.value))) && ((parseInt(document.form.cmbToDate.value
)) < (parseInt(document.form.cmbFromDate.value))) )
{
alert('<%=INDT%>');
sub5=1;
}
if(document.form.SelRadio3[0].checked==true)
{
document.form.conference.value="All";
}
else if(document.form.SelRadio3[1].checked==true)
{
document.form.conference.value="onetoone";
}else if(document.form.SelRadio3[2].checked==true)
{
document.form.conference.value="conf";
}
if(sub5==0)
{
document.form.parameter.value=document.form.cmbFromYear.value+"-"+docume
nt.form.cmbFromMonth.value+"-"+document.form.cmbFromDate.value+";"+document.form
.cmbToYear.value+"-"+document.form.cmbToMonth.value+"-"+document.form.cmbToDate.
value+";";
//alert(document.form.parameter.value);
document.form.action="ArcmentorController?caller=PasAuditShow";
document.form.submit();
}
}
else if(document.form.SelRadio2[1].checked==true)
{ //if search criteri
a is time only
var sub6=0;
//alert('in time');
document.form.whichCriteria.value=3;
document.form.imtype.value= document.form.cmbSingle.value;
if( ((parseInt(document.form.cmbToHour.value)) < (parseInt(document.form
.cmbFromHour.value))) || ((parseInt(document.form.cmbToMin.value)) < (parseInt(d
ocument.form.cmbFromMin.value))) )
{
alert('<%=INT%>');
sub6=1;
}
if(document.form.SelRadio3[0].checked==true)
{
document.form.conference.value="All";
}
else if(document.form.SelRadio3[1].checked==true)
{
document.form.conference.value="onetoone";
}else if(document.form.SelRadio3[2].checked==true)
{
document.form.conference.value="conf";
}
if(sub6==0)
{
document.form.parameter.value=document.form.cmbFromHour .value+"
:"+document.form.cmbFromMin.value+":"+"00"+";"+document.form.cmbToHour.value+":"
+document.form.cmbToMin.value+":"+"00"+";";
//alert(document.form.parameter.value+"--------"+document.form.w
hichCriteria.value);
document.form.action="ArcmentorController?caller=PasAuditShow";
document.form.submit();
}
}
else
{
if(document.form.SelRadio3[0].checked==true)
{
document.form.conference.value="All";
}
else if(document.form.SelRadio3[1].checked==true)
{
document.form.conference.value="onetoone";
}else if(document.form.SelRadio3[2].checked==true)
{
document.form.conference.value="conf";
}
document.form.whichCriteria.value=0;
document.form.imtype.value= document.form.cmbSingle.value;
document.form.action="ArcmentorController?caller=PasAuditShow";
document.form.submit();
}
}// function fnSearch1()
function OnComboChg(){
document.form.imtype.value= document.form.cmbSingle.value;
document.form.action="PastSession.jsp";
document.form.submit();
}
</script>

<title><%=IM%></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="arcswstyle.css" type="text/css">
</head>
<body bgcolor="#EDF3FA" leftmargin=0 rightmargin=0 topmargin=0 >
<script type="text/javascript" language="javascript1.2" src="resources/menu.js
"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td bgcolor="#BFD5EE" height="10">
<div align="center"><img src="Images/arc1.gif" width="130" heigh
t="20"></div>
</td>
</tr>
<tr>
<td bgcolor="#BFD5EE" height="10"><font color="#BFD5EE" face="Geneva
, Arial, Helvetica, san-serif" size="4"></font></td>
</tr>
<tr>
<td valign="middle" align="center">
<form method ="Post" name="form" >
<input name='whichCriteria' type="hidden" value='nothing'>
<input name='imtype' type="hidden" value='nothing'>
<input name='parameter' type="hidden" value='nothing'>
<input name='conference' type="hidden" value='nothing'>
<%@ taglib uri="WEB-INF/tld/taglib133.tld" prefix="c" %>
<c:group width="560px" height="480px" border="1px" backgroundColor=
"#BFD5EE" borderColor="teal">
<c:caption backgroundColor="#3A5994"><center><font color="#00000
0" size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong class="head1b">
<i>Past Session</i></strong></center></font></c:caption>
<c:body>
<br>
<div align="center">
<c:group width="485px" height="45px" border="1px" backg
roundColor="#BFD5EE" borderColor="teal">
<c:caption backgroundColor="#BFD5EE"><strong class="
arc123"><center><i><%=IMT%></i></center></strong></c:caption>
<c:body>
<div align="left">
<table border="0" width="100%" bgcolor="#BFD
5EE">
<tr>
<td align="right" width="30%"><strong cl
ass="arc1"><br>
<%=IMT%></strong></font>
</td>
<td align="left">
<div align="left"> <br>
&nbsp;&nbsp;&nbsp;<select name="
cmbSingle" class="inputbox" onchange='javascript:OnComboChg();'>
<%try{
String IMTYPE="";
if(IMCNT==1){
while(rs1.next())
{ IMTYPE=rs1.getString("IMTYPE
");%>
<option value="<%=IMTYPE%>" sele
cted><%=IMTYPE.toLowerCase()%></option>
<% }
query1="select FROMID from IM_USERS order
by FROMID asc";
} //f(IMCNT==1)
else if(IMCNT > 1){
if(SELIM.length()==0){%>
<option value="" selected>All</o
ption>
<%}else{%>
<option value="" >All</option>
<!--After IM selection-->
<%}
while(rs1.next())
{ if(SELIM.length()==0){ %>
<option value="<%=rs1.getString(
"IMTYPE")%>"><%=(rs1.getString("IMTYPE")).toLowerCase()%></option>
<% }else{
if(SELIM.equals(rs1.getString("I
MTYPE"))){%>
<option value="<%=rs1.getString(
"IMTYPE")%>" selected><%=(rs1.getString("IMTYPE")).toLowerCase()%></option>
<%}else{%>
<option value="<%=rs1.getString(
"IMTYPE")%>"><%=(rs1.getString("IMTYPE")).toLowerCase()%></option>
<%}
}
}
if(SELIM.length()==0){
query1="select FROMID from IM_USERS order by
FROMID asc";
}else{
query1="select FROMID from IM_USERS where IM
TYPE='"+SELIM+"' order by FROMID asc";
}
}//else if(IMCNT > 1)
//System.out.println("The querry is "+query1);
rs1.close();
stmt1.close();
}catch(Exception s23){
%>
<log:error category="PastSession.jsp"> Exception 2 in PastSession.jsp:+<%=s23%><
/log:error>
<%}%>
</select>
</div>
</td>
</tr>
</table>
</div>
</c:body>
</c:group>
<br>
<br>
<c:group width="500px" h
eight="50px" border="1px" backgroundColor="#BFD5EE" borderColor="teal">
<c:caption backgroun
dColor="#BFD5EE"><strong class="arc123"><center><i><%=confses%></i></center></st
rong></c:caption>
<c:body>
<div align="left
"> <br>
<table bord
er="0" cellpadding="0" cellspacing="0">
<tr>
<td>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name ='SelR
adio3' value='0' checked onClick="Toggle(3);"><strong class="arc1">&nbsp;<%=AL%>
</strong></td>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name ='SelRadio3' value='1' onCl
ick="Toggle(3);"><strong class="arc1">&nbsp;<%=oto%>&nbsp;</strong></td>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input t
ype="radio" name ='SelRadio3' value='2' onClick="Toggle(3);"><strong class="arc1
">&nbsp;<%=conf%>&nbsp;</strong></td>
</tr>
</table>
</div>
</c:body>
</c:group>
<br>
<br>
<c:group width="500px" height="80px" border="1px" backg
roundColor="#BFD5EE" borderColor="teal">
<c:caption backgroundColor="#BFD5EE"><strong class="
arc123"><center><i><%=US%></i></center></strong></c:caption>
<c:body>
<div align="center">
<table border="0" width="100%" bgcolor="#BFD
5EE">
<tr>
<td align="center" width="30%">
<table>
<tr><input type="radio" name ='S
elRadio0' value='0' checked onClick="Toggle(0);"><strong class="arc1">&nbsp;&nbs
p;<%=AL%>&nbsp;<%=US%></strong><br></tr>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<t
r><input type="radio" name ='SelRadio0' value='1' onClick="Toggle(0);"><strong c
lass="arc1">&nbsp;&nbsp;<%=S%>&nbsp;<%=US%></strong></tr>
</table>
</td>
<td align="left"><br>
&nbsp;&nbsp;&nbsp;<select name="cmbS
ingle1" size='4' class="inputbox" multiple disabled >
<% try{
rs2=stmt2.executeQuery(query1);
while(rs2.next())
{ %>
<option value="<%=rs2.getString(
"FROMID")%>"><%=rs2.getString("FROMID")%></option>
<%}
rs2.close();
stmt2.close();
connection.close();
}catch(Exception s24){%>
<log:error category="PastSession.jsp"> Excep
tion 3 in PastSession.jsp:+<%=s24%></log:error>
<%}%>
</select>
</td>
</tr>
</table>
</div>
</c:body>
</c:group>
<br><br> <br>
<table width='100%' border='0' bgcolor="#BFD5EE"><tr> <
td width="45%" align='left'>
<c:group width="250px" height="125px" border="1px"
backgroundColor="#BFD5EE" borderColor="teal">
<c:caption backgroundColor="#BFD5EE"><strong cla
ss="arc123"><center><i><%=DT%></i></center></strong></c:caption>
<c:body>
<div align="center"><br>
<table border="0" width="100%" bgcolor="
#BFD5EE">
<tr>
<td colspan='4'><input type="radio"
name ='SelRadio1' value='0' checked onClick="Toggle(1);"><strong class="arc1">&n
bsp;&nbsp;&nbsp;<%=AD%></strong></td>
</tr>
<tr>
<td colspan='4'><input type="radio"
name ='SelRadio1' value='1' onClick="Toggle(1);"><strong class="arc1">&nbsp;&nbs
p;<%=SDR%></strong></td>
</tr>
<tr>
<td align="center" width="20%"><str
ong class="arc4">&nbsp;</strong></td>
<td align="center"><strong class="ar
c4"><%=MM%></strong></td>
<td align="center"><strong class="ar
c4"><%=DD%></strong></td>
<td align="center"><strong class="ar
c4"><%=YY%></strong></td>
</tr>
<tr>
<td align ="right" width="30%"><stro
ng class="arc1"><%=FDT%>:</strong></font>
</td>
<td>
<div align="center">
<select name="cmbFromMonth"
class="inputbox" disabled>
<%
for(int i=1;i<=12;++i)
{
//System.out.println("i :"+i);
// System.out.println("todayMonth :"+todayDate);
if(i==(todayMonth-1))
{
// System.out.println("i is eqaual to 7")
;
%>
<option value=<%=i%> selecte
d><%=i%></option>
<% }else
{%>
<option value=<%=i%>><%=i%><
/option>
<%}
}
%>
</select>
</div>
</td>
<td>
<div align="center">
<select name="cmbFromDate" c
lass="inputbox" disabled>
<%
for(int i=1;i<=31;++i)
{
// System.out.println("i :"+i);
// System.out.println("todayDate :"+todayDate);
if(i==todayDate)
{
// System.out.println("i is eqaual to 7")
;
%>
<option value=<%=i%> selecte
d><%=i%></option>
<% }else
{%>
<option value=<%=i%>><%=i%><
/option>
<%}
}
%>
</select>
</div>
</td>
<td>
<div align="center">
<select name="cmbFromYear" c
lass="inputbox" disabled>
<%
for(int i=2000;i<=2030;++i)
{
// System.out.println("i :"+i);
// System.out.println("todayYear :"+todayYear);
if(i==todayYear)
{
// System.out.println("i is eqaual to 7")
;
%>
<option value=<%=i%> selecte
d><%=i%></option>
<% }else
{%>
<option value=<%=i%>><%=i%><
/option>
<%}
}
%>
</select>
</div>
</td>
</tr>
<tr>
<td align ="right" width="20%"><stro
ng class="arc1"><%=TDT%>:</strong></font>
</td>
<td>
<div align="center">
<select name="cmbToMonth" cl
ass="inputbox" disabled>
<%
for(int i=1;i<=12;++i)
{
//System.out.println("i :"+i);
// System.out.println("todayMonth :"+todayDate);
if(i==todayMonth)
{
// System.out.println("i is eqaual to 7")
;
%>
<option value=<%=i%> selecte
d><%=i%></option>
<% }else
{%>
<option value=<%=i%>><%=i%><
/option>
<%}
}
%>
</select>
</div>
</td>
<td>
<div align="center">
<select name="cmbToDate" cla
ss="inputbox" disabled>
<%
for(int i=1;i<=31;++i)
{
// System.out.println("i :"+i);
// System.out.println("todayDate :"+todayDate);
if(i==todayDate)
{
// System.out.println("i is eqaual to 7")
;
%>
<option value=<%=i%> selecte
d><%=i%></option>
<% }else
{%>
<option value=<%=i%>><%=i%><
/option>
<%}
}
%>
</select>
</div>
</td>
<td>
<div align="center">
<select name="cmbToYear" cla
ss="inputbox" disabled>
<%
for(int i=2000;i<=2030;++i)
{
// System.out.println("i :"+i);
// System.out.println("todayYear :"+todayYear);
if(i==todayYear)
{
// System.out.println("i is eqaual to 7")
;
%>
<option value=<%=i%> selecte
d><%=i%></option>
<% }else
{%>
<option value=<%=i%>><%=i%><
/option>
<%}
}
%>
</select>
</div>
</td>
</tr>
</table>

</div>
</c:body>
</c:group>
</td>
<td width="35%">
<c:group width="250px" height="125px" border="1px" back
groundColor="#BFD5EE" borderColor="teal">
<c:caption backgroundColor="#BFD5EE"><strong class="
arc123"><center><i><%=T%></i></center></strong></c:caption>
<c:body>
<div align="center"><br>
<table border="0" width="100%" bgcolor="#BFD
5EE">
<tr>
<td colspan='4'><input type="radio" name
='SelRadio2' value='0' checked onClick="Toggle(2);"><strong class="arc1">&nbsp;
&nbsp;<%=AT%></strong></td>
</tr>
<tr>
<td colspan='4'><input type="radio" name
='SelRadio2' value='1' onClick="Toggle(2);"><strong class="arc1">&nbsp;&nbsp;<%
=STR%></strong></td>
</tr>
<tr>
<td align="center" width="40%"><strong
class="arc4">&nbsp;</strong></td>
<td align="center"><strong class="arc4">
<%=HH%></strong></td>
<td align="center"><strong class="arc4">
<%=MM%></strong></td>
<td align="center" width="10%"><strong c
lass="arc4">&nbsp;</strong></td>
</tr>
<tr>
<td align ="right" width="40%"><strong c
lass="arc1"><%=FT%>:</strong></font>
<td>
<div align="center">
<select name="cmbFromHour" class
="inputbox" disabled>
<%
for(int i=0;i<=23;++i)
{
// System.out.println("i :"+i);
// System.out.println("todayMonth
:"+todayDate);
if(i==(todayHour-1))
{
// System.out.println("i is
eqaual to 7");
%>
<option value=<%=i%> selected><%
=i%></option>
<% }else
{%>
<option value=<%=i%>><%=i%></opt
ion>
<%}
}
%>
</select>
</div>
</td>
<td>
<div align="center">
<select name="cmbFromMin" class=
"inputbox" disabled>
<%
for(int i=0;i<=59;++i)
{
// System.out.println("i :"+i);
// System.out.println("todayMonth :
"+todayDate);
if(i==todayMin)
{
// System.out.println("i is eq
aual to 7");
%>
<option value=<%=i%> selected><%
=i%></option>
<% }else
{%>
<option value=<%=i%>><%=i%></opt
ion>
<%}
}
%>
</select>
</div>
</td>
<td align="center" width="10%"><strong c
lass="arc4">&nbsp;</strong></td>
</tr>
<tr>
<td align ="right" width="40%"><strong c
lass="arc1"><%=TT%>:</strong></font>
<td>
<div align="center">
<select name="cmbToHour" class="
inputbox" disabled>
<%
for(int i=0;i<=23;++i)
{
// System.out.println("i :"+i);
// System.out.println("todayMonth :"+todayDate);
if(i==todayHour)
{
// System.out.println("i is eqaual to 7")
;
%>
<option value=<%=i%> selected><%
=i%></option>
<% }else
{%>
<option value=<%=i%>><%=i%></opt
ion>
<%}
}
%>
</select>
</div>
</td>
<td>
<div align="center">
<select name="cmbToMin" class="i
nputbox" disabled>
<%
for(int i=0;i<=59;++i)
{
// System.out.println("i :"+i);
// System.out.println("todayMonth :"+todayDate);
if(i==todayMin)
{
// System.out.println("i is eqaual to 7")
;
%>
<option value=<%=i%> selected><%
=i%></option>
<% }else
{%>
<option value=<%=i%>><%=i%></opt
ion>
<%}
}
%>
</select>
</div>
</td>
<td align="center" width="10%"><strong c
lass="arc4">&nbsp;</strong></td>
</tr>
</table>
</div>
</c:body>
</c:group>
</td>
</tr></table>
<br><br><br>
</div>
<br>
<!--<input type ="submit" name="btnSubmit" id = "btnSubmit"
value="<%=Search%>" class="b_submit" onclick='fnSearch1();return false;' >-->
<input type ="submit" name="btnSubmit" id = "btnSubmit" valu
e="<%=Search%>" class="b_submit" onclick='fnSearch1();return false;'>

</c:body>
</c:group>
</form>
</td>
</tr>
<tr>
<td valign="bottom" align="right">
<table valign="bottom" width="100%" border="0" cellspacing="0" cellpa
dding="0" height="100%">
<tr>
<td valign="bottom" align="right">
<table width='100%' border="0" cellspacing="1" align="left" cellpadd
ing="1">
<tr>
<td></td><td></td>
<td valign="bottom" align="middle"><img
src="Images/amlogo1.jpg" width="100" height="50"></td>
</tr>
<tr> <td></td> <td></td>
<td align ="middle" width="30%" align="right" ><
strong class="success"><%=IM%> <br> </strong></td>
</tr> <tr></tr> <tr></tr><tr></tr>
<tr> <td></td>
<td align ="right" width="50%" align="right"><st
rong class="arc1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=BVMIE%>
<br> </strong></td>
<tr></tr>
</table>
</td>
</tr>
</table>
</body>
</html>

--------------------------------------------------------------------------------
------------------------
PastAuditResult.jsp
-----------------------------------------
<%@page import="javax.servlet.*,javax.servlet.http.*,java.sql.*,java.text.*,java
.io.*,java.util.*,com.base64.Base64,com.arcmentor.*"%>
<%@ taglib uri="WEB-INF/tld/taglibs-log.tld" prefix="log" %>
<log:debug category="PastAuditResults.jsp">-------------Entered PastAuditResults
.jsp----------------</log:debug>
<%
String UID="",SESSID="",STDT="",STTI="",UINSESS="",FID="",MSGSNTIME="",MS="",MR=
"",NOREC="",menu="",IM="",cp="",urip="",ldpath="",Y="",N="";
String rec_stat="",imty="",FLT="",IMT="",AUD="";
String SD="",ST="",ED="",ET="",MD="",MT="",CD="",CT="",w1="",w3="",LRDT="",LRT="
",LSID="",CSID="",ESID="",SEL="",PARAM="",Keyword="",Keyval="",conf="",conferenc
e="",CONF="";
String SourceIP="";
HttpSession ses1=null;
int flag_aud=0;
if(session.getAttribute("user") == null)
{
response.sendRedirect("index.jsp");
}
else
{
ses1 = request.getSession();
Locale loc = (Locale)ses1.getAttribute("lang");
SourceIP =ResourceBundle.getBundle("ArcLabels",loc).getString("SourceIP");
UID =ResourceBundle.getBundle("ArcLabels",loc).getString("UA");
SESSID =ResourceBundle.getBundle("ArcLabels",loc).getString("SESSID");
STDT=ResourceBundle.getBundle("ArcLabels",loc).getString("STDT");
STTI =ResourceBundle.getBundle("ArcLabels",loc).getString("STTI");
UINSESS =ResourceBundle.getBundle("ArcLabels",loc).getString("UINSESS");
FID =ResourceBundle.getBundle("ArcLabels",loc).getString("FID");
MSGSNTIME =ResourceBundle.getBundle("ArcLabels",loc).getString("MSGSNTIME");
MS =ResourceBundle.getBundle("ArcLabels",loc).getString("MS");
MR =ResourceBundle.getBundle("ArcLabels",loc).getString("MR");
Y =ResourceBundle.getBundle("ArcLabels",loc).getString("Y");
N =ResourceBundle.getBundle("ArcLabels",loc).getString("N");
NOREC=ResourceBundle.getBundle("ArcLabels",loc).getString("#NOREC");
FLT=ResourceBundle.getBundle("ArcLabels",loc).getString("FLT");
menu = ResourceBundle.getBundle("ArcLabels",loc).getString("MENU");
IM = ResourceBundle.getBundle("ArcLabels",loc).getString("IM");
IMT = ResourceBundle.getBundle("ArcLabels",loc).getString("IMT");
AUD = ResourceBundle.getBundle("ArcLabels",loc).getString("AUD");
cp=request.getContextPath();
urip=cp.substring(1,cp.length());

//newly added for getting attribute


imty=(String)request.getAttribute("imtype");
//System.out.println("The imtype in the jsp page is "+imty);
w1=(String)request.getAttribute("BSlid");
w3=(String)request.getAttribute("ASlid");
SD = (String)request.getAttribute("SD");
ST = (String)request.getAttribute("ST");
ED = (String)request.getAttribute("ED");
ET = (String)request.getAttribute("ET");
MD = (String)request.getAttribute("MD");
MT = (String)request.getAttribute("MT");
CD = (String)request.getAttribute("CUR_SLID_DT");
CT = (String)request.getAttribute("CUR_SLID_T");
CSID=(String)request.getAttribute("CUR_SLID_SID");
ESID=(String)request.getAttribute("END_SID");
LRDT=(String)request.getAttribute("Last_Rec_DT");
LRT=(String)request.getAttribute("Last_Rec_T");
LSID=(String)request.getAttribute("Last_Rec_SID");
SEL=(String)request.getAttribute("SEL");
PARAM=(String)request.getAttribute("PARAM");
CONF=(String)request.getAttribute("CONF");
//conf=(String)request.getAttribute("conference");
//System.out.println("The Parametr passed in jsp pages is "+PARAM);
Keyword=(String)request.getAttribute("Keyword");
///if(Keyword.equals("1"))
// {
// Keyval=(String)request.getAttribute("Keyval");
//}

//added till here for getting attribute

if(request.getAttribute("REC_STAT")!=null) //TO CHECK WHETHER RESULTSET


IS EMPTY,WITH 10 REC,or <10 REC
{
rec_stat= (String)request.getAttribute("REC_STAT");
// System.out.println("The records are "+rec_stat);
}
}
%>
<html>
<head>
<script type="text/javascript" language="javascript" src="resources/sniffer.js">
</script>
<script type="text/javascript" language="javascript1.2" src="resources/<%=me
nu%>"></script>
<script type="text/javascript" language="javascript1.2" src="resources/style
.js"></script>
<title><%=IM%></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="arcswstyle.css" type="text/css">
</head>
<body bgcolor="#EDF3FA" leftmargin=0 rightmargin=0 topmargin=0>
<script type="text/javascript" language="javascript1.2" src="resources/menu.
js"></script>
<form name="form" method="post">
<!--********* Added hidden variables**************-->
<input type="hidden" name="imt" value= <%=imty%> >
<input type="hidden" name="hbslider" value= <%=w1%> >
<input type="hidden" name="haslider" value= <%=w3%> > <!-- the values of th
e new arrow -->
<input type="hidden" name="SD" value= '<%=SD%>' >
<input type="hidden" name="ST" value= '<%=ST%>' >
<input type="hidden" name="MD" value= '<%=MD%>' >
<input type="hidden" name="MT" value= '<%=MT%>' >
<input type="hidden" name="ED" value= '<%=ED%>' >
<input type="hidden" name="ET" value= '<%=ET%>' >
<input type="hidden" name="CD" value= '<%=CD%>' > <!-- The parameter set for
the store the current selected date -->
<input type="hidden" name="CT" value= '<%=CT%>' ><!-- current selected time
-->
<input type="hidden" name="CSID" value= '<%=CSID%>' >
<input type="hidden" name="ESID" value= '<%=ESID%>' >
<input type="hidden" name="LRDT" value= '<%=LRDT%>' >
<input type="hidden" name="LRT" value= '<%=LRT%>' >
<input type="hidden" name="LSID" value= '<%=LSID%>' >
<input type="hidden" name="SEL" value= '<%=SEL%>' >
<input type="hidden" name="CONF" value= '<%=CONF%>' >
<input type="hidden" name="PARAM" value= "<%=PARAM%>" >
<input type="hidden" name="Keyword" value= '<%=Keyword%>' >
<input type="hidden" name="Keyval" value= '<%=Keyval%>' >
<input type="hidden" name="USRPARAM" value= "<%=PARAM%>" >
<input type="hidden" name="x" value= '' >
<input type="hidden" name="y" value= '' >
<input type="hidden" name="rec_stat" value= '<%=rec_stat%>' >
<!--********* Added hidden variables ENDS**************-->
<!-- newly added script for click on timeline -->
<script language="JavaScript1.2">
function fnChk(parameter)
{
document.form.action ="";
if(parameter==1){
<!-- When right arrow is pressed -->
if(<%=rec_stat%>==0){

<!-- If records presents and > 10 -->


document.form.action="ArcmentorController?caller=PastSessionNext";
document.form.submit();
}
}
if(parameter==2){
<!-- When left arrow is pressed -->
if(<%=rec_stat%>==0){
<!-- If records presents and > 10 -->
// alert(document.form.SEL.value);
document.form.action="ArcmentorController?caller=PastSessionPrev";
document.form.submit();
}
}
}

if (navigator.appName == 'Netscape') {
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = netscapeMouseMove;
}
function netscapeMouseMove(e) {
<!-- not used -->
if (e.screenX != document.form.x.value && e.screenY != document.form.y.value
) {
document.form.x.value = e.screenX;
document.form.y.value = e.screenY;
}
}
function microsoftMouseMove() {
<!-- To calulate the mouse moment position used in the detect() method -->
if (window.event.x != document.form.x.value && window.event.y != document.for
m.y.value) {
// document.form.x.value = window.event.x;
return window.event.x;
}
}

function detect(e) <!-- called when click occour on the bar -->
{
if(<%=rec_stat%>== 0){
if(navigator.appName == 'Microsoft Internet Explorer')
{
document.form.x.value=e.clientX;
document.form.action = "ArcmentorController?caller=PastSessionClk";
document.form.submit();
}
else
{
document.form.x.value=e.clientX;
document.form.action = "ArcmentorController?caller=PastSessionClk";
document.form.submit();
}
}
}
</script>
<!-- End of the script for timeline click -->
<div align="center">
<%
//System.out.println("The width is for w1 "+w1);
String s5="";
boolean empty=false;
boolean check;
java.sql.Connection con = (java.sql.Connection)request.getAttribute("con");
Statement stmt1=null;
Statement stmt3=null;
//Statement stmt4=null;
//Statement stmt6=null;
Statement stmt2=null;
ResultSet rs1=null;
ResultSet rs3=null;
ResultSet rs2=null;
int selno=0;
String[] arr = new String[7];
rs1 = (ResultSet)request.getAttribute("REC");
java.sql.Connection connection = null;
DBConnection dbcon;
dbcon= new DBConnection();
try
{
connection = dbcon.getConnection();
}
catch (Exception e)
{
%>
<log:error category="PastAuditResults">driver class not found+<%=e
%></log:error>
<%
}
try
{
stmt1=connection.createStatement();
//stmt2=connection.createStatement();
stmt3=connection.createStatement();
stmt2=connection.createStatement();
//stmt4=connection.createStatement();
// rs1=stmt1.executeQuery(query);
// rs4=stmt4.executeQuery(query);
}
catch(SQLException s22)
{%>
<log:error category="PastAuditResults">Exception +<%=s22%></log
:error><%}%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td bgcolor="#BFD5EE" height="10">
<div align="center"><img src="Images/arc1.gif" width="130" height="2
0"></div>
</td>
</tr>
<tr>
<td bgcolor="#BFD5EE" height="10"><font color="#BFD5EE" face="Geneva, Ar
ial, Helvetica, san-serif" size="4"></font></td>
</tr>
<tr >
<td align="middle">
<br>
<table border="0" width="100%">
<tr>
<td align="center">
<!-- newly added for displaying the timeline -->

<%if(rec_stat.equals("0")){%>
<!-- If records presents and > 10 -->
<tr>
<td><br></td>
</tr>
<tr>
<TABLE cellSpacing=0 cellPadding=0 width=698 border=0>
<TBODY>
<TR>
<TD width=20><IMG height=1
src="Images/transpix.gif"
width=20></TD>
<TD width=226>
<DIV align=left><strong class="arc1"><%=SD%> (<%=ST%>)</Strong></DIV></T
D>
<TD width=226>
<DIV align=center>
<CENTER><strong class="arc1"><%=MD%> (<%=MT%>)</Strong></CENTER></DIV></
TD>
<TD width=226>
<DIV align=right><strong class="arc1"><%=ED%> (<%=ET%>)</Strong></DIV></
TD>
<TD width=20><IMG height=1
src="Images/transpix.gif"
width=20></TD></TR></TBODY></TABLE>
</tr>
<%}%>

<%if(rec_stat.equals("0")){%>
<!-- If records presents and > 10 -->
<tr>
<TABLE cellSpacing=0 cellPadding=0 width=698 background="Images/timeline
.gif"
border=0 valign=middle>
<TR>
<!-- If left side arrow clicked then pass argument 2 to the function fnC
hk -->
<TD width=60 height=28><a href="javascript:fnChk(2); "><IMG src="Images/
transpix.gif" height=28
width=60 border=0 ></A></TD>
<TD width="<%=w1%>" height="28" ><INPUT type=image height="28" width="<%
=w1%>" src="Images/transpix.gif"
name=l onclick="detect(event); return(false);"></TD>
<TD width=8 height=28><INPUT type=image height=28 width=8 src="Images/ti
meline_mark.gif"
name=l3 onclick="javascript:return(false);"></TD>
<TD width="<%=w3%>" height="28" ><INPUT type=image height="28" width="<%
=w3%>" src="Images/transpix.gif"
name=l2 onclick="detect(event); return(false);"></TD>
<TD width=60 height=28><a href="javascript:fnChk(1);"><IMG height=28 src
="Images/transpix.gif"
width=60 border=0></A></TD></TR></TABLE>
</table>
</tr>
<%}%>
<!--888888888888888888888-->
<%if(rec_stat.equals("0")){%>
<!-- If records presents and > 10 -->
<TABLE cellSpacing=0 cellPadding=0 border=0 width="698">
<TBODY>
<TR>
<!-- This TD width is dynamically set so that the pointer will move coorspo
ndingly due to changed size of the column -->
<TD width='<%=w1%>'><IMG height=1 src="Images/transpix.gif" width=1></TD
>
<TD vAlign=top width='150'>
<DIV align=left>
<CENTER><strong class="link2"><%=CD%>&nbsp;(<%=CT%>)</CENTER></DIV></str
ong></TD>
<td><TD width='<%=w3%>'><IMG height=1 src="Images/transpix.gif" width=1>
</TD></td>
</TR></TBODY></TABLE>
<%}%>

<!-- Added till here to display timeline -->


<table valign="top" align="middle" border="0" width="80%" cellspacing="
0" cellpadding="1" >
<tr>
<td valign="top" align="center" bgcolor="#3A5994"><font color="#000000"
size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong class="head1b"><%
=UID%></strong></font>
</td>
</tr>
<tr>
<td><div align="middle">
<% ldpath="/"+urip+"/PastAuditResults.jsp?";%>
<%@ taglib uri="/WEB-INF/tld/taglib139.tld" prefix="pg" %>
<pg:paging idPage="p" url="<%=ldpath%>" pageSize="10" indexSize=
"15">
<%
if(rec_stat.equals("1"))
{ %>
<table align="center" border="0" cellpadding="0" cellspacing="1"
height="30%" bgcolor="#BFD5EE" width="100%">
<tr>
<td align="center" height="100%" bgcolor="#BFD5EE" ><strong
class="arc123"><br><br><%=NOREC%><br><br> </strong></td>
</tr>
</table>
<% }
if(!rec_stat.equals("1")){

while(rs1.next())
{
System.out.println("The rs present");
rs2=stmt2.executeQuery("(select distinct FROMID
from MESSAGES WHERE SESSIONID='"+rs1.getString("SESSIONID")+"' ) UNION (select
distinct TOID from MESSAGES where SESSIONID='"+rs1.getString("SESSIONID")+"')");
%>
<pg:item>
<table align="center" width="100%" border="0 " cellpadding="0
" cellspacing="1" bgcolor="#BFD5EE">
<tr >
<td colspan="4">
&nbsp;
</td>
</tr>
<tr width="100%">
<td align="left" bgcolor="#000066" class="whitehead" width="10%
"><strong><%=SESSID%></strong></td>
<td align="left" bgcolor="#000066" class="whitehead" width="5%">
<strong><%=STDT%></strTARTDATE")ong></td>
<td align="left" bgcolor="#000066" class="whitehead" width="10%"
><strong><%=STTI%></strong></td>
<td align="left" bgcolor="#000066" class="whitehead" width="20%"
><strong><%=UINSESS%></strong></td>
<td align="left" bgcolor="#000066" class="whitehead" width="10%"
><strong><%=IMT%></strong></td>
<td align="left" bgcolor="#000066" class="whitehead"width="5%">
<strong><%=AUD%></strong></td>
</tr>
<tr>
<td align="left"><strong><span class="arc3"><%=rs1.getString("SE
SSIONID")%> </span></strong></td>
<td align="left"><strong><span class="arc3"><%=rs1.getString("ST
ARTDATE")%></span></strong></td>
<td align="left"><strong><span class="arc3"><%=rs1.getString("ST
ARTTIME")%></span></strong></td>
<%
while(rs2.next())
{
s5=s5+rs2.getString("FROMID")+"<br>";
}
// else
// { s5=s5+rs1.getString("FROMID")+
"<br>"+rs1.getString("TOID");}
%>
<td align="left"><strong><span class="arc3"><%=s5%></span></stro
ng></td>
<td align="left"><strong><span class="arc3"><%=rs1.getString("IM
TYPE")%>&nbsp;&nbsp;</span></strong></td>
<%
try
{
/* String aud="";
aud=rs1.getStrin
g("AUDITED");
if(!aud.equals("Y")){flag_aud=0;}
else{ flag_aud=1;}
*/
if((rs1.getString("AUDITED"))==null)
{
flag_aud=0;
}
else
{
flag_aud=1;
}
}
catch(Exception e)
{
System.out.println("Exception in audit:"+e);
}
if(flag_aud==1)
{
%>
<td align="left"><strong><span class="arc3" width="5%"><%=Y%></spa
n></strong></td>
<%}
else if(flag_aud==0)
{
%>
<td align="left"><strong><span class="arc3" width="5%"><%=N%></span>
</strong></td>
<% } %>
</tr>
<tr>
<td align="left" bgcolor="#000066" class="whitehead" width ="18%
"><strong><%=SourceIP%></strong></td>
<td align="left" bgcolor="#000066" class="whitehead" width ="18%
"><strong><%=FID%></strong></td>
<td align="left" bgcolor="#000066" class="whitehead" width ="10%
"><strong><%=MSGSNTIME%></strong></td>
<td align="left" bgcolor="#000066" class="whitehead" colspan="4"
><strong><%=MS%></strong></td>
</tr>
<%
rs3=stmt3.executeQuery("select SOU
RCE_IP,FROMID,STARTTIME,MESSAGE,FILENAME from MESSAGES where SESSIONID='"+rs1.ge
tString("SESSIONID")+"' ORDER BY STARTTIME");
while(rs3.next())
{
%>
<tr class="btnav" onmouseover="style.backgroundColor='#99CCFF';"
onmouseout="style.backgroundColor='#BFD5EE'">
<td align="left"><strong><span class="arc3"><%=rs3.getString("SO
URCE_IP")%>&nbsp;&nbsp;</span></strong></td>
<td align="left"><strong><span class="arc3"><%=rs3.getString("FR
OMID")%>&nbsp;&nbsp;</span></strong></td>
<td align="left"><strong><span class="arc3"><%=rs3.getString("ST
ARTTIME")%></span></strong></td>
<%
if(((rs3.getStri
ng("MESSAGE")).equals("NULL")) && !(rs3.getString("FILENAME")).equals("NULL"))
{
%>
<td alig
n="left" colspan="4"><strong><span class="arc3"><i><font color='red'><%=FLT%><b>
:</b> <%=rs3.getString("FILENAME")%></font><i></span></strong></td>
</tr>
<% }
else
{
%>
<td alig
n="left" colspan="4"><strong><span class="arc3"><%=rs3.getString("MESSAGE")%></s
pan></strong></td>
<% }
%>
<% } %>
</tr>
</td>
</tr>
</pg:item>
<%
s5="";
}
rs2.close();
stmt2.close();
rs3.close();
stmt3.close();
rs1.close();
stmt1.close();
connection.close();
con.close();
}
%>
</table>
</td>
</tr>
</table>
<div align="center">
<span class="arc3"><pg:index title="More:">
<pg:page><strong><span class="arc3"><%=thisPage%></span></st
rong></pg:page>
</pg:index>
</pg:paging>
</span>
</div>
</div>
</td>
<!--<-/pg:item> -->
</table>
</form>
</body>
</html>
--------------------------------------------------------------------------------
-----------------------
pastsessionid
---------------------------------
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="javax.servlet.*,javax.servlet.http.*,java.sql.*,java.text.*,java
.io.*,java.util.*,com.base64.Base64"%>
<%@ taglib uri="WEB-INF/tld/taglibs-log.tld" prefix="log" %>
<log:debug category="KeywordExpertise.jsp">-------------Entered KeywordExpertis
e.jsp----------------</log:debug>
<%
String RESESSID="",SELSESSID="",SESSID="",SER="",menu="",ENTKEY="",IM="",BVMIE="
";
HttpSession ses1=null;
if(session.getAttribute("user") == null)
{
HttpSession ses2 = request.getSession(true);
ses2.setAttribute("Timeout","true");
response.sendRedirect("index.jsp");
}
else
{
ses1 = request.getSession();
Locale loc = (Locale)ses1.getAttribute("lang");
RESESSID =ResourceBundle.getBundle("ArcLabels",loc).getString("RESESSID");
SELSESSID =ResourceBundle.getBundle("ArcLabels",loc).getString("SELSESSID");
SESSID=ResourceBundle.getBundle("ArcLabels",loc).getString("SESSID");
SER =ResourceBundle.getBundle("ArcLabels",loc).getString("SER");
BVMIE =ResourceBundle.getBundle("ArcLabels",loc).getString("BVMIE");

menu = ResourceBundle.getBundle("ArcLabels",loc).getString("MENU");
IM = ResourceBundle.getBundle("ArcLabels",loc).getString("IM");
ENTKEY = ResourceBundle.getBundle("ArcLabels1",loc).getString("ENTKEY");

%>
<html>
<head>
<script type="text/javascript" language="javascript1.2" src="resources/sniffer.j
s"></script>
<script type="text/javascript" language="javascript1.2" src="resources/<%=menu%>
"></script>
<script type="text/javascript" language="javascript1.2" src="resources/style.js"
></script>
<title><%=IM%></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="arcswstyle.css" type="text/css">
<script language="JavaScript1.2">
function fnSubmit()
{
if((document.form.txtKeyword.value == "") || (document.form.txtKeyword.va
lue == " "))
{
alert('<%=ENTKEY%>');
document.form.txtKeyword.focus();
}
else
{
document.form.submit();
}
}
function setFocus()
{
document.form.txtKeyword.focus();
}
</script>
</head>
<body bgcolor="#EDF3FA" leftmargin=0 rightmargin=0 topmargin=0>
<script type="text/javascript" language="javascript1.2" src="resources/menu.js"
></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td bgcolor="#BFD5EE" height="10">
<div align="center"><img src="Images/arc1.gif" width="130" heigh
t="20"></div>
</td>
</tr>
<tr>
<td bgcolor="#BFD5EE" height="10"><font color="#BFD5EE" face="Geneva
, Arial, Helvetica, san-serif" size="4"></font></td>
</tr>
<tr>
<td valign="middle" align="center">
<form name ="form" method="post" action="SessionIdResult.jsp">
<%@ taglib uri="WEB-INF/tld/taglib133.tld" prefix="c" %>
<c:group width="530px" height="150px" border="1px" backgroundColor="
#BFD5EE" borderColor="teal">
<c:caption backgroundColor="#3A5994"><center><font color="#000000" si
ze="1" face="Verdana, Arial, Helvetica, sans-serif"><strong class="head1b"><i><%
=RESESSID%></i></strong></center></font></c:caption>
<c:body>
<c:group width="500px" height="50px" border="0" backgroundColo
r="#BFD5EE" borderColor="">
<c:caption backgroundColor="#BFD5EE"><center><strong class="ar
c123"><i><%=SELSESSID%></i></strong></center></c:caption>
<c:body>
<div align="center">
<table border="0" width="100%" bgcolor="#BFD5EE">
<tr>
<td align="right" width="40%"><strong class="arc1"> <br>
<%=SESSID%></strong></font>
</td>
<td align="left"> <br>
&nbsp;&nbsp;&nbsp; <input type="text" name="txtKeyword" s
ize="23" maxlength="255" class="inputbox">
</td>
</tr>
</table>
</div>
</c:body>
</c:group>
<br>
<br>
<br>
<input type ="submit" name="btnSubmit" id = "btnSubmit" value="<%=SER
%>" class="b_submit" onclick='fnSubmit();return false;' >
</c:body>
</c:group>
</form>
</td>
</tr>
<tr>
<td valign="bottom" align="right">
<table valign="bottom" width="100%" border="0" cellspacing="0" cellpadding
="0" height="100%">
<tr>
<td valign="bottom" align="right">
<table width='100%' border="0" cellspacing="1" align="left" cellpadding="
1">

<tr>
<td></td><td></td>
<td valign="bottom" align="middle"><img
src="Images/amlogo1.jpg" width="100" height="50"></td>
</tr>
<tr> <td></td> <td></td>
<td align ="middle" width="30%" align="right" ><
strong class="success"><%=IM%> <br> </strong></td>
</tr> <tr></tr> <tr></tr><tr></tr>
<tr> <td></td>
<td align ="right" width="50%" align="right"><st
rong class="arc1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=BVMIE%>
<br> </strong></td>
</tr>
<tr></tr>
</table>
</td>
</tr>
</table>
</body>
</html>
--------------------------------------------------------------------------------
-------------------------
DBconnnection
----------------------------------------
/*
* DBConnection.java
*
* Created on June 30, 2004, 2:19 PM
*/
/**
*
* @author Hitesh Rathod
*/
package com.arcmentor;
import java.io.*;
import java.sql.*;
import java.util.*;

import org.apache.log4j.*;
import com.base64.Base64;
public class DBConnection
{
String LogFileURL,INIFileURL,OSname,PrimaryDatabaseServerIP,PrimaryDatabaseR
ootUser,PrimaryDatabaseRootUserPassword,s2,s3,s4;
boolean check;
Statement stmt1;
String inLine="";
String temp="";
int n;
Logger logger=Logger.getLogger("DBconnection");
/** Creates a new instance of DBConnection */
public DBConnection ()
{
try
{
OSname = System.getProperty ("os.name");
check = (OSname.toUpperCase ()).startsWith ("W");
if(check)
{
LogFileURL = "c:\\Arcmentor\\Arcmentor.log";
INIFileURL = "c:\\Arcmentor\\Arcmentor.ini";
}
else
{
LogFileURL = "/usr/Arcmentor/Arcmentor.log";
INIFileURL = "/usr/Arcmentor/Arcmentor.ini";
}
BufferedReader br = new BufferedReader (new FileReader (INIFileURL))
;
while ((inLine = br.readLine()) != null) {
StringTokenizer st=new StringTokenizer(inLine,"=");
while(st.hasMoreTokens())
{
temp=st.nextToken();
if(temp.equalsIgnoreCase("PrimaryDatabaseRootUser"))
{
s3=st.nextToken();
//s3=s3.replaceFirst(";","");
}
if(temp.equalsIgnoreCase("PrimaryDatabaseServerIP"))
{
s2=st.nextToken();
// s2=s2.replaceFirst(";","");
}
if(temp.equalsIgnoreCase("PrimaryDatabaseRootUserPassword"))
{
//s4=st.nextToken();
// s4=s4.replaceFirst(";","");
s4 = inLine.substring (32,inLine.length ());
// s4 = s4.replaceFirst(";","");
s4 = s4.trim();
if(s4 != null){
s4=new String(Base64.decode(s4));
s4 = s4.trim();
}
}
}
}
/* PrimaryDatabaseServerIP = br.readLine ();
PrimaryDatabaseRootUser =br.readLine ();
PrimaryDatabaseRootUserPassword =br.readLine ();
s2 = PrimaryDatabaseServerIP.substring (24,PrimaryDatabaseServerIP.l
ength ());
s3 = PrimaryDatabaseRootUser.substring (24,PrimaryDatabaseRootUser.l
ength ());
s4 = PrimaryDatabaseRootUserPassword.substring (32,PrimaryDatabaseRo
otUserPassword.length ());
if(s4 != null){
s4=new String(Base64.decode(s4));
}*/
// System.out.println(" IP: " + s2 + " UserID: " + s3 + " Password: "
+ s4);
}
catch(Exception e1)
{
logger.error("DBConnection: Arcmentor.ini not Found "+e1);

}
}
public Connection getConnection ()
{
java.sql.Connection connection=null;
try
{
Class.forName ("org.gjt.mm.mysql.Driver");
connection = DriverManager.getConnection ("jdbc:mysql://"+s2+"/ims",
s3,s4);
}
catch (Exception e)
{
logger.error("DBConnection: Database connection error "+e);
}
return connection;
}
public ResultSet execQuery (Connection con1, String s)
{
//System.out.println (s);
ResultSet rs1=null;
try {
stmt1=con1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
rs1=stmt1.executeQuery (s);
//con1.close ();
}
catch(SQLException s2)
{
// con1.close ();
System.out.println (s2);
logger.error("error "+s2);
}
return rs1;
}
public int executeUpdate (Connection con1, String s)
{
try
{
//System.out.println ("DBcon : query : "+s);
stmt1=con1.createStatement (ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
n =stmt1.executeUpdate (s);
// con1.close ();
}
catch(SQLException s2)
{
logger.error("error occoured "+s2);
// con1.close ();
}
return n;
}
}

--------------------------------------------------------------------------------
----------------
ArcmentorController
--------------------------
/*
* ArcmentorController.java
*
* Created on June 30, 2004, 12:39 PM
*/
/**
*
* @author root
*/
package com.arcmentor;
import java.io.IOException;
import java.io.*;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import javax.servlet.*;
import java.util.*;
import org.apache.log4j.Logger;
import com.base64.Base64;
public class ArcmentorController extends HttpServlet{
Action action;
String redirect=null,who;
HttpSession session;
String action1="";
String db="";
// ServletContext ctx;

protected void processRequest(HttpServletRequest request, HttpServletRespons


e response) throws ServletException, IOException {
//System.out.println("===========Entered ArcmentorController========");
String caller=request.getParameter("caller");
//System.out.println("Value Of Caller:\t"+caller);
HttpSession ses = null;
Logger logger = null;

try {
logger = Logger.getLogger("ArcmentorController");
logger.debug("Entered ArcmentorController");

/////////////////////////////// For Login //////////////////////////


if(caller.equals("index1")) {
String Language="",Country="";
ses = request.getSession(true);
//System.out.println("SessionId in ArcmentorController:- "+ses.g
etId());
int combsel = Integer.parseInt(request.getParameter("combsel"))
;
switch(combsel) {
case 1: Language="en"; Country="US"; break;
case 2: Language="zh"; Country="CN"; break;
default : break;
}
request.setAttribute("LANGNO",Integer.toString(combsel));
Locale lang = new Locale(Language,Country);
ses.setAttribute("lang",lang);
redirect = "/index.jsp";
}
if(caller.equals("index")) {
String Language="",Country="";
ses = request.getSession(true);
//System.out.println("SessionId in ArcmentorController:- "+ses.g
etId());
int combsel = Integer.parseInt(request.getParameter("combsel"))
;

switch(combsel) {
case 1: Language="en"; Country="US"; break;
case 2: Language="zh"; Country="CN"; break;
default : break;
}
Locale lang = new Locale(Language,Country);
ses.setAttribute("lang",lang);
action= new LoginCommand();
String check = action.execute(request,response);
if(!check.equals("Y")){
redirect=check;
}else{
action=new IMstatus();
redirect = action.getData(request,response,"Status");}
}
/////////////////For TM Statics/////////////////
if(caller.equals("Status")||caller.equals("Graph")||caller.equals("I
Mgraph"))
{
action=new IMstatus();
redirect = action.getData(request,response,caller);
}
////////////////For Licensing//////////
if(caller.equals("showlic")||caller.equals("getlic"))
{
action=new LicensCommand();
redirect = action.doProcess(request,response,caller);
}
/////////////////////////// For Adding Administrator ///////////////
if(caller.equals("AddAdmin")) {
who="";
caller="";
//ses.setAttribute("who", "");
//System.out.println("Called by AddAdmin");
action = new AdminManageCommand();
redirect = action.execute(request,response);
//System.out.println("dispatching to :"+redirect);
}
/////////////////////////// For Administrator Preferences //////////
////
if(caller.equals("AdminManage")|| caller.equals("AMDeleteDone")) {
caller="";
//System.out.println("Value of who while calling AdminManage :"+
who);
//action= new AdminManageCommand();
session = request.getSession(true);
//System.out.println("Called by AdminManage");
action= new AdminManageCommand();
redirect = action.getResults(request,response, "AdminManage");
}
if(caller.equals("AdminManageDelete")) {
//System.out.println("Called By Admin Manage Delete");
action=new AdminManageCommand();
redirect=action.doChange(request,response,"delete");
}
if(caller.equals("AdminManageEdit")) {
//System.out.println("Called by AdminManage Edit");
action=new AdminManageCommand();
redirect=action.doChange(request,response,"edit");
}
if(caller.equals("AdminManageSubmit")) {
//System.out.println("Called by AdminManage Edit");
action=new AdminManageCommand();
redirect=action.doUpdate(request,response,"submit");
}
if(caller.equals("EditPassword")) {
HttpSession ses1 = request.getSession();
String adminuser = (String)ses1.getAttribute("AdminUser");
ses1.setAttribute("ChangePassStatus","notdone");
//System.out.println("Called by EditPassword : Value of AdminUse
r is :"+adminuser);
action=new AdminManageCommand();
redirect=action.doEditPass(request,response,adminuser);
String adminpassword = (String)request.getAttribute("AdminPass")
;
//System.out.println("Called by EditPassword : Value of AdminPas
sword is :"+adminpassword);
}
if(caller.equals("ChangePassword")) {
HttpSession ses2 = request.getSession();
ses2.setAttribute("ChangePassStatus","done");
String newpass=request.getParameter("txtNewPassword");
newpass = new String(Base64.encode(newpass));
// System.out.println("The new pass is "+newpass);
//System.out.println("Called by ChangePassword : Value of newpas
sword is :"+newpass);
request.setAttribute("newPass",newpass);
request.setAttribute("ChangePassStatus","success");
action=new AdminManageCommand();
redirect=action.doEditPass(request,response, "changepass");
}

///////////////////// For Keywords /////////////////////////////


/////////////////
if(caller.equals("KeywordsShow")) {
//System.out.println("Called by CustomkeyShow");
action = new AdminManageCommand();
redirect = action.doKeyShow(request,response,"show");
}
if(caller.equals("KeywordsDelete")) {
//System.out.println("Called By Keyword Delete");
action=new AdminManageCommand();
redirect=action.doKeyChange(request,response,"delete");
}
if(caller.equals("KeywordsInsert")) {
//System.out.println("Called By Keyword insert");
action=new AdminManageCommand();
redirect=action.doKeyChange(request,response,"insert");
}
if(caller.equals("KeywordsEdit")) {
//System.out.println("Called by User Manage Edit");
action=new AdminManageCommand();
redirect=action.doKeyChange(request,response,"edit");
}
if(caller.equals("KeywordsSubmit")) {
//System.out.println("Called by Keyword Submit");
action=new AdminManageCommand();
redirect=action.doUpdateKeywords(request,response,"submit");
//System.out.println("ArcmentorController : caller : KeywordsSub
mit: redirect :"+redirect);
}
////////////////////For EmailStructure/////////////////////
if(caller.equals("EmailStructShow")) {
// db="primary";
action=new AdminManageCommand();
redirect=action.EmailStruct(request,response, "EmailStructShow")
;
}
if(caller.equals("EmailStructSave")) {
// db="primary";
action=new AdminManageCommand();
redirect=action.EmailStruct(request,response, "EmailStructSave")
;

}
////////////////////// For Users ///////////////////////////////////
///////////////////////////////////
if(caller.equals("AddUser")) {
//who="";
caller="";
//ses.setAttribute("who", "");
//System.out.println("Called by AddUser");
action = new UserManageCommand();
redirect = action.addUser(request,response);
//System.out.println("disopatching to :"+redirect);
}
if(caller.equals("UserManage")|| caller.equals("UMDeleteDone")) {
caller="";
//System.out.println("Value of who while calling UserManage :"+w
ho);
session = request.getSession(true);
//System.out.println("Called by UserManage");
action= new UserManageCommand();
redirect = action.userManage(request,response, "AdminManage");
}
if(caller.equals("UserManageDelete")) {
//System.out.println("Called By User Manage Delete");
action=new UserManageCommand();
redirect=action.doChange(request,response,"delete");
}
if(caller.equals("UserManageCheckall")) {
//System.out.println("Called By User Manage Delete");
action=new UserManageCommand();
redirect=action.doChange(request,response,"checkall");
}

if(caller.equals("UserManageEdit")) {
//System.out.println("Called by User Manage Edit");
action=new UserManageCommand();
redirect=action.doChange(request,response,"edit");
}
if(caller.equals("UserManageSubmit")) {
//System.out.println("Called by User Manage Submittttttttttttttt
tttttt");
action=new UserManageCommand();
redirect=action.doUpdate(request,response,"submit");
}

///////////////////////////////////////////For Audit Messaging ////


//////////////////////////////////////
if(caller.equals("UserAuditPast")) {
//System.out.println("Called by User Audit Past");
action = new AuditMessageCommand();
redirect = action.fetchPastUser(request,response,"show");
}

if((caller.equals("PasAuditShow"))||(caller.equals("PastSessionPrev"
))||(caller.equals("PastSessionNext"))||(caller.equals("PastSessionClk"))) {
//System.out.println("Called by "+caller);
action = new AuditMessageCommand();
redirect = action.fetchPastUser(request,response,caller);
}

if(caller.equals("UserAuditPastShow")) {
String whichcriteria=request.getParameter("whichCriteria");
//System.out.println("Called by User Audit Past SHOW :"+whichcri
teria);
action = new AuditMessageCommand();
redirect = action.fetchPastUserResults(request,response,whichcri
teria);
}
/////////////////////////////////////For Advanced///////////////////
//////////////////////////////////////
if(caller.equals("clustershow")) {
//System.out.println("Entered clustershow");
action = new ClusterManage();
redirect = action.addCluster(request,response,caller);
}
if((caller.equals("AddCluster"))||(caller.equals("AddPass"))) {
//System.out.println("Entered AddCluster");
action = new ClusterManage();
redirect = action.addCluster(request,response,caller);
}
if(caller.equals("ClusEdit")) {

//System.out.println("Entered ClusEdit");
action = new ClusterManage();
redirect = action.clusterEditdel(request,response,caller);
}
if(caller.equals("Clussubmit")) {
//System.out.println("Entered submit");
action = new ClusterManage();
redirect = action.clusterEditdel(request,response,caller);
}
if(caller.equals("ClusDelete")) {
//System.out.println("Entered Delete");
action = new ClusterManage();
redirect = action.clusterEditdel(request,response,caller);
}

if(caller.equals("ArchiveShow")) {
//System.out.println("Entered ArchiveShow :");
action = new Archive();
redirect = action.archiveSet(request,response,caller);
}
if((caller.equals("AddSettings"))||(caller.equals("Archive"))) {
//System.out.println("Entered Archiveset");
String temp="";
action = new Archive();
redirect = action.archiveSet(request,response,caller);
if(caller.equals("AddSettings"))
{
temp=request.getParameter("setsav");
request.setAttribute("setsav",temp);
}
}
if(caller.equals("AddExclude")) {
//System.out.println("Entered AddExclude :");
action = new Archive();
redirect = action.archiveSet(request,response,caller);
}
if(caller.equals("DelExclude")) {
//System.out.println("Entered DelExclude :");
action = new Archive();
redirect = action.archiveSet(request,response,caller);
}
if(caller.equals("showArcBack")) {
//System.out.println("Entered showArcBack");
action = new Archive();
redirect = action.archiveBack(request,response,caller);
}

if(caller.equals("backup")||caller.equals("purge")||caller.equals("u
pload")) {
//System.out.println("Entered :" +caller);
action = new Archive();
/* redirect = */ action.archiveBack(request,response,caller);
}

if((caller.equals("Sessiondown"))||(caller.equals("Sessiontick"))||(
caller.equals("Sessionup"))||(caller.equals("ShowAuditSess"))) {
//System.out.println("Entered Sessiondown :" +caller);
action = new SessLog();
redirect = action.SessAudit(request,response,caller);
}

}
catch(Exception e) {
//response.sendRedirect("index.jsp");
HttpSession ses42 = request.getSession(true);
ses42.setAttribute("Timeout","true");
redirect="/index.jsp";
logger.debug("Exception in ArcmentorController" + e);
}
/* String checkAction1 = request.getQueryString();
System.out.println("action1 found :"+checkAction1);
String checkIfDelete = (String)session.getValue("deleteRecord");
if(checkAction1.equals("delete"))
{
redirect = action.doChange(request,response,"delete");
}
*/
// System.out.println("Back to ArcmentorController");
//System.out.println("dispatching to :"+redirect);
// System.out.println("Value of ctx :\t"+ctx);
// RequestDispatcher dispatcher = getServletContext().getRequestDispatche
r(redirect);
RequestDispatcher dispatcher =getServletContext().getRequestDispatcher
(redirect);
// redirect=null;
// System.out.println("Redispatching to :"+redirect);
// System.out.println("forwarding ");
dispatcher.forward(request,response);
// }
}
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException,IOException {
processRequest(req,res);
}
protected void doPost(HttpServletRequest req, HttpServletResponse res) throw
s ServletException,IOException {
processRequest(req,res);
}
}

--------------------------------------------------------------------------------
----------------
Auditmessagecmd
-----------------

/*
* AuditMessageCommand.java
*
* Created on July 13, 2004, 3:16 PM
*/
package com.arcmentor;
import java.sql.*;
import java.util.*;
import java.lang.*;
import java.text.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import org.apache.log4j.Logger;
/**
*
* @author root
*/
public class AuditMessageCommand implements Action{
DBConnection dbcon;
Connection con;
Logger logger;
/** Creates a new instance of AuditMessageCommand */
public AuditMessageCommand() {
//System.out.println("=========Entered AuditMessageCommand===========");
dbcon = new DBConnection();
con = dbcon.getConnection();

try
{
logger = Logger.getLogger("AuditMessageCommand");
}
catch(Exception e)
{
System.out.println("AuditMessageCommand: Exception while getting Log
ger" + e);
}
logger.debug("--------------Entered AuditMessageCommand-----------------
---");

private void RsScroll(HttpServletRequest req, HttpServletResponse resp,Stri


ng caller,ResultSet rs,String END_DT,String END_T,boolean right_limit) throws S
ervletException
{
//******************code for calculating previous/next 40 records BEGINS
System.out.println("---------------Inside RsScroll()---------------");
try
{
rs.beforeFirst();
rs.next(); //last record of table
String CUR_SLID_DT = rs.getString("STARTDATE");
String CUR_SLID_T =rs.getString("STARTTIME");
String Curr_Sesid = rs.getString("SESSIONID");
req.setAttribute("CUR_SLID_DT",CUR_SLID_DT);
req.setAttribute("CUR_SLID_T",CUR_SLID_T);
req.setAttribute("CUR_SLID_SID",Curr_Sesid);
rs.last();
String Last_Rec_DT = rs.getString("STARTDATE");
String Last_Rec_T =rs.getString("STARTTIME");
String Last_Rec_SID=rs.getString("SESSIONID");

req.setAttribute("Last_Rec_DT",Last_Rec_DT);
req.setAttribute("Last_Rec_T",Last_Rec_T);
req.setAttribute("Last_Rec_SID",Last_Rec_SID);
System.out.println("CUR_SLID_SID : "+Curr_Sesid);
System.out.println("Last_Rec_SID"+Last_Rec_SID);
rs.beforeFirst();
req.setAttribute("REC",rs);
System.out.println("end of rsScroll"+rs);
}
catch(Exception e) {
logger.error("Exception in RsScroll for:"+ caller +" :"+e);
}
//******************code for calculating previous/next 40 records ENDS
}

private int RsCalc(HttpServletRequest req, HttpServletResponse resp,String c


aller,String query) throws ServletException {
int total_rec=0;
//################code to get Start , Middle and End (Date & Time) BEGIN
#################
try{
System.out.println("-----Inside RsCalc()-----");
//System.out.println("in RsCalc---query2 : "+query);
ResultSet rs1=dbcon.execQuery(con,query);
rs1.next(); //first record of table
String ED = rs1.getString("STARTDATE");
String ET = rs1.getString("STARTTIME");
String Curr_Sesid = rs1.getString("SESSIONID");

rs1.last(); //last record of table


String SD = rs1.getString("STARTDATE");
String ST = rs1.getString("STARTTIME");

total_rec=rs1.getRow();
System.out.println("Total No Of Rows.: "+total_rec);
rs1.beforeFirst();
int trow=(int)(total_rec/2);
// System.out.println("ROW. NO. of Middle Record: "+trow);
trow=trow+2;
if(trow >= total_rec){ trow = total_rec;}//condition to check whethe
r total_rec less than 3
rs1.absolute(trow); //Middle record of table
String MD = rs1.getString("STARTDATE");
String MT = rs1.getString("STARTTIME");

rs1.close();
// System.out.println("#SD:"+SD+" #ST: "+ST+" #ED: "+ED+" #ET:
"+ET+" #MD: "+MD+" #MT: "+MT);
req.setAttribute("SD",SD);
req.setAttribute("ST",ST);
req.setAttribute("ED",ED);
req.setAttribute("ET",ET);
req.setAttribute("MD",MD);
req.setAttribute("MT",MT);
req.setAttribute("END_SID",Curr_Sesid);
req.setAttribute("Keyword",req.getParameter("Keyword"));
req.setAttribute("Keyval",req.getParameter("Keyval"));
String tp=req.getParameter("Keyword");
//# System.out.println("KEYWRDDDDDDDD: "+tp+"Keyval: "+req.getP
arameter("Keyval"));
if(caller.equals("PasAuditShow")) //To Set Slider Date For First Ti
me Display
{
String CUR_SLID_DT = ED;
String CUR_SLID_T = ET;
req.setAttribute("CUR_SLID_DT",CUR_SLID_DT);
req.setAttribute("CUR_SLID_T",CUR_SLID_T);
req.setAttribute("CUR_SLID_SID",Curr_Sesid);
req.setAttribute("END_SID",Curr_Sesid);
System.out.println("CUR_SLID_DT"+CUR_SLID_DT);
System.out.println("CUR_SLID_SID"+Curr_Sesid);
}
System.out.println("end of rscalc");
}
catch(Exception e) {
logger.error("Exception in RsCalc(): "+e);
}

//################code to get Start , Middle and End (Date & Time) ENDS#
###############
//# System.out.println("Return value from ReCalc(): "+total_rec);
return total_rec;
}

public String fetchPastUser(HttpServletRequest req, HttpServletResponse resp


, String caller) throws ServletException {

String redirect="";
String ctype="_c%";

System.out.println(" fetchPastUser : ");


System.out.println("CONF value is : "+req.getParameter("CONF"));
if(caller.equals("show")) {
ResultSet rs = dbcon.execQuery(con,"select DISTINCT FROMID from MESS
AGES order by FROMID asc");
ResultSet rs1 = dbcon.execQuery(con,"select DISTINCT FROMID from MES
SAGES order by FROMID asc");
ResultSet rs2 = dbcon.execQuery(con,"select DISTINCT FROMID from MES
SAGES order by FROMID asc");
req.setAttribute("PastUserValues",rs);
req.setAttribute("PastUserValues1",rs1);
req.setAttribute("PastUserValues2",rs2);
redirect= "/UserAudit.jsp";
}
if(caller.equals("PasAuditShow")) {
System.out.println("---------------Inside PasAuditShow---------------
");
String conf="";
HttpSession ses=null;
int rec_stat=0;
String bslider="570";
String aslider="0";
String parameter="";
// String whichCriteria="";
String imtype="";
conf=req.getParameter("conference");
System.out.println("conference in PasAuditShow : " +conf);
req.setAttribute("BSlid",bslider);
req.setAttribute("ASlid",aslider);
try{
String selcriteria = req.getParameter("whichCriteria");
System.out.println("Selected type :"+selcriteria);
int sel = Integer.parseInt(selcriteria);

String[] arr = new String[7];


//code to set attribute for the session
try
{
if(req.getParameter("whichCriteria")!=null)
{
imtype=req.getParameter("imtype");
req.setAttribute("imtype",imtype);
if(sel!=0) //to get parameter for query
(like userid,date,time)
{
parameter=req.getParameter("parameter");
System.out.println("parameter is"+parameter);
char ch=parameter.charAt(0);
if(ch=='[')
{
String[] Arr = new String[500];
int k=0;
StringTokenizer stz1 = new StringTokenizer(pa
rameter,"[]\"");
while(stz1.hasMoreTokens())
{
Arr[k]=stz1.nextToken();
k++;
}
System.out.println(k);
parameter="";
for(int j=0;j<k;j++)
{
System.out.println(Arr[j]);
parameter=parameter+Arr[j];
}
System.out.println("parameter is"+parameter);
}
req.setAttribute("PARAM",parameter);
}
else{
req.setAttribute("PARAM","");
}
}
}
catch(Exception e)
{
System.out.println("The Exception test"+e);
}
if((sel!=0)&&(sel!=1))
{
String temp=parameter;
StringTokenizer stz = new StringTokenizer(parameter,";"
);
int i=0;
while(stz.hasMoreTokens())
{
arr[i]=stz.nextToken();
i++;
}
System.out.println("arr[0]="+arr[0]);
int k=0;
String[] Arr = new String[100];
String user="";
StringTokenizer stz1 = new StringTokenizer(arr[0],"[]\"
");
while(stz1.hasMoreTokens())
{
Arr[k]=stz1.nextToken();
k++;
}
System.out.println(k);
for(int j=0;j<k;j++)
{
System.out.println(Arr[j]);
user=user+Arr[j];
}
System.out.println("user is"+user);
arr[0]=user;
parameter=temp;
req.setAttribute("PARAM",parameter);
}
if(sel==1)
{
int k=0;
String[] Arr = new String[500];
StringTokenizer stz1 = new StringTokenizer(parameter,"[
]\"");
while(stz1.hasMoreTokens())
{
Arr[k]=stz1.nextToken();
k++;
}
System.out.println(k);
parameter="";
for(int j=0;j<k;j++)
{
System.out.println(Arr[j]);
parameter=parameter+Arr[j];
}
System.out.println(parameter);
req.setAttribute("PARAM",parameter);
}
String query="";
System.out.println("criteria (sel) is :"+sel);
switch(sel){
case 0:if(imtype.length()==0){//query="select DISTINCT SESSIONID,FR
OMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED from MESSAGES GROUP BY SESSIONID or
der by STARTDATE desc,STARTTIME desc";
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where (sessionid like '"+ctype+"') order by
STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where (sessionid not like '"+ctype+"') order b
y STARTDATE desc,STARTTIME desc";
} else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO order by STARTDATE desc,STARTTIME desc";
}
}else
{//query="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from MESSAGES where IMTYPE ='"+imtype+"' GROUP BY SESSIONID orde
r by STARTDATE desc,STARTTIME desc";
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (sessionid li
ke '"+ctype+"')) order by STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (sessionid no
t like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') order by STARTDATE
desc,STARTTIME desc";
}
}
break;
case 1:if(imtype.length()==0){//query="select DISTINCT SESSIONID,FR
OMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED from MESSAGES where (FROMID IN ("+p
arameter+") or TOID IN ("+parameter+")) GROUP BY SESSIONID order by STARTDATE de
sc,STARTTIME desc";
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN ("+parameter+") or TOID IN (
"+parameter+")) and (sessionid like '"+ctype+"')) order by STARTDATE desc,STARTT
IME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((FROMID IN ("+parameter+") or TOID IN ("
+parameter+")) and (sessionid not like '"+ctype+"')) order by STARTDATE desc,STA
RTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,
AUDITED from PASTSESSIONINFO where (FROMID IN ("+parameter+") or TOID IN ("+para
meter+")) order by STARTDATE desc,STARTTIME desc";
}
}
else
{//query="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from MESSAGES where IMTYPE ='"+imtype+"' and (FROMID IN ("+param
eter+") or TOID IN ("+parameter+")) GROUP BY SESSIONID order by STARTDATE desc,
STARTTIME desc";
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+para
meter+") or TOID IN ("+parameter+")) and (sessionid like '"+ctype+"')) order by
STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYP
E,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+p
arameter+") or TOID IN ("+parameter+")) and (sessionid not like '"+ctype+"')) or
der by STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,
AUDITED from PASTSESSIONINFO where IMTYPE ='"+imtype+"' and (FROMID IN ("+parame
ter+") or TOID IN ("+parameter+")) order by STARTDATE desc,STARTTIME desc";
}
}
break;
case 2:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where ((STARTDATE between '"+arr[0]+"' and '"+arr[1]
+"') and (sessionid like '"+ctype+"'))order by STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((STARTDATE between '"+arr[0]+"' and '"+a
rr[1]+"') and (sessionid not like '"+ctype+"'))order by STARTDATE desc,STARTTIME
desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where (STARTDATE between '"+arr[0]+"' and '"+a
rr[1]+"') order by STARTDATE desc,STARTTIME desc";
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTY
PE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (STARTDATE bet
ween '"+arr[0]+"' and '"+arr[1]+"') and (sessionid like '"+ctype+"')) order by S
TARTDATE desc,STARTTIME desc";

}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYP
E,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (STARTDATE betw
een '"+arr[0]+"' and '"+arr[1]+"') and (sessionid not like '"+ctype+"')) order b
y STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (STARTDATE between
'"+arr[0]+"' and '"+arr[1]+"')) order by STARTDATE desc,STARTTIME desc";
}
}
break;
case 3:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((STARTTIME between '"+arr[0]+"' and '"+a
rr[1]+"') and (sessionid like '"+ctype+"')) order by STARTDATE desc,STARTTIME de
sc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYP
E,AUDITED from PASTSESSIONINFO where ((STARTTIME between '"+arr[0]+"' and '"+arr
[1]+"') and (sessionid not like '"+ctype+"')) order by STARTDATE desc,STARTTIME
desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where (STARTTIME between '"+arr[0]+"' and '"+arr[1]+
"') order by STARTDATE desc,STARTTIME desc";
}
}
else{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (STARTTIME b
etween '"+arr[0]+"' and '"+arr[1]+"') and (sessionid like '"+ctype+"')) order by
STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (STARTTIME be
tween '"+arr[0]+"' and '"+arr[1]+"') and (sessionid not like '"+ctype+"')) order
by STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (STARTTIME between
'"+arr[0]+"' and '"+arr[1]+"')) order by STARTDATE desc,STARTTIME desc";
}
}
break;
case 4:if(imtype.length()==0){
//query="select DISTINCT SESSIONID,FROMID,TOID,STARTDA
TE,STARTTIME,IMTYPE,AUDITED from MESSAGES where (FROMID IN ("+arr[0]+") or TOID
IN ("+arr[0]+")) and ((STARTDATE ='"+arr[1]+"' and STARTTIME >='"+arr[3]+"') OR
(STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"') OR (STARTDATE='"+arr[2]+"'
and STARTTIME<= '"+arr[4]+"')) GROUP BY SESSIONID order by STARTDATE desc,START
TIME desc";
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or TOID IN ("+ar
r[0]+")) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '
"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (START
TIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STA
RTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) and (sessionid like '"+ctype+"')
) order by STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYP
E,AUDITED from PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[
0]+")) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+
arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTI
ME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (START
TIME between '"+arr[3]+"' and '"+arr[4]+"'))) and (sessionid not like '"+ctype+"
')) order by STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+"
)) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[
4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME b
etween '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME
between '"+arr[3]+"' and '"+arr[4]+"'))) order by STARTDATE desc,STARTTIME desc
";
}
}else{
// query="select DISTINCT SESSIONID,FROMID,TOID,STARTDA
TE,STARTTIME,IMTYPE,AUDITED from MESSAGES where IMTYPE ='"+imtype+"' and (FROMID
IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+arr[1]+"' and STAR
TTIME >='"+arr[3]+"') OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"') O
R (STARTDATE='"+arr[2]+"' and STARTTIME<= '"+arr[4]+"')) and IMTYPE ='"+imtype+"
' GROUP BY SESSIONID order by STARTDATE desc,STARTTIME desc";}
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTY
PE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+
arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME
between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDAT
E< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (START
DATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) and (s
essionid like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTY
PE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+
arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME
between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDAT
E< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (START
DATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) and (s
essionid not like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[
0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME betw
een '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '
"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE
='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')))) order by
STARTDATE desc,STARTTIME desc";
}
}
break;
case 5:if(imtype.length()==0){
// query="select DISTINCT SESSIONID,FROMID,TOID,START
DATE,STARTTIME,IMTYPE,AUDITED from MESSAGES where ((STARTDATE ='"+arr[0]+"' and
STARTTIME >='"+arr[2]+"') OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+
"') OR (STARTDATE='"+arr[1]+"' and STARTTIME<= '"+arr[3]+"')) GROUP BY SESSIONID
order by STARTDATE desc,STARTTIME desc";
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE ='"+arr[0]+"' and (STAR
TTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and ST
ARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR
(STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')))
and (sessionid like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE ='"+arr[0]+"' and (STAR
TTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and ST
ARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR
(STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')))
and (sessionid not like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE
,AUDITED from PASTSESSIONINFO where ((STARTDATE ='"+arr[0]+"' and (STARTTIME be
tween '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE<
'"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDA
TE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) order by
STARTDATE desc,STARTTIME desc";
}
}
else{
//query="select DISTINCT SESSIONID,FROMID,TOID,STA
RTDATE,STARTTIME,IMTYPE,AUDITED from MESSAGES where IMTYPE ='"+imtype+"' and ((S
TARTDATE ='"+arr[0]+"' and STARTTIME >='"+arr[2]+"') OR (STARTDATE >'"+arr[0]+"'
and STARTDATE< '"+arr[1]+"') OR (STARTDATE='"+arr[1]+"' and STARTTIME<= '"+arr[
3]+"')) and IMTYPE ='"+imtype+"' GROUP BY SESSIONID order by STARTDATE desc,STAR
TTIME desc";
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE
='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDA
TE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"'
and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+
"' and '"+arr[3]+"'))) and (sessionid like '"+ctype+"')) order by STARTDATE desc
,STARTTIME desc";

}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE
='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTD
ATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"
' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]
+"' and '"+arr[3]+"'))) and (sessionid not like '"+ctype+"')) order by STARTDATE
desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE
,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE ='"+
arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >
'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and
'"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' a
nd '"+arr[3]+"')))) order by STARTDATE desc,STARTTIME desc";
}
}
break;
case 6:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or TOID IN ("+
arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"') and (sessionid
like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or TOID IN ("+ar
r[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"') and (sessionid no
t like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,
AUDITED from PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]
+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"')) order by STARTDATE d
esc,STARTTIME desc";
}
}
else
{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN (
"+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+
arr[2]+"') and (sessionid like '"+ctype+"')) order by STARTDATE desc,STARTTIME d
esc";

}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTY
PE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+
arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+ar
r[2]+"') and (sessionid not like '"+ctype+"')) order by STARTDATE desc,STARTTIME
desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,
AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+arr
[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2
]+"')) order by STARTDATE desc,STARTTIME desc";
}
}
break;
case 7:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or TOID IN ("+a
rr[0]+")) and (STARTTIME between '"+arr[1]+"' and '"+arr[2]+"') and (sessionid l
ike '"+ctype+"')) order by STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or TOID IN ("+a
rr[0]+")) and (STARTTIME between '"+arr[1]+"' and '"+arr[2]+"') and (sessionid n
ot like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,
AUDITED from PASTSESSIONINFO where (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+
")) and (STARTTIME between '"+arr[1]+"' and '"+arr[2]+"') order by STARTDATE des
c,STARTTIME desc";
}
}
else
{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN
("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTTIME between '"+arr[1]+"' and '"
+arr[2]+"') and (sessionid like '"+ctype+"')) order by STARTDATE desc,STARTTIME
desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("
+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTTIME between '"+arr[1]+"' and '"+a
rr[2]+"') and (sessionid not like '"+ctype+"')) order by STARTDATE desc,STARTTIM
E desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,
AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+arr
[0]+") or TOID IN ("+arr[0]+")) and (STARTTIME between '"+arr[1]+"' and '"+arr[2
]+"')) order by STARTDATE desc,STARTTIME desc";
}
}
break;
}

String query1 = query +" limit 0,10";


System.out.println("The query in PasAuditShow is "+query1);
req.setAttribute("SEL",Integer.toString(sel));
req.setAttribute("CONF",conf);
ResultSet rs=dbcon.execQuery(con,query1);
if(rs.next()) { //to check whether resultset
is empty or not
rs.last();
String Last_Rec_DT=rs.getString("STARTDATE");
String Last_Rec_T=rs.getString("STARTTIME");
String Last_Rec_SID=rs.getString("SESSIONID");
rs.beforeFirst();
req.setAttribute("REC",rs);
//# System.out.println("Last Rec Date: "+Last_Rec_DT+" Last
Rec Time: "+Last_Rec_T);
req.setAttribute("Last_Rec_DT",Last_Rec_DT);
req.setAttribute("Last_Rec_T",Last_Rec_T);
req.setAttribute("Last_Rec_SID",Last_Rec_SID);
//req.setAttribute("conference",conf);
int totrec=RsCalc(req,resp,caller,query); //call to RsCalc(
)

System.out.println("Last_Rec_Dt"+Last_Rec_DT);
System.out.println("Last_Rec_SID"+Last_Rec_SID);
if(totrec<=10) {
//# System.out.println("---TOTAL RECOR
DS LESS THAN OR EQUAL TO 40");
rec_stat=2;
}
}
else {
System.out.println("-----RECORD EMPTY-----");
rec_stat=1;
req.setAttribute("SD","");
req.setAttribute("ST","");
req.setAttribute("ED","");
req.setAttribute("ET","");
req.setAttribute("MD","");
req.setAttribute("MT","");
req.setAttribute("Last_Rec_DT","");
req.setAttribute("Last_Rec_T","");
req.setAttribute("CUR_SLID_DT","");
req.setAttribute("CUR_SLID_T","");
req.setAttribute("CUR_SLID_SID","");
req.setAttribute("END_SID","");
req.setAttribute("Keyword",req.getParameter("Keyword"));
req.setAttribute("Keyval",req.getParameter("Keyval"));
}

req.setAttribute("REC_STAT",Integer.toString(rec_stat));
req.setAttribute("con",con); //new code for connection
}catch(Exception e){
logger.error("Exception in PasAuditShow: "+e);
}
System.out.println("end of PasAuditShow : now to redirecting to Past
AuditResults.jsp");
redirect="/PastAuditResults.jsp";
}

if(caller.equals("PastSessionPrev")) {
System.out.println("---------------Inside PastSessionPrev-----------
----");
String conf="";
ResultSet rs3 =null;
boolean left_limit=false;
String imtype=req.getParameter("imt");
req.setAttribute("imtype",imtype);
System.out.println("the imtype is :"+imtype);
// System.out.println("The IMtype to be disaplyed in the ser v is "+
imtype);
String Last_Rec_DT=req.getParameter("LRDT");
String Last_Rec_T=req.getParameter("LRT");
String Last_Rec_SID=req.getParameter("LSID");
System.out.println("Last Rec Date: "+Last_Rec_DT+" Last Rec Time: "+
Last_Rec_T+" Last Rec Sessionid"+Last_Rec_SID);
String CUR_DT=req.getParameter("CD");
String CUR_T=req.getParameter("CT");
String CUR_SID=req.getParameter("CSID");
String START_DT=req.getParameter("SD");
String START_T=req.getParameter("ST");
//String START_SID=req.getParameter("SID");
System.out.println("SD: "+START_DT+" ST: "+START_T);
conf=req.getParameter("CONF");
System.out.println("conference in pastsessionprev : " +conf);
String rec_stat1=req.getParameter("rec_stat");
int rec_stat=Integer.parseInt(rec_stat1);
System.out.println("rec_stat is "+rec_stat);
if((Last_Rec_DT.equals(START_DT))&&(Last_Rec_T.equals(START_T))) //
condition to check whether left record limit is reached
{
left_limit=true;
System.out.println("*******LEFT LIMIT REACHED******** ");
}
String selS=req.getParameter("SEL");
int sel = Integer.parseInt(selS);
String selSt = req.getParameter("PARAM");
System.out.println("selSt (Parameter or PARAM) is"+selSt);
System.out.println("criteria(SEL) is :"+sel);
Calendar cal = Calendar.getInstance();
java.util.Date today = cal.getTime();
SimpleDateFormat fmt =new SimpleDateFormat("yyyy-MM-dd");
String todayDate = fmt.format(today);
String[] arr = new String[7];
if((sel!=0)&&(sel!=1)){
StringTokenizer stz = new StringTokenizer(selSt,";");
int i=0;
while(stz.hasMoreTokens()) {
arr[i]=stz.nextToken();
i++;
}
}
String query="";
String query1="";
String query2="";
switch(sel){
case 0:if(imtype.length()==0){
if(conf.equals("conf"))
{
//query="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,ST
ARTTIME,MESSAGE,IMTYPE,AUDITED from MESSAGES where (STARTDATE< '"+CUR_DT+"') OR
(STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"') group by SESSIONID order
by STARTDATE desc,STARTTIME desc limit 0,10";
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,
AUDITED from PASTSESSIONINFO where (((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+
CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (sessionid like '"+ctype+"')) order
by STARTDATE desc,STARTTIME desc limit 0,10";
//query1="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTT
IME,MESSAGE,IMTYPE,AUDITED from MESSAGES where ((STARTDATE< '"+Last_Rec_DT+"')
OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONI
D <> '"+Last_Rec_SID+"') group by SESSIONID order by STARTDATE desc,STARTTIME d
esc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE
,AUDITED from PASTSESSIONINFO where (((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDA
TE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Las
t_Rec_SID+"') and (sessionid like '"+ctype+"')) order by STARTDATE desc,STARTTIM
E desc limit 0,10";
// query2="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTT
IME,MESSAGE,IMTYPE,AUDITED from MESSAGES GROUP BY SESSIONID ORDER BY STARTDATE
desc,STARTTIME desc" ;
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONIN
FO where (sessionid like '"+ctype+"') order by STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
//query="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,S
TARTTIME,MESSAGE,IMTYPE,AUDITED from MESSAGES where (STARTDATE< '"+CUR_DT+"') O
R (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"') group by SESSIONID orde
r by STARTDATE desc,STARTTIME desc limit 0,10";
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where (((STARTDATE< '"+CUR_DT+"') OR (STARTDATE
='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (sessionid not like '"+ctype+"'
)) order by STARTDATE desc,STARTTIME desc limit 0,10";
//query1="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTT
IME,MESSAGE,IMTYPE,AUDITED from MESSAGES where ((STARTDATE< '"+Last_Rec_DT+"')
OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONI
D <> '"+Last_Rec_SID+"') group by SESSIONID order by STARTDATE desc,STARTTIME d
esc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE
,AUDITED from PASTSESSIONINFO where (((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDA
TE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Las
t_Rec_SID+"') and (sessionid not like '"+ctype+"')) order by STARTDATE desc,STAR
TTIME desc limit 0,10";
// query2="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTT
IME,MESSAGE,IMTYPE,AUDITED from MESSAGES GROUP BY SESSIONID ORDER BY STARTDATE
desc,STARTTIME desc" ;
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONIN
FO where (sessionid not like '"+ctype+"') order by STARTDATE desc,STARTTIME desc
";
}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where (STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR
_DT+"' and STARTTIME <= '"+CUR_T+"') order by STARTDATE desc,STARTTIME desc limi
t 0,10";
//query1="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTT
IME,MESSAGE,IMTYPE,AUDITED from MESSAGES where ((STARTDATE< '"+Last_Rec_DT+"')
OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONI
D <> '"+Last_Rec_SID+"') group by SESSIONID order by STARTDATE desc,STARTTIME d
esc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE
,AUDITED from PASTSESSIONINFO where ((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDAT
E='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last
_Rec_SID+"') order by STARTDATE desc,STARTTIME desc limit 0,10";
// query2="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTT
IME,MESSAGE,IMTYPE,AUDITED from MESSAGES GROUP BY SESSIONID ORDER BY STARTDATE
desc,STARTTIME desc" ;
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONIN
FO order by STARTDATE desc,STARTTIME desc";
}
}else
{
if(conf.equals("conf"))
{
//query="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,S
TARTTIME,MESSAGE,IMTYPE,AUDITED from MESSAGES where (IMTYPE ='"+imtype+"') and
((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T
+"')) group by SESSIONID order by STARTDATE desc,STARTTIME desc limit 0,10";
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE
,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"+
CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (sessio
nid like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
//query1="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTT
IME,MESSAGE,IMTYPE,AUDITED from MESSAGES where (IMTYPE ='"+imtype+"') and (((S
TARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+
Last_Rec_T+"'))) and (SESSIONID <> '"+Last_Rec_SID+"') group by SESSIONID order
by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYP
E,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"
+Last_Rec_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"
')) and (SESSIONID <> '"+Last_Rec_SID+"') and (sessionid like '"+ctype+"')) orde
r by STARTDATE desc,STARTTIME desc limit 0,10";
//query2="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STAR
TTIME,MESSAGE,IMTYPE,AUDITED from MESSAGES where IMTYPE ='"+imtype+"' GROUP B
Y SESSIONID ORDER BY STARTDATE desc,STARTTIME desc" ;
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONI
NFO where ((IMTYPE ='"+imtype+"') and (sessionid like '"+ctype+"')) ORDER BY STA
RTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
//query="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,S
TARTTIME,MESSAGE,IMTYPE,AUDITED from MESSAGES where (IMTYPE ='"+imtype+"') and
((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T
+"')) group by SESSIONID order by STARTDATE desc,STARTTIME desc limit 0,10";
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE
,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"+
CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (sessio
nid not like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
//query1="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTT
IME,MESSAGE,IMTYPE,AUDITED from MESSAGES where (IMTYPE ='"+imtype+"') and (((S
TARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+
Last_Rec_T+"'))) and (SESSIONID <> '"+Last_Rec_SID+"') group by SESSIONID order
by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYP
E,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"
+Last_Rec_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"
')) and (SESSIONID <> '"+Last_Rec_SID+"') and (sessionid not like '"+ctype+"'))
order by STARTDATE desc,STARTTIME desc limit 0,10";
//query2="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STAR
TTIME,MESSAGE,IMTYPE,AUDITED from MESSAGES where IMTYPE ='"+imtype+"' GROUP B
Y SESSIONID ORDER BY STARTDATE desc,STARTTIME desc" ;
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONI
NFO where ((IMTYPE ='"+imtype+"') and (sessionid not like '"+ctype+"')) ORDER BY
STARTDATE desc,STARTTIME desc";
}
else{
//query="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTTI
ME,MESSAGE,IMTYPE,AUDITED from MESSAGES where (IMTYPE ='"+imtype+"') and ((STA
RTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"'))
group by SESSIONID order by STARTDATE desc,STARTTIME desc limit 0,10";
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE
,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"+
CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"'))) order by S
TARTDATE desc,STARTTIME desc limit 0,10";
//query1="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTT
IME,MESSAGE,IMTYPE,AUDITED from MESSAGES where (IMTYPE ='"+imtype+"') and (((S
TARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+
Last_Rec_T+"'))) and (SESSIONID <> '"+Last_Rec_SID+"') group by SESSIONID order
by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYP
E,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"
+Last_Rec_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"
')) and (SESSIONID <> '"+Last_Rec_SID+"')) order by STARTDATE desc,STARTTIME des
c limit 0,10";
//query2="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STAR
TTIME,MESSAGE,IMTYPE,AUDITED from MESSAGES where IMTYPE ='"+imtype+"' GROUP B
Y SESSIONID ORDER BY STARTDATE desc,STARTTIME desc" ;
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONI
NFO where (IMTYPE ='"+imtype+"') ORDER BY STARTDATE desc,STARTTIME desc";
}
}
break;
case 1:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITE
D from PASTSESSIONINFO where (((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT
+"' and STARTTIME <= '"+CUR_T+"')) and (FROMID IN ("+selSt+") or TOID IN ("+selS
t+")) and (sessionid like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc l
imit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDIT
ED from PASTSESSIONINFO where (((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+
Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (FROMID IN ("+selSt+") or
TOID IN ("+selSt+")) and (sessionid like '"+ctype+"')) order by STARTDATE desc,S
TARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO whe
re ((FROMID IN ("+selSt+") or TOID IN ("+selSt+")) and (sessionid like '"+ctype+
"')) ORDER BY STARTDATE desc,STARTTIME desc";
//System.out.println("query is "+query);
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE< '"+CUR_DT+"') OR (STARTDAT
E='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (FROMID IN ("+selSt+") or TOID
IN ("+selSt+")) and (sessionid not like '"+ctype+"')) order by STARTDATE desc,S
TARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDIT
ED from PASTSESSIONINFO where (((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+
Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (FROMID IN ("+selSt+") or
TOID IN ("+selSt+")) and (sessionid not like '"+ctype+"')) order by STARTDATE de
sc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO whe
re ((FROMID IN ("+selSt+") or TOID IN ("+selSt+")) and (sessionid not like '"+ct
ype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITE
D from PASTSESSIONINFO where ((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+
"' and STARTTIME <= '"+CUR_T+"')) and (FROMID IN ("+selSt+") or TOID IN ("+selSt
+")) order by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDIT
ED from PASTSESSIONINFO where ((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+L
ast_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (FROMID IN ("+selSt+") or T
OID IN ("+selSt+")) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO whe
re (FROMID IN ("+selSt+") or TOID IN ("+selSt+")) ORDER BY STARTDATE desc,START
TIME desc";
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITE
D from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"+CUR_DT
+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (FROMID IN ("
+selSt+") or TOID IN ("+selSt+")) and (sessionid like '"+ctype+"')) order by STA
RTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDIT
ED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"+Last_
Rec_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) an
d (FROMID IN ("+selSt+") or TOID IN ("+selSt+")) and (sessionid like '"+ctype+"'
)) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO whe
re ((IMTYPE ='"+imtype+"') and (FROMID IN ("+selSt+") or TOID IN ("+selSt+")) a
nd (sessionid like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITE
D from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"+CUR_DT
+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (FROMID IN ("
+selSt+") or TOID IN ("+selSt+")) and (sessionid not like '"+ctype+"')) order by
STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDIT
ED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"+Last_
Rec_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) an
d (FROMID IN ("+selSt+") or TOID IN ("+selSt+")) and (sessionid not like '"+ctyp
e+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO whe
re ((IMTYPE ='"+imtype+"') and (FROMID IN ("+selSt+") or TOID IN ("+selSt+")) a
nd (sessionid not like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";

}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITE
D from PASTSESSIONINFO where IMTYPE ='"+imtype+"' and ((STARTDATE< '"+CUR_DT+"'
) OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (FROMID IN ("+se
lSt+") or TOID IN ("+selSt+")) order by STARTDATE desc,STARTTIME desc limit 0,10
";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDIT
ED from PASTSESSIONINFO where IMTYPE ='"+imtype+"' and ((STARTDATE< '"+Last_Rec
_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (
FROMID IN ("+selSt+") or TOID IN ("+selSt+")) order by STARTDATE desc,STARTTIME
desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO whe
re IMTYPE ='"+imtype+"' and (FROMID IN ("+selSt+") or TOID IN ("+selSt+")) ORDE
R BY STARTDATE desc,STARTTIME desc";
}
}
break;

case 2:if(imtype.length()==0){
if(conf.equals("conf"))
{
System.out.println("case 2"+sel);
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where (((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+
"' and STARTTIME <= '"+CUR_T+"')) and (STARTDATE between '"+arr[0]+"' and '"+arr
[1]+"') and (SESSIONID like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc
limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITE
D from PASTSESSIONINFO where (((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+L
ast_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (STARTDATE between '"+arr[0
]+"' and '"+arr[1]+"') and (SESSIONID <> '"+Last_Rec_SID+"') and (SESSIONID like
'"+ctype+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO wher
e ((STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') and (SESSIONID like '"+ctyp
e+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE
,AUDITED from PASTSESSIONINFO where (((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"
+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (STARTDATE between '"+arr[0]+"' an
d '"+arr[1]+"') and (SESSIONID not like '"+ctype+"')) order by STARTDATE desc,ST
ARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITE
D from PASTSESSIONINFO where (((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+L
ast_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (STARTDATE between '"+arr[0
]+"' and '"+arr[1]+"') and (SESSIONID not like '"+ctype+"')) order by STARTDATE
desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO wher
e ((STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') and (sessionid not like '"+
ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where ((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"
' and STARTTIME <= '"+CUR_T+"')) and (STARTDATE between '"+arr[0]+"' and '"+arr[
1]+"') order by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITE
D from PASTSESSIONINFO where ((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+La
st_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (STARTDATE between '"+arr[0]
+"' and '"+arr[1]+"') order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO wher
e (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') ORDER BY STARTDATE desc,STAR
TTIME desc";
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE<
'"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (STA
RTDATE between '"+arr[0]+"' and '"+arr[1]+"') and (sessionid like '"+ctype+"'))
order by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITE
D from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"+Last_Re
c_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and
(STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') and (sessionid like '"+ctype+"
')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO wher
e ((IMTYPE ='"+imtype+"') and (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"')
and (sessionid like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE
,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"+
CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (STARTD
ATE between '"+arr[0]+"' and '"+arr[1]+"') and (sessionid not like '"+ctype+"'))
order by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITE
D from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"+Last_Re
c_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and
(STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') and (sessionid not like '"+cty
pe+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO wher
e ((IMTYPE ='"+imtype+"') and (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"')
and (sessionid not like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"+CUR_DT+"
') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (STARTDATE betw
een '"+arr[0]+"' and '"+arr[1]+"')) order by STARTDATE desc,STARTTIME desc limit
0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITE
D from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"+Last_Re
c_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and
(STARTDATE between '"+arr[0]+"' and '"+arr[1]+"')) order by STARTDATE desc,START
TIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO wher
e ((IMTYPE ='"+imtype+"') and (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"'))
ORDER BY STARTDATE desc,STARTTIME desc";
}
}
break;
case 3:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTY
PE,AUDITED from PASTSESSIONINFO where (((STARTDATE< '"+CUR_DT+"') OR (STARTDATE=
'"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (STARTTIME between '"+arr[0]+"'
and '"+arr[1]+"') and (sessionid like '"+ctype+"')) order by STARTDATE desc,STAR
TTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED f
rom PASTSESSIONINFO where (((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last
_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID+
"' ) and (STARTTIME between '"+arr[0]+"' and '"+arr[1]+"') and (sessionid like '
"+ctype+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where (
(STARTTIME between '"+arr[0]+"' and '"+arr[1]+"') and (sessionid like '"+ctype+"
')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTT
IME,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE< '"+CUR_DT+"') OR (ST
ARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (STARTTIME between '"+ar
r[0]+"' and '"+arr[1]+"') and (sessionid not like '"+ctype+"')) order by STARTDA
TE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED f
rom PASTSESSIONINFO where (((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last
_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID+
"' ) and (STARTTIME between '"+arr[0]+"' and '"+arr[1]+"') and (sessionid not li
ke '"+ctype+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where (
(STARTTIME between '"+arr[0]+"' and '"+arr[1]+"') and (sessionid not like '"+cty
pe+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED fr
om PASTSESSIONINFO where ((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' a
nd STARTTIME <= '"+CUR_T+"')) and (STARTTIME between '"+arr[0]+"' and '"+arr[1]+
"') order by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED f
rom PASTSESSIONINFO where ((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last_
Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID+"
' ) and (STARTTIME between '"+arr[0]+"' and '"+arr[1]+"') order by STARTDATE des
c,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where (
STARTTIME between '"+arr[0]+"' and '"+arr[1]+"') ORDER BY STARTDATE desc,STARTT
IME desc";
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE<
'"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (STA
RTTIME between '"+arr[0]+"' and '"+arr[1]+"') and (sessionid like '"+ctype+"'))
order by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED f
rom PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"+Last_Rec_D
T+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SE
SSIONID <> '"+Last_Rec_SID+"' ) and (STARTTIME between '"+arr[0]+"' and '"+arr[1
]+"') and (sessionid like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc l
imit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where (
(IMTYPE ='"+imtype+"') and (STARTTIME between '"+arr[0]+"' and '"+arr[1]+"') and
(sessionid like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE
< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (S
TARTTIME between '"+arr[0]+"' and '"+arr[1]+"') and (sessionid like '"+ctype+"')
) order by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED f
rom PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE< '"+Last_Rec_D
T+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SE
SSIONID <> '"+Last_Rec_SID+"' ) and (STARTTIME between '"+arr[0]+"' and '"+arr[1
]+"') and (sessionid like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc l
imit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where (
(IMTYPE ='"+imtype+"') and (STARTTIME between '"+arr[0]+"' and '"+arr[1]+"') and
(sessionid like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED fr
om PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and ((STARTDATE< '"+CUR_DT+"') O
R (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and (STARTTIME between
'"+arr[0]+"' and '"+arr[1]+"') order by STARTDATE desc,STARTTIME desc limit 0,10
";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED f
rom PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and ((STARTDATE< '"+Last_Rec_DT
+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SES
SIONID <> '"+Last_Rec_SID+"' ) and (STARTTIME between '"+arr[0]+"' and '"+arr[1]
+"') order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where (
IMTYPE ='"+imtype+"') and (STARTTIME between '"+arr[0]+"' and '"+arr[1]+"') ORDE
R BY STARTDATE desc,STARTTIME desc";
}
}
break;

case 4:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTY
PE,AUDITED from PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or TOID IN ("+arr
[0]+")) and ((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME
<= '"+CUR_T+"')) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+
"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' an
d (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"'
and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) and (sessionid like '"+c
type+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED f
rom PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and
((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME <
'"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID+"') and ((STARTDATE ='"+ar
r[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"
+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '
"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and
'"+arr[4]+"'))) and (sessionid like '"+ctype+"')) order by STARTDATE desc,START
TIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where (
(FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+arr[1]+"' a
nd (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"
' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+
"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4
]+"'))) and (sessionid like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME des
c";

}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,
STARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or
TOID IN ("+arr[0]+")) and ((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"'
and STARTTIME <= '"+CUR_T+"')) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME betw
een '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '
"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE
='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) and (sessi
onid not like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED f
rom PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and
((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME <
'"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID+"') and ((STARTDATE ='"+ar
r[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"
+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '
"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and
'"+arr[4]+"'))) and (sessionid not like '"+ctype+"')) order by STARTDATE desc,S
TARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where (
(FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+arr[1]+"' a
nd (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"
' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+
"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4
]+"'))) and (sessionid not like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME
desc";
}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED fr
om PASTSESSIONINFO where (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((
STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"'
)) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[
4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME b
etween '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME
between '"+arr[3]+"' and '"+arr[4]+"'))) order by STARTDATE desc,STARTTIME desc
limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED f
rom PASTSESSIONINFO where (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (
(STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '
"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID+"') and ((STARTDATE ='"+arr
[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+
arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"
+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and
'"+arr[4]+"'))) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where (
FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+arr[1]+"' an
d (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"'
and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"
')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]
+"'))) ORDER BY STARTDATE desc,STARTTIME desc";
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN
("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE< '"+CUR_DT+"') OR (STARTDA
TE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and ((STARTDATE ='"+arr[1]+"' and
(STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"'
and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'
)) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+
"'))) and (sessionid like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc l
imit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED f
rom PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or
TOID IN ("+arr[0]+")) and ((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last
_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID
+"') and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+ar
r[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME
between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTI
ME between '"+arr[3]+"' and '"+arr[4]+"'))) and (sessionid like '"+ctype+"')) or
der by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where (
(IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and
((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))
OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between
'"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME betwee
n '"+arr[3]+"' and '"+arr[4]+"'))) and (sessionid like '"+ctype+"')) ORDER BY ST
ARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,S
TARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and
(FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE< '"+CUR_DT+"')
OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and ((STARTDATE ='"+ar
r[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"
+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '
"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and
'"+arr[4]+"'))) and (sessionid not like '"+ctype+"')) order by STARTDATE desc,S
TARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED f
rom PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or
TOID IN ("+arr[0]+")) and ((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last
_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID
+"') and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+ar
r[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME
between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTI
ME between '"+arr[3]+"' and '"+arr[4]+"'))) and (sessionid not like '"+ctype+"')
) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where (
(IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and
((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))
OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between
'"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME betwee
n '"+arr[3]+"' and '"+arr[4]+"'))) and (sessionid not like '"+ctype+"')) ORDER B
Y STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED fr
om PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or
TOID IN ("+arr[0]+")) and ((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"'
and STARTTIME <= '"+CUR_T+"')) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME betw
een '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '
"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE
='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) order by S
TARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED f
rom PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or
TOID IN ("+arr[0]+")) and ((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last_
Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID+
"') and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr
[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME
between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIM
E between '"+arr[3]+"' and '"+arr[4]+"'))) order by STARTDATE desc,STARTTIME des
c limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where (
IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (
(STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))
OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '
"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between
'"+arr[3]+"' and '"+arr[4]+"'))) ORDER BY STARTDATE desc,STARTTIME desc";
}
}
break;
case 5:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE< '"+CUR_DT+"') OR (STARTDAT
E='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and ((STARTDATE ='"+arr[0]+"' and
(STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' a
nd STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')
) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"
'))) and (sessionid like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc li
mit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where (((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+La
st_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SI
D+"') and ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+a
rr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIM
E between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTT
IME between '"+arr[2]+"' and '"+arr[3]+"'))) and (sessionid like '"+ctype+"')) o
rder by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
(((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'
)) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME betwee
n '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME betw
een '"+arr[2]+"' and '"+arr[3]+"'))) and (sessionid like '"+ctype+"')) ORDER BY
STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYP
E,AUDITED from PASTSESSIONINFO where (((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='
"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and ((STARTDATE ='"+arr[0]+"' and (ST
ARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and
STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) O
R (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))
) and (sessionid not like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc l
imit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where (((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+La
st_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SI
D+"') and ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+a
rr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIM
E between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTT
IME between '"+arr[2]+"' and '"+arr[3]+"'))) and (sessionid not like '"+ctype+"'
)) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
(((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'
)) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME betwee
n '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME betw
een '"+arr[2]+"' and '"+arr[3]+"'))) and (sessionid not like '"+ctype+"')) ORDER
BY STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where ((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"'
and STARTTIME <= '"+CUR_T+"')) and ((STARTDATE ='"+arr[0]+"' and (STARTTIME bet
ween '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE<
'"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDAT
E='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) order by
STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where ((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Las
t_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID
+"') and ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+ar
r[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME
between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTI
ME between '"+arr[2]+"' and '"+arr[3]+"'))) order by STARTDATE desc,STARTTIME de
sc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')
) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between
'"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME betwe
en '"+arr[2]+"' and '"+arr[3]+"'))) ORDER BY STARTDATE desc,STARTTIME desc";

}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTDATE<
'"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"'))) and ((
STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) O
R (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"
+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between
'"+arr[2]+"' and '"+arr[3]+"'))) and (sessionid like '"+ctype+"')) order by STAR
TDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTDATE< '"+Last_Re
c_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"'))) and
(SESSIONID <> '"+Last_Rec_SID+"') and ((STARTDATE ='"+arr[0]+"' and (STARTTIME
between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDAT
E< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (START
DATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) and (s
essionid like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
((IMTYPE ='"+imtype+"') and ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"
+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[
1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+ar
r[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) and (sessionid l
ike '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTDATE<
'"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"'))) and ((
STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) O
R (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"
+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between
'"+arr[2]+"' and '"+arr[3]+"'))) and (sessionid not like '"+ctype+"')) order by
STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTDATE< '"+Last_Re
c_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"'))) and
(SESSIONID <> '"+Last_Rec_SID+"') and ((STARTDATE ='"+arr[0]+"' and (STARTTIME
between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDAT
E< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (START
DATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) and (s
essionid not like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc limit 0,1
0";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
((IMTYPE ='"+imtype+"') and ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"
+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[
1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+ar
r[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) and (sessionid n
ot like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (((STARTDATE< '"+CUR_DT+"'
) OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"'))) and ((STARTDATE ='"
+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE
>'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' an
d '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"'
and '"+arr[3]+"'))) order by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (((STARTDATE< '"+Last_Rec
_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"'))) and
(SESSIONID <> '"+Last_Rec_SID+"') and ((STARTDATE ='"+arr[0]+"' and (STARTTIME b
etween '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE
< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTD
ATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) order b
y STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
(IMTYPE ='"+imtype+"') and ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+
arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1
]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr
[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) ORDER BY STARTDAT
E desc,STARTTIME desc";
}
}
break;
case 6:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE< '"+CUR_DT+"') OR (STARTDAT
E='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and ((FROMID IN ("+arr[0]+") or TO
ID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"')) and (
sessionid like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where (((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+La
st_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SI
D+"' ) and ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE betw
een '"+arr[1]+"' and '"+arr[2]+"')) and (sessionid like '"+ctype+"')) order by S
TARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr
[1]+"' and '"+arr[2]+"') and (sessionid like '"+ctype+"')) ORDER BY STARTDATE de
sc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE
,AUDITED from PASTSESSIONINFO where (((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"
+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and ((FROMID IN ("+arr[0]+") or TOID I
N ("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"')) and (sess
ionid not like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where (((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+La
st_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SI
D+"' ) and ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE betw
een '"+arr[1]+"' and '"+arr[2]+"')) and (sessionid not like '"+ctype+"')) order
by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr
[1]+"' and '"+arr[2]+"') and (sessionid not like '"+ctype+"')) ORDER BY STARTDAT
E desc,STARTTIME desc";
}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where ((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"'
and STARTTIME <= '"+CUR_T+"')) and ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0
]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"')) order by STARTDATE
desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where ((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Las
t_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID
+"' ) and ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE betwe
en '"+arr[1]+"' and '"+arr[2]+"')) order by STARTDATE desc,STARTTIME desc limit
0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
(FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[
1]+"' and '"+arr[2]+"') ORDER BY STARTDATE desc,STARTTIME desc";
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTDATE
< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"'))) and (
(FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1
]+"' and '"+arr[2]+"')) and (sessionid like '"+ctype+"')) order by STARTDATE des
c,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTDATE< '"+Last_Re
c_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"'))) and
(SESSIONID <> '"+Last_Rec_SID+"' ) and ((FROMID IN ("+arr[0]+") or TOID IN ("+a
rr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"')) and (sessionid
like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
((IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) an
d (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"') and (sessionid like '"+ctype
+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTDATE
< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"'))) and (
(FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1
]+"' and '"+arr[2]+"')) and (sessionid not like '"+ctype+"')) order by STARTDATE
desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTDATE< '"+Last_Re
c_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"'))) and
(SESSIONID <> '"+Last_Rec_SID+"' ) and ((FROMID IN ("+arr[0]+") or TOID IN ("+a
rr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"')) and (sessionid
not like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
((IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) an
d (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"') and (sessionid not like '"+c
type+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (((STARTDATE< '"+CUR_DT+"
') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"'))) and ((FROMID IN ("
+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+a
rr[2]+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (((STARTDATE< '"+Last_Rec
_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"'))) and
(SESSIONID <> '"+Last_Rec_SID+"' ) and ((FROMID IN ("+arr[0]+") or TOID IN ("+ar
r[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"')) order by STARTDA
TE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
(IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and
(STARTDATE between '"+arr[1]+"' and '"+arr[2]+"') ORDER BY STARTDATE desc,START
TIME desc";
}
}
break;

case 7:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN("+arr[0]+") or TOID IN("+arr
[0]+")) and ((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME
<= '"+CUR_T+"')) and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"'))
and (sessionid like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc limit 0
,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where ((FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and
((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME <
'"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID+"') and (STARTTIME >= '"+a
rr[1]+"' and STARTTIME <='"+arr[2]+"') and (sessionid like '"+ctype+"')) order b
y STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
((FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and (STARTTIME between '"+arr[1
]+"' and '"+arr[2]+"') and (sessionid like '"+ctype+"')) order by STARTDATE desc
,STARTTIME desc" ;
//query2="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,MES
SAGE,IMTYPE,AUDITED from MESSAGES where (FROMID IN("+arr[0]+") or TOID IN("+arr[
0]+")) and (STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"') GROUP BY SES
SIONID ORDER BY STARTTIME desc " ;
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN("+arr[0]+") or TOID IN("+arr
[0]+")) and ((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME
<= '"+CUR_T+"')) and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"'))
and (sessionid not like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc lim
it 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where ((FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and
((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME <
'"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID+"') and (STARTTIME >= '"+a
rr[1]+"' and STARTTIME <='"+arr[2]+"') and (sessionid not like '"+ctype+"')) ord
er by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
((FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and (STARTTIME between '"+arr[1
]+"' and '"+arr[2]+"') and (sessionid not like '"+ctype+"')) order by STARTDATE
desc,STARTTIME desc" ;
//query2="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,MES
SAGE,IMTYPE,AUDITED from MESSAGES where (FROMID IN("+arr[0]+") or TOID IN("+arr[
0]+")) and (STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"') GROUP BY SES
SIONID ORDER BY STARTTIME desc " ;
}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where (FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and ((
STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"'
)) and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"')) order by START
DATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where (FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and (
(STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last_Rec_DT+"' and STARTTIME < '
"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID+"') and (STARTTIME >= '"+ar
r[1]+"' and STARTTIME <='"+arr[2]+"') order by STARTDATE desc,STARTTIME desc lim
it 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
(FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and (STARTTIME between '"+arr[1]
+"' and '"+arr[2]+"') order by STARTDATE desc,STARTTIME desc" ;
//query2="select DISTINCT SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,MES
SAGE,IMTYPE,AUDITED from MESSAGES where (FROMID IN("+arr[0]+") or TOID IN("+arr[
0]+")) and (STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"') GROUP BY SES
SIONID ORDER BY STARTTIME desc " ;
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN("
+arr[0]+") or TOID IN("+arr[0]+")) and ((STARTDATE< '"+CUR_DT+"') OR (STARTDATE=
'"+CUR_DT+"' and STARTTIME <= '"+CUR_T+"')) and ((STARTTIME >= '"+arr[1]+"' and
STARTTIME <='"+arr[2]+"')) and (sessionid like '"+ctype+"')) order by STARTDATE
desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") o
r TOID IN("+arr[0]+")) and ((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last
_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID+
"') and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"')) and (sessioni
d like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
((IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and
(STARTTIME between '"+arr[1]+"' and '"+arr[2]+"') and (sessionid like '"+ctype+"
')) order by STARTDATE desc,STARTTIME desc" ;
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") o
r TOID IN("+arr[0]+")) and ((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"'
and STARTTIME <= '"+CUR_T+"')) and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <=
'"+arr[2]+"')) and (sessionid not like '"+ctype+"')) order by STARTDATE desc,STA
RTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") o
r TOID IN("+arr[0]+")) and ((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last
_Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID+
"') and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"')) and (sessioni
d not like '"+ctype+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
((IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and
(STARTTIME between '"+arr[1]+"' and '"+arr[2]+"') and (sessionid not like '"+cty
pe+"')) order by STARTDATE desc,STARTTIME desc" ;
}
else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") or
TOID IN("+arr[0]+")) and ((STARTDATE< '"+CUR_DT+"') OR (STARTDATE='"+CUR_DT+"'
and STARTTIME <= '"+CUR_T+"')) and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='
"+arr[2]+"')) order by STARTDATE desc,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED
from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") or
TOID IN("+arr[0]+")) and ((STARTDATE< '"+Last_Rec_DT+"') OR (STARTDATE='"+Last_
Rec_DT+"' and STARTTIME < '"+Last_Rec_T+"')) and (SESSIONID <> '"+Last_Rec_SID+"
') and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"')) order by START
DATE desc,STARTTIME desc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
(IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and (
STARTTIME between '"+arr[1]+"' and '"+arr[2]+"') order by STARTDATE desc,STARTTI
ME desc" ;
}
}
break;
}

req.setAttribute("SEL",Integer.toString(sel));
req.setAttribute("PARAM",selSt);
if(left_limit) {
// System.out.println("in if ");
rs3=dbcon.execQuery(con,query);
System.out.println("The query is :"+query);
// System.out.println("query : "+query);
}
else {
// System.out.println("in else");
rs3=dbcon.execQuery(con,query1);
System.out.println("conference query is "+conf);
if(conf.equals("conf"))
{
// System.out.println("The query is :"+query);
System.out.println("The query1 is "+query1);
// System.out.println("The query2 is :"+query2);
}
}
// System.out.println("$$$$$ ----query2 : "+query2);
req.setAttribute("CONF",conf);
int recnt=RsCalc(req,resp,caller,query2);

//*************code for calculating next cursor position BEGINS*****


*******************
String bslider1=req.getParameter("hbslider");
String aslider1=req.getParameter("haslider");

int bslid=Integer.parseInt(bslider1);
int aslid=Integer.parseInt(aslider1);
//# System.out.println("**********passed parameter1: "+bslid+
" parameter2: "+aslid+"TOTAl RECORDS: "+recnt);
float temp= 570.0f;
float slid_off = (temp/recnt)*10;
//# System.out.println("---FLOAT SLID_OFF "+slid_off);
int slid_off1=(int)slid_off;
//# System.out.println("---INT SLID_OFF "+slid_off1);
int old_bslid=bslid;

if(left_limit) {
bslid=old_bslid;
aslid=570-bslid;
}
else
{
bslid=bslid-slid_off1;
aslid=570-bslid;
}
if(bslid < 0 ) {
bslid=0;
aslid=570;
}
//# System.out.println("**********CALCULATED parameter1: "+bs
lid+" parameter2: "+aslid);
bslider1 = Integer.toString(bslid);
aslider1 = Integer.toString(aslid);
req.setAttribute("BSlid",bslider1);
req.setAttribute("ASlid",aslider1);
req.setAttribute("REC_STAT","0");
//**************code for calculating next cursor position ENDS******
*****************
RsScroll(req,resp,"PastSessionPrev",rs3,"START_DT","START_T",left_li
mit); //call to RsScroll() methodfs
req.setAttribute("con",con);
redirect="/PastAuditResults.jsp";
}

if(caller.equals("PastSessionNext")) {
System.out.println("---------------Inside PastSessionNext-----------
---");
String conf="";
String imtype=(String)req.getParameter("imt");
req.setAttribute("imtype",imtype);
ResultSet rs4=null;
ResultSet rs5=null;
boolean right_limit=false;
String CUR_SLID_DT=req.getParameter("CD");
String CUR_SLID_T=req.getParameter("CT");
String Cur_sid=req.getParameter("CSID");
//# System.out.println("CUR_SLID_DT: "+CUR_SLID_DT+" CUR_SL
ID_T: "+CUR_SLID_T+" Cur_sid:"+Cur_sid);
String END_DT=req.getParameter("ED");
String END_T=req.getParameter("ET");
String END_SID=req.getParameter("ESID");
// System.out.println("ED: "+END_DT+" ET: "+END_T+" END_SID: "+END_SI
D);
if((CUR_SLID_DT.equals(END_DT)) && (CUR_SLID_T.equals(END_T))) //
condition to check whether right limit is reached
{ right_limit=true;
System.out.println("*********RIGHT LIMIT REACHED in AuditMessage
Command.java **************");
}
// if(END_SID.equals(Cur_sid)) {
// right_limit=true;
// System.out.println("*********RIGHT LIMIT REACHED**************
");
// }

String selS=req.getParameter("SEL");
int sel = Integer.parseInt(selS);
// System.out.println("Selected Criteria: "+sel);
String selSt=req.getParameter("PARAM");
String[] arr = new String[7];
if((sel!=0)&&(sel!=1)){
StringTokenizer stz = new StringTokenizer(selSt,";");
int i=0;
while(stz.hasMoreTokens()) {
arr[i]=stz.nextToken();
// System.out.println("The token no"+i+" collected are "+arr[
i]);
i++;
}
}
conf=req.getParameter("CONF");
String query="";
String query1="";
String query2="";
String query3="";

switch(sel){
case 0:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where (((STARTDATE < '"+CUR_SLID_DT+"') OR (STARTDAT
E='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR_SLID_T+"')) and (SESSIONID like '"+c
type+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
(STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME >
'"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and (SESSIONID like '"+ctyp
e+"')) order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (SESSIONID like '"+ctype+"')ORDER BY STARTDATE desc,STARTTIME desc" ;
}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+CUR_SLID_DT+"') OR
(STARTDATE='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR_SLID_T+"')) and (SESSIONID
not like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
(STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME >
'"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and (SESSIONID not like '"+
ctype+"')) order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (SESSIONID not like '"+ctype+"')ORDER BY STARTDATE desc,STARTTIME desc"
;
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where (STARTDATE < '"+CUR_SLID_DT+"') OR (STARTDATE=
'"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR_SLID_T+"') order by STARTDATE desc ,ST
ARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME > '
"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) order by STARTDATE asc,START
TIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O ORDER BY STARTDATE desc,STARTTIME desc" ;
}
System.out.println("the query is "+query);
System.out.println("the query1 is "+query1);
System.out.println("the query2 is "+query2);
}
else{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTD
ATE < '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR
_SLID_T+"')) and (SESSIONID like '"+ctype+"')) order by STARTDATE desc ,STARTTIM
E desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where (
(IMTYPE ='"+imtype+"') and (((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+C
UR_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"'))) and (SESSIONID <> '"+Cur_sid+"
' ) and (SESSIONID like '"+ctype+"')) order by STARTDATE asc,STARTTIME asc limi
t 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and (SESSIONID like '"+ctype+"')) ORDER BY START
DATE desc,STARTTIME desc" ;
}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDA
TE < '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR_
SLID_T+"')) and (SESSIONID not like '"+ctype+"')) order by STARTDATE desc ,START
TIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where (
(IMTYPE ='"+imtype+"') and (((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+C
UR_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"'))) and (SESSIONID <> '"+Cur_sid+"
' ) and (SESSIONID not like '"+ctype+"')) order by STARTDATE asc,STARTTIME asc
limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and (SESSIONID not like '"+ctype+"')) ORDER BY S
TARTDATE desc,STARTTIME desc" ;

}else{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,
AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE < '"
+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR_SLID_T+
"'))) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where (
(IMTYPE ='"+imtype+"') and ((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CU
R_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"'
)) order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (IMTYPE ='"+imtype+"') ORDER BY STARTDATE desc,STARTTIME desc" ;
}
}
break;
case 1:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+CUR_SLID_DT+"') OR
(STARTDATE='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR_SLID_T+"')) and (FROMID IN
("+selS+") or TOID IN ("+selS+")) and (SESSIONID like '"+ctype+"')) order by STA
RTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
(STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME >
'"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and (FROMID IN ("+selS+") o
r TOID IN ("+selS+")) and (SESSIONID like '"+ctype+"')) order by STARTDATE asc,S
TARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((FROMID IN ("+selS+") or TOID IN ("+selS+")) and (SESSIONID like '"+cty
pe+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+CUR_SLID_DT+"') OR (S
TARTDATE='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR_SLID_T+"')) and (FROMID IN ("
+selS+") or TOID IN ("+selS+")) and (SESSIONID not like '"+ctype+"')) order by S
TARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
(STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME >
'"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and (FROMID IN ("+selS+") o
r TOID IN ("+selS+")) and (SESSIONID not like '"+ctype+"')) order by STARTDATE a
sc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((FROMID IN ("+selS+") or TOID IN ("+selS+")) and (SESSIONID not like '"
+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where ((STARTDATE < '"+CUR_SLID_DT+"') OR (STARTDATE
='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR_SLID_T+"')) and (FROMID IN ("+selS+")
or TOID IN ("+selS+")) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME > '
"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and (FROMID IN ("+selS+") or
TOID IN ("+selS+")) order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (FROMID IN ("+selS+") or TOID IN ("+selS+")) ORDER BY STARTDATE desc,STA
RTTIME desc";
} }else{

if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDA
TE < '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR_
SLID_T+"')) and (FROMID IN ("+selS+") or TOID IN ("+selS+")) and (SESSIONID like
'"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
IMTYPE ='"+imtype+"') and (((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR
_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' )
and (FROMID IN ("+selS+") or TOID IN ("+selS+"))) and (SESSIONID like '"+ctype+
"')) order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+selS+") or TOID IN ("+selS+"))
and (SESSIONID like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDA
TE < '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR_
SLID_T+"')) and (FROMID IN ("+selS+") or TOID IN ("+selS+")) and (SESSIONID not
like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
IMTYPE ='"+imtype+"') and (((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR
_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' )
and (FROMID IN ("+selS+") or TOID IN ("+selS+"))) and (SESSIONID not like '"+ct
ype+"')) order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+selS+") or TOID IN ("+selS+"))
and (SESSIONID not like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and ((STARTDATE < '"+CU
R_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR_SLID_T+"')
) and (FROMID IN ("+selS+") or TOID IN ("+selS+")) order by STARTDATE desc ,STAR
TTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where (I
MTYPE ='"+imtype+"') and (((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_
SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' )
and (FROMID IN ("+selS+") or TOID IN ("+selS+"))) order by STARTDATE asc,STARTTI
ME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (IMTYPE ='"+imtype+"') and (FROMID IN ("+selS+") or TOID IN ("+selS+"))
ORDER BY STARTDATE desc,STARTTIME desc";
} }
break;

case 2:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+CUR_SLID_DT+"') OR
(STARTDATE='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR_SLID_T+"')) and (STARTDATE
between '"+arr[0]+"' and '"+arr[1]+"') and (SESSIONID like '"+ctype+"')) order b
y STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
(STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME >
'"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and (STARTDATE between '"+a
rr[0]+"' and '"+arr[1]+"') and (SESSIONID like '"+ctype+"')) order by STARTDATE
asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') and (SESSIONID like '
"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIM
E,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+CUR_SLID_DT+"') OR
(STARTDATE='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR_SLID_T+"')) and (STARTDATE
between '"+arr[0]+"' and '"+arr[1]+"') and (SESSIONID not like '"+ctype+"')) or
der by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
(STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME >
'"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and (STARTDATE between '"+a
rr[0]+"' and '"+arr[1]+"') and (SESSIONID not like '"+ctype+"')) order by STARTD
ATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') and (SESSIONID not li
ke '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where ((STARTDATE < '"+CUR_SLID_DT+"') OR (STARTDATE
='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR_SLID_T+"')) and (STARTDATE between '"
+arr[0]+"' and '"+arr[1]+"') order by STARTDATE desc ,STARTTIME desc limit 0,10"
;
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME > '
"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and (STARTDATE between '"+ar
r[0]+"' and '"+arr[1]+"') order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') ORDER BY STARTDATE des
c,STARTTIME desc";
} }else{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTD
ATE < '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR
_SLID_T+"')) and (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') and (SESSIONI
D like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
IMTYPE ='"+imtype+"') and ((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CU
R_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"'
) and (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') and (SESSIONID like '"+c
type+"')) order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and (STARTDATE between '"+arr[0]+"' and '"+arr
[1]+"') and (SESSIONID like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc
";
}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTD
ATE < '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR
_SLID_T+"')) and (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') and (SESSIONI
D not like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
IMTYPE ='"+imtype+"') and ((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CU
R_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"'
) and (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') and (SESSIONID not like
'"+ctype+"')) order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and (STARTDATE between '"+arr[0]+"' and '"+arr
[1]+"') and (SESSIONID not like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME
desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITEDfrom PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and ((STARTDATE < '"+CU
R_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME <= '"+CUR_SLID_T+"')
) and (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') order by STARTDATE desc
,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where (I
MTYPE ='"+imtype+"') and ((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR
_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' )
and (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') order by STARTDATE asc,ST
ARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (IMTYPE ='"+imtype+"') and (STARTDATE between '"+arr[0]+"' and '"+arr[
1]+"') ORDER BY STARTDATE desc,STARTTIME desc";
} }
break;
case 3:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+END_DT+"') OR (START
DATE='"+END_DT+"' and STARTTIME <= '"+END_T+"')) and ((STARTTIME >= '"+arr[0]+"'
and STARTTIME <='"+arr[1]+"')) and (SESSIONID like '"+ctype+"')) order by START
DATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
(STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME >
'"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ( (STARTTIME >= '"+arr[
0]+"' and STARTTIME <='"+arr[1]+"')) and (SESSIONID like '"+ctype+"')) order by
STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"') and (SESSIONID
like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+END_DT+"') OR (START
DATE='"+END_DT+"' and STARTTIME <= '"+END_T+"')) and ((STARTTIME >= '"+arr[0]+"'
and STARTTIME <='"+arr[1]+"')) and (SESSIONID not like '"+ctype+"')) order by S
TARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
(STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME >
'"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ( (STARTTIME >= '"+arr[
0]+"' and STARTTIME <='"+arr[1]+"')) and (SESSIONID not like '"+ctype+"')) order
by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"') and (SESSIONID
not like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITEDfrom PASTSESSIONINFO where ((STARTDATE < '"+END_DT+"') OR (STARTDATE='"+EN
D_DT+"' and STARTTIME <= '"+END_T+"')) and ((STARTTIME >= '"+arr[0]+"' and START
TIME <='"+arr[1]+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME > '
"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ( (STARTTIME >= '"+arr[0
]+"' and STARTTIME <='"+arr[1]+"')) order by STARTDATE asc,STARTTIME asc limit
0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"') ORDER BY STARTD
ATE desc,STARTTIME desc";
} }else{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITEDfrom PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDAT
E < '"+END_DT+"') OR (STARTDATE='"+END_DT+"' and STARTTIME <= '"+END_T+"')) and
((STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"')) and (SESSIONID like '
"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
IMTYPE ='"+imtype+"') and ((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR
_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' )
and ( (STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"')) and (SESSIONID
like '"+ctype+"')) order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and (STARTTIME >= '"+arr[0]+"' and STARTTIME <='
"+arr[1]+"') and (SESSIONID like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME
desc";
}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDA
TE < '"+END_DT+"') OR (STARTDATE='"+END_DT+"' and STARTTIME <= '"+END_T+"')) and
((STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"')) and (SESSIONID not l
ike '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
IMTYPE ='"+imtype+"') and ((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR
_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' )
and ( (STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"')) and (SESSIONID
not like '"+ctype+"')) order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and (STARTTIME >= '"+arr[0]+"' and STARTTIME <='
"+arr[1]+"') and (SESSIONID not like '"+ctype+"')) ORDER BY STARTDATE desc,START
TIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and ((STARTDATE < '"+E
ND_DT+"') OR (STARTDATE='"+END_DT+"' and STARTTIME <= '"+END_T+"')) and ((STARTT
IME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"')) order by STARTDATE desc ,STAR
TTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where (I
MTYPE ='"+imtype+"') and ((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_
SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' )
and ( (STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"')) order by STARTDA
TE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (IMTYPE ='"+imtype+"') and (STARTTIME >= '"+arr[0]+"' and STARTTIME <='"
+arr[1]+"') ORDER BY STARTDATE desc,STARTTIME desc";
}
}
break;

case 4:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or TOID IN ("
+arr[0]+")) and ((STARTDATE < '"+END_DT+"') OR (STARTDATE='"+END_DT+"' and START
TIME <= '"+END_T+"')) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+ar
r[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+
"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2
]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) and (SESSIONID like
'"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,
AUDITED from PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]
+")) and ((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and ST
ARTTIME > '"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ((STARTDATE =
'"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDAT
E >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"'
and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"
' and '"+arr[4]+"'))) and (SESSIONID like '"+ctype+"')) order by STARTDATE asc,S
TARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+ar
r[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"
+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '
"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and
'"+arr[4]+"'))) and (SESSIONID like '"+ctype+"')) ORDER BY STARTDATE desc,START
TIME desc";

}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or TOID IN (
"+arr[0]+")) and ((STARTDATE < '"+END_DT+"') OR (STARTDATE='"+END_DT+"' and STAR
TTIME <= '"+END_T+"')) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+a
rr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]
+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[
2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) and (SESSIONID not
like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE > '"+CUR_SLID_DT
+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"')) and (SES
SIONID <> '"+Cur_sid+"' ) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '
"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr
[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+a
rr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) and (SESSIONID
not like '"+ctype+"')) order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+ar
r[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"
+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '
"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and
'"+arr[4]+"'))) and (SESSIONID not like '"+ctype+"')) ORDER BY STARTDATE desc,S
TARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+"
)) and ((STARTDATE < '"+END_DT+"') OR (STARTDATE='"+END_DT+"' and STARTTIME <= '
"+END_T+"')) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' a
nd '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (S
TARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and
(STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) order by STARTDATE desc ,STA
RTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where (F
ROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE > '"+CUR_SLID_DT+
"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"')) and (SESS
IONID <> '"+Cur_sid+"' ) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"
+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[
2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+ar
r[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) order by STARTDA
TE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+arr
[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+
arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"
+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and
'"+arr[4]+"'))) ORDER BY STARTDATE desc,STARTTIME desc";
} }else{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID I
N ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE < '"+END_DT+"') OR (STAR
TDATE='"+END_DT+"' and STARTTIME <= '"+END_T+"')) and ((STARTDATE ='"+arr[1]+"'
and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+
"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]
+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[
4]+"'))) and (SESSIONID like '"+ctype+"')) order by STARTDATE desc ,STARTTIME de
sc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (
(STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME >
'"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ((STARTDATE ='"+arr[1]+
"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[
1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr
[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+a
rr[4]+"'))) and (SESSIONID like '"+ctype+"')) order by STARTDATE asc,STARTTIME a
sc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]
+")) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+ar
r[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME
between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTI
ME between '"+arr[3]+"' and '"+arr[4]+"'))) and (SESSIONID like '"+ctype+"')) OR
DER BY STARTDATE desc,STARTTIME desc";
}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID I
N ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE < '"+END_DT+"') OR (STAR
TDATE='"+END_DT+"' and STARTTIME <= '"+END_T+"')) and ((STARTDATE ='"+arr[1]+"'
and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+
"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]
+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[
4]+"'))) and (SESSIONID not like '"+ctype+"')) order by STARTDATE desc ,STARTTIM
E desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (
(STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME >
'"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ((STARTDATE ='"+arr[1]+
"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[
1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr
[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+a
rr[4]+"'))) and (SESSIONID not like '"+ctype+"')) order by STARTDATE asc,STARTTI
ME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]
+")) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+ar
r[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME
between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTI
ME between '"+arr[3]+"' and '"+arr[4]+"'))) and (SESSIONID not like '"+ctype+"')
) ORDER BY STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[
0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE < '"+END_DT+"') OR (STARTDATE='"+
END_DT+"' and STARTTIME <= '"+END_T+"')) and ((STARTDATE ='"+arr[1]+"' and (STAR
TTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and ST
ARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR
(STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')))
order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where (I
MTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((
STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME > '
"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ((STARTDATE ='"+arr[1]+"
' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1
]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[
4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+ar
r[4]+"'))) order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+
")) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr
[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME
between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIM
E between '"+arr[3]+"' and '"+arr[4]+"'))) ORDER BY STARTDATE desc,STARTTIME des
c";
} }
break;
case 5:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+END_DT+"') OR (STARTD
ATE='"+END_DT+"' and STARTTIME <= '"+END_T+"')) and ((STARTDATE ='"+arr[0]+"' an
d (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"'
and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"
')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]
+"'))) and (SESSIONID like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc
limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
(STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME >
'"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ((STARTDATE ='"+arr[0]+
"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[
0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr
[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+a
rr[3]+"'))) and (SESSIONID like '"+ctype+"')) order by STARTDATE asc,STARTTIME a
sc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+ar
r[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME
between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTI
ME between '"+arr[2]+"' and '"+arr[3]+"'))) and (SESSIONID like '"+ctype+"')) OR
DER BY STARTDATE desc,STARTTIME desc";
}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+END_DT+"') OR (STAR
TDATE='"+END_DT+"' and STARTTIME <= '"+END_T+"')) and ((STARTDATE ='"+arr[0]+"'
and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+
"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]
+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[
3]+"'))) and (SESSIONID not like '"+ctype+"')) order by STARTDATE desc ,STARTTIM
E desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
(STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME >
'"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ((STARTDATE ='"+arr[0]+
"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[
0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr
[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+a
rr[3]+"'))) and (SESSIONID not like '"+ctype+"')) order by STARTDATE asc,STARTTI
ME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+ar
r[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME
between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTI
ME between '"+arr[2]+"' and '"+arr[3]+"'))) and (SESSIONID not like '"+ctype+"')
) ORDER BY STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where ((STARTDATE < '"+END_DT+"') OR (STARTDATE='"+E
ND_DT+"' and STARTTIME <= '"+END_T+"')) and ((STARTDATE ='"+arr[0]+"' and (START
TIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STA
RTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (
STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) o
rder by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME > '
"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ((STARTDATE ='"+arr[0]+"
' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0
]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[
3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+ar
r[3]+"'))) order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr
[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME
between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIM
E between '"+arr[2]+"' and '"+arr[3]+"'))) ORDER BY STARTDATE desc,STARTTIME des
c";
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTDA
TE < '"+END_DT+"') OR (STARTDATE='"+END_DT+"' and STARTTIME <= '"+END_T+"'))) an
d ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'
)) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME betwee
n '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME betw
een '"+arr[2]+"' and '"+arr[3]+"'))) and (SESSIONID like '"+ctype+"')) order by
STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
IMTYPE ='"+imtype+"') and (((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR
_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"'))) and (SESSIONID <> '"+Cur_sid+"'
) and ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3
]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME be
tween '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME
between '"+arr[2]+"' and '"+arr[3]+"'))) and (SESSIONID like '"+ctype+"')) order
by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and ((STARTDATE ='"+arr[0]+"' and (STARTTIME bet
ween '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE<
'"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDAT
E='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) and (SESS
IONID like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";

}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTDAT
E < '"+END_DT+"') OR (STARTDATE='"+END_DT+"' and STARTTIME <= '"+END_T+"'))) and
((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')
) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between
'"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME betwe
en '"+arr[2]+"' and '"+arr[3]+"'))) and (SESSIONID not like '"+ctype+"')) order
by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
IMTYPE ='"+imtype+"') and (((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR
_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"'))) and (SESSIONID <> '"+Cur_sid+"'
) and ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3
]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME be
tween '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME
between '"+arr[2]+"' and '"+arr[3]+"'))) and (SESSIONID not like '"+ctype+"')) o
rder by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and ((STARTDATE ='"+arr[0]+"' and (STARTTIME bet
ween '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE<
'"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDAT
E='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) and (SESS
IONID not like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (((STARTDATE < '"+E
ND_DT+"') OR (STARTDATE='"+END_DT+"' and STARTTIME <= '"+END_T+"'))) and ((START
DATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (ST
ARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[
2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+ar
r[2]+"' and '"+arr[3]+"'))) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where (I
MTYPE ='"+imtype+"') and (((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_
SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"'))) and (SESSIONID <> '"+Cur_sid+"' )
and ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]
+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME bet
ween '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME b
etween '"+arr[2]+"' and '"+arr[3]+"'))) order by STARTDATE asc,STARTTIME asc li
mit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (IMTYPE ='"+imtype+"') and ((STARTDATE ='"+arr[0]+"' and (STARTTIME betw
een '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '
"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE
='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) ORDER BY S
TARTDATE desc,STARTTIME desc";
} }
break;
case 6:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+END_DT+"') OR (STARTD
ATE='"+END_DT+"' and STARTTIME <= '"+END_T+"')) and ((FROMID IN ("+arr[0]+") or
TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"')) and
(SESSIONID like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,1
0";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
(STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME >
'"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ((FROMID IN ("+arr[0]+"
) or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"')
) and (SESSIONID like '"+ctype+"')) order by STARTDATE asc,STARTTIME asc limit
0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between
'"+arr[1]+"' and '"+arr[2]+"') and (SESSIONID like '"+ctype+"')) ORDER BY START
DATE desc,STARTTIME desc";
}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+END_DT+"') OR (STARTDAT
E='"+END_DT+"' and STARTTIME <= '"+END_T+"')) and ((FROMID IN ("+arr[0]+") or TO
ID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"')) and (
SESSIONID not like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0
,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
(STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME >
'"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ((FROMID IN ("+arr[0]+"
) or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"')
) and (SESSIONID not like '"+ctype+"')) order by STARTDATE asc,STARTTIME asc li
mit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between
'"+arr[1]+"' and '"+arr[2]+"') and (SESSIONID not like '"+ctype+"')) ORDER BY S
TARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,
AUDITED from PASTSESSIONINFO where ((STARTDATE < '"+END_DT+"') OR (STARTDATE='"+
END_DT+"' and STARTTIME <= '"+END_T+"')) and ((FROMID IN ("+arr[0]+") or TOID IN
("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"')) order by S
TARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME > '
"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ((FROMID IN ("+arr[0]+")
or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"'))
order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between
'"+arr[1]+"' and '"+arr[2]+"') ORDER BY STARTDATE desc,STARTTIME desc";
} }else{
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTD
ATE < '"+END_DT+"') OR (STARTDATE='"+END_DT+"' and STARTTIME <= '"+END_T+"'))) a
nd ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+a
rr[1]+"' and '"+arr[2]+"')) and (SESSIONID like '"+ctype+"')) order by STARTDATE
desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
IMTYPE ='"+imtype+"') and (((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR
_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"'))) and (SESSIONID <> '"+Cur_sid+"'
) and ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '
"+arr[1]+"' and '"+arr[2]+"')) and (SESSIONID like '"+ctype+"')) order by STARTD
ATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]
+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"') and (SESSIONID like '
"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTDA
TE < '"+END_DT+"') OR (STARTDATE='"+END_DT+"' and STARTTIME <= '"+END_T+"'))) an
d ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+ar
r[1]+"' and '"+arr[2]+"')) and (SESSIONID not like '"+ctype+"')) order by STARTD
ATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
IMTYPE ='"+imtype+"') and (((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR
_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"'))) and (SESSIONID <> '"+Cur_sid+"'
) and ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '
"+arr[1]+"' and '"+arr[2]+"')) and (SESSIONID not like '"+ctype+"')) order by ST
ARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]
+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"') and (SESSIONID not li
ke '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (((STARTDATE < '"+E
ND_DT+"') OR (STARTDATE='"+END_DT+"' and STARTTIME <= '"+END_T+"'))) and ((FROMI
D IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' a
nd '"+arr[2]+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where (I
MTYPE ='"+imtype+"') and (((STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_
SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"'))) and (SESSIONID <> '"+Cur_sid+"' )
and ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"
+arr[1]+"' and '"+arr[2]+"')) order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+
")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"') ORDER BY STARTDATE des
c,STARTTIME desc";
} }
break;
case 7:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN("+arr[0]+") or TOID IN("+a
rr[0]+")) and ((STARTDATE < '"+END_DT+"') OR (STARTDATE='"+END_DT+"' and STARTTI
ME <= '"+END_T+"')) and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"'
)) and (SESSIONID like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc lim
it 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and ((STARTDATE > '"+CUR_SLID_DT+"
') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"')) and (SESSI
ONID <> '"+Cur_sid+"' ) and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2
]+"')) and (SESSIONID like '"+ctype+"')) order by STARTDATE asc,STARTTIME asc l
imit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and (STARTTIME >= '"+arr
[1]+"' and STARTTIME <='"+arr[2]+"') and (SESSIONID like '"+ctype+"')) ORDER BY
STARTDATE desc,STARTTIME desc";
}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN("+arr[0]+") or TOID IN("+a
rr[0]+")) and ((STARTDATE < '"+END_DT+"') OR (STARTDATE='"+END_DT+"' and STARTTI
ME <= '"+END_T+"')) and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"'
)) and (SESSIONID not like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc
limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where ((
FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and ((STARTDATE > '"+CUR_SLID_DT+"
') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"')) and (SESSI
ONID <> '"+Cur_sid+"' ) and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2
]+"')) and (SESSIONID not like '"+ctype+"')) order by STARTDATE asc,STARTTIME as
c limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and (STARTTIME >= '"+arr
[1]+"' and STARTTIME <='"+arr[2]+"') and (SESSIONID not like '"+ctype+"')) ORDER
BY STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,A
UDITED from PASTSESSIONINFO where (FROMID IN("+arr[0]+") or TOID IN("+arr[0]+"))
and ((STARTDATE < '"+END_DT+"') OR (STARTDATE='"+END_DT+"' and STARTTIME <= '"+
END_T+"')) and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"')) order
by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where (F
ROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and ((STARTDATE > '"+CUR_SLID_DT+"'
) OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME > '"+CUR_SLID_T+"')) and (SESSIO
NID <> '"+Cur_sid+"' ) and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]
+"')) order by STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and (STARTTIME >= '"+arr[
1]+"' and STARTTIME <='"+arr[2]+"') ORDER BY STARTDATE desc,STARTTIME desc";
} }else{

if(conf.equals("conf"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN("
+arr[0]+") or TOID IN("+arr[0]+")) and ((STARTDATE < '"+END_DT+"') OR (STARTDATE
='"+END_DT+"' and STARTTIME <= '"+END_T+"')) and ((STARTTIME >= '"+arr[1]+"' and
STARTTIME <='"+arr[2]+"')) and (SESSIONID like '"+ctype+"')) order by STARTDATE
desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where (
(IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and ((
STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME > '
"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ((STARTTIME >= '"+arr[1]
+"' and STARTTIME <='"+arr[2]+"')) and (SESSIONID like '"+ctype+"')) order by ST
ARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") or TOID IN("+arr[0]+"
)) and (STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"') and (SESSIONID l
ike '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}else if(conf.equals("onetoone"))
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN
("+arr[0]+") or TOID IN("+arr[0]+")) and ((STARTDATE < '"+END_DT+"') OR (STARTDA
TE='"+END_DT+"' and STARTTIME <= '"+END_T+"')) and ((STARTTIME >= '"+arr[1]+"' a
nd STARTTIME <='"+arr[2]+"')) and (SESSIONID not like '"+ctype+"')) order by STA
RTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where (
(IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and ((
STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME > '
"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ((STARTTIME >= '"+arr[1]
+"' and STARTTIME <='"+arr[2]+"')) and (SESSIONID not like '"+ctype+"')) order b
y STARTDATE asc,STARTTIME asc limit 0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") or TOID IN("+arr[0]+"
)) and (STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"') and (SESSIONID n
ot like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else
{
query="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,
AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN("+arr[
0]+") or TOID IN("+arr[0]+")) and ((STARTDATE < '"+END_DT+"') OR (STARTDATE='"+E
ND_DT+"' and STARTTIME <= '"+END_T+"')) and ((STARTTIME >= '"+arr[1]+"' and STAR
TTIME <='"+arr[2]+"'))) order by STARTDATE desc ,STARTTIME desc limit 0,10";
query1="select STARTDATE,STARTTIME from PASTSESSIONINFO where (
(IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and ((
STARTDATE > '"+CUR_SLID_DT+"') OR (STARTDATE='"+CUR_SLID_DT+"' and STARTTIME > '
"+CUR_SLID_T+"')) and (SESSIONID <> '"+Cur_sid+"' ) and ((STARTTIME >= '"+arr[1]
+"' and STARTTIME <='"+arr[2]+"'))) order by STARTDATE asc,STARTTIME asc limit
0,10";
query2="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where ((IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") or TOID IN("+arr[0]+"
)) and (STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"')) ORDER BY STARTD
ATE desc,STARTTIME desc";
} }
break;
}

//req.setAttribute("SEL",Integer.toString(sel));
//req.setAttribute("PARAM",selSt);
int recnt=RsCalc(req,resp,caller,query2);
if(right_limit) {
rs5 = dbcon.execQuery(con,query);
System.out.println(" right limit reached query
is :"+query);
}
else {
rs4 = dbcon.execQuery(con,query1);
System.out.println("the query1 of rs4 in pastsessionNext is "+qu
ery1);
////code to find next 40 records while SessionUP BEGINS
try {
rs4.next();
String asc_date_0 = rs4.getString("STARTDATE");
String asc_time_0 = rs4.getString("STARTTIME");
rs4.last();
String asc_date_40= rs4.getString("STARTDATE");
String asc_time_40 = rs4.getString("STARTTIME");
rs4.close();
//# System.out.println("asc_date_0: "+asc_date_0
+" asc_time_0: "+asc_time_0+" asc_date_40: "+asc_date_40+" asc_time_40: "+asc_ti
me_40);

//# System.out.println("SEL: "+sel);


switch(sel) {
case 0:if(imtype.length()==0){
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STA
RTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+asc_date_40+
"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and (SE
SSIONID like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,S
TARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+asc_date_4
0+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and (
SESSIONID not like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0
,10";
}
else
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE
,AUDITED from PASTSESSIONINFO where ((STARTDATE < '"+asc_date_40+"') OR (STARTD
ATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) order by STARTDATE d
esc ,STARTTIME desc limit 0,10";
}
}else{
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,ST
ARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and
((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME
<= '"+asc_time_40+"')) and (SESSIONID like '"+ctype+"')) order by STARTDATE desc
,STARTTIME desc limit 0,10";

}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,S
TARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and
((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME
<= '"+asc_time_40+"')) and (SESSIONID not like '"+ctype+"')) order by STARTDATE
desc ,STARTTIME desc limit 0,10";
}
else
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,ST
ARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and
((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <
= '"+asc_time_40+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
}
break;
case 1:if(imtype.length()==0){
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTT
IME,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+asc_date_40+"')
OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and (FROMI
D IN ("+selS+") or TOID IN ("+selS+")) and (SESSIONID like '"+ctype+"')) order b
y STARTDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTI
ME,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+asc_date_40+"')
OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and (FROMID
IN ("+selS+") or TOID IN ("+selS+")) and (SESSIONID not like '"+ctype+"')) orde
r by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDI
TED from PASTSESSIONINFO where (((STARTDATE < '"+asc_date_40+"') OR (STARTDATE=
'"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and (FROMID IN ("+selS+")
or TOID IN ("+selS+"))) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
}else{
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,
STARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and
(((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIM
E <= '"+asc_time_40+"'))) and (FROMID IN ("+selS+") or TOID IN ("+selS+")) and (
SESSIONID like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10"
;
}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,S
TARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and
((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME
<= '"+asc_time_40+"')) and (FROMID IN ("+selS+") or TOID IN ("+selS+")) and (SES
SIONID not like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10
";
}
else
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDI
TED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE < '"+as
c_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"'
)) and (FROMID IN ("+selS+") or TOID IN ("+selS+"))) order by STARTDATE desc ,ST
ARTTIME desc limit 0,10";
} }
break;
case 2:
if(imtype.length()==0){
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+asc_date_40+"') OR (S
TARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and (STARTDATE b
etween '"+arr[0]+"' and '"+arr[1]+"') and (SESSIONID like '"+ctype+"')) order b
y STARTDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+asc_date_40+"') OR (S
TARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and (STARTDATE b
etween '"+arr[0]+"' and '"+arr[1]+"') and (SESSIONID not like '"+ctype+"')) ord
er by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AU
DITED from PASTSESSIONINFO where (((STARTDATE < '"+asc_date_40+"') OR (STARTDATE
='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and (STARTDATE between '
"+arr[0]+"' and '"+arr[1]+"')) order by STARTDATE desc ,STARTTIME desc limit 0,
10";
}
}else{
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((START
DATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+as
c_time_40+"')) and (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') and (SESSIO
NID like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((START
DATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+as
c_time_40+"')) and (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') and (SESSIO
NID not like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";

}
else
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDIT
ED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE < '"+as
c_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"'
)) and (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"')) order by STARTDATE des
c ,STARTTIME desc limit 0,10";
}
}
break;

case 3:if(imtype.length()==0){
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,
STARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+asc_date_4
0+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and (
STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"') and (SESSIONID like '"+c
type+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,S
TARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+asc_date_40
+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and (S
TARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"') and (SESSIONID not like '
"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,
STARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+asc_date_4
0+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and (
STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"')) order by STARTDATE desc
,STARTTIME desc limit 0,10";
}
}else{
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,S
TARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and
((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <
= '"+asc_time_40+"')) and (STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+
"') and (SESSIONID like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc li
mit 0,10";
}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,S
TARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and
((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <
= '"+asc_time_40+"')) and (STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+
"') and (SESSIONID not like '"+ctype+"')) order by STARTDATE desc ,STARTTIME des
c limit 0,10";
}
else{
query3="select SESSIONID,FROMID,TOID,STARTDATE,
STARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and
((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME
<= '"+asc_time_40+"')) and (STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]
+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
}
break;

case 4:if(imtype.length()==0){
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIM
E,IMTYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or TOID IN
("+arr[0]+")) and ((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+
"' and STARTTIME <= '"+asc_time_40+"')) and ((STARTDATE ='"+arr[1]+"' and (START
TIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STA
RTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (
STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) a
nd (SESSIONID like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0
,10";
}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIM
E,IMTYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN ("+arr[0]+") or TOID IN
("+arr[0]+")) and ((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+
"' and STARTTIME <= '"+asc_time_40+"')) and ((STARTDATE ='"+arr[1]+"' and (START
TIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STA
RTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (
STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) a
nd (SESSIONID not like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc lim
it 0,10";
}
else
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED from
PASTSESSIONINFO where (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((ST
ARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"
+asc_time_40+"')) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]
+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' a
nd (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"'
and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) order by STARTDATE desc
,STARTTIME desc limit 0,10";
}
}else{
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTI
ME,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMI
D IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE < '"+asc_date_40+"')
OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and ((START
DATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (ST
ARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[
3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+ar
r[3]+"' and '"+arr[4]+"'))) and (SESSIONID like '"+ctype+"')) order by STARTDATE
desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIM
E,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID
IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE < '"+asc_date_40+"') O
R (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and ((STARTD
ATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STA
RTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3
]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr
[3]+"' and '"+arr[4]+"'))) and (SESSIONID not like '"+ctype+"')) order by STARTD
ATE desc ,STARTTIME desc limit 0,10";
}
else
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (FROMID I
N ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE < '"+asc_date_40+"') OR
(STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and ((STARTDAT
E ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (START
DATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+
"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3
]+"' and '"+arr[4]+"'))) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
}
break;
case 5:if(imtype.length()==0){
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+asc_date_40+"') OR (
STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and ((STARTDATE
='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTD
ATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"
' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]
+"' and '"+arr[3]+"'))) and (SESSIONID like '"+ctype+"')) order by STARTDATE des
c ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+asc_date_40+"') OR (
STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and ((STARTDATE
='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTD
ATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"
' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]
+"' and '"+arr[3]+"'))) and (SESSIONID not like '"+ctype+"')) order by STARTDATE
desc ,STARTTIME desc limit 0,10";
}
else
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where ((STARTDATE < '"+asc_date_40+"') OR (ST
ARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and ((STARTDATE =
'"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDAT
E >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"'
and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"
' and '"+arr[3]+"'))) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
}
else{
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTD
ATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc
_time_40+"')) and ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"'
and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (
STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and
(STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) and (SESSIONID like '"+ctyp
e+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDA
TE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_
time_40+"')) and ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' a
nd '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (S
TARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and
(STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) and (SESSIONID not like '"+c
type+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED fr
om PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (((STARTDATE < '"+asc_date
_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"'))) an
d ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'
)) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME betwee
n '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME betw
een '"+arr[2]+"' and '"+arr[3]+"'))) order by STARTDATE desc ,STARTTIME desc lim
it 0,10";
}
}
break;
case 6:if(imtype.length()==0){
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,S
TARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+asc_date_40
+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and ((
FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]
+"' and '"+arr[2]+"')) and (SESSIONID like '"+ctype+"')) order by STARTDATE desc
,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,
STARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+asc_date_4
0+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and (
(FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1
]+"' and '"+arr[2]+"')) and (SESSIONID not like '"+ctype+"')) order by STARTDATE
desc ,STARTTIME desc limit 0,10";
}
else
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,
STARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((STARTDATE < '"+asc_date_40
+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and ((
FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]
+"' and '"+arr[2]+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
}else{
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,
STARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') an
d (((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIM
E <= '"+asc_time_40+"'))) and ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+"))
and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"')) and (SESSIONID like '"+ct
ype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,ST
ARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and
(((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME
<= '"+asc_time_40+"'))) and ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) an
d (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"')) and (SESSIONID not like '"+
ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,
STARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and
(((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME
<= '"+asc_time_40+"'))) and ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) a
nd (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"')) order by STARTDATE desc ,S
TARTTIME desc limit 0,10";
}
}
break;

case 7:if(imtype.length()==0){
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,ST
ARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN("+arr[0]+") or TOI
D IN("+arr[0]+")) and ((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date
_40+"' and STARTTIME <= '"+asc_time_40+"')) and ((STARTTIME >= '"+arr[1]+"' and
STARTTIME <='"+arr[2]+"')) and (SESSIONID like '"+ctype+"')) order by STARTDATE
desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,S
TARTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN("+arr[0]+") or TO
ID IN("+arr[0]+")) and ((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_dat
e_40+"' and STARTTIME <= '"+asc_time_40+"')) and ((STARTTIME >= '"+arr[1]+"' and
STARTTIME <='"+arr[2]+"')) and (SESSIONID not like '"+ctype+"')) order by START
DATE desc ,STARTTIME desc limit 0,10";
}
else
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED from
PASTSESSIONINFO where (FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and ((START
DATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+as
c_time_40+"')) and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"')) or
der by STARTDATE desc ,STARTTIME desc limit 0,10";
}
}else{
if(conf.equals("conf"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STAR
TTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FR
OMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and ((STARTDATE < '"+asc_date_40+"')
OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and ((STAR
TTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"')) and (SESSIONID like '"+ctyp
e+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STA
RTTIME,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (F
ROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and ((STARTDATE < '"+asc_date_40+"'
) OR (STARTDATE='"+asc_date_40+"' and STARTTIME <= '"+asc_time_40+"')) and ((STA
RTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"')) and (SESSIONID not like '"
+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else
{
query3="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYPE,AUDITED from P
ASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") or TOID
IN("+arr[0]+")) and ((STARTDATE < '"+asc_date_40+"') OR (STARTDATE='"+asc_date_
40+"' and STARTTIME <= '"+asc_time_40+"')) and ((STARTTIME >= '"+arr[1]+"' and S
TARTTIME <='"+arr[2]+"'))) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
}
break;

}//switch()
rs5 = dbcon.execQuery(con,query3);
System.out.println("Last The query3 in pastsessionnext() is
"+query3);
rs5.beforeFirst();
}
catch(Exception e) {
logger.error("Exception while clicking up: "+e);

}
////code to find next 40 records while SessionUP ENDS
}

//*************code for calculating next cursor position BEGINS*****


*******************
String bslider1=req.getParameter("hbslider");
String aslider1=req.getParameter("haslider");

int bslid=Integer.parseInt(bslider1);
int aslid=Integer.parseInt(aslider1);
//# System.out.println("**********passed parameter1: "+bslid
+" parameter2: "+aslid+"TOTAl RECORDS: "+recnt);
float temp=570.0f;
float slid_off= (temp/recnt)*10;
//# System.out.println("---FLOAT SLID_OFF "+slid_off);
int slid_off1=(int)slid_off;
//# System.out.println("---INT SLID_OFF "+slid_off1);
int old_bslid=bslid;

if(right_limit) {
bslid=old_bslid;
aslid=570-bslid;
System.out.println("now to rsscroll"+END_DT);
}
else
{
bslid=bslid+slid_off1;
aslid=570-bslid;
}

if(bslid > 570 ) {


bslid=570;
aslid=0;
}

//# System.out.println("**********CALCULATED parameter1: "+b


slid+" parameter2: "+aslid);
req.setAttribute("SEL",Integer.toString(sel));
req.setAttribute("PARAM",selSt);
req.setAttribute("CONF",conf);
bslider1 = Integer.toString(bslid);
aslider1 = Integer.toString(aslid);
req.setAttribute("BSlid",bslider1);
req.setAttribute("ASlid",aslider1);
req.setAttribute("REC_STAT","0");
//**************code for calculating next cursor position ENDS******
*****************
RsScroll(req,resp,"PastSessionNext",rs5,END_DT,END_T,right_limit);
//call to RsScroll() method
req.setAttribute("con",con);
redirect="/PastAuditResults.jsp";
}

if(caller.equals("PastSessionClk")) {
System.out.println("---------------Inside PastSessionClk------------
--");
String conf="";
ResultSet rs6=null,rs5=null;
String realx=req.getParameter("x");
System.out.println("realx is"+realx);
int inter = Integer.parseInt(realx);
String imtype=(String)req.getParameter("imt");
req.setAttribute("imtype",imtype);
//# System.out.println("passed x co-ordinate: "+inter);
inter=inter-222;
//# System.out.println("passed x co-ordinate after calculatio
n: "+inter);
////*********************code to calculate slider position BEGINS
String bslider1=req.getParameter("hbslider");
String aslider1=req.getParameter("haslider");
int bslid=Integer.parseInt(bslider1);
int aslid=Integer.parseInt(aslider1);
//# System.out.println("**********passed parameter1: "+bslid+"
parameter2: "+aslid);
bslid=inter;
if(bslid <= 0) {
bslid=0;
}
aslid=570-bslid;
//# System.out.println("**********CALCULATED parameter1: "+bs
lid+" parameter2: "+aslid);
String bslider3=Integer.toString(bslid);
String aslider3=Integer.toString(aslid);
req.setAttribute("BSlid",bslider3);
req.setAttribute("ASlid",aslider3);
req.setAttribute("REC_STAT","0");
////*********************code to calculate slider position ENDS
String selS=req.getParameter("SEL");
int sel = Integer.parseInt(selS);
//# System.out.println("Selected Criteria: "+sel);
selS=req.getParameter("PARAM");
System.out.println("selS"+selS);
String[] arr = new String[7];
if((sel!=0)&&(sel!=1)){
StringTokenizer stz = new StringTokenizer(selS,";");
int i=0;
while(stz.hasMoreTokens()) {
arr[i]=stz.nextToken();
i++;
}
}

String query="" ;
switch(sel) {
case 0:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSES
SIONINFO where (SESSIONID like '"+ctype+"') ORDER BY STARTDATE desc,STARTTIME de
sc" ;
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSES
SIONINFO where (SESSIONID not like '"+ctype+"') ORDER BY STARTDATE desc,STARTTIM
E desc" ;
}
else{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONI
NFO ORDER BY STARTDATE desc,STARTTIME desc" ;
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSI
ONINFO where ((IMTYPE ='"+imtype+"') and (SESSIONID like '"+ctype+"')) ORDER BY
STARTDATE desc,STARTTIME desc" ;
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSI
ONINFO where ((IMTYPE ='"+imtype+"') and (SESSIONID not like '"+ctype+"')) ORDER
BY STARTDATE desc,STARTTIME desc" ;

}
else{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSION
INFO where IMTYPE ='"+imtype+"' ORDER BY STARTDATE desc,STARTTIME desc" ;
}
}
break;
case 1:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIO
NINFO where ((FROMID IN ("+selS+") or TOID IN ("+selS+")) and (SESSIONID like '"
+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSI
ONINFO where ((FROMID IN ("+selS+") or TOID IN ("+selS+")) and (SESSIONID not li
ke '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";

}
else{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSION
INFO where (FROMID IN ("+selS+") or TOID IN ("+selS+")) ORDER BY STARTDATE desc,
STARTTIME desc";
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSI
ONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+selS+") or TOID IN ("+sel
S+")) and (SESSIONID like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIO
NINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+selS+") or TOID IN ("+selS
+")) and (SESSIONID not like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME des
c";
}
else{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSION
INFO where IMTYPE ='"+imtype+"' and (FROMID IN ("+selS+") or TOID IN ("+selS+"))
ORDER BY STARTDATE desc,STARTTIME desc";
}
}
break;
case 2:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIO
NINFO where ((STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') and (SESSIONID li
ke '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";

}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSION
INFO where ((STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') and (SESSIONID not
like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"') ORDER BY STARTDATE des
c,STARTTIME desc";
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSI
ONINFO where ((IMTYPE ='"+imtype+"') and (STARTDATE between '"+arr[0]+"' and '"
+arr[1]+"') and (SESSIONID like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME
desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIO
NINFO where ((IMTYPE ='"+imtype+"') and (STARTDATE between '"+arr[0]+"' and '"+
arr[1]+"') and (SESSIONID not like '"+ctype+"')) ORDER BY STARTDATE desc,STARTT
IME desc";
}
else{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONIN
FO where IMTYPE ='"+imtype+"' and (STARTDATE between '"+arr[0]+"' and '"+arr[1]
+"') ORDER BY STARTDATE desc,STARTTIME desc";
}
}
break;
case 3:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONI
NFO where ((STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"') and (SESSION
ID like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSION
INFO where ((STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"') and (SESSIO
NID not like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO wher
e (STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"') ORDER BY STARTDATE de
sc,STARTTIME desc";
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIO
NINFO where ((IMTYPE ='"+imtype+"') and (STARTTIME >= '"+arr[0]+"' and STARTTIME
<='"+arr[1]+"') and (SESSIONID like '"+ctype+"')) ORDER BY STARTDATE desc,START
TIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONI
NFO where ((IMTYPE ='"+imtype+"') and (STARTTIME >= '"+arr[0]+"' and STARTTIME <
='"+arr[1]+"') and (SESSIONID not like '"+ctype+"')) ORDER BY STARTDATE desc,STA
RTTIME desc";
}
else{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
IMTYPE ='"+imtype+"' and (STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"
') ORDER BY STARTDATE desc,STARTTIME desc";
}
}

break;
case 4:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSION
INFO where ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"
+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE
>'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' an
d '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"'
and '"+arr[4]+"'))) and (SESSIONID like '"+ctype+"')) ORDER BY STARTDATE desc,ST
ARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIO
NINFO where ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='
"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE
>'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' a
nd '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"'
and '"+arr[4]+"'))) and (SESSIONID not like '"+ctype+"')) ORDER BY STARTDATE de
sc,STARTTIME desc";
}
else{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO wh
ere (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+arr[1]+
"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[
1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr
[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+a
rr[4]+"'))) ORDER BY STARTDATE desc,STARTTIME desc";
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONI
NFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[
0]+")) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+
arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTI
ME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (START
TIME between '"+arr[3]+"' and '"+arr[4]+"'))) and (SESSIONID like '"+ctype+"'))
ORDER BY STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIO
NINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+ar
r[0]+")) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '
"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (START
TIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STA
RTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) and (SESSIONID not like '"+ctype
+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO whe
re IMTYPE ='"+imtype+"' and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and
((STARTDATE ='"+arr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')
) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between
'"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME betwe
en '"+arr[3]+"' and '"+arr[4]+"'))) ORDER BY STARTDATE desc,STARTTIME desc";
}
}
//System.out.println("The query for 4 type is "+query);
break;

case 5:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSION
INFO where (((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"
+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTT
IME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STAR
TTIME between '"+arr[2]+"' and '"+arr[3]+"'))) and (SESSIONID like '"+ctype+"'))
ORDER BY STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIO
NINFO where (((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '
"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (START
TIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STA
RTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) and (SESSIONID not like '"+ctype
+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO
where ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[
3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME b
etween '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME
between '"+arr[2]+"' and '"+arr[3]+"'))) ORDER BY STARTDATE desc,STARTTIME des
c";
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSION
INFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE ='"+arr[0]+"' and (STARTTIME
between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDAT
E< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (START
DATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) and (S
ESSIONID like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSI
ONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE ='"+arr[0]+"' and (STARTTIM
E between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTD
ATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STA
RTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) and
(SESSIONID not like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINF
O where IMTYPE ='"+imtype+"' and ((STARTDATE ='"+arr[0]+"' and (STARTTIME betwee
n '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+
arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='
"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) ORDER BY STA
RTDATE desc,STARTTIME desc";
}
}
break;
case 6:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSION
INFO where ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE betw
een '"+arr[1]+"' and '"+arr[2]+"') and (SESSIONID like '"+ctype+"')) ORDER BY ST
ARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSION
INFO where ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE betw
een '"+arr[1]+"' and '"+arr[2]+"') and (SESSIONID not like '"+ctype+"')) ORDER B
Y STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO
where (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '
"+arr[1]+"' and '"+arr[2]+"') ORDER BY STARTDATE desc,STARTTIME desc";
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIMED from PASTSESS
IONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("
+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"') and (SESSIONID
like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIMED from PASTSESSIO
NINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN ("+arr[0]+") or TOID IN ("+a
rr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"') and (SESSIONID n
ot like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,STARTDATE,STARTTIMED from PASTSESSIONINFO
where IMTYPE ='"+imtype+"' and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")
) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]+"') ORDER BY STARTDATE desc,
STARTTIME desc";
}
}
break;

case 7:if(imtype.length()==0){
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONI
NFO where ((FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and (STARTTIME >= '"+a
rr[1]+"' and STARTTIME <='"+arr[2]+"') and (SESSIONID like '"+ctype+"')) ORDER B
Y STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONI
NFO where ((FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and (STARTTIME >= '"+a
rr[1]+"' and STARTTIME <='"+arr[2]+"') and (SESSIONID not like '"+ctype+"')) ORD
ER BY STARTDATE desc,STARTTIME desc";
}
else{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
(FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and (STARTTIME >= '"+arr[1]+"' a
nd STARTTIME <='"+arr[2]+"') ORDER BY STARTDATE desc,STARTTIME desc";
}
}else{
if(conf.equals("conf"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONI
NFO where ((IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") or TOID IN("+arr[0]
+")) and (STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"') and (SESSIONID
like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";
}
else if(conf.equals("onetoone"))
{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSION
INFO where ((IMTYPE ='"+imtype+"') and (FROMID IN("+arr[0]+") or TOID IN("+arr[0
]+")) and (STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"') and (SESSIONI
D not like '"+ctype+"')) ORDER BY STARTDATE desc,STARTTIME desc";

}
else{
query="select SESSIONID,STARTDATE,STARTTIME from PASTSESSIONINFO where
IMTYPE ='"+imtype+"' and (FROMID IN("+arr[0]+") or TOID IN("+arr[0]+")) and (STA
RTTIME >= '"+arr[1]+"' and STARTTIME <='"+arr[2]+"') ORDER BY STARTDATE desc,STA
RTTIME desc";
}
}
break;
//ready till condition 2
}
req.setAttribute("SEL",Integer.toString(sel));
req.setAttribute("PARAM",selS);
//code to calculate record count from x-Coordinate BEGINS
int recnt=RsCalc(req,resp,caller,query);
//float temp=570.0f;
float slid_off= (570/recnt)*10;
//# System.out.println("---FLOAT SLID_OFF "+slid_off);
int slid_off1=(int)slid_off;
//# System.out.println("---INT SLID_OFF "+slid_off1);
int next_pos=java.lang.Math.round((recnt * inter)/ 570 );
next_pos=recnt-next_pos;
if(next_pos >= recnt) {
next_pos=recnt-1;
}
if(next_pos <= 0) {
next_pos=1;
}
//# System.out.println("######### NEXT RECORD NO ###########
"+next_pos);
rs5=dbcon.execQuery(con,query);
try{
rs5.absolute(next_pos);
String tick_date = rs5.getString("STARTDATE");
String tick_time =rs5.getString("STARTTIME");
//# System.out.println("TICK_DATE: "+tick_date+"TICK
_TIME"+tick_time);
rs5.close();
String query1="";
switch(sel){
case 0:if(imtype.length()==0){
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((STARTDATE < '"+tick_date+"') OR (START
DATE='"+tick_date+"' and STARTTIME < '"+tick_time+"') and (SESSIONID like '"+cty
pe+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";

}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((STARTDATE < '"+tick_date+"') OR (START
DATE='"+tick_date+"' and STARTTIME < '"+tick_time+"') and (SESSIONID not like '"
+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTY
PE,AUDITED from PASTSESSIONINFO where (STARTDATE < '"+tick_date+"') OR (STARTDA
TE='"+tick_date+"' and STARTTIME < '"+tick_time+"') order by STARTDATE desc ,STA
RTTIME desc limit 0,10";
}
}else{
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDAT
E < '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+
"')) and (SESSIONID like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc l
imit 0,10";
}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE
< '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"
')) and (SESSIONID not like '"+ctype+"')) order by STARTDATE desc ,STARTTIME des
c limit 0,10";
}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTY
PE,AUDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and ((STARTDATE <
'"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"'))
order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
}
break;
case 1:if(imtype.length()==0){
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+tick_date+"') OR (START
DATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and (FROMID IN ("+selS+")
or TOID IN ("+selS+")) and (SESSIONID like '"+ctype+"')) order by STARTDATE des
c ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+tick_date+"') OR (STA
RTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and (FROMID IN ("+selS+
") or TOID IN ("+selS+")) and (SESSIONID not like '"+ctype+"')) order by STARTDA
TE desc ,STARTTIME desc limit 0,10";
}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYP
E,AUDITED from PASTSESSIONINFO where ((STARTDATE < '"+tick_date+"') OR (STARTDAT
E='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and (FROMID IN ("+selS+") or
TOID IN ("+selS+")) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
}else{
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTDA
TE < '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time
+"')) and (FROMID IN ("+selS+") or TOID IN ("+selS+"))) and (SESSIONID like '"+c
type+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTDAT
E < '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+
"')) and (FROMID IN ("+selS+") or TOID IN ("+selS+"))) and (SESSIONID not like '
"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTY
PE,AUDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (((STARTDATE
< '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"'
)) and (FROMID IN ("+selS+") or TOID IN ("+selS+"))) order by STARTDATE desc ,ST
ARTTIME desc limit 0,10";
}
}
break;
case 2:if(imtype.length()==0){
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+tick_date+"') OR (ST
ARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and (STARTDATE between
'"+arr[0]+"' and '"+arr[1]+"') and (SESSIONID like '"+ctype+"')) order by START
DATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+tick_date+"') OR (ST
ARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and (STARTDATE between
'"+arr[0]+"' and '"+arr[1]+"') and (SESSIONID not like '"+ctype+"')) order by S
TARTDATE desc ,STARTTIME desc limit 0,10";
}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTT
IME,IMTYPE,AUDITED from PASTSESSIONINFO where ((STARTDATE < '"+tick_date+"') OR
(STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and (STARTDATE bet
ween '"+arr[0]+"' and '"+arr[1]+"') order by STARTDATE desc ,STARTTIME desc limi
t 0,10";
}
}else{
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTDATE
< '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"
')) and (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"')) and (SESSIONID like '
"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (((STARTDAT
E < '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+
"')) and (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"')) and (SESSIONID not l
ike '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";

}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTYP
E,AUDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (((STARTDATE <
'"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"'))
and (STARTDATE between '"+arr[0]+"' and '"+arr[1]+"')) order by STARTDATE desc
,STARTTIME desc limit 0,10";
}
}
break;
case 3:if(imtype.length()==0){
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+tick_date+"') OR (START
DATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and ((STARTTIME >= '"+arr
[0]+"' and STARTTIME <='"+arr[1]+"')) and (SESSIONID like '"+ctype+"')) order by
STARTDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+tick_date+"') OR (START
DATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and ( (STARTTIME >= '"+ar
r[0]+"' and STARTTIME <='"+arr[1]+"')) and (SESSIONID not like '"+ctype+"')) ord
er by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMTY
PE,AUDITED from PASTSESSIONINFO where ((STARTDATE < '"+tick_date+"') OR (STARTDA
TE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and ( (STARTTIME >= '"+arr[
0]+"' and STARTTIME <='"+arr[1]+"')) order by STARTDATE desc ,STARTTIME desc lim
it 0,10";
}
}else{
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE <
'"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')
) and ((STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"')) and (SESSIONID
like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and ((STARTDATE <
'"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')
) and ((STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"')) and (SESSIONID
not like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and ((STARTDATE <
'"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"'))
and ((STARTTIME >= '"+arr[0]+"' and STARTTIME <='"+arr[1]+"')) order by STARTDA
TE desc ,STARTTIME desc limit 0,10";
}
}
break;
case 4:if(imtype.length()==0){
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+tick_date+"') OR (STAR
TDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and (FROMID IN ("+arr[0]
+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME betwee
n '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+
arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='
"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) and (SESSION
ID like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+tick_date+"') OR (STAR
TDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and (FROMID IN ("+arr[0]
+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME betwee
n '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"+
arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE='
"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) and (SESSION
ID not like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((STARTDATE < '"+tick_date+"') OR (STA
RTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and (FROMID IN ("+arr[0
]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+arr[1]+"' and (STARTTIME betwe
en '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+arr[1]+"' and STARTDATE< '"
+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE=
'"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"'))) order by ST
ARTDATE desc ,STARTTIME desc limit 0,10";
}
}else{
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDAT
E < '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+
"')) and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+ar
r[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"
+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '
"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and
'"+arr[4]+"'))) and (SESSIONID like '"+ctype+"')) order by STARTDATE desc ,STAR
TTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IM
TYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE
< '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"
')) and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+arr
[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'"+
arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and '"
+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and
'"+arr[4]+"'))) and (SESSIONID not like '"+ctype+"')) order by STARTDATE desc ,S
TARTTIME desc limit 0,10";
}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDA
TE < '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time
+"')) and (FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and ((STARTDATE ='"+a
rr[1]+"' and (STARTTIME between '"+arr[3]+"' and '"+arr[4]+"')) OR (STARTDATE >'
"+arr[1]+"' and STARTDATE< '"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' and
'"+arr[4]+"')) OR (STARTDATE='"+arr[2]+"' and (STARTTIME between '"+arr[3]+"' an
d '"+arr[4]+"'))) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
}
break;
case 5:if(imtype.length()==0){
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+tick_date+"') OR (ST
ARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and ((STARTDATE ='"+ar
r[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"
+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '
"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and
'"+arr[3]+"'))) and (SESSIONID like '"+ctype+"')) order by STARTDATE desc ,STAR
TTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+tick_date+"') OR (STA
RTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and ((STARTDATE ='"+arr
[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE >'"+
arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and '"
+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' and
'"+arr[3]+"'))) and (SESSIONID not like '"+ctype+"')) order by STARTDATE desc ,S
TARTTIME desc limit 0,10";
}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTT
IME,IMTYPE,AUDITED from PASTSESSIONINFO where ((STARTDATE < '"+tick_date+"') OR
(STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and ((STARTDATE ='"
+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE
>'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTIME between '"+arr[2]+"' an
d '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (STARTTIME between '"+arr[2]+"'
and '"+arr[3]+"'))) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
}else{
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTD
ATE < '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_tim
e+"')) and ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+
arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTI
ME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (START
TIME between '"+arr[2]+"' and '"+arr[3]+"'))) and (SESSIONID like '"+ctype+"'))
order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTD
ATE < '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_tim
e+"')) and ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and '"+
arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STARTTI
ME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (START
TIME between '"+arr[2]+"' and '"+arr[3]+"'))) and (SESSIONID like '"+ctype+"'))
order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,START
TIME,IMTYPE,AUDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and ((STA
RTDATE < '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_
time+"')) and ((STARTDATE ='"+arr[0]+"' and (STARTTIME between '"+arr[2]+"' and
'"+arr[3]+"')) OR (STARTDATE >'"+arr[0]+"' and STARTDATE< '"+arr[1]+"' and (STAR
TTIME between '"+arr[2]+"' and '"+arr[3]+"')) OR (STARTDATE='"+arr[1]+"' and (ST
ARTTIME between '"+arr[2]+"' and '"+arr[3]+"'))) order by STARTDATE desc ,STARTT
IME desc limit 0,10";
}
}
break;
case 6:if(imtype.length()==0){
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+tick_date+"') OR (STA
RTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and ((FROMID IN ("+arr[
0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2]
+"')) and (SESSIONID like '"+ctype+"')) order by STARTDATE desc ,STARTTIME desc
limit 0,10";
}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where (((STARTDATE < '"+tick_date+"') OR (ST
ARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and ((FROMID IN ("+arr
[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[2
]+"')) and (SESSIONID not like '"+ctype+"')) order by STARTDATE desc ,STARTTIME
desc limit 0,10";
}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIM
E,IMTYPE,AUDITED from PASTSESSIONINFO where ((STARTDATE < '"+tick_date+"') OR (S
TARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and ((FROMID IN ("+ar
r[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between '"+arr[1]+"' and '"+arr[
2]+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
}else{
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE
< '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"
')) and ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between
'"+arr[1]+"' and '"+arr[2]+"')) and (SESSIONID like '"+ctype+"')) order by STAR
TDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and ((STARTDATE
< '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"
')) and ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE between
'"+arr[1]+"' and '"+arr[2]+"')) and (SESSIONID not like '"+ctype+"')) order by
STARTDATE desc ,STARTTIME desc limit 0,10";
}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME
,IMTYPE,AUDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and ((STARTDAT
E < '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+
"')) and ((FROMID IN ("+arr[0]+") or TOID IN ("+arr[0]+")) and (STARTDATE betwee
n '"+arr[1]+"' and '"+arr[2]+"')) order by STARTDATE desc ,STARTTIME desc limit
0,10";
}
}
break;
case 7:if(imtype.length()==0){
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,I
MTYPE,AUDITED from PASTSESSIONINFO where ((FROMID IN("+arr[0]+") or TOID IN("+a
rr[0]+")) and ((STARTDATE < '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and S
TARTTIME < '"+tick_time+"')) and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+
arr[2]+"')) and (SESSIONID like '"+ctype+"')) order by STARTDATE desc ,STARTTIME
desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,IMT
YPE,AUDITED from PASTSESSIONINFO where ((FROMID IN("+arr[0]+") or TOID IN("+arr
[0]+")) and ((STARTDATE < '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and STA
RTTIME < '"+tick_time+"')) and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='"+ar
r[2]+"')) and (SESSIONID not like '"+ctype+"')) order by STARTDATE desc ,STARTTI
ME desc limit 0,10";
}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIM
E,IMTYPE,AUDITED from PASTSESSIONINFO where (FROMID IN("+arr[0]+") or TOID IN("
+arr[0]+")) and ((STARTDATE < '"+tick_date+"') OR (STARTDATE='"+tick_date+"' and
STARTTIME < '"+tick_time+"')) and ((STARTTIME >= '"+arr[1]+"' and STARTTIME <='
"+arr[2]+"')) order by STARTDATE desc ,STARTTIME desc limit 0,10";
}
}else{
if(conf.equals("conf"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN
("+arr[0]+") or TOID IN("+arr[0]+")) and ((STARTDATE < '"+tick_date+"') OR (STAR
TDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and ((STARTTIME >= '"+ar
r[1]+"' and STARTTIME <='"+arr[2]+"')) and (SESSIONID like '"+ctype+"')) order b
y STARTDATE desc ,STARTTIME desc limit 0,10";
}
else if(conf.equals("onetoone"))
{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIME,
IMTYPE,AUDITED from PASTSESSIONINFO where ((IMTYPE ='"+imtype+"') and (FROMID IN
("+arr[0]+") or TOID IN("+arr[0]+")) and ((STARTDATE < '"+tick_date+"') OR (STAR
TDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and ((STARTTIME >= '"+ar
r[1]+"' and STARTTIME <='"+arr[2]+"')) and (SESSIONID not like '"+ctype+"')) ord
er by STARTDATE desc ,STARTTIME desc limit 0,10";
}
else{
query1="select SESSIONID,FROMID,TOID,STARTDATE,STARTTIM
E,IMTYPE,AUDITED from PASTSESSIONINFO where (IMTYPE ='"+imtype+"') and (FROMID I
N("+arr[0]+") or TOID IN("+arr[0]+")) and ((STARTDATE < '"+tick_date+"') OR (STA
RTDATE='"+tick_date+"' and STARTTIME < '"+tick_time+"')) and ((STARTTIME >= '"+a
rr[1]+"' and STARTTIME <='"+arr[2]+"')) order by STARTDATE desc ,STARTTIME desc
limit 0,10";
}
}
break;

}//switch(sel)

rs6=dbcon.execQuery(con,query1);
RsScroll(req,resp,"PastSessionClk",rs6,"","",false); //call
to RsScroll() method ends;
}
catch(Exception e){
logger.error("Exception 1 in PastSessionClk: "+e);

}
//code to calculate record count from x-Coordinate ENDS
req.setAttribute("con",con);
redirect="/PastAuditResults.jsp";
}

return redirect;
}

public String fetchPastUserResults(HttpServletRequest req, HttpServletRespon


se resp, String caller) throws ServletException {
//System.out.println("Value of caller while fetching :"+caller);
String fromdate= req.getParameter("cmbFromMonth")+"-"+req.getParameter("
cmbFromDate")+"-"+req.getParameter("cmbFromYear");
String fromtime= req.getParameter("cmbFromHour")+":"+req.getParameter("c
mbFromMin");
String todate= req.getParameter("cmbToMonth")+"-"+req.getParameter("cmbT
oDate")+"-"+req.getParameter("cmbToYear");
String totime= req.getParameter("cmbToHour")+":"+req.getParameter("cmbTo
Min");

if(caller.equals("1d")) {
ResultSet rs = dbcon.execQuery(con,"select * from MESSAGES");
req.setAttribute("PastUserAuditResults",rs);
//System.out.println("inside fetch method:"+rs);
}

return "/UserAuditResults.jsp";
}

public String addUser(HttpServletRequest req, HttpServletResponse resp) thro


ws ServletException {return "nothing";}
public String doChange(HttpServletRequest request, HttpServletResponse respo
nse, String caller) throws ServletException {return "nothing";}
public String doEditPass(HttpServletRequest req, HttpServletResponse resp, S
tring id) throws ServletException {return "nothing"; }
public String doKeyChange(HttpServletRequest req, HttpServletResponse resp,
String caller) throws ServletException {return "nothing";}
public String doKeyShow(HttpServletRequest req, HttpServletResponse resp, St
ring caller) throws ServletException {return "nothing"; }
public String doUpdate(HttpServletRequest req, HttpServletResponse resp, Str
ing caller) throws ServletException {return "nothing";}
public String doUpdateKeywords(HttpServletRequest req, HttpServletResponse r
esp, String caller) throws ServletException {return "nothing"; }
public String execute(HttpServletRequest request, HttpServletResponse respon
se) throws ServletException {return "nothing";}
public String getResults(HttpServletRequest request, HttpServletResponse res
ponse, String caller) throws ServletException {return "nothing"; }
public String userManage(HttpServletRequest req, HttpServletResponse resp, S
tring caller) throws ServletException {return "nothing";}
public String addCluster(HttpServletRequest request, HttpServletResponse res
ponse, String caller) throws ServletException {return "nothing";}
public String clusterEditdel(HttpServletRequest req, HttpServletResponse res
p, String caller) throws ServletException {return "nothing";}
public String archiveSet(HttpServletRequest req, HttpServletResponse resp, S
tring caller) throws ServletException {return "nothing";}
public String archiveBack(HttpServletRequest req, HttpServletResponse resp,
String caller) throws ServletException {return "nothing";}
public String SessAudit(HttpServletRequest req, HttpServletResponse resp, St
ring caller) throws ServletException {return "nothing"; }
public String EmailStruct(HttpServletRequest req, HttpServletResponse resp,
String caller) throws ServletException {return "nothing"; }
public String getData(HttpServletRequest req,HttpServletResponse resp,String
caller)throws ServletException {return "nothing"; }
public String doProcess(HttpServletRequest request, HttpServletResponse resp
onse,String caller)throws ServletException {return "nothing"; }
}
--------------------------------------------------------------------------------
---------------

Anda mungkin juga menyukai