/
plugin
/
backup
/
4season
/
Upload File
HOME
<html> <head> <title> Make Document </title> <link rel="shortcut icon" type="image/png" href="favicon.ico"/> <style> .box { float: left; width: 200px; height: 100px; margin: 1em; } .after-box { clear: left; } </style> </head> <body> <?php include "mpdf60/mpdf.php"; include "zoho_functions.php"; $IDs = $_GET["ids"]; $date=date( "Y-m-d", strtotime( $_GET["date"])); $get_id=explode("|||",$IDs); $i=0; $data_d=array(); $day=""; $TotalAverages=0; $arrivaltime="2400"; $deptime="2400"; $deptimearr=array(); $e_index=200; $get_data=search_Records("CustomModule1","(Date:".$date.")",1,$e_index); $count=count($get_data['response']['result']['CustomModule1']['row']); while($count==200) { $get_data1=search_Records("CustomModule1","(Date:".$date.")",$e_index,$e_index+200); if($get_data1['response']['error']['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['response']['result']['CustomModule1']['row']); if($count>0) { $get_data = array_merge($get_data['response']['result']['CustomModule1']['row'],$get_data1['response']['result']['CustomModule1']['row']); $e_index=$e_index+200; } else { break; } } $count=count($get_data['response']['result']['CustomModule1']['row']); create_log("log.txt", $count." Bookings are found in this date ".$date); if($get_data['response']['error']['message']=="You crossed your license limit") { echo "Your API limit has been reached!!!"; create_log("log.txt", "Your API limit has been reached!!!"); die; } $z=0; $IDs=""; $datarows=$get_data['response']['result']['CustomModule1']['row']; foreach($datarows as $index=>$value) { foreach($value["FL"] as $key1=>$val1) { if($val1["content"]=="null") { $data_d[$z][$val1["val"]]=""; } else { if(($val1["val"]=="Departure Time")) { $deptime=$val1["content"]; $deptimearr["Departure Time"][$z]=$val1["content"]; } if(($val1["val"]=="Arrival Time")) { $arrivaltime=$val1["content"]; } if(($val1["val"]=="Boat")) { $boat[]=$val1["content"]; } if($val1["val"]=="Day") { $day=$val1["content"]; } if($val1["val"]=="CUSTOMMODULE1_ID") { $IDs.="|||".$val1["content"]; } $data_d[$z][$val1["val"]]=$val1["content"]; } } $z++; } // echo "<pre>";print_r($data_d); // die; for($q=0; $q<count($data_d); $q++ ) { if($data_d[$q]["PORT SCHED"]== "S") { $deptimearr["Departure Time"][$q] = $data_d[$q]["Departure Time"]."1-".$data_d[$q]["PORT SCHED"]; } elseif($data_d[$q]["PORT SCHED"]== "H") { $deptimearr["Departure Time"][$q] = $data_d[$q]["Departure Time"]."2-".$data_d[$q]["PORT SCHED"]; } } $boats=array_unique($boat); sort($boats); //create_log("log.txt", $IDs." these are ids!!!"); $distinct_dep_tim=array_unique($deptimearr["Departure Time"]); sort($distinct_dep_tim,SORT_NUMERIC | SORT_FLAG_CASE); usort($data_d, function($a, $b) { return strcmp($a["Tour Company"], $b["Tour Company"]); }); create_log("log.txt", "Manifest sheet created!!!"); ob_start(); if(empty($boats)) { $html='<div style="width:100%"> <table style="width:100%"> <tr> <td style="text-align:center"> <h3>No record found due to missing Boat values.<h3> </td> </tr> </table> </div>'; $templateHTML = $html; } else { foreach($boats as $key=>$val) { include "tour_detail_template.php"; } $ob = ob_get_clean(); $templateHTML = $ob; } // echo "<pre>";print_r($templateHTML); // die; $mpdf= new mPDF('utf-8', 'A4-L'); $mpdf->ignore_invalid_utf8 = TRUE; $mpdf->keep_table_proportions = true; $mpdf->ignore_table_percents = TRUE; $mpdf->shrink_tables_to_fit=1; $mpdf->WriteHTML(html_entity_decode($templateHTML)); $pdf=$mpdf->Output(); ?> </body></html>