<?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
			}
			
			    .print-btn {
        background-color: #007bff;
        color: white;
        padding: 10px 18px;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        font-size: 16px;
        transition: 0.3s;
		float:left;
    }

    .print-btn:hover {
        background-color: #0056b3;
    }
			-->

		</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 Breakfast list</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 == ""){

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


		  $ds=dtformat($ds);
		  $de=dtformat($de);
		  


 ?>
										<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 dtformat($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 dtformat($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>
<?php 
		 
$ds = date('Y-m-d', strtotime($ds . ' -1 day'));
$de = date('Y-m-d', strtotime($de . ' -1 day'));

$dsn = date('Y-m-d', strtotime($ds . ' +1 day'));
$den = date('Y-m-d', strtotime($de . ' +1 day'));

 
 
		  
		  $d="and  check_in BETWEEN '$ds' AND '$de'";
 
						?>
						<tr>
							<td align="center" valign="middle">	
			<button class="print-btn" onclick="popUp('hotel_breakfast_list_print.php?ds=<?php echo $ds; ?>&de=<?php echo $de; ?>');">🖨 Print</button>
            
            <button class="print-btn" onclick="popUp('hotel_breakfast_token_print.php?ds=<?php echo $ds; ?>&de=<?php echo $de; ?>');" style=" margin-left:50px;"> Print TOKEN</button>
            
            <h3>
              Breakfast list <?php echo dtformat($dsn);?> to <?php echo dtformat($den);?></h3></td>
						</tr>
						<tr>
							<td class="round_box">
								<table width="100%" border="0" cellpadding="3" cellspacing="1" class="list_table">


									<tr>
										<th align="center">Date</th>
										<th align="center">  Reservations No</th>
										<th width="10%" align="center">Room No</th>
										<th align="center">Complimentary Breakfast</th>
										<th align="center">Without Breakfast</th>
										<th align="center">Parata</th>
										<th align="center">Ruti</th>
										<th align="center">Person</th>
										<th align="center">Extra</th>
									</tr>
									<?php 
		    
		 

		  $dresult=mysql_query("SELECT * FROM bookings WHERE id!='' $d  order by check_in,room_no asc");
          $drow=mysql_fetch_array($dresult);
		  $total=0;
		  do{
		  ?>
									<tr>
										<td width="12%" align="center" class="link"><span class="link" style="white-space: nowrap">
										  <?php 
			
			 
$date = $drow[check_in];
$nextDate = date('d-m-Y', strtotime($date . ' +1 day'));

echo $nextDate; // 2026-01-11


			?>
										</span></td>
										<td width="10%" align="center" class="link" style="white-space: nowrap"><a href="javascript:void(0);" onclick="popUp('show_bill.php?id=<?php echo $drow[bill_id]; ?>')"> <?php echo $drow[bill_id]; ?> </a></td>
										<td align="center" class="link"><?php 
 
			 echo $drow[room_no];
			 
			?></td>
										<td width="14%" align="center" class="link">
											<?php 
 if($drow[additional_ser] == "Complimentary Breakfast"){
			
			 echo number_format($drow[addi_pax]);

$due=$due+$drow[addi_pax];
	  }
			?></td>
										<td width="12%" align="center" class="link"><?php 
 if($drow[additional_ser]!="Complimentary Breakfast"){
			
			 echo number_format($drow[addi_pax]);

$due2=$due2+$drow[addi_pax];
	  }
			?></td>
										<td width="13%" align="center" class="link">&nbsp;</td>
										<td width="10%" align="center" class="link">&nbsp;</td>
										<td width="11%" align="center" class="link">&nbsp;</td>
										<td width="8%" align="center" class="link">&nbsp;</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 $due; ?></strong></td>
										<td align="center" class="link"><strong><?php echo $due2; ?></strong></td>
										<td align="right" class="link">&nbsp;</td>
										<td align="right" 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 }?>