<?php session_start(); ob_start(); ?>

<?php  include 'header.php'; ?>

<?php
	ini_set('display_errors', 0);
if(empty($_SESSION['LOGINID']) && empty($_SESSION['LOGINNM']) ){

	header("Location:index.php");
}


include("user.php");
	$date1 = $_GET["date1"];
	$date2 = $_GET["date2"];
	
?>


						  
	<?php
												  

$settingsSQL = mysqli_query($connection, "SELECT * FROM `settings` where name='address' ");
$settingsSQL = mysqli_fetch_object($settingsSQL);
									
$address = $settingsSQL->value;

$settingsSQL = mysqli_query($connection, "SELECT * FROM `settings` where name='mobile' ");
$settingsSQL = mysqli_fetch_object($settingsSQL);
									
$our_mobile = $settingsSQL->value;

$settingsSQL = mysqli_query($connection, "SELECT * FROM `settings` where name='email' ");
$settingsSQL = mysqli_fetch_object($settingsSQL);
									
$our_email = $settingsSQL->value;
								   
?>	

<html>

<style>
body {
  background: rgb(204,204,204); 
}
page {
  background: white;
  display: block;
  padding-top: 2cm;
  padding-left: 2cm;
  padding-right: 2cm;
  margin: auto;
  margin-bottom: 2.0cm;
}
page[size="A4"] {  
  width: 21cm;
  height: auto; 
}
page[size="A4"][layout="landscape"] {
  width: 29.7cm;
  height: 21cm;  
}

@media print {
  body, page {
    margin: 0;
    box-shadow: 0;
  }
}



</style>

  <head>
    <title>Booking Print</title>
	<meta http-equiv='content-type' content='text/html;charset=utf-8' />
  </head>
  
  <page size="A4">
  
  <body>
<center>
<table style="width:100%;border: 0px solid black;" cellpadding='0' height='' cellspacing='0'  >
 
  <tr align="center" >
    <td  style="width:100%; "  > <img src="assets/images/logo_wd.png" width="150" /> </br>
<?php echo "$address"; ?> </br>
<?php echo "$our_email"; ?> </br>
<?php echo "$our_mobile"; ?>  </br>
<b> Payment Received </b></br>
From Date : <?php echo "$date1"; ?> to  <?php echo "$date2"; ?>

	</td>
  
  </tr>
</table>

</br></br>

<table style="width:100%" cellpadding='' height='' cellspacing='0' border='0' align='center' valign= 'top' >
	<tr align="left" >
	
	
	
	
	  <td style="width:15%;border-bottom: 1px solid black;" > 
	   &nbsp;&nbsp; <b>Date </b>
      </td> 
	  <td style="width:10%;border-bottom: 1px solid black;" > 
	   <b>Booking ID</b>
      </td> 
	  <td style="width:5%;border-bottom: 1px solid black;" > 
	   <b>MR No</b>
      </td> 
	    <td style="width:60%;border-bottom: 1px solid black;" > 
	   <b>Details</b>
      </td> 
	    <td style="width:10%;border-bottom: 1px solid black;" > 
	  <b> Amount</b>
      </td> 
	  
	</tr> 
	
	
	
	 <?php 
											
											$sl=0;
                                $sqlSelectedLG = "select f1.* , f2.name from (SELECT t1.*,t2.booking_id FROM `transactions` as t1 left join bookings as t2 on t1.temp_booking_id=t2.id) as f1 left join users as f2 on f1.updated_by = f2.id  where f1.date BETWEEN '$date1' AND '$date2' order by f1.date desc";

                               $sqlSelectedLG = mysqli_query($connection, $sqlSelectedLG);


$tpaid=0;
                               while ($list = mysqli_fetch_object($sqlSelectedLG)) {

                                 
                                    $idn = $list->id;
								    $date = $list->date;
									$booking_id = $list->booking_id;
									$mr_no = $list->mr_no;
									$amount = $list->amount;
									$tpaid=$tpaid+$amount;
									$updated_by = $list->name;
									$method = $list->method;
								$details = $list->details;
								
				                $amount_in=IND_money_format($amount);
							
									
									?>
	
	
	
	
	
	
	
	<tr align="left" >
	  <td style="width:15%;border-bottom: 1px solid black;" > 
	   &nbsp;&nbsp; <?php echo $date; ?>
      </td> 
	  <td style="width:10%;border-bottom: 1px solid black;" > 
	  <?php echo $booking_id; ?>
      </td> 
	  <td style="width:5%;border-bottom: 1px solid black;" > 
	<?php echo $mr_no; ?>
      </td> 
	    <td style="width:60%;border-bottom: 1px solid black;" > 
	<?php echo $details; ?>
      </td> 
	    <td style="width:10%;border-bottom: 1px solid black;" > 
	  <?php echo $amount_in; ?> 
      </td> 
	 
	</tr> 
	
	
							   <?php } ?>
							   
							   <tr align="left" >
	  <td style="width:10%;border-bottom: 1px solid black;" > 
	   &nbsp;&nbsp; 
      </td> 
	  <td style="width:25%;border-bottom: 1px solid black;" > 
	  
      </td> 
	  <td style="width:15%;border-bottom: 1px solid black;" > 
	
      </td> 
	    <td style="width:15%;border-bottom: 1px solid black;" > 
	 Total = 
      </td> 
	    <td style="width:20%;border-bottom: 1px solid black;" > 
	  <?php echo IND_money_format($tpaid); ?> 
      </td> 
	   <td style="width:15%;border-bottom: 1px solid black;" > 
	  &nbsp;&nbsp; 
      </td>
	</tr> 
</table>
</br></br>




 
 
 
 
 
 
 
 
 </center> 
 
 
  </body>
  
  </page>
  
</html>