dec($task);}} switch($task) { case "default": $this->fn_default_sum(); break; case $task: $task="fn_".$task; if(method_exists($this,$task)){$this->$task();} break; default: $this->fn_default_sum(); break; } } public function fn_default_sum() { echo $this->FN_CREATEHEADER(); echo ""; echo ""; echo $this->FN_CLOSEHEADER(); echo $this->FN_CREATEBODY("white"); echo ""; echo " "; echo "
Nakroma Passenger Performance Period ".date("Y")."
"; $qry="select totalseat from ".DB_APORTIL.".tbl_ship_information where id=1"; if($this->fn_row_isexists($qry)){ $totalseat=$this->fn_get_fieldvalue("totalseat",$qry); $j=10;$s=5; for($i=1;$i<=$totalseat;$i++){ $colors="#ecf0f1";$colorfont="black"; if($i==1||$i==($j+1)){ echo ""; } // Content // === Dili atauro $qrycheckin="select inctiket,status from ".DB_APORTIL.".tbl_passenger_tiket where inctiket='$i' and idship=1 and idroutestart=1 and cast(dates as date)=cast(now() as date)"; if($this->fn_row_isexists($qrycheckin)){ $colorfont="white"; $status=$this->fn_get_fieldvalue("status",$qrycheckin); $colors="#f1c40f"; if($status==1){$colors="#3498db";} if($status==-2){$colors="#ecf0f1";$colorfont="black";} } echo ""; if($i==$s){ echo ""; } if($i%10==0){ $j+=10;$s+=10; echo ""; } } } //$arr=array("4-H"=>"#f1c40f","5-C"=>"#f1c40f","5-F"=>"#f1c40f","5-G"=>"#f1c40f","5-H"=>"#f1c40f","20-C"=>"#2980b9","20-D"=>"#2980b9","30-D"=>"#2980b9"); // === Seat Code // echo ""; // for($h=1;$h<=10;$h++){ // if($h==1){ // echo ""; // } // echo ""; // if($h==5){ // echo ""; // } // } // echo ""; // // === SEAT Number // for($i=1;$i<=30;$i++){ // echo ""; // for($j=1;$j<=10;$j++) // { // $colors="#ecf0f1"; //if($i==4&&$j==8){$colors="#f1c40f";} // if(array_key_exists("$i-".chr(64+$j),$arr)){ // $colors=$arr["$i-".chr(64+$j)]; // } // if($j==1){ // echo ""; // } // echo ""; // if($j==5){ // echo ""; // } // } // echo ""; // } echo "
Ship : Nakroma , Rute : Dili-Atauro
$i
 
  ".chr(64+$h)." 
$i. //
//   //
//
 
Nakroma Passenger
Period ".date("Y")."
Atauro : 55% (1.5K) Oekuse : 45% (800)
Nakroma Manifest
Nacroma Tonase : 200 ton
Threshold : 180 ton
Unit Qty ( \$ ) ( ton )
Passenger Person 300 \$1.800 15.0
Vehichle unit 10 \$6.800 20.0
Non Vehichle unit 10 \$4.700 18.0
Total 330 \$13.300 54.0
GAP ( Ton ) -> 180.0 - 54.0 =
126.0
Tonase Status  :  GOOD
"; echo $this->FN_CREATEFOOTER(); } public function fn_getstinfo(){ $idship=$_REQUEST['idship']; $idroutestart=$_REQUEST['idroutestart']; $arr=array(); $qry="select totalseat from ".DB_APORTIL.".tbl_ship_information where id=$idship"; //echo $qry;return false; if($this->fn_row_isexists($qry)){ $totalseat=$this->fn_get_fieldvalue("totalseat",$qry); for($i=1;$i<=$totalseat;$i++){ $colors="#ecf0f1";$colorfont="black"; // === Dili atauro $qrycheckin="select inctiket,status from ".DB_APORTIL.".tbl_passenger_tiket where inctiket='$i' and idship=$idship and idroutestart=$idroutestart and cast(dates as date)=cast(now() as date)"; //echo $qrycheckin;return false; if($this->fn_row_isexists($qrycheckin)){ $status=$this->fn_get_fieldvalue("status",$qrycheckin); $colors="#f1c40f";$colorfont="white"; if($status==1){$colors="#3498db";} if($status==-2){$colors="#ecf0f1";$colorfont="black";} // array_push($arr,array("$i"=>$colors)); array_push($arr,array("ndx"=>$i,"colors"=>$colors,"colorfont"=>$colorfont)); } } } echo json_encode($arr); } } ?>