<?php


require('../config/config.php');

$month = intval($_GET['q']);
if($month == ''  || !isset($_GET['q']))
{
$month = date("M");
}

$year = date("y");

		$hotelObClnder = new Calendar;
		$Emnth = $hotelObClnder->mnth_trsform($month);
		$hotelObClnder->current_Date($month,$year);
		//echo "<br>";
		$hotelObClnder->setcrntmnth($month);
		$crntvmnth = $hotelObClnder->getcrntmnth();
		//echo "<br>Crnt_Mnth".$crntvmnth;
		$hotelObClnder->setcrntyear($year);
		$crntyear = $hotelObClnder->getcrntyear();
		//echo "<br>Crnt_Year<br>".$crntyear;
		$hotelObClnder->setprevmnth($month-1);
		$prevmnth = $hotelObClnder->getpreviousmnth();
		//echo "P_MNTH_CHART".$prevmnth ;
		$hotelObClnder->setnxtmnth($month+1);
		$hotelObClnder->setprevyear($year);
		$prevyear = $hotelObClnder->getprevyear();

		$nextmnth = $hotelObClnder->getnxtmnths();
		$hotelObClnder->setnxtyear($year);
		$nextyear = $hotelObClnder->getnxtyear();
		//echo "<br> Next Year <br>".$nextyear;
		if($prevmnth == 0) 
		{
		$prevmnth = 12 ;	//$previousmnth = 12 ;
		$hotelObClnder->setcrntmnth($prevmnth);
		$prevyear = $crntyear-1;
		$hotelObClnder->setcrntyear($prevyear);
		//$hotelObClnder->setprevyear($crntyear-1 ); //$prev_year = $year-1;

		}
		if($nextmnth == 13 )
		{
		$nextmnth = 1 ;
		$hotelObClnder->setcrntmnth($nextmnth );
		$nextyear = $crntyear+1;
		$hotelObClnder->setcrntyear($nextyear);
		//$hotelObClnder->setnxtmnth(1); //$nxtmnth = 1 ;
		//$hotelObClnder->setnxtyear($crntyear+1); //$nxt_year = $year+1;

		}
		
		$crntvmnth = $hotelObClnder->getcrntmnth();
		//echo "Current Month".$crntvmnth;
		$month = $crntvmnth ;
		$tdays = $hotelObClnder->daysInMonth($month,$year);
		//echo $tdays;
		
?>
<body>


<br><small><div align="center">Current Month : <?php echo $Emnth." , " .$year; ?> </div></small></br>
<table class="table table-bordered table-striped table-booking-history">
<thead>	
		<tr>
		<th> </th>
		<?php
		$tdays = $hotelObClnder->daysInMonth($month,$year);

		for($r=1; $r<=$tdays; $r++)
		{  ?>


		<th><?php
		echo $r; ?>
		</th> 
		<?php }

		?>
		</tr> <?php  ?> 
</thead>

		<tbody>

		</tbody>
</table>

</body>

