<?php
session_start();
if( isset($_POST["dat"]) && isset( $_POST['hotelID'] )){
	 $hid=$_POST['hotelID'];
	$date=$_POST["dat"];
	///$dd = $_POST["days"];
	 
	
include("buda_connect.php");
//$da=1;
?><table border=1 id="b"><?php
//while($da<=$dd){
	/*if($da<10){
	$date=$de."-0".$da;
	}
	else{
	$date=$de."-".$da;	
	}*/
	 ?>
	 <tr><td colspan=8>ROOM SERVICES SUMMARY FOR <?php echo "  ".$date;?></b> </td></tr>
	 
	 <tr id="tdprof"><td id=" "><font size=2  type="agency fb"> ROOM NO</font></td>
	
	<td id=" "><font size=2  type="agency fb"> ROOM NAME</font></td>
	
	<td id=" "><font size=2  type="agency fb"> ROOM COST</font></td>
	
	<td id=" "><font size=2  type="agency fb"> ROOM TYPE</font></td>
	
	<td id=" "><font size=2 type="agency fb"> CUSTOMER NAME</font></td>
	
	<td id=" "><font size=2  type="agency fb"> CASH AMOUNT</font></td>
	
	<td id=" "><font size=2  type="agency fb">PAYMENT STATUS</font></td>
	  
	  <td id=" "><font size=2  type="agency fb">DATE</font></td>
	</tr>
	 
	 <?php

$qH=mysql_query("select room.room_no,room.rname,room.rcost,room.rtype,room.rstatus,recept.cash_amount,recept.p_status,recept.departure_on ,customer.fname,customer.mname,customer.lname from room,recept,customer where room.hotel_id='$hid' and room.room_no=recept.room_id and recept.departure_on like '%$date%' and recept.cust_id = customer.cust_id ")or die("Error3: ".mysql_error());
$ht=mysql_num_rows($qH);
if($ht > 0){
 $av=0;
 $total=0;
 
	 $rum = array();
while($av<$ht){
	 $OD=mysql_fetch_array($qH);
	 
	 array_push($rum,array('room.room_no'=>$OD[0],
	                         'room.rname'=>$OD[1],
							 'room.rcost'=>$OD[2],
							 'room.rtype'=>$OD[3],
							 'room.rstatus'=>$OD[4],
							 'recept.cash_amount'=>$OD[5],
							  'recept.p_status'=>$OD[6],
							  'recept.p_status'=>$OD[7],
							   'customer.fname'=>$OD[8],
							    'customer.mname'=>$OD[9],
								 'customer.lname'=>$OD[10],
							 ));
				 
 				 
						?>
	<tr id="tdprof"><td id=" "><font size=2 type="agency fb"><?php echo $OD[0]; ?></font></td>
	
	<td id=" "><font size=2   type="agency fb"><?php echo $OD[1]; ?></font></td>
	
	<td id=" "><font size=2   type="agency fb"><?php echo $OD[2]; ?></font></td>
	
	<td id=" "><font size=2   type="agency fb"><?php echo $OD[3]; ?></font></td>
	  
	<td id=" "><font size=2  type="agency fb"><?php echo $OD[8]." ".$OD[9]." ".$OD[10]; ?></font></td>
	
	<td id=" "><font size=2 type="agency fb"><?php echo $OD[5]; ?></font></td>
	
	<td id=" "><font size=2  type="agency fb"><?php echo $OD[6]; ?></font></td>
	<td id=" "><font size=2  type="agency fb"><?php echo $OD[7]; ?></font></td>
	  
	</tr>
	
	 
<?php			 
 
 $total=$total+$OD[5];
 $av++;
}

}
else{
	echo "No room covered on that date!.." ;
}
//$da++;
//}
?>

<tr id="tdprof"><td id=" ">
	<td id=" " colspan=8>Total amount money enhenced:<font size=2  type="agency fb"><?php echo $total;; ?></font></td>
	  
	</tr>



 </table><?php
}

							 
		?>