<?php session_start();







if($_SESSION[invcox] == ""){







header("location:login.php?action=need");







}else{















include("config.php");?>







<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">







<html xmlns="http://www.w3.org/1999/xhtml">







<head>







<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />







<title>Arnim Holidays Accounting Software</title>







<link href="style.css" rel="stylesheet" type="text/css" />



 





<SCRIPT LANGUAGE="JavaScript">















<!-- Begin







function popUp(URL) {



day = new Date();

id = day.getTime();







eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=yes,width=950,height=650,left = 100,top = 100');");







}







// End -->







</script>



<style type="text/css">



<!--



.style2 {color: #DC147B;



	font-weight: bold;



}



.style3 {color: #000000}



-->



</style>

<?php include("calendar.php"); ?>

</head>















<body>







<table width="95%" border="0" align="center" cellpadding="0" cellspacing="1" class="box-wrap">







  <tr>







    <td><?php include("top.php")?></td>







  </tr>







  <tr>







    <td>&nbsp;</td>







  </tr>







  <tr>







    <td class="center_page_white"><table width="100%" border="0" cellspacing="1" cellpadding="0">







      <tr>







        <td valign="top"><br />







          <form id="form1" name="form1" method="post" action="">







            <table width="100%" border="0" cellpadding="3" cellspacing="1"  class="round_box">







              <tr>







                <td width="16%"><strong>Search Reservations</strong></td>







                <td width="84%">&nbsp;</td>







              </tr>



<?php 



if($_POST[ds]!=""){$ds=$_POST[ds];}



if($_POST[de]!=""){$de=$_POST[de];}







if($_GET[ds]!=""){$ds=$_GET[ds];}



if($_GET[de]!=""){$de=$_GET[de];}







if($ds == ""){







$dddez = strtotime("-60 day");



$ds=date('d-m-Y', $dddez);







}



if($de == ""){$de=date("d-m-Y");}







 ?>



              <tr>







                <td>Search by date :                  </td>







                <td><table width="703" border="0" cellspacing="1" cellpadding="2">

                  <tbody>

                    <tr>

                      <td width="69">From

                        <input name="p" type="hidden" id="p" value="y" /></td>

                      <td width="233"><table width="180" border="0" cellspacing="0" cellpadding="0">

                        <tr>

                          <td width="70%"><input name="ds" type="text" id="ds" size="15"  value="<?php echo $ds;?>" required="required"/></td>

                          <td width="30%" align="center"><a title="Calendar" onclick="displayDatePicker('ds', this);" href="javascript:;"><img src="images/calendar.gif" width="20" height="20" border="0" /></a></td>

                        </tr>

                      </table></td>

                      <td width="22"><input name="p2" type="hidden" id="p2" value="y" /></td>

                      <td width="23">To</td>

                      <td width="233"><table width="180" border="0" cellspacing="0" cellpadding="0">

                        <tr>

                          <td width="70%"><input name="de" type="text" id="de" size="15"  value="<?php echo $de;?>" required="required"/></td>

                          <td width="30%" align="center"><a title="Calendar" onclick="displayDatePicker('de', this);" href="javascript:;"><img src="images/calendar.gif" width="20" height="20" border="0" /></a></td>

                        </tr>

                      </table></td>

                      <td width="92"><input type="submit" name="Submit" value="Search" /></td>

                    </tr>

                  </tbody>

                </table></td>







              </tr>



              <tr>

                

                

                

                <td>&nbsp;</td>

                

                

                

                <td>&nbsp;</td>

                

                

                

              </tr>







            </table>







            </form>







          </td>







      </tr>







      <tr>







        <td height="30">&nbsp;</td>







      </tr>







      <tr>







        <td class="round_box"><table width="100%" border="0" cellpadding="3" cellspacing="1" class="list_table">







         





          <tr>



            <th align="center" >Reservations No</th>
            <th align="center" >Booking Date</th>



            <th width="18%" align="center" ><table width="100%" border="0" cellspacing="0" cellpadding="2">
              <tbody>
                <tr>
                  <td align="center">Room No</td>
                  <td align="center">Check IN</td>
                  <td align="center">Check Out</td>
                  <td align="center">Nights</td>
                </tr>
                
              </tbody>
            </table></th>
            <th align="center" >Total Payeble</th>



            <th align="center" >Payment</th>



            <th align="center" >Due</th>
            <th align="center" >Commission</th>



            <th align="center" >P.Method </th>

            <th align="center" >User</th>

            <th align="center" >Pay Due</th>
            <th align="center" >Verify</th>
            </tr>







          <?php 







		    







		 



		  if($ds!=""){







		  $ds=dtformat($ds);







		  $de=dtformat($de);







		  $d="and cdate>='$ds' and cdate<='$de' ";}else{$d="";}



		  

 





		  $dresult=mysql_query("select * from bill WHERE bill_id!='0'  $d order by id desc limit 500");
 
          $drow=mysql_fetch_array($dresult);







		  $total=0;







		  do{







		  ?>







          <tr>







            <td width="7%" align="center" class="link"><a href="javascript:void(0);" onclick="popUp('show_bill.php?id=<?php echo $drow[bill_id]; ?>')"><?php echo $drow[bill_id]; ?></a></td>
            <td width="5%" align="center" class="link" style="white-space: nowrap"><?php 







			 echo dtformat($drow[cdate]);







			?></td>







            <td align="center" class="link"><?php 	

$eresult=mysql_query("SELECT COUNT( * ) AS days,bookings.room_no, MIN( bookings.check_in ) AS check_in, MAX( bookings.check_in ) AS check_out
FROM bookings
WHERE bookings.bill_id = '$drow[bill_id]'
GROUP BY bookings.room_no
ORDER BY bookings.room_no ASC ;");
$erow=mysql_fetch_array($eresult);	
			  
		  ?>   
              <table width="100%" border="0" cellspacing="0" cellpadding="2">
                <tbody>
                
<?php  do{?>
                  <tr>
                    <td align="center"><?php echo $erow[room_no];?></td>
                    <td align="center"><?php echo dtformat($erow[check_in]);?></td>
                    <td align="center"><?php 
		
$date = $erow[check_out]; // your date
$check_out = date("d-M-Y", strtotime($date . " +1 day"));
echo $check_out; // Output: 2025-11-13

  
		?></td>
                    <td align="center"><?php echo $erow[days];?></td>
                  </tr>
					<?php  
	   }while($erow=mysql_fetch_array($eresult));

		?>
                </tbody>
              </table></td>
            <td width="10%" align="center" class="link"><?php 



 



			 echo $drow[total_payeble];







			 $total=$total+$drow[total_payeble];







			?>                  </td>







            <td width="10%" align="center" class="link"><?php 







			 echo number_format($drow[all_payment_total]);







			?></td>







            <td width="7%" align="center" class="link"><?php 







			 echo number_format($drow[last_due]);





$due=$due+$drow[last_due];

			?>              </td>
            <td width="7%" align="center" class="link"><?php 

			 echo $drow[rcom];


			 $trcom=$trcom+$drow[rcom];

 

			?></td>







            <td width="17%" align="center" class="link"><?php  echo $drow[pay_methode];?></td>

            <td width="4%" align="center" class="link"><?php  
			  
$eresult=mysql_query("SELECT  userid FROM user WHERE id = '$drow[suser]'  limit 1");
$erow=mysql_fetch_array($eresult);
				
			  echo $erow[userid];
				?> 
				
				<span class="info-icon" onclick="openPopup('show_ip_info.php?ip=<?php echo $drow[user_ip]; ?>&time=<?php $date = "$drow[created_at]";
echo date("d-m-Y H:i:s", strtotime($date));?>')">i</span></td>

            <td width="7%" align="center" class="link"><?php if($drow[last_due]>'0'){?><a href="hotel_new_due_payment.php?id=<?php  echo $drow[bill_id];?>">Pay Due</a><?php }?></td>
            
            <td width="8%" align="center" class="link2" style="white-space:nowrap">
			<?php 
			if($drow[verify] == ""){
			if($bill_verify == '1'){ 
			?>
            <a href="hotel_verify.php?id=<?php  echo $drow[bill_id];?>&d=1">Verify</a> | <a href="hotel_verify.php?id=<?php  echo $drow[bill_id];?>&d=2">Deny</a>
              <?php }}else{
				  
				  if($drow[verify_s] == "1"){
				  echo 'Verified';
				  
				  
				  }
				  
				  if($drow[verify_s] == "2"){
				  echo 'Denied';
				  
				  
				  }
			  }
				  
				  ?></td>
            </tr>







          <?php 







		  }while($drow=mysql_fetch_array($dresult));







		 







		  ?>







          <tr>



            <td colspan="2" align="center"  class="link">&nbsp;</td>

            <td align="right"  class="link"><strong>Total :</strong></td>
            <td align="center"  class="link"><strong><?php echo $total; ?></strong></td>







            <td align="center"  class="link">&nbsp;</td>







            <td align="center"  class="link"><strong><?php echo $due; ?></strong></td>
            <td align="center"  class="link"><strong><?php echo $trcom; ?></strong></td>







            <td align="center"  class="link">&nbsp;</td>

            <td align="center"  class="link">&nbsp;</td>

            <td align="center"  class="link">&nbsp;</td>
            <td align="center"  class="link">&nbsp;</td>
            </tr>







        </table></td>







      </tr>







    </table></td>







  </tr>







  <tr>







    <td><?php include("bot.php")?></td>







  </tr>







</table>







</body>







</html>







<?php }?>