dec($task);}}
switch($task)
{
case "default":
$this->fn_default_monthly();
break;
case $task:
$task="fn_".$task;
if(method_exists($this,$task)){$this->$task();}
break;
default:
$this->fn_default_monthly();
break;
}
}
public function fn_default_monthly()
{
echo $this->FN_CREATEHEADER();
echo "";
echo "";
echo $this->FN_CLOSEHEADER();
echo $this->FN_CREATEBODY("e8f1ff");
echo $this->CREATE_LINK("","xls","","_self","","","margin-top:-122px;position:absolute;","id=\"a_rpt\" name=\"a_rpt\"");
echo "
";
echo $this->FN_CREATEFOOTER();
}
public function fn_default_monthlyold()
{
echo $this->FN_CREATEHEADER();
echo "";
echo "";
echo $this->FN_CLOSEHEADER();
echo $this->FN_CREATEBODY("e8f1ff");
echo $this->CREATE_LINK("","xls","","_self","","","margin-top:-122px;position:absolute;","id=\"a_rpt\" name=\"a_rpt\"");
echo "";
echo $this->FN_CREATEFOOTER();
}
public function fn_rptload()
{
//$dates=$_REQUEST['dates'];
$period1=$_REQUEST['period1'];
$period1name=$this->getFullNameOfMonth($period1);
$period2=$_REQUEST['period2'];
$period2name=$this->getFullNameOfMonth($period2);
$years=$_REQUEST['years'];
$idemployee=$_REQUEST['idemployee'];
if($idemployee){
$nik=$this->fn_get_fieldvalue("nik","select nik from ".DB_APORTIL.".tbl_employee where id='$idemployee'");
}
$totdays=cal_days_in_month(CAL_GREGORIAN,$month,$period);
include("lib/mpdf/mpdf.php");
//$mpdf=new mPDF('L','A4-L','','',3,3,29,10);
$top=32;
$mpdf = new mPDF('c', 'A4', 2, 2, 5, 5, $top, $top, 9, 9, 'L');
$mpdf->SetDisplayMode('fullpage');
//$mpdf=new mPDF('c', 'A4-L');
//$mpdf=new mPDF('L','','','','',25,25,55,45,18,12);
// LOAD a stylesheet
$stylesheet = file_get_contents('lib/mpdf/css/mpdfstyleA4.css');
$mpdf->WriteHTML($stylesheet,1); // The parameter 1 tells that this is css/style only and no body/html/text
$htmlheader="Ticketing Monthly Report
";
$htmlheader.="";
$htmlheader.=" ";
$htmlheader.="
| Reported By |
: |
( ".$_SESSION['employeename']." ) |
";
$htmlheader.="
| Date Reporting |
: |
".date("d M Y H:i:s")." |
";
$htmlheader.="
| Periode Transaction |
: |
".$period1name." s.d ".$period2name." $years |
";
$htmlheader.="
";
$htmlheader.="";
$htmlheader.="
";
//$htmlheader.="";
$mpdf->SetHTMLHeader($htmlheader);
$mpdf->setFooter('{PAGENO} of {nbpg} pages||{PAGENO} of {nbpg} pages') ;
//$mpdf->AddPage('L','','','',5,5,5,5);
$html="";
$html.="";
$html.=" | No. | ";
$html.=" Tiket Number | ";
$html.=" Voy. Number | ";
//$html.=" Ship Number | ";
$html.=" Passenger | ";
$html.=" Identity | ";
$html.=" Route | ";
$html.=" Price | ";
$html.=" Baggage ( kg ) | ";
$html.=" Over Baggage | ";
$html.=" Total Price | ";
$html.="
";
$swherenik="";
if($idemployee){
$swherenik="iby='$nik' and ";
}
$qry="select id, idship, tiketnumber, voynumber, inctiket, shipnumber, shipname, passengername, idcardtype, cardtype, cardnumber,
picdata, dates, idroutestart, routenamestart, idrouteend, routenameend, seatnumber, quantity, price, baggageinkg,
limitbaggage, overlimitbaggage, priceoverinkg, pricebaggage, totalprice from ".DB_APORTIL.".tbl_passenger_tiket
where $swherenik isdeleted=0 and status in(0,1) and (month(dates)>=$period1 and month(dates)<=$period2) and years='$years'
order by id asc";
$rs=$this->selectquery($qry);
if($rs){
$i=1;$totalprice=0;
while($rw=$this->data_row_object($rs)){
$html.="";
$html.=" | $i. | ";
$html.=" ".$rw->tiketnumber." | ";
$html.=" ".$rw->voynumber." | ";
//$html.=" ".$rw->shipnumber." | ";
$html.=" ".$rw->passengername." | ";
$html.=" ".$rw->cardtype."/".$rw->cardnumber." | ";
$html.=" ".$rw->routenamestart."-".$rw->routenameend." | ";
$html.=" \$".number_format($rw->price,2)." | ";
$html.=" ".$rw->baggageinkg." kg | ";
$html.=" \$".number_format($rw->pricebaggage,2)." | ";
$html.=" \$".number_format($rw->totalprice,2)." | ";
$html.="
";
$i+=1;
$totalprice+=$rw->totalprice;
}
$html.="";
$html.=" | Grand Total : | ";
$html.=" \$".number_format($totalprice,2)." | ";
$html.="
";
}
$html.="
";
//$html=$qry;
//$mpdf->SetDisplayMode('fullwidth');
$mpdf->WriteHTML($html);
// $mpdf->Output();
$mpdf->Output('DailyRepot_'.date("Ymd").'.pdf','I');
exit;
}
}
?>