/
plugin
/
backup
/
4season
/
Upload File
HOME
<head> <style> /* @media screen and (min-width: 25em){ html { font-size: calc( 16px + (24 - 16) * (100vw - 400px) / (800 - 400) ); } } */ body { /* width: 100%; */ font-size: 12px; } .firstSection { width: 100%; height: auto; margin-bottom: 100px; } .secondSection { width: 100%; height: auto; border-top: 2px solid black; } .firstLeftDiv { float: left; /* width: 30%; */ padding-top: 50px; } .firstTableDiv { width: 85%; float: right; } .firstLeftDivInner { border: 1px solid black; font-size: 10px; } .tdDash { border-bottom: 1px solid black; width: 50%; } .firstTable { width: 100%; float: right; font-size: 10px; } .firstLeftDivInnerTable { font-size: 10px; } .tdWithLeftBottomBorder { border-left: 1px solid black; border-bottom: 1px solid black; } .tdWithfullBorder { border: 1px solid black; } .alignCenter { text-align: center; } h4 { text-align: center; } </style> </head> <?php // ini_set('display_errors', 1); // ini_set('display_startup_errors', 1); // error_reporting(E_ALL); require_once 'Classes/PHPExcel.php'; include "zoho_functions.php"; $dates = explode(",",$_GET['date']); // echo "<pre>"; // print_r($dates); // die(); $date=date( "Y-m-d", strtotime( $dates[0])); // echo "<pre>"; // print_r($date); // die(); $e_index=200; $get_data=search_Records("Bookings","\'".$date."\'",1,$e_index); // echo '<pre>'; // print_r($get_data); // die(); $count=count($get_data['data']); // echo "<pre>"; // echo $count; // die(); while($count==200) { $get_data1=search_Records("Bookings","\'".$date."\'",$e_index,$e_index+200); if($get_data1['message']=="You crossed your license limit") { echo "Your API limit has been reached!!!"; create_log("log.txt", "Your API limit has been reached!!!"); die; } $count=count($get_data1['data']); if($count>0) { $get_data = array_merge($get_data['data'],$get_data1['data']); $e_index=$e_index+200; } else { break; } } $count=count($get_data['data']); // echo "<pre>"; // echo $count; // die(); if($get_data['message']=="You crossed your license limit") { echo "Your API limit has been reached!!!"; die; } $z=0; $IDs=""; $datarows=$get_data['data']; // echo "<pre>"; // print_r($datarows); // die(); foreach($datarows as $index=>$value) { // echo "<pre>"; // print_r($value); // die(); $data_d[$z]=$value; // foreach($value["FL"] as $key1=>$val1) // { // if($val1["content"]=="null") // { // $data_d[$z][$val1["val"]]=""; // } // else // { // $data_d[$z][$val1["val"]]=$val1["content"]; // } // } $z++; } // die; // echo "<pre>";print_r($data_d);die; //Create a PHPExcel object //$objPHPExcel = new PHPExcel(); //Set document properties //$objPHPExcel->getProperties()->setCreator("SAIFULLAH") // ->setLastModifiedBy("SAIFULLAH Techloyce") // ->setTitle("User's Information") // ->setSubject("User's Personal Data") // ->setDescription("Description of User's") // ->setKeywords("") // ->setCategory(""); // //// Set default font //$objPHPExcel->getDefaultStyle()->getFont()->setName('Arial') // ->setSize(10); // ////Set the first row as the header row //$objPHPExcel->getActiveSheet()->setCellValue('A1', 'Booking ID') // ->setCellValue('B1', 'Booking Name') // ->setCellValue('C1', 'Date') // ->setCellValue('D1', 'Day') // ->setCellValue('E1', 'Departure_Time') // ->setCellValue('F1', 'Arrival_Time') // ->setCellValue('G1', 'ADULT') // ->setCellValue('H1', 'INDY_Adult') // ->setCellValue('I1', 'Child') // ->setCellValue('J1', 'INDY_Child') // ->setCellValue('K1', 'Week') // ->setCellValue('L1', 'Book To') // ->setCellValue('M1', 'BookingType') // ->setCellValue('N1', 'Tour') // ->setCellValue('O1', 'Tour_Company') // ->setCellValue('P1', 'Averages') // ->setCellValue('Q1', 'Total_Averages') // ->setCellValue('R1', 'PRE_LIM_PAX') // ->setCellValue('S1', 'Total_PRE_LIM_PAX') // ->setCellValue('T1', 'Operator Allocation') // ->setCellValue('U1', 'Pairs') // ->setCellValue('V1', 'PAIR_ORDER') // ->setCellValue('W1', 'VocherNo') // ->setCellValue('X1', 'COMP') // ->setCellValue('Y1', 'Tier') // ->setCellValue('Z1', 'Port Sched') // ->setCellValue('AA1', 'Boat') // ->setCellValue('AB1', 'Total Pax') // ->setCellValue('AC1', 'Ship') // ->setCellValue('AD1', 'Invoice'); // ////Rename the worksheet //$objPHPExcel->getActiveSheet()->setTitle('USER INFO'); // ////Set active worksheet index to the first sheet, so Excel opens this as the first sheet //$objPHPExcel->setActiveSheetIndex(0); //------------------------------------------------------------------------------------------- $count=1; ?> <body onload="window.print()"> <!-- <button onclick="window.print()" alignCenter>Print this page</button> --> <!-- First Section --> <div class="firstSection"> <h3>MANIFEST FOR: RM <?= $data_d[0]["Day"] ?> <?=$data_d[0]["Arrival_Date1"] ?></h3> <hr /> <?php // echo "<pre>"; // echo "before"; asort($data_d); // echo "after"; // print_r(array_unique($data_d["Depart_TIME"])); // die; $arrayCont = 0; $varCont = 0; ${'data_d'.$arrayCont} = array(); $departureTime = $data_d[0]['Depart_TIME']; foreach ($data_d as $value) { // echo "<pre>"; // print_r($value); if($value['Depart_TIME'] != $departureTime) { $departureTime = $value['Depart_TIME']; $arrayCont++; $varCont = 0; } ${'data_d'.$arrayCont}[$varCont] = $value; $varCont++; } // echo "<pre>"; // echo "now its working"; // for($j=0;$j<=$arrayCont;$j++) // { // print_r(${'data_d'.$j}); // echo ".....ended here.....<br/><br/>"; // } // print_r(${'data_d'.'2'}); // die(); for($j=0;$j<=$arrayCont;$j++) { // print_r(${'data_d'.$j}); // echo ".....ended here.....<br/><br/>"; $depTime = ${'data_d'.$j}[0]["Depart_TIME"]; $portSched = ${'data_d'.$j}[0]["PORT_SCHED"]; $boat = ${'data_d'.$j}[0]["Boat"]; $totChar = strlen($depTime); if ($j == $arrayCont) { ?> <div class="firstSection"> <?php } else { ?> <div class="firstSection" style="page-break-after: always;"> <?php } ?> <div class="firstLeftDiv"> <?php if($totChar == 3) { $hour = substr($depTime,0,1); $minutes = substr($depTime,1,2); ?> <strong><?=$hour . ":" . $minutes . " AM"?><br /><?=$portSched?><br /><?=$boat?><br /></strong> <?php } elseif ($depTime < 1200 || $depTime >= 2400) { $hour = substr($depTime,0,2); $minutes = substr($depTime,2,2); ?> <strong><?=$hour . ":" . $minutes . " AM"?><br /><?=$portSched?><br /><?=$boat?><br /></strong> <?php } else if($totChar == 4) { $hour = substr($depTime,0,2); switch ($hour) { case "13": $hour = "01"; break; case "14": $hour = "02"; break; case "15": $hour = "03"; break; case "16": $hour = "04"; break; case "17": $hour = "05"; break; case "18": $hour = "06"; break; case "19": $hour = "07"; break; case "20": $hour = "08"; break; case "21": $hour = "09"; break; case "22": $hour = "10"; break; case "23": $hour = "11"; break; // case "24": // $hour = "12"; // break; } $minutes = substr($depTime,2,2); ?> <strong><?=$hour . ":" . $minutes . " PM"?><br /><?=$portSched?><br /><?=$boat?><br /></strong> <?php } ?> <div class="firstLeftDivInner"> <table class="firstLeftDivInnerTable"> <tr> <td>Boat</td> <td class="tdDash"></td> </tr> <tr> <td>Clicker Ct</td> <td class="tdDash"></td> </tr> <tr> <td>A/C</td> <td class="tdDash"></td> </tr> <tr> <td>Dept Time</td> <td class="tdDash"></td> </tr> </table> </div> <h4>CIA / PC</h4> </div> <div class="firstTableDiv"> <table cellpadding="7" cellspacing="5" class="firstTable"> <thead> <tr> <th>COMPANY</th> <th>TOUR</th> <th>SHIP</th> <th>PRE <br /> LIM</th> <th>PAX# <br /> AD</th> <th>PAX# <br /> CHILD</th> <th>PAX# <br /> CMP</th> <th>VOUCHER <br />/ TICKET#</th> </tr> </thead> <tbody> <?php $totPreLimPax = 0; $totAdult = 0; $totChild = 0; $totComp = 0; for($n=0; $n<count(${'data_d'.$j}); $n++) { $booking_id =${'data_d'.$j}[$n]["id"]; $BookingName = ${'data_d'.$j}[$n]["Name"]; $Date = ${'data_d'.$j}[$n]["Arrival_Date1"]; if(empty($Date) || $Date == "null"){ $Date = " "; } $Day = ${'data_d'.$j}[$n]["Day"]; if(empty($Day) || $Day == "null"){ $Day = " "; } $Departure_Time = ${'data_d'.$j}[$n]["Depart_TIME"]; if(empty($Departure_Time) || $Departure_Time == "null"){ $Departure_Time = " "; } $Arrival_Time = ${'data_d'.$j}[$n]["Arriv_TIME"]; if(empty($Arrival_Time) || $Arrival_Time == "null"){ $Arrival_Time = " "; } $Week = ${'data_d'.$j}[$n]["Week"]; if(empty($Week) || $Week == "null"){ $Week = " "; } $BookedTo = ${'data_d'.$j}[$n]["Booked_To"]; if(empty($BookedTo) || $BookedTo == "null"){ $BookedTo = " "; } $Child = ${'data_d'.$j}[$n]["CHILD"]; if(empty($Child) || $Child == "null"){ $Child = ""; } $totChild += $Child; $INDY_Child = ${'data_d'.$j}[$n]["INDY_Child"]; if(empty($INDY_Child) || $INDY_Child == "null"){ $INDY_Child = " "; } $ADULT = ${'data_d'.$j}[$n]["ADULT"]; if(empty($ADULT) || $ADULT == "null"){ $ADULT = " "; } $totAdult += $ADULT; $INDY_Adult = ${'data_d'.$j}[$n]["INDY_Adult"]; if(empty($INDY_Adult) || $INDY_Adult == "null"){ $INDY_Adult = " "; } $Averages = ${'data_d'.$j}[$n]["Averages"]; if(empty($Averages) || $Averages == "null"){ $Averages = " "; } $Total_Averages = ${'data_d'.$j}[$n]["Total Averages"]; if(empty($Total_Averages) || $Total_Averages == "null"){ $Total_Averages = " "; } $PRE_LIM_PAX = ${'data_d'.$j}[$n]["PRE_LIM_PAX"]; if(empty($PRE_LIM_PAX) || $PRE_LIM_PAX == "null"){ $PRE_LIM_PAX = " "; } $totPreLimPax += $PRE_LIM_PAX; $Total_PRE_LIM_PAX = ${'data_d'.$j}[$n]["Total PRE-LIM PAX"]; if(empty($Total_PRE_LIM_PAX) || $Total_PRE_LIM_PAX == "null"){ $Total_PRE_LIM_PAX = " "; } $TOTAL_PAX = ${'data_d'.$j}[$n]["TOTAL PAX"]; if(empty($TOTAL_PAX) || $TOTAL_PAX == "null"){ $TOTAL_PAX = " "; } $Tour = ${'data_d'.$j}[$n]["Tour"]["id"]; if(empty($Tour) || $Tour == "null"){ $Tour = " "; } $res = get_Record_by_id("Tours",$Tour); $tourName = $res["data"][0]["Name"]; $TourCompany = ${'data_d'.$j}[$n]["Tour_Company"]["id"]; if(empty($TourCompany) || $TourCompany == "null"){ $TourCompany = " "; } $res = get_Record_by_id("Accounts",$TourCompany); $tourCompanyName = $res["data"][0]["Account_Name"]; $operatorAllocation = ${'data_d'.$j}[$n]["OPERATOR_ALLOCATION"]; if(empty($operatorAllocation) || $operatorAllocation == "null"){ $operatorAllocation = " "; } $COMP = ${'data_d'.$j}[$n]["COMP"]; if(empty($COMP) || $COMP == "null"){ $COMP = " "; } $totComp += $COMP; $VocherNo = ${'data_d'.$j}[$n]["VOUCHER_No"]; if(empty($VocherNo) || $VocherNo == "null"){ $VocherNo = " "; } $Ship = ${'data_d'.$j}[$n]["Ship"]["id"]; if(empty($Ship) || $Ship == "null"){ $Ship = " "; } $res = get_Record_by_id("Ships",$Ship); $shipName = $res["data"][0]["Name"]; $BookingType = ${'data_d'.$j}[$n]["Booking_Type"]; if(empty($BookingType) || $BookingType == "null"){ $BookingType = " "; } $PAIRS = ${'data_d'.$j}[$n]["PAIRS"]; if(empty($PAIRS) || $PAIRS == "null"){ $PAIRS = " "; } $PAIR_ORDER = ${'data_d'.$j}[$n]["PAIR_ORDER"]; if(empty($PAIR_ORDER) || $PAIR_ORDER == "null"){ $PAIR_ORDER = " "; } $Tier = ${'data_d'.$j}[$n]["Tier"]; if(empty($Tier) || $Tier == "null"){ $Tier = " "; } // $portSched = ${'data_d'.$j}[$n]["PORT_SCHED"]; // if(empty($portSched) || $portSched == "null"){ // $portSched = " "; // } // $Boat = ${'data_d'.$j}[$n]["Boat"]; // if(empty($Boat) || $Boat == "null"){ // $Boat = " "; // } $Invoice = ${'data_d'.$j}[$n]["Invoice1"]; if(empty($Invoice) || $Invoice == "null"){ $Invoice = " "; } ?> <tr> <td class="tdWithLeftBottomBorder"><strong><?=$tourCompanyName?></strong></td> <td class="tdWithLeftBottomBorder"><?=$tourName?></td> <td class="tdWithLeftBottomBorder"><?=$shipName?></td> <td class="tdWithfullBorder alignCenter"><?=$PRE_LIM_PAX?></td> <td class="tdWithfullBorder alignCenter"><?=$ADULT?></td> <td class="tdWithfullBorder alignCenter"><?=$Child?></td> <td class="tdWithfullBorder alignCenter"><?=$COMP?></td> <td class="tdWithfullBorder alignCenter"><?=$VocherNo?></td> </tr> <?php } $total = $totPreLimPax + $totAdult + $totChild + $totComp ; if($totPreLimPax == 0) { $totPreLimPax = " "; } if($totAdult == 0) { $totAdult = " "; } if($totChild == 0) { $totChild = " "; } if($totComp == 0) { $totComp = " "; } if($total == 0) { $total = " "; } ?> <tr> <td> </td> <td class="alignCenter"><strong>BOOKED TO:</strong></td> <td class="tdWithfullBorder alignCenter"></td> <td class="tdWithfullBorder alignCenter"><?=$totPreLimPax?></td> <td class="tdWithfullBorder alignCenter"><?=$totAdult?></td> <td class="tdWithfullBorder alignCenter"><?=$totChild?></td> <td class="tdWithfullBorder alignCenter"><?=$totComp?></td> <td class="alignCenter"><strong>=</strong> <?=$total?> <strong>TOTAL</strong></td> </tr> </tbody> </table> </div> <div style="clear:both"></div> </div> <div style="clear:both"></div> <?php } ?> </div> </body>