 
<!--#include file="includes\Connect.asp"-->
<!--#include file="includes\chklogin.asp"-->
<!--#include FILE="includes/mail.asp" -->

<%
Function GetLink()
	  'if request.querystring("Mode") = "view" then
		'GetLink = "<td align=right><a href='compreportcheque.asp?Mode=add' class='lnk'>Add Compatibility Report Cheque</a></td>"
	  if request.QueryString("mode")="add" or request.QueryString("mode")="edit" then
		GetLink = "<td align=right><a href='compreportcheque.asp?Mode=view' class='lnk'>Back</a></td>"
	  end if
End function
if request.QueryString("mode")="save" then
	set rs=server.CreateObject("adodb.recordset")
		rs.open "select * from Tbl_CRCheque where 1=2",cn,1,3
		rs.addnew
		rs("UserCRID_FK")= request.Form("hid")
		rs("Cheque Number")=request.Form("txtchqno")
		rs("Cheque Bank")=request.Form("txtbank")
		rs("Cheque Date")=request.Form("txtdate")
		rs("Amount")=request.Form("txtamt")
		if request.Form("rdochq") <>"N" then
						rs("ChequeAccepted")=true
					set rs2=server.CreateObject("ADODB.Recordset")
	    rs2.open "select * from Tbl_compability  where autocode="&request.form("hid")&"",cn,1,3	
	    do until rs2.eof
		id=rs2("User_ID_FK")
		rs2.movenext
		loop	
		cn.execute "update Tbl_user set MemberShipType='P' where User_ID_PK="&id&""
					else
						rs("ChequeAccepted")=false
						set rs2=server.CreateObject("ADODB.Recordset")
	    rs2.open "select * from Tbl_compability  where autocode="&request.form("hid")&"",cn,1,3	
	    do until rs2.eof
		id=rs2("User_ID_FK")
		rs2.movenext
		loop	
		cn.execute "update Tbl_user set MemberShipType='F' where User_ID_PK="&id&""
				end if  
		rs("Comment")=request.Form("txtcomment")
		rs.update
		set rschk=server.CreateObject("ADODB.Recordset")
	    rschk.open "select * from Tbl_UserCheques  where 1=2",cn,1,3	
	    rschk.addnew
	     rschk("user_id_fk")= request.Form("hid")
		if request.Form("rdochq") <>"N" then
						rschk("ChequeAccepted")=true
						set rs2=server.CreateObject("ADODB.Recordset")
	    rs2.open "select * from Tbl_compability  where autocode="&rschk("user_id_fk")&"",cn,1,3	
	    do until rs2.eof
		id=rs2("User_ID_FK")
		rs2.movenext
		loop	
		cn.execute "update Tbl_user set MemberShipType='P' where User_ID_PK="&id&""
						
					else
						rschk("ChequeAccepted")=false
						set rs2=server.CreateObject("ADODB.Recordset")
	    rs2.open "select * from Tbl_compability  where autocode="&rschk("user_id_fk")&"",cn,1,3	
	    do until rs2.eof
		id=rs2("User_ID_FK")
		rs2.movenext
		loop	
		cn.execute "update Tbl_user set MemberShipType='F' where User_ID_PK="&id&""
					end if  
		rschk("ChequeBank")=request.Form("txtbank")
		rschk("ChequeNo")=request.Form("txtchqno")
		rschk("ChequeAmount")=request.Form("txtamt")
		rschk("ChequeDate")=request.Form("txtdate")
		rschk.update
		session("msg")="Compatibility Report cheque detail added succesfully"		
		response.Redirect("compreportcheque.asp?mode=view")
end if


if request.QueryString("mode")="delete" then

		Dim i,intId,sql
			intId=trim(Request.Form("chkID"))
			'response.Write(intId)
			'response.End()
			if intId <>"" then
					 sql = "Delete  from Tbl_CRCheque where UserCRID_FK in (" & Request.Form ("chkID") &")" 
					 sql1= "Delete  from Tbl_compability where AutoCode in (" & Request.Form ("chkID") &")" 
				cn.Execute(sql)
				cn.Execute(sql1)
					Session("msg") = "Compatibility Report Deleted Successfully"
				response.redirect "compreportcheque.asp?mode=view"
			end if
end if

if request.QueryString("mode")="update" then
		set rs=server.CreateObject("adodb.recordset")
			rs.open "select * from Tbl_CRCheque where UserCRID_FK="&request.form("hid"),cn,3,2
			if rs.eof <> true then
				'rs.addnew	
				rs("UserCRID_FK")=request.Form("hid")
				rs("Cheque Number")=request.Form("txtchqno")
				rs("Cheque Bank")=request.Form("txtbank")
				rs("Amount")=request.Form("txtamt")
				rs("Comment")=request.Form("txtcomment")
					if request.Form("rdochq") <>"N" then
						rs("ChequeAccepted")=true
						
					else
						rs("ChequeAccepted")=false
						
					end if  
				rs.update
			else
				rs.addnew	
				rs("UserCRID_FK")=request.Form("hid")
				rs("Cheque Number")=request.Form("txtchqno")
				rs("Cheque Bank")=request.Form("txtbank")
				rs("Amount")=request.Form("txtamt")
				rs("Comment")=request.Form("txtcomment")
					if request.Form("rdochq") <>"N" then
						rs("ChequeAccepted")=true
						
					else
						rs("ChequeAccepted")=false
					
					
				rs.update
				end if  
				 set rschk=server.CreateObject("ADODB.Recordset")
				 rschk.open "select * from Tbl_UserCheques where User_ID_FK="&request("hid"),cn,3,2
			if rschk.eof <> true then
				 rschk.addnew
	rschk("user_id_fk")= rs("UserCRID_FK")
		rschk("ChequeAccepted")=request.Form("hid")
		rschk("ChequeBank")=request.Form("txtbank")
		rschk("ChequeNo")=request.Form("txtchqno")
		rschk("ChequeAmount")=request.Form("txtamt")
		rschk("ChequeDate")=request.Form("txtdate")
					if request.Form("rdochq") <>"N" then
						rschk("ChequeAccepted")=true
						set rs2=server.CreateObject("ADODB.Recordset")
	    rs2.open "select * from Tbl_compability  where autocode="&rschk("user_id_fk")&"",cn,1,3	
	    do until rs2.eof
		id=rs2("User_ID_FK")
		rs2.movenext
		loop	
		cn.execute "update Tbl_user set MemberShipType='P' where User_ID_PK="&id&""
					else
						rschk("ChequeAccepted")=false
						set rs2=server.CreateObject("ADODB.Recordset")
	    rs2.open "select * from Tbl_compability  where autocode="&rschk("user_id_fk")&"",cn,1,3	
	    do until rs2.eof
		id=rs2("User_ID_FK")
		rs2.movenext
		loop	
		cn.execute "update Tbl_user set MemberShipType='F' where User_ID_PK="&id&""
					end if  
			else
				 rschk.addnew
	rschk("user_id_fk")= rs("UserCRID_FK")
		rschk("ChequeAccepted")=request.Form("hid")
		rschk("ChequeBank")=request.Form("txtbank")
		rschk("ChequeNo")=request.Form("txtchqno")
		rschk("ChequeAmount")=request.Form("txtamt")
		rschk("ChequeDate")=request.Form("txtdate")
					if request.Form("rdochq") <>"N" then
						rschk("ChequeAccepted")=true
						set rs2=server.CreateObject("ADODB.Recordset")
	    rs2.open "select * from Tbl_compability  where autocode="&rschk("user_id_fk")&"",cn,1,3	
	    do until rs2.eof
		id=rs2("User_ID_FK")
		rs2.movenext
		loop	
		cn.execute "update Tbl_user set MemberShipType='P' where User_ID_PK="&id&""
						
					else
						rschk("ChequeAccepted")=false
						set rs2=server.CreateObject("ADODB.Recordset")
	    rs2.open "select * from Tbl_compability  where autocode="&rschk("user_id_fk")&"",cn,1,3	
	    do until rs2.eof
		id=rs2("User_ID_FK")
		rs2.movenext
		loop	
		cn.execute "update Tbl_user set MemberShipType='F' where User_ID_PK="&id&""
					end if  
				rschk.update
			end if	
			end if	
			
		if rs("ChequeAccepted")=true  then
		  strmode="CHEQUE"	
		  set rs=server.CreateObject("Adodb.Recordset")
		  rs.open "select * from Tbl_compability where PaymentMode='"&strmode&"' and AutoCode="&request.form("hid"),Cn,3,2
		  if rs.eof <> true then
			Report = "<table align='center' cellpadding='5' cellspacing='0' width='600' border='1' style='font-family:verdana;font-size:12px;'>"&vbcrlf
			Report=Report & "<tr><td  align='center' colspan=""2"" align='center'><b>Cheque Processed Confirmation for Match/Dating Compatibility Report</b></td></tr>"&vbcrlf
			Report=Report & "<tr><td width='100'><b>Cheque Holder Name</b></td><td>" & rs("Person1_FullName") & "</td></tr>"&vbcrlf
			Report=Report & "<tr><td><b>City</b></td><td>" & RS("Person1_BirthCity") & "</td></tr>"&vbcrlf
			Report=Report & "<tr><td><b>Country</b></td><td>" & RS("Person1_BirthCountry") & "</td></tr>"&vbcrlf
			Report=Report & "<tr><td><b>State</b></td><td>" & RS("state") & "</td></tr>"
			Report=Report & "<tr><td><b>Email</b></td><td>" & RS("EMail") & "</td></tr>"&vbcrlf
			Report=Report & "<tr><td><b>Cheque Number</b></td><td>" & request.Form("txtchqno") & "</td></tr>"&vbcrlf
			Report=Report & "<tr><td><b>Cheque Bank</b></td><td>" & request.Form("txtbank") & "</td></tr>"&vbcrlf
			Report=Report & "<tr><td><b>Cheque Amount</b></td><td>" & request.Form("txtamt") & "</td></tr>"&vbcrlf
			Report=Report &  "<tr><td colspan=""2""><ul><LI>Our email address will also be sent to you in the receipt for your reference.</LI></ul></td></tr>"&vbcrlf
			Report=Report & "</table>"&vbcrlf
			'response.Write(Report):response.End()
			fromAddr = "customercare@findyourfate.com" 
			'fromAddr = "anand@aesasp.com" 
			recipients=cstr("" &RS("Email"))
			'recipients1 = "Arun@AESASP.COM"
			'recipients1 ="analyst@findyourfate.com" 
			strSubject="Cheque Processed Confirmation Report For Matrimonial Compatibility Report"
			mailComp ="EasyMail"
			call SendMail(fromAddr,recipients,recipients1,strSubject,Report,mailComp)
			'session("Msg")="Your data has been sent to our Analysts for Compatability Report and we will get in touch with you shortly. Go to <a href='dating.asp' alt='Home'>Home</a>"
		  end if 
		end if	
		response.Redirect("compreportcheque.asp?mode=view")
		set rs=nothing	
end if

if request.QueryString("id")<> "" then
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from Tbl_CRCheque where UserCRID_FK ="&request("id"),cn,3,2
		if rs.eof<>true then
			strChequeAccepted=rs("ChequeAccepted")
			strchqno=rs("Cheque Number")
			strchqamt=rs("Amount")
			strchqdate=rs("Cheque Date")
			strchqbank=rs("Cheque Bank")
			strcomment=rs("Comment")
		end if		
end if


	

%>
<html>
<head>
<title>Web Control Panel - Match - Findyourfate </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="includes/style.css" rel="stylesheet" type="text/css">
<script language="JavaScript">var linkPath="";</script>
<script language="JavaScript" src="includes/scripts.js"></script>
<script language="javascript" type="text/javascript" src="includes/datetimepicker.js"></script>

<script language="JavaScript"  src="includes/validate.js"></script>

<script language="JavaScript">
function Trim(nStr){return nStr.replace(/(^\s*)|(\s*$)/g, "");}

function Submit()
{
	if(document.thisForm.txtchqno.value=="")
	{
		alert("Please enter the Cheque Number");
		document.thisForm.txtchqno.focus();
		return false;
	}
	var exp= /[0-9]$/;
	//var exp=/^[a-z][A-Z]$/;
	 if(!exp.test(document.thisForm.txtchqno.value))
	 {
		alert("Please enter a valid Cheque Number");
		document.thisForm.txtchqno.value="";
		document.thisForm.txtchqno.focus();
		return false;
	 }
	 
	if(document.thisForm.txtbank.value=="")
	{
		alert("Please enter the Cheque Issued Bank");
		document.thisForm.txtbank.focus();
		return false;
	}
	var exp=/^[a-z][A-Z]$/;
	if(exp.test(document.thisForm.txtbank.value))
	{
		alert("Please enter a valid Cheque Issued Bank");
		document.thisForm.txtbank.focus();
		return false;
	}
	if(document.thisForm.txtdate.value=="")
	{
		alert("Please enter the Cheque Date");
		document.thisForm.txtdate.focus();
		return false;
	}
	if(document.thisForm.txtdate.value!="")
	{
		var d1, d2
		/*dt=document.thisForm.txtdate.value.split("/")
		d1= new Date(dt[2],dt[0]-1,dt[1])
		dt1=document.thisForm.hiddate.value.split("/")
		d2= new Date(dt1[2],dt1[0]-1,dt1[1])*/
		dt=document.thisForm.txtdate.value.split("/")
		d1= new Date(dt[2],dt[1]-1,dt[0])
		dt1=document.thisForm.hiddate.value.split("/")
		d2= new Date(dt1[2],dt1[0]-1,dt1[1])
		if((d1-d2)<0)
		{
			alert("Please select the date above the current date");
			return false;
		}
		/*if((d1-d2)>0)
		{
			return false;
		}*/
	}	
	if(document.thisForm.txtamt.value=="")
	{
		alert("Please enter the Cheque Amount");
		document.thisForm.txtamt.focus();
		return false;
	}
	 var exp= /[0-9]$/;
	 if(!exp.test(document.thisForm.txtamt.value))
	 {
		alert("Please enter a valid Amount");
		document.thisForm.txtamt.value="";
		document.thisForm.txtamt.focus();
		return false;
	 }
	 if(Trim(document.thisForm.txtamt.value)!="")
	{
 		exp=/[a-zA-Z]/;
	//	exp = (/(^([a-z]|[A-Z]|[0-9])*$)/);
		if (exp.test(document.thisForm.txtamt.value))
		{
			alert("Please enter a valid Amount");
			document.thisForm.txtamt.value="";
			document.thisForm.txtamt.focus();
			return false;
		}
	}
	 if(document.thisForm.txtamt.value<=0)
	{
		alert("Please enter a valid Amount");
		document.thisForm.txtamt.value="";
		document.thisForm.txtamt.focus();
		return false;
	}
	if(document.thisForm.txtcomment.value=="")
	{
		alert("Please enter the Comments");
		document.thisForm.txtcomment.focus();
		return false;
	}
	<%if request("mode") = "add" or request("mode") = "edit"  or request("mode")="save" then %>
		document.thisForm.action="compreportcheque.asp?mode=save";
		//document.thisForm.submit();
	<%else %>
		//alert(document.thisForm.hid.value);
		document.thisForm.action="compreportcheque.asp?mode=update&cid="+document.thisForm.hid.value;
		document.thisForm.action="compreportcheque.asp?mode=update";
		//document.thisForm.submit();
	<% end if %>
}

function fnSelectAll()
 	{
	if (document.thisForm.chkID.length)
	{
		if (document.thisForm.chkSelectAll.checked == true )
		{
			for(i=0;i<document.thisForm.chkID.length;i++)
			{
				document.thisForm.chkID[i].checked =true;
			}
		}
		else
		{
			for(i=0;i<document.thisForm.chkID.length;i++)
			{
			document.thisForm.chkID[i].checked =false;
			}
		}
	}
	else
	{
		if (document.thisForm.chkSelectAll.checked == true )
		{
			document.thisForm.chkID.checked =true;	
		}
		else if (document.thisForm.chkSelectAll.checked == false )
		{
			document.thisForm.chkID.checked =false;	
		}	
 	//		document.thisForm.chkID.checked=true;
	}
}

function fnReverseSelect()
{
	if (document.thisForm.chkID.length)
	{
		if (document.thisForm.chkReverseSelect.checked == true )
		{
			for(i=0;i<document.thisForm.chkID.length;i++)
			{
				if (document.thisForm.chkID[i].checked == true)
				{ 		
					document.thisForm.chkID[i].checked =false;
				}
				else
				{ 		
					document.thisForm.chkID[i].checked =true;
				}
			}
		}
		else
		{
			for(i=0;i<document.thisForm.chkID.length;i++)
			{
				if (document.thisForm.chkID[i].checked == false)
				{ 		
					document.thisForm.chkID[i].checked =true;
				}
				else
				{ 		
					document.thisForm.chkID[i].checked =false;
				}
			}
		}			
	}
	else
	  {
			if (document.thisForm.chkReverseSelect.checked == true )
			{
				if (document.thisForm.chkID.checked == false)
				{
					document.thisForm.chkID.checked = true;
				}
				else
				{
					document.thisForm.chkID.checked = false;
				}
				}
			else if (document.thisForm.chkReverseSelect.checked == false )
			{
				if (document.thisForm.chkID.checked == false)
				{
					document.thisForm.chkID.checked = true;
				}
				else
				{
				document.thisForm.chkID.checked = false;
				}
			}	
	}
}


function fndelete()
{
	var i;
	if(document.thisForm.chkID.length)//array
	{
		for(i=0;i<document.thisForm.chkID.length;i++)
		{
			if(document.thisForm.chkID[i].checked==true)
			{
				if(confirm("Are you sure, Do you want to delete ?")==true)
				{
					document.thisForm.action="compreportcheque.asp?mode=delete";
					document.thisForm.submit();
					return;
				}
				else
				{
					return;
				}
			}
		}
	}
	else//not an array
	{
		if(document.thisForm.chkID.checked==true)
		{
			if(confirm("Are you sure, Do you want to delete ?")==true)
			{
				document.thisForm.action="compreportcheque.asp?mode=delete";
				document.thisForm.submit();
				return;
			}
		}
		else
		{
			alert("Please select atleast one item to delete");
		}
		 	return;//if this is not present then the alert present below will be displayed if cancel is clicked for confirm()
	}
		alert("Please select atleast one item to delete");
}
function fnupdate()
{
	document.thisForm.action="compreportcheque.asp?Mode=activeupdate"	
	document.thisForm.submit();
}

function fnShowCalendar(tObj)
{
  
	if(document.all)
	{
		var getIt=window.showModalDialog("includes/calender.htm","","dialogHeight: 283px; dialogWidth: 276px;  center: Yes; help: No; resizable: No; status: No;titlebar:No; scrollbar:No");
	}
	else
	{
		var getIt=window.open("includes/calender.htm",'','width=267,height=235,left=200,top=100,resizable=no, toolbar=no,menubar=no,location=no,scrollbar=no');	
	}
	//if (getIt !='xyz')tObj.value = getIt;

	if(document.all)
	{	
		if (getIt !='xyz')tObj.value = getIt;	
	}
	else
	{
		if (getIt !='xyz')tObj.value = getIt; {
		document.thisForm.txtdate.value=""; }
	}

}

</script>
</head>
<%if request("mode") = "add" or request("mode")="edit" then %> 
	<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" nLoad="javascript:document.thisForm.txtchqno.focus();">
<%end if%>
<%if request("mode") = "view" then %> 
	<body  topmargin="0" left margin="0" marginwidth="0" marginheight="0">
<%end if%>
<!--Start : Main Table-->
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%" align="center">
	<tr><td width="100%" height="20" colspan="3" align="center"><img src="images/spacer.gif" border="0" height="20"></td></tr>
	<tr>
		<td width="20" height="100%"><img src="images/spacer.gif" border="0" width="20"></td>
		<td width="100%" height="100%" valign="top">
			<table cellpadding="0" cellspacing="0" border="1" width="100%" height="100%" class="tmain" bordercolor="#000000" style="border:thin;">
			<tr>
				<td>
					<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
				
					<!-- Start : Header  -->
						<tr><td><script language="JavaScript">fnHeader();</script></td></tr>
					<!-- End : Header  -->
				
					<!-- Start : Menu -->
						<tr><td><script language="JavaScript">fnMenu();</script></td></tr>
					<!-- End : Menu -->
				
					<!-- Start : Title -->
						<tr class="titlebg"><td>
							<table cellpadding="0" cellspacing="0" border="0" width="98%" height="22" align="center">
								<tr>
									<td class="title">Welcome <font class="session"><%=session("UID")%></font></td>
						 			 <td align="right" class="session"><b><%=Session("Msg")%></b></td>
						 			 <%session("Msg")=""%>
								</tr>
							</table>
						</td></tr>
					<!-- End : Title -->
				
						<tr><td><img src="images/spacer.gif" border="0" width="1" height="1"></td></tr>
				
				<!-- Start : Sub Title -->
						<tr class="subtitlebg"><td>
							<table cellpadding="0" cellspacing="0" border="0" width="98%" height="22" align="center">
							<tr>
								<td class="subtitle">Compatibility Report Cheque</td>
								<td align="right"> <%=GetLink()%></td>
							</tr>
							</table>
						</td></tr>
				<!-- End : Sub Title -->
				
						<tr><td width="100%" height="100%" valign="top" lass="contentbg"><br>
				<!-- Start : Table Of Contents -->
				<form name="thisForm" method="post" onSubmit="return Submit();">
				<% strdate=Date() %>
				<%actdate = Split(strdate,"/")(1) & "/" & Split(strdate,"/")(0) & "/" & Split(strdate,"/")(2)%>
				<input type="hidden" name="hiddate" value=<%=Date()%>>
				  			<table cellpadding="4" cellspacing="1" border="0" width="500" align="center" class="tblBorder">
							<% if request.QueryString("mode")="add" then %>
				
								<tr bgcolor="#FFFFFF">
									<td>&nbsp;Cheque/DD  number <b class="star">*</b></td>
									<td colspan="2"><input type="text" class="txtbox" name="txtchqno" maxlength="40" value="<%=strChkNo%>"></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td>&nbsp;Cheque/DD Issued Bank <b class="star">*</b></td>
									<td colspan="2"><input type="text" name="txtbank" maxlength="255" class="txtbox" value="<%=strChkBName%>"></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td>&nbsp;Cheque/DD Date <b class="star">*</b></td>
									<td width="300" colspan="2"> <input type="text"  maxlength="20" name="txtdate" id="txtdate"  value="<%=strchequeDate%>" readonly="true" class="txtbox">&nbsp;&nbsp;<a href="javascript:NewCal('txtdate','mmddyyyy')"><img src="https://matrimonial.findyourfate.com/images/cal.gif" border="0" align="absmiddle" title="Select Date"></a></td>
								</tr>
								
								<tr bgcolor="#FFFFFF">
									<td>&nbsp;Cheque Amount <b class="star">*</b></td>
									<td colspan="2"><input type="text" name="txtamt" eadonly="true" class="txtbox" maxlength="100" value="<%=strAmount%>"></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td>&nbsp;Comments <b class="star">*</b></td>
									<td colspan="2"><textarea name="txtcomment" class="txtarea"></textarea></td>
								</tr>
								<tr  bgcolor="#FFFFFF"><td bgcolor="#FFFFFF"  colspan="3" align="center" height="30"><input type="submit" name="btnsave" value="Save" class="butten"></td></tr>
								<tr  bgcolor="#FFFFFF"><td colspan="3" bgcolor="#FFFFFF" class="small"><b class="star">*</b> Mandatory fields</td></tr>
							<% end if%>					 
							<% if request.QueryString("id") <> "" then %>
								<input type="hidden" name="hid" value="<%=request("id")%>">
								<tr bgcolor="#FFFFFF">
									<td bgcolor="#FFFFFF">&nbsp;Cheque Processed <b class="star">*</b></td>
									<td colspan="2" bgcolor="#FFFFFF">
									<input type="hidden"  name="hicheque" value="1">
									<%
									if strChequeAccepted=true then %>
									<input type="radio" name="rdochq" value='Y' checked>Yes <input type="radio" name="rdochq" value='N'>No
									<%elseif strChequeAccepted =false then  
									%>
									<input type="radio" name="rdochq" value='Y'>Yes <input type="radio" checked name="rdochq" value='N'>No
									<%else%>
									<input type="radio" name="rdochq" value='Y'>Yes <input type="radio"  name="rdochq" value='N'>No
									<%end if%>
									</td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td>&nbsp;Cheque/DD  number <b class="star">*</b></td>
									<td colspan="2"><input type="text" class="txtbox" name="txtchqno" maxlength="40" value="<%=strchqno%>"></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td>&nbsp;Cheque/DD Issued Bank <b class="star">*</b></td>
									<td colspan="2"><input type="text" name="txtbank" maxlength="255" class="txtbox" value="<%=strchqbank%>"></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td>&nbsp;Cheque/DD Date <b class="star">*</b></td>
									<td width="300" colspan="2"> <input type="text"  maxlength="20" name="txtdate"  value="<%=strchqdate%>" readonly="true" class="txtbox" id="txtdate">&nbsp;&nbsp;<a href="javascript:NewCal('txtdate','mmddyyyy')"><img src="https://matrimonial.findyourfate.com/images/cal.gif" border="0" align="absmiddle" title="Select Date"></a></td>
								</tr>
								
								<tr bgcolor="#FFFFFF">
									<td>&nbsp;Cheque Amount <b class="star">*</b></td>
									<td colspan="2"><input type="text" name="txtamt" eadonly="true" class="txtbox" maxlength="100" value="<%=strchqamt%>"></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td>&nbsp;Comments <b class="star">*</b></td>
									<td colspan="2"><textarea name="txtcomment" class="txtarea"><%=strcomment%></textarea></td>
								</tr>
								<tr bordercolor="#FFFFFF"><td bgcolor="#FFFFFF"  colspan="3" align="center" height="30"><input type="submit" name="btnupdate" value="Save" class="butten"></td></tr>
								<tr><td colspan="3" bgcolor="#FFFFFF" class="small"><b class="star">*</b> Mandatory fields</td></tr>
							<% end if %>
								
							<% if request.QueryString("mode")="view" then %>
							
							
							<%
Function Updatepageno1()
response.write("<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"&"<b>" &"<"  &"</b>" &"&nbsp;" &"</font>")
for i=1 to 10
response.write("<a href='compreportcheque.asp?Mode=view&goPage=" & i &  "'>" &"<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"& i & "</a>"& "&nbsp;"&"</font>")
next
response.write("<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"&"<b>" &">"  &"</b>" &"&nbsp;" &"</font>")
response.write("<a href='compreportcheque.asp?Mode=view&goPage=" &i& "'>" &"<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"&"<b>"& "Next" &"</b>" &"</font>"& "</a>"& "&nbsp;")
end function
function updatepageno()
no=request.QueryString("gopage")
if request.QueryString("gopage")="" or request.QueryString("gopage")=1 then
updatepageno1()
elseif request.QueryString("gopage")<=10then
updatepageno1()

elseif no=11 then
response.write "<a href='compreportcheque.asp?Mode=view&goPage=" &no-1& "'>" &"<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>" &"<b>"&"Previous" &"</b>"&"</font>" &"</a>" & "&nbsp;"
response.write("<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"&"<b>"&"<" &"</b>" &"&nbsp;" &"</font>")

for i=no-9 to no

response.write("<a href='compreportcheque.asp?Mode=view&goPage=" &i& "'>" &"<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>" & i& "</a>"& "&nbsp;"&"</font>")
next
if i <=TotalPages then
response.write("<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"&"<b>"&">" &"</b>" &"&nbsp;" &"</font>")

					response.write("<a href='compreportcheque.asp?Mode=view&goPage=" &i& "'>" &"<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"&"<b>"& "Next" &"</b>" &"</font>"& "</a>"& "&nbsp;")
					end if
elseif no>11 then
response.write "<a href='compreportcheque.asp?Mode=view&goPage=" &no-1&  "'>" &"<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>" &"<b>"&"Previous" &"</b>"&"</font>" &"</a>" & "&nbsp;"
response.write("<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"&"<b>"&"<" &"</b>" &"&nbsp;" &"</font>")
for i=no-9 to no
response.write("<a href='compreportcheque.asp?Mode=view&goPage=" &i& "'>" &"<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>" & i& "</a>"& "&nbsp;"&"</font>")
next
if i <=TotalPages then
response.write("<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"&"<b>"&">" &"</b>" &"&nbsp;" &"</font>")

					response.write("<a href='compreportcheque.asp?Mode=view&goPage=" &i& "'>" &"<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"&"<b>"& "Next" &"</b>" &"</font>"& "</a>"& "&nbsp;")
					end if
else
response.write "<a href='compreportcheque.asp?Mode=view&goPage=" &no-1& "'>" &"<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>" &"<b>"&"Previous" &"</b>"&"</font>" &"</a>" & "&nbsp;"
response.write("<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"&"<b>"&"<" &"</b>" &"&nbsp;" &"</font>")

 TotalPages = rschq.PageCount
for i=no to no+9

if i=<TotalPages then

response.write("<a href='compreportcheque.asp?Mode=view&goPage=" &i & "'>" &"<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"& i & "</a>"& "&nbsp;"&"</font>")

end if
next
response.write("<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"&"<b>" &">"  &"</b>" &"&nbsp;" &"</font>")

 'TotalPages = oRs.PageCount
					'j= request.QueryString("gopage")
					if i <=TotalPages then
					response.write("<a href='compreportcheque.asp?Mode=view&goPage=" &request.QueryString("gopage")+10& "'>" &"<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"&"<b>"& "Next" &"</b>" &"</font>"& "</a>"& "&nbsp;")
			end if	
end if
end function
%>	
								<tr class="tblHead">
									<td width=100 class="tdhead"><b>Select</b></td>
									<td width=170 class="tdhead"><b>Name</b></td>
									<td class="tdhead"><b>Payment Mode</b></td>
									
								</tr>
								<%
									strmode="CHEQUE"
									set rschq=server.CreateObject("adodb.recordset")
										rschq.open "select * from Tbl_compability where PaymentMode='"&strmode&"'",cn,3,2
											if rschq.eof <> true then
												psize=10
												rschq.PageSize =psize
												TotalPages = rschq.PageCount
												iCnt = 0
												if request.QueryString("gopage") <>	 "" then
													pageNo=request.QueryString("gopage")
												else
													pageNo=1
												end if 
												rowcnt=rschq.recordcount-((pageno*rschq.pagesize)-rschq.pagesize)	
												If Request("goPage") = "" or Clng(0 & Request("goPage")) > TotalPages then
													rschq.AbsolutePage = 1
												Else
													if Clng(0 & Request("goPage")) > 1 then 
													rCnt = rCnt - (rschq.PageSize * (Clng(0 & Request("gopage"))-1))
													End If
													rschq.AbsolutePage = Clng(0 & Request("goPage"))
												End If
												while not rschq.eof and iCnt < rschq.PageSize
													strname=rschq("Person1_FullName")
													strpaymentmode=rschq("PaymentMode")
													response.Write("<tr bgcolor='#ffffff'>")
								response.Write("<td bgcolor='#ffffff'><input type=hidden name=hiddenID value="& rschq("AutoCode")&"><input type=checkbox name=chkID value="& rschq("AutoCode")&"></td>")
													response.Write("<td bgcolor='#ffffff'><a href='compreportcheque.asp?mode=edit&id="&rschq("AutoCode")&"'><input type=hidden name=hid value="&rschq("AutoCode")&">"&strname&"</a></td>")
													response.Write("<td bgcolor='#ffffff'>"&strpaymentmode&"</td></tr>")
												    rschq.movenext				
												    rowcnt=rowcnt-1
												    iCnt=iCnt+1
												wend
									%>
												<tr bgcolor="#FFFFFF"><td colspan='6' align='center' bgcolor='#ffffff' ><input type=checkbox  name='chkSelectAll' onClick='JavaScript:fnSelectAll()' ID="Checkbox1">Select All<input type=checkbox  name='chkReverseSelect' onClick='JavaScript:fnReverseSelect()' ID="Checkbox2">Select Reverse</td></tr>
												<tr bgcolor="#FFFFFF"><td align="center" colspan="6"><input type="button" name="btndelete" value="Delete" class="butten" onClick="fndelete();">&nbsp;</td></tr>
											<%else%>
												<tr><td colspan="6" bgcolor="#FFFFFF" align="center">No Records Found</td></tr>	
											<%end if%>
											<tr bgcolor="#FFFFFF"><td colspan='6' align="center">
											<%	'for rCount=1 to TotalPages %>
												
											<%	'next
											
											i=1				
		response.write("&nbsp" & "<a href='compreportcheque.asp?Mode=view&goPage=" &i&  "'>" &"<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"&"<b>"& "<<" &"</b>" &"</font>"& "</a>"& "&nbsp;")
		i=i+1




					if TotalPages>10 then
    				updatepageno()
				else
				strPageNos=""
					j=1
					
					For i = 1 to TotalPages
				if i=rschq.AbsolutePage then
strPageNos = strPageNos &  "&nbsp;<a href='compreportcheque.asp?Mode=view&goPage=" & i & "'>" &"<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>" & i & "</a>"& "&nbsp;"&"</font>"
								
						else
							if j >= 40 then
							strPageNos = strPageNos &  "&nbsp;<a href='compreportcheque.asp?Mode=view&goPage=" & i & "'>" & "<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>" & i & "</a>" & "&nbsp;" &"</font>"

								j=0
							else	
							strPageNos = strPageNos &  "&nbsp;<a href='compreportcheque.asp?Mode=view&goPage=" & i & "'>" &"<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>" & i &"</a>" &"&nbsp;" &"</font>"
		
							end if
						end if
						j=j+1
						Next
						
					response.write strPageNos	
			end if
			
			
				response.write("&nbsp" & "<a href='compreportcheque.asp?Mode=view&goPage=" &totalpages&  "'>" &"<font face=Arial, Helvetica, sans-serif color=#B57D59 size=2>"&"<b>"& ">>" &"</b>" &"</font>"& "</a>"& "&nbsp;")
											
											
											 %>
								<%end if%>
									</td></tr>
							</table>
				</form>
			 	<!-- End : Table Of Contents -->
				</td></tr>
				</table>
				<br>
			</td>
		</tr>
		</table>
	</td>
	<td width="20" height="100%"><img src="images/spacer.gif" border="0" width="20"></td>
</tr>
<tr><td width="100%" height="20" colspan="3" align="center"><img src="images/spacer.gif" border="0" height="20"></td></tr>
</table>
<!--		End : Main Table		-->
</body>
</html>
