G:
/
PleskVhosts
/
seeonsoft.com
/
hp.thefalconunited.com
/
up file
home
<?php include('config.php'); $fdate = $_POST['fdate']; $from = date('d-m-Y', strtotime($fdate)); $tdate = $_POST['tdate']; $to = date('d-m-Y', strtotime($tdate)); $enqstatus = 'Confirmed'; $sql = $js->prepare('SELECT * FROM hotelreservations WHERE cindate >= :fdate AND cindate <= :tdate AND res_status = :enqstatus ORDER BY `cindate` '); $sql->execute(array(':fdate' => $fdate, ':tdate' => $tdate, ':enqstatus' => $enqstatus)); ?> <style type="text/css"> @page { size: A4; margin: .6in; size:landscape; } @media print { #table{ max-width: 2480px; width:100%; } #table td{ width: auto; overflow: hidden; word-wrap: break-word; } .noprint {display:none;} } </style> <script> function myFunction() { window.print(); } </script> <div align="center" style="background-color:#FFF"> <img src="images/logodmc.png"><HR style="border-color:#5053FD" /> <h3>Checkin List From <?php echo $from?> to <?php echo $to?></h3> <table style="border-collapse: collapse; " id="table" border="1" cellpadding="5" width="100%"> <thead> <tr style="background-color:#555; color:#fff"> <th>Sl No</th> <th>Cust Name</th> <th>No of Pax</th> <th>Hotel Name</th> <th>Location</th> <th>Checkin Date</th> <th>Checkout Date</th> <th>Remarks</th> <th>Payment Status</th> <th>Special Rate</th> <th>Paid Amount</th> <th>Balance Amount</th> </tr> </thead> <tbody> <?php $x = 1; $hotels = 'hotel'; while($row = $sql->fetch(PDO::FETCH_ASSOC)) { $id = $row['id']; $custid = $row['custid']; $cindate = date('d-m-Y', strtotime($row['cindate'])); $coutdate = date('d-m-Y', strtotime($row['coutdate'])); $hotel = $row['hotel']; $rate = $row['roomrate']; $totals = $rate; $descr = strtoupper($row['remarks']); $resultsh = $js->prepare('SELECT * FROM `hotelvendor` WHERE id = :hotel '); $resultsh->execute(array(':hotel' => $hotel)); while($rowsh = $resultsh->fetch(PDO::FETCH_ASSOC)) { $hotelname = strtoupper($rowsh['hotelname']); $location = strtoupper($rowsh['location']); $hphone = $rowsh['hotelphone']; $mphone = $rowsh['managerphone']; } $resultsc = $js->prepare('SELECT * FROM `customer_entry` WHERE id = :custid '); $resultsc->execute(array(':custid' => $custid)); while($rowsc = $resultsc->fetch(PDO::FETCH_ASSOC)) { $cid = $rowsc['id']; $custname = strtoupper($rowsc['custname']); $pax = strtoupper($rowsc['pax']); } $resultr = $js->prepare('SELECT * FROM `customer_expense` WHERE custid = :cid AND paysubhead = :id AND payhead = :hotels '); $resultr->execute(array(':cid' => $cid, ':id' => $id, ':hotels' => $hotels)); while($rowr = $resultr->fetch(PDO::FETCH_ASSOC)) { $payamount = $rowr['payamount']; $totalpaid += $payamount; } echo "<tr>"; echo "<td>$x</td>"; echo "<td>$custname</td>"; echo "<td>$pax</td>"; echo "<td align='center'>$hotelname <br>$hphone"; if($mphone !=' ') { echo " Manager : $mphone"; } echo "</td>"; echo "<td align='center'>$location</td>"; echo "<td align='center'>$cindate</td>"; echo "<td align='center'>$coutdate</td>"; echo "<td>$descr</td>"; $pieces4 = explode(".", $rate); $mainmenu4 = $pieces4[0]; $submenu4 = $pieces4[1]; $str= strlen($submenu4); if($str == '1') $submenu4 .= '00'; elseif($str == '2') $submenu4 .= '0'; elseif($str == '0') $submenu4 .= '000'; else{} $rates = $mainmenu4.".".$submenu4; echo "<td>"; $pieces4 = explode(".", $totals); $mainmenu4 = $pieces4[0]; $submenu4 = $pieces4[1]; $str= strlen($submenu4); if($str == '1') $submenu4 .= '00'; elseif($str == '2') $submenu4 .= '0'; elseif($str == '0') $submenu4 .= '000'; else{} $totalss = $mainmenu4.".".$submenu4; if($totalpaid == $totals && ($totalpaid != '.000' || $totalpaid != '00.000')) { echo "<font color='green'>PAID</font>"; //echo "<font color='green'>PAID $totalss</font>"; $balance = '0.000'; } elseif($totalpaid == '0' || $totalpaid == '') { echo "<font color='red'>NOT PAID</font>"; $balance = $totalss; } else { $balance = $totals - $totalpaid; $pieces4 = explode(".", $balance); $mainmenu4 = $pieces4[0]; $submenu4 = $pieces4[1]; $str= strlen($submenu4); if($str == '1') $submenu4 .= '00'; elseif($str == '2') $submenu4 .= '0'; elseif($str == '0') $submenu4 .= '000'; else{} $balance = $mainmenu4.".".$submenu4; //echo "<font color='blue'>BALANCE $balance</font>"; echo "PARTIALLY PAID"; } echo "</td>"; echo "<td align='right' style='padding-right:10px;'>$rates</td>"; $splrate += $rates; echo "<td align='right' style='padding-right:10px;'>$totalpaid</td>"; $paidtotal += $totalpaid; echo "<td align='right' style='padding-right:10px;'>$balance</td>"; $balancetotal += $balance; echo "</tr>"; $x++; $payamount =0; $totals=0; $totalpaid = 0; } ?> <tr> <td colspan="9" align="right"><strong>TOTAL</strong></td> <td align="right" style="color:blue;"><strong><?php echo $splrate?></strong></td> <td align="right" style="color:green;"><strong><?php echo $paidtotal?></strong></td> <td align="right" style="color:red;"><strong><?php echo $balancetotal?></strong></td> </tr> </tbody> </table> <div class="noprint"> <p align="center"> <a href="#" onClick="myFunction()" style="border:5px solid; background-color:#093; color:#FFF; padding:8px; text-decoration:none;">PRINT</a> <a href="search_hotelcheckins.php" style="border:5px solid; background-color:#F00; color:#FFF; padding:8px; text-decoration:none;">CLOSE</a> </p> </div> </div>