<?php
	include "db_connection/db_connection.php";
	include "config/config.php";
	
	if($_SESSION['admin_login_id'] == '')
	{
		echo "<script>window.location='index.php';</script>";
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?php echo $PROJECT_TITLE ?></title>
<style>
    body {
        height: 842px;
        width: 960px;
        /* to centre page on screen*/
        margin-left: auto;
        margin-right: auto;
    }
</style>
</head>

<body>
<?php
	if(isset($_GET['pa_id']))
	{
		$pa_id	=	base64_decode(base64_decode(base64_decode($_GET['pa_id'])));
	}
	else
	{
		$pa_id = $_POST['par_id'];		
	}
	
	if(isset($_POST['std'])){$st_dt	=$_POST['std']; $stdate	=$_POST['std']; }else{ $st_dt= ''; $stdate	='';}
	if(isset($_POST['edd'])){$ed_dt	=$_POST['edd']; $todate	=$_POST['edd']; }else{ $ed_dt= ''; $todate	=''; }
	
	//echo $st_dt."<br>";
	//echo $stdate."<br>";
	//	echo $ed_dt."<br>";
	
	if($st_dt=="" && $ed_dt!="")
	{
		if(isset($_POST['yr']) && isset($_POST['mnt']) && isset($_POST['dty']))
		{ 
			if(isset($_POST['yr']) && $_POST['yr']!='' ){ $yea_r = 'checked="checked"';	}else{ $yea_r = ''; }
			if(isset($_POST['mnt']) && $_POST['mnt']!='' ){ $mont_h = 'checked="checked"';	}else{ $mont_h = ''; }
			if(isset($_POST['dty']) && $_POST['dty']!='' ){ $da_y = 'checked="checked"';	}else{ $da_y = ''; }
			//echo "aaa";
			$design_date = "entry_date"; 	
			if($yea_r!='' && $mont_h!='' && $da_y!='')
			{ 
				$dat_str = "STR_TO_DATE(".$design_date.",'%d-%m-%Y') = STR_TO_DATE('$todate','%d/%m/%Y')"; 
				$dat_str_op = "STR_TO_DATE(".$design_date.",'%d-%m-%Y') < STR_TO_DATE('$todate','%d/%m/%Y')";	
				$flgg = 1;		
				//echo "1";	
			}
			
			else if($yea_r!='' && $mont_h!='' && $da_y=='')
			{
				$vl = explode("/",$todate);
				$todat_vl = $vl[2]."-".$vl[1]."-".$vl[0];
				$dat_str = "DATE_FORMAT(STR_TO_DATE(".$design_date.",'%d-%m-%Y'),'%m-%Y') = DATE_FORMAT(STR_TO_DATE('$todate','%d/%m/%Y'),'%m-%Y')"; 
				//$dat_str_op = "DATE_FORMAT(STR_TO_DATE(".$design_date.",'%d-%m-%Y'),'%m-%Y') < DATE_FORMAT(STR_TO_DATE('$todate','%d/%m/%Y'),'%m-%Y')"; 
				$dat_str_op = "STR_TO_DATE(".$design_date.",'%d-%m-%Y') BETWEEN STR_TO_DATE(".$design_date.",'%d-%m-%Y') AND STR_TO_DATE(LAST_DAY(DATE_SUB('$todat_vl', INTERVAL 1 MONTH)) ,'%Y-%m-%d')"; 
				$flgg = 1;
			}
			
			else if($yea_r!='' && $mont_h=='' && $da_y=='')
			{ 
				$vl = explode("/",$todate);
				$todat_vl = ($vl[2]-1)."-12-31";
				$dat_str = "YEAR(STR_TO_DATE(".$design_date.",'%d-%m-%Y')) = YEAR(STR_TO_DATE('$todate','%d/%m/%Y'))"; 				
				//$dat_str_op = "YEAR(STR_TO_DATE(".$design_date.",'%d-%m-%Y')) < YEAR(STR_TO_DATE('$todate','%d/%m/%Y'))"; 
				$dat_str_op = "STR_TO_DATE(".$design_date.",'%d-%m-%Y') BETWEEN STR_TO_DATE(".$design_date.",'%d-%m-%Y') AND STR_TO_DATE('$todat_vl','%Y-%m-%d')"; 
				$flgg = 1;
			}
			
			else if($yea_r=='' && $mont_h=='' && $da_y=='')
			{ 
				//echo "4";
				/*$dat_str = "STR_TO_DATE(".$design_date.",'%d-%m-%Y') <= STR_TO_DATE('$todate','%d/%m/%Y')"; 				
				$dat_str_op = "STR_TO_DATE(".$design_date.",'%d-%m-%Y') <= STR_TO_DATE('$stdate','%d/%m/%Y')";*/ 
				$dat_str_op = "STR_TO_DATE(".$design_date.",'%d-%m-%Y') < STR_TO_DATE('$stdate','%d/%m/%Y')";
				$dat_str = "STR_TO_DATE(".$design_date.",'%d-%m-%Y') <= STR_TO_DATE('$todate','%d/%m/%Y')";
				$flgg = 0;
			}
			
			else if($yea_r=='' && $mont_h!='' && $da_y=='')
			{ 
				//echo "5";
				$vl = explode("/",$todate);
				$todat_vl = $vl[2]."-".$vl[1]."-".$vl[0];
				$dat_str = "DATE_FORMAT(STR_TO_DATE(".$design_date.",'%d-%m-%Y'),'%m-%Y') = DATE_FORMAT(STR_TO_DATE('$todate','%d/%m/%Y'),'%m-%Y')";  
				//$dat_str_op = "DATE_FORMAT(STR_TO_DATE(".$design_date.",'%d-%m-%Y'),'%m-%Y') < DATE_FORMAT(STR_TO_DATE('$todate','%d/%m/%Y'),'%m-%Y')";
				$dat_str_op = "STR_TO_DATE(".$design_date.",'%d-%m-%Y') BETWEEN STR_TO_DATE(".$design_date.",'%d-%m-%Y') AND STR_TO_DATE(LAST_DAY(DATE_SUB('$todat_vl', INTERVAL 1 MONTH)) ,'%Y-%m-%d')"; 
				$flgg = 1;
				//echo date('m-01-Y 00:00:00',strtotime('this month')) . '<br/>';
				//echo date('m-t-Y 12:59:59',strtotime('this month')) . '<br/>';
			}
			
			else if($yea_r=='' && $mont_h=='' && $da_y!='')
			{ 
				//echo "6";
				$dat_str = "STR_TO_DATE(".$design_date.",'%d-%m-%Y') = STR_TO_DATE('$todate','%d/%m/%Y')"; 
				$dat_str_op = "STR_TO_DATE(".$design_date.",'%d-%m-%Y') < STR_TO_DATE('$todate','%d/%m/%Y')"; 
				$flgg = 1;
			}
			
			else if($yea_r!='' && $mont_h=='' && $da_y!='')
			{ 
				//echo "7";
				$dat_str = "STR_TO_DATE(".$design_date.",'%d-%m-%Y') = STR_TO_DATE('$todate','%d/%m/%Y')"; 
				$dat_str_op = "STR_TO_DATE(".$design_date.",'%d-%m-%Y') < STR_TO_DATE('$todate','%d/%m/%Y')"; 
				$flgg = 1;
			}
			
			else if($yea_r=='' && $mont_h!='' && $da_y!='')
			{ 
				//echo "8";
				$dat_str = "STR_TO_DATE(".$design_date.",'%d-%m-%Y') = STR_TO_DATE('$todate','%d/%m/%Y')"; 				
				$dat_str_op = "STR_TO_DATE(".$design_date.",'%d-%m-%Y') < STR_TO_DATE('$todate','%d/%m/%Y')"; 
				$flgg = 1;
			}
		}
		else
		{
			$dat_str_op = "STR_TO_DATE(entry_date,'%d-%m-%Y') < STR_TO_DATE('$stdate','%d/%m/%Y')";
			$dat_str = "1";
			$flgg = 1;
		}
	}
	else
	{
		//echo "bb";
		$dat_str_op = "STR_TO_DATE(entry_date,'%d-%m-%Y') < STR_TO_DATE('$stdate','%d/%m/%Y')";
		//$dat_str = "STR_TO_DATE(entry_date,'%d-%m-%Y') BETWEEN STR_TO_DATE('$todate','%d/%m/%Y') AND STR_TO_DATE('$cur_date','%Y-%m-%d')";
		$dat_str = "STR_TO_DATE(entry_date,'%d-%m-%Y') <= STR_TO_DATE('$todate','%d/%m/%Y')";
		$flgg = 1;
	}
	
	//echo $ed_dt;
	$SLCT_f = "SELECT * FROM party_det WHERE party_det_id = '$pa_id'";
	//echo $SLCT_f;
	$QURY_f = mysqli_query($connect,$SLCT_f);
	$FTCHf = mysqli_fetch_object($QURY_f);
	
	$SLCT1 = "SELECT * FROM ac_party_det WHERE party_det_id = '$pa_id'";
	//echo $SLCT1;
	$QURY1 = mysqli_query($connect,$SLCT1);	
	$FTCH1 = mysqli_fetch_object($QURY1);
	
	if($st_dt!="" && $ed_dt!="")
	{
		$SLCT = "SELECT * FROM acc_rep_temp WHERE party_det_id = '$pa_id' AND STR_TO_DATE(entry_date,'%d-%m-%Y') BETWEEN STR_TO_DATE('$st_dt','%d/%m/%Y') AND STR_TO_DATE('$ed_dt','%d/%m/%Y') ORDER BY STR_TO_DATE(entry_date,'%d-%m-%Y') ASC";
		$flgg = 1;
	}
	else if($st_dt!="" && $ed_dt=="")
	{
		$SLCT = "SELECT * FROM acc_rep_temp WHERE party_det_id = '$pa_id' AND STR_TO_DATE(entry_date,'%d-%m-%Y') BETWEEN STR_TO_DATE('$st_dt','%d/%m/%Y') AND STR_TO_DATE('$cur_date','%Y-%m-%d') ORDER BY STR_TO_DATE(entry_date,'%d-%m-%Y') ASC";
	}
	else if($st_dt=="" && $ed_dt!="")
	{
		$SLCT = "SELECT * FROM acc_rep_temp WHERE party_det_id = '$pa_id' AND ".$dat_str." ORDER BY STR_TO_DATE(entry_date,'%d-%m-%Y') ASC";
		//$SLCT = "SELECT * FROM acc_rep_temp WHERE party_det_id = '$pa_id' AND STR_TO_DATE(entry_date,'%d-%m-%Y') <= STR_TO_DATE('$ed_dt','%d/%m/%Y') AND STR_TO_DATE('$cur_date','%Y-%m-%d') ORDER BY STR_TO_DATE(entry_date,'%d-%m-%Y') ASC";		
	}
	else
	{
		$SLCT = "SELECT * FROM acc_rep_temp WHERE party_det_id = '$pa_id' ORDER BY STR_TO_DATE(entry_date,'%d-%m-%Y') ASC";
	}	
	//echo $SLCT."<br>";
	$QURY = mysqli_query($connect,$SLCT);	
	if(mysqli_num_rows($QURY)>0)
	{
		$open_amt = 0;
		$tot_bil_amt = 0;
		$tot_rec_amt = 0;
		$tot_dis_amt = 0;
		
		$tot_bil = 0;
		$tot_re = 0;
		$tot_dis = 0;
		
		while($FTCH_tst2 = mysqli_fetch_object($QURY))
		{
			if($FTCH_tst2->data_type=="billing")
			{
				$SLCT_tpb2 = "SELECT * FROM billing_det WHERE billing_det_id = '$FTCH_tst2->billing_det_id'";
				$QURY_tpb2 = mysqli_query($connect,$SLCT_tpb2);
				$FTCH_tpb2 = mysqli_fetch_object($QURY_tpb2);						
				
				$rec_amt  = '';
				$dis_amt  = '';
				$tot_bil = $tot_bil + $FTCH_tpb2->bill_amt;
			}
			else
			{
				$bill_amt	= '';
				
				$SLCT_t2 = "SELECT * FROM ac_received_det WHERE ac_received_det_id = '$FTCH_tst2->ac_received_det_id'";
				$QURY_t2 = mysqli_query($connect,$SLCT_t2);
				$FTCH_t2 = mysqli_fetch_object($QURY_t2);
				
				$tot_re = $tot_re + $FTCH_t2->received_amt;
				$tot_dis = $tot_dis + $FTCH_t2->dis_amt;
			}				
		}
		$tot_rec = $tot_re + $tot_dis; 
		
		
		$SLCT_tst = "SELECT * FROM acc_rep_temp WHERE party_det_id = '$pa_id' AND ".$dat_str_op." ORDER BY STR_TO_DATE(entry_date,'%d-%m-%Y') ASC";
		//echo $SLCT_tst."<br>";
		$QURY_tst = mysqli_query($connect,$SLCT_tst);
		if(mysqli_num_rows($QURY_tst)>0)
		{	
			while($FTCH_tst = mysqli_fetch_object($QURY_tst))
			{
				if($FTCH_tst->data_type=="billing")
				{
					$SLCT_tpb = "SELECT * FROM billing_det WHERE billing_det_id = '$FTCH_tst->billing_det_id'";
					//echo $SLCT_tpb;
					$QURY_tpb = mysqli_query($connect,$SLCT_tpb);
					$FTCH_tpb = mysqli_fetch_object($QURY_tpb);						
					
					$rec_amt  = '';
					$dis_amt  = '';
					$tot_bil_amt = $tot_bil_amt + $FTCH_tpb->bill_amt;
				}
				else
				{
					$bill_amt	= '';
					
					$SLCT_t = "SELECT * FROM ac_received_det WHERE ac_received_det_id = '$FTCH_tst->ac_received_det_id'";
					$QURY_t = mysqli_query($connect,$SLCT_t);
					$FTCH_t = mysqli_fetch_object($QURY_t);
					
					$tot_rec_amt = $tot_rec_amt + $FTCH_t->received_amt;
					$tot_dis_amt = $tot_dis_amt + $FTCH_t->dis_amt;
				}				
			}
			$pen = $tot_bil_amt - $tot_rec_amt ;
			$open_amt = $tot_bil_amt - ($tot_rec_amt + $tot_dis_amt)  ;
		}
		else
		{
			$tot_bil_amt = 0;
			$tot_rec_amt = 0;
			$pen = 0;
			$open_amt = 0;
		}
		if($flgg == 0)
		{
			$pen_amt = $tot_bil - $tot_rec ;
		}
		else if($flgg == 1)
		{				
			$pen_amt = ($tot_bil + $open_amt) - $tot_rec ;
		}
		//echo $open_amt."<br>";
	
?>      
<table width="960" border="0" align="center" cellspacing="0" style="outline:#000000 solid 1px;">
  <tr >
    <td width="56" >&nbsp;</td>
    <td width="295" >&nbsp;</td>
    <td width="273" >&nbsp;</td>
    <td width="71" >&nbsp;</td>
    <td width="255" >&nbsp;</td>
  </tr>
  <tr>
    <td align="center"></td>
    <td colspan="2"><strong>Party Name  : <?php echo $FTCHf->cmp_name; ?></strong></td>
    <td align="center">&nbsp;</td>
    <td align="left"><strong>Party Code  : <?php echo $FTCHf->party_code; ?></strong></td>
    
  </tr>
  
 
  <tr>
    <td >&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="left" style="border-bottom: solid 0px;"></td>
    <td align="left" style="border-bottom: solid 0px;"><strong>Total Billed Amount  : <?php echo number_format($tot_bil,2); ?></strong> </td>
    <td align="left" style="border-bottom: solid 0px;"><strong>Total Received Amount  : <?php echo number_format($tot_rec,2); ?></strong> </td>
    <td colspan="2" align="center" style="border-bottom: solid 0px;">
    <?php
	if($pen_amt<0)
	{
	?>
    	<strong>Total Advance Amount  : <?php echo number_format(abs($pen_amt),2); ?></strong> 
  	<?php
	}
	else if($pen_amt>=0)
	{
	?>
    	<strong>Total Pending Amount  : <?php echo number_format(abs($pen_amt),2); ?></strong> 
  	<?php
	}
	?>
    
    </td>
  </tr>
 
  <tr>
    <td >&nbsp;</td>
    <td >&nbsp;</td>
	<td >&nbsp;</td>
	<td >&nbsp;</td>
	<td >&nbsp;</td>
  </tr>
</table>
<table width="960" border="1" align="center" cellspacing="0" style=" border-collapse: collapse; outline:#000000 thin 1px;">
  <tr>
    <th width="27" scope="col">S.No</th>
    <th width="79" scope="col">Bill Type </th>
    <th width="93" scope="col">Bill No </th>
    <th width="75" scope="col">Bill Date </th>
    <th width="78" scope="col">Billin Amount </th>
    <th width="87" scope="col">Payment Date </th>
    <th width="75" scope="col">Payment</th>
    <th width="73" scope="col">Roundoff</th>
    <th width="87" scope="col">Payment Type </th>
    <th width="184" scope="col">Bank / Receiver </th>
	<th width="60" scope="col">Statement</th>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="2"><div align="center"><strong>Opennig Amount</strong></div></td>
    <td>&nbsp;</td>
    <td align="right">&nbsp;</td>
    <td >&nbsp;</td>
     <td align="right"><strong><?php echo number_format($open_amt,2); ?></strong> </td>
     <td align="right">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
	 <td>&nbsp;</td>
  </tr>
  <?php 
  	$loop = 1;
	$i=1;
	$tot_bil_amt = 0;
	$tot_rec_amt = 0;
	$tot_dis_amt = 0;	
	$clos_amt = 0;
	$stmt_amt = $open_amt;
	//echo $SLCT;
	echo "<br>";
 	$QURY = mysqli_query($connect,$SLCT);	
	while($FTCH = mysqli_fetch_object($QURY))
	{	
		if($FTCH->data_type=="billing")
		{
		
			$SLCT_tpb = "SELECT * FROM billing_det WHERE billing_det_id = '$FTCH->billing_det_id'";
			$QURY_tpb = mysqli_query($connect,$SLCT_tpb);
			$FTCH_tpb = mysqli_fetch_object($QURY_tpb);
						
			$bill_type = $FTCH_tpb->bill_type;
			$bill_no	= $FTCH_tpb->bill_no;
			$bill_amt	= number_format($FTCH_tpb->bill_amt,2);
			$bill_date  = $FTCH_tpb->bill_date;
						
			$pay_typ = '';
			$received_date = '';
			$received_amt  = '';
			$dis_amt  = '';
			$pay_typ = '';
			$re_name = '';
			
			$tot_bil_amt = $tot_bil_amt + $FTCH_tpb->bill_amt;
			$stmt_amt    = $stmt_amt+$FTCH_tpb->bill_amt;
		}
		else
		{
			$bill_type = '';
			$bill_no	= '';
			$bill_amt	= '';
			$bill_date  = '';
 			//echo
			$SLCT_t = "SELECT * FROM ac_received_det WHERE ac_received_det_id = '$FTCH->ac_received_det_id'";
			//echo "<br>";
			$QURY_t = mysqli_query($connect,$SLCT_t);
			$FTCH_t = mysqli_fetch_object($QURY_t);
			
			$re_am = ($FTCH_t->received_amt!=0)?$FTCH_t->received_amt:$FTCH_t->cred_amt;
			
			$tot_rec_amt = $tot_rec_amt + $re_am;
			$tot_dis_amt = $tot_dis_amt + $FTCH_t->dis_amt;
			
			$pay_typ = $FTCH_t->payment_type;
			$received_date = $FTCH_t->received_date;
			$received_amt  = number_format($re_am,2);
			$dis_amt  = number_format($FTCH_t->dis_amt,2);
			
			if($FTCH_t->payment_type=="cash")
			{
				$SLCT_e = "SELECT * FROM emp_det WHERE emp_det_id = '$FTCH_t->emp_det_id'";
				$QURY_e = mysqli_query($connect,$SLCT_e);
				$FTCH_e = mysqli_fetch_object($QURY_e);
				
				$re_name = $FTCH_e->name; 
			}
			else if($FTCH_t->payment_type=="cheque")
			{
				$SLCT_e = "SELECT * FROM emp_det WHERE emp_det_id = '$FTCH_t->emp_det_id'";
				$QURY_e = mysqli_query($connect,$SLCT_e);
				$FTCH_e = mysqli_fetch_object($QURY_e);
				
				$re_name = $FTCH_e->name; 
			}
			else if($FTCH_t->payment_type=="neft")
			{
				$re_name = $FTCH_t->bank_name; 
			}
			$stmt_amt    = $stmt_amt-($re_am+$FTCH_t->dis_amt);
		}
		/*if($FTCH->acc_amt != '')
		{
			$stmt = $FTCH->acc_amt;
		}
		else
		{
			$stmt = 0;
		}*/
		$stmt = $stmt_amt;
				
  ?>
  
  <tr>
    <td align="left" style="vertical-align:middle;"><div align="left"><?php echo $loop ?></div></td>
    <td align="left" style="vertical-align:middle;"><div align="center"><?php echo $bill_type; ?></div></td>
    <td align="center" style="vertical-align:middle;"><div align="center"><?php echo $bill_no; ?></div></td>
    <td><?php if($bill_date!=''){ echo str_replace("-", "/", $bill_date); } ?></td>
    <td align="left" style="vertical-align:middle;"><div align="right"><?php echo $bill_amt; ?></div></td>
    <td align="left" style="vertical-align:middle;"><?php if($received_date!=''){ echo str_replace("-", "/", $received_date); } ?></td>
    <td align="right" style="vertical-align:middle;"><?php echo $received_amt; ?></td>
    <td align="right" style="vertical-align:middle;"><?php echo $dis_amt; ?></td>
    <td align="left" style="vertical-align:middle;"><div align="center"><?php echo $pay_typ; ?></div></td>
    <td align="left" style="vertical-align:middle;">
	<div align="left">
	<?php echo $re_name; ?>
	</div>
	</td>
	 <td align="right" style="vertical-align:middle;"><div align="right"><?php echo number_format($stmt,2); ?></div></td>
  </tr>
  <?php
    $i++; $loop++; } ?>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
	<td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="2"><div align="center"><strong>Total</strong></div></td>
    <td>&nbsp;</td>
    <td align="right"><strong><?php echo number_format($tot_bil_amt,2); ?></strong> </td>
    <td >&nbsp;</td>
     <td align="right"><strong><?php echo number_format($tot_rec_amt,2); ?></strong> </td>
     <td align="right"><strong><?php echo number_format($tot_dis_amt,2); ?></strong></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
	<td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
	<td>&nbsp;</td>
  </tr>  
</table>
<?php
	}
	else
	{
?>
	<table width="960" border="0" align="center" cellspacing="0" style="outline:#000000 solid 1px;">
      <tr >
        <td width="56" >&nbsp;</td>
        <td width="295" >&nbsp;</td>
        <td width="273" >&nbsp;</td>
        <td width="71" >&nbsp;</td>
        <td width="255" >&nbsp;</td>
      </tr>
      <tr>
        <td align="center"></td>
        <td align="left"><strong>Party Name  : <?php echo $FTCHf->cmp_name; ?></strong></td>
        <td align="center">&nbsp;</td>
        <td colspan="2"><strong>Party Code  : <?php echo $FTCHf->party_code; ?></strong></td>
      </tr>
      <tr>
        <td >&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    <table width="960" border="1" align="center" cellspacing="0" style=" border-collapse: collapse; outline:#000000 thin 1px;">
      <tr>
        <th width="27" scope="col">S.No</th>
        <th width="79" scope="col">Bill Type </th>
        <th width="93" scope="col">Bill No </th>
        <th width="75" scope="col">Bill Date </th>
        <th width="78" scope="col">Billin Amount </th>
        <th width="87" scope="col">Payment Date </th>
        <th width="75" scope="col">Payment</th>
        <th width="73" scope="col">Roundoff</th>
        <th width="87" scope="col">Payment Type </th>
        <th width="184" scope="col">Bank / Receiver </th>
		<th width="60" scope="col">Statement</th>
      </tr>
      <tr>
      	<td colspan="11" style="color:#F00" align="center"><strong>No Details are Avilable Between this Date</strong></td>
      </tr>
   	</table>
<?php
	}
?>

</body>
</html>
