258 lines
15 KiB
PHP
258 lines
15 KiB
PHP
<?php
|
|
class RPT_MNFEST extends RPT
|
|
{
|
|
public function rpt_mnfest_javainit()
|
|
{
|
|
|
|
}
|
|
|
|
public function fn_mnfest_init()
|
|
{
|
|
if(isset($_REQUEST['task'])){$task=trim(strtolower($_REQUEST['task']));}
|
|
if(isset($_POST['task'])){$task=trim(strtolower($_POST['task']));}
|
|
if($_REQUEST||$_POST){if($_REQUEST['sec']||$_POST['sec']){$task=$this->dec($task);}}
|
|
|
|
switch($task)
|
|
{
|
|
case "default":
|
|
$this->fn_default_mnfest();
|
|
break;
|
|
|
|
case $task:
|
|
$task="fn_".$task;
|
|
if(method_exists($this,$task)){$this->$task();}
|
|
break;
|
|
|
|
default:
|
|
$this->fn_default_mnfest();
|
|
break;
|
|
}
|
|
}
|
|
|
|
public function fn_default_mnfest()
|
|
{
|
|
echo $this->FN_CREATEHEADER();
|
|
|
|
echo "<style>
|
|
.besidebtnsave {margin-left:104px;margin-top:-6px;position:absolute;}
|
|
.besidebtnupdate {margin-left:198px;margin-top:-6px;position:absolute;}
|
|
.besidebtndelete {margin-left:288px;margin-top:-6px;position:absolute;}
|
|
</style>";
|
|
echo "<script>
|
|
var myForm,myFormsearch,dgtra;
|
|
function initObject()
|
|
{
|
|
var docheight=$(document).height();
|
|
var docwidth=$(document).width();
|
|
$('#ifrpt').height(docheight-115);
|
|
$('#ifrpt').width('100%');";
|
|
$formdata=array(
|
|
array("type"=>"settings","position"=>"label-left","labelWidth"=>"20","inputWidth"=>"120"),
|
|
array("type"=>"block","width"=>"1040","label"=>"Laporan Histori Deposit",
|
|
"list"=>array(
|
|
array("type"=>"calendar","name"=>"txt_dates","label"=>"","info"=>"true","inputWidth"=>"110","value"=>date("Y-m-d"),"note"=>array("text"=>"[?] Dates"),
|
|
"tooltip"=>"Masukkan Tahun Terlebih dahulu","maxLength"=>"9","className"=>"txtcenter","labelWidth"=>"0","offsetLeft"=>"0"),
|
|
array("type"=>"newcolumn"),
|
|
array("type"=>"combo","name"=>"cbo_idemployee","label"=>"","required"=>"false","info"=>"true","inputWidth"=>"260",
|
|
"tooltip"=>"","maxLength"=>"6","className"=>"txtleft","offsetLeft"=>"10",
|
|
"note"=>array("text"=>"[?] Cashier Name")),
|
|
array("type"=>"newcolumn"),
|
|
array("type"=>"button","name"=>"btnsearch","value"=>"","className"=>"button_find","offsetLeft"=>"5","offsetTop"=>"5","disabled"=>0),
|
|
)
|
|
)
|
|
);
|
|
$this->FN_DHTMLXFORM("myForm","divsearchcategory",$formdata,"");
|
|
// === Form Init
|
|
$arrerror=array("txt_dates"=>"Error Found : Please Insert <b>Dates</b> First. Thank You");
|
|
$this->FN_DHTMLXFORMVALIDATIONERROR("myForm",$arrerror);
|
|
|
|
|
|
// === Init Employee Name
|
|
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_employee|id,fullname')";
|
|
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idemployee","tbl_employee","$urlcbo","");
|
|
|
|
|
|
|
|
$eventbtnsearch="var url='?ajax=1&sec=1&option=".$this->enc("obj_rpt")."&obj=".$this->enc("rpt_mnfest")."&task=".$this->enc("rptload")."';";
|
|
$eventbtnsearch.=" url=url+'&dates='+myForm.getCalendar('txt_dates').getDate(true)+'&idemployee='+myForm.getItemValue('cbo_idemployee');";
|
|
$eventbtnsearch.="document.getElementById('ifrpt').src=url;";
|
|
$eventbtnsearch.="setTimeout(function(){".$this->FN_DHTMLXWINDOWSHIDEPROGRESS().";},2500);";
|
|
$onclickbtnsearch.="if(myForm.validate()){".$this->FN_DHTMLXWINDOWSHOWPROGESS($eventbtnsearch)."}";
|
|
|
|
$filexls="var params='month='+myForm.getItemValue('cbo_month')+'&period='+myForm.getItemValue('txt_period')+'&idsubunit='+myForm.getItemValue('cbo_idsubunit');";
|
|
$filexls.=" params=params+'&idemployee='+myForm.getItemValue('cbo_idemployee')+'&idsubunit='+myForm.getItemValue('cbo_idsubunit');";
|
|
$filexls.="if(myForm.getItemValue('cbo_idsubunit'))";
|
|
$filexls.="{";
|
|
$filexls.=" var urlrpt='?sec=1&xlson=1&xls=".$this->enc("xlshcmabssbnit")."&'+params;";
|
|
$filexls.="}";
|
|
$filexls.="else";
|
|
$filexls.="{";
|
|
$filexls.=" var urlrpt='?sec=1&xlson=1&xls=".$this->enc("xlshcmabs")."&'+params;";
|
|
$filexls.="}";
|
|
$onclickbtnexcel=$filexls;
|
|
$onclickbtnexcel.="a_rpt.href=urlrpt;a_rpt.click();";
|
|
|
|
$arrevent=array(
|
|
array("eventname"=>"onbuttonclick","eventparam"=>"id,val",
|
|
"switch"=>array(
|
|
"btnsearch"=>"$onclickbtnsearch",
|
|
"btnexcel"=>"$onclickbtnexcel"
|
|
)
|
|
)
|
|
);
|
|
|
|
$this->FN_DHTMLXFORMEVENT("myForm",$arrevent);
|
|
|
|
echo " }
|
|
|
|
function fn_grid_loaddata()
|
|
{";
|
|
|
|
echo " }
|
|
window.onresize = function(event) {
|
|
var docheight=$(document).height();
|
|
var docwidth=$(document).width();
|
|
$('#ifrpt').height(docheight-115);
|
|
$('#ifrpt').width('100%');
|
|
//alert(docwidth);
|
|
};
|
|
</script>";
|
|
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 "<table width=\"97%\" border=\"0\">
|
|
<tr>
|
|
<td width=\"90%\" valign=\"top\"><div id=\"divsearchcategory\" style=\"\"></div></td>
|
|
</tr>
|
|
<tr>
|
|
<td valign=\"top\" style=\"padding:8px;background:gray;\">
|
|
<iframe id=\"ifrpt\" name=\"ifrpt\" src=\"\" frameborder=\"0\"width=\"100%\" scrolling=\"auto\" style=\"height:370px;margin-left:0px;background-color:white;\"></iframe>
|
|
</td>
|
|
</tr>
|
|
</table>";
|
|
|
|
echo $this->FN_CREATEFOOTER();
|
|
|
|
}
|
|
|
|
public function fn_rptload()
|
|
{
|
|
$dates=$_REQUEST['dates'];
|
|
$idemployee=$_REQUEST['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="Report<br/>";
|
|
$htmlheader="<span>";
|
|
$htmlheader.=" <table width='100%' style='font-size:11'>";
|
|
$htmlheader.=" <tr>
|
|
<td width='10%'>Reported By</td>
|
|
<td width='2px'>:</td>
|
|
<td>( ".$_SESSION['employeename']." ) Reported : ".date("d M Y H:i:s")." Departure : ".date("d M Y",strtotime($dates))."</td>
|
|
</tr>";
|
|
// $htmlheader.=" <tr>
|
|
// <td>Date Reporting</td>
|
|
// <td>:</td>
|
|
// <td>".date("d M Y H:i:s")."</td>
|
|
// </tr>";
|
|
// $htmlheader.=" <tr>
|
|
// <td>Periode Transaction</td>
|
|
// <td>:</td>
|
|
// <td>".date("d M Y",strtotime($dates))."</td>
|
|
// </tr>";
|
|
$htmlheader.=" <tr>
|
|
<td colspan=\"3\"><img src=\"".PATH_THEME."/images/aportil.jpg\" width=\"100\" height=\"40\" /></td>
|
|
</tr>";
|
|
$htmlheader.=" <tr>
|
|
<td colspan=\"3\">MANIFESTO DE PASSAGEIROS</td>
|
|
</tr>";
|
|
$htmlheader.=" </table>";
|
|
$htmlheader.="</span></br>";
|
|
$htmlheader.="<div style='border-top:1px solid black;'> </div><br/>";
|
|
//$htmlheader.="<table width>";
|
|
|
|
$mpdf->SetHTMLHeader($htmlheader);
|
|
$mpdf->setFooter('{PAGENO} of {nbpg} pages||{PAGENO} of {nbpg} pages') ;
|
|
|
|
//$mpdf->AddPage('L','','','',5,5,5,5);
|
|
$html="<table width='100%' style='font-size:11' cellpadding='0' cellspacing='0'>";
|
|
$html.="<tr>";
|
|
$html.=" <td width='23' style='border-bottom:1px dotted black' rowspan='2'>No.</td>";
|
|
$html.=" <td width='120' style='border-bottom:1px dotted black' rowspan='2'>Nome do passageiros</td>";
|
|
$html.=" <td width='80' style='border-bottom:1px dotted black' rowspan='2'>No. De Bilhete</td>";
|
|
$html.=" <td width='90' style='border-bottom:1px dotted black;text-align:center;' colspan='2'>Sexo</td>";
|
|
$html.=" <td width='80' style='border-bottom:1px dotted black' rowspan='2'>Idade</td>";
|
|
$html.=" <td width='80' style='border-bottom:1px dotted black' rowspan='2'>No. da Cadeira</td>";
|
|
$html.=" <td width='80' style='border-bottom:1px dotted black;' rowspan='2'>Nacionalidade </td>";
|
|
$html.=" <td width='110' style='border-bottom:1px dotted black;' rowspan='2'>No Passprte /ID </td>";
|
|
$html.=" <td style='border-bottom:1px dotted black;' rowspan='2'>Observacao </td>";
|
|
$html.="</tr>";
|
|
$html.="<tr>";
|
|
// $html.=" <td width='23' style='border-bottom:1px dotted black'></td>";
|
|
// $html.=" <td width='80' style='border-bottom:1px dotted black'></td>";
|
|
// $html.=" <td width='80' style='border-bottom:1px dotted black'></td>";
|
|
$html.=" <td style='border-bottom:1px dotted black;text-align:center'>M</td>";
|
|
$html.=" <td style='border-bottom:1px dotted black;text-align:center'>F</td>";
|
|
// $html.=" <td width='80' style='border-bottom:1px dotted black'></td>";
|
|
// $html.=" <td width='80' style='border-bottom:1px dotted black'></td>";
|
|
// $html.=" <td width='80' style='border-bottom:1px dotted black;text-align:right;'></td>";
|
|
// $html.=" <td width='80' style='border-bottom:1px dotted black;text-align:right;'></td>";
|
|
// $html.=" <td width='80' style='border-bottom:1px dotted black;text-align:right;'></td>";
|
|
$html.="</tr>";
|
|
$qry="select id, idship, tiketnumber, voynumber,bod, inctiket, shipnumber, shipname, passengername, idcardtype, cardtype, cardnumber,
|
|
picdata, dates, idroutestart, routenamestart, idrouteend, routenameend, seatnumber, quantity, price, baggageinkg,gender,
|
|
limitbaggage, overlimitbaggage, priceoverinkg, pricebaggage, totalprice from ".DB_APORTIL.".tbl_passenger_tiket
|
|
where isdeleted=0 and status in(0,1) and cast(dates as date)=cast('$dates' as date)
|
|
order by id asc";
|
|
|
|
$rs=$this->selectquery($qry);
|
|
if($rs){
|
|
$i=1;$totalprice=0;
|
|
while($rw=$this->data_row_object($rs)){
|
|
$html.="<tr>";
|
|
$html.=" <td style='height:20px;font-size:9px'>$i.</td>";
|
|
$html.=" <td style='font-size:9px'>".$rw->passengername."</td>";
|
|
$html.=" <td style='font-size:9px'>".$rw->inctiket."</td>";
|
|
$m="M";$f="";
|
|
if($rw->gender=='F'){$m="";$f="F";}
|
|
$html.=" <td style='font-size:9px;text-align:center;'>".$m."</td>";
|
|
$html.=" <td style='font-size:9px;text-align:center;'>".$f."</td>";
|
|
$html.=" <td style='font-size:9px'>".date("Y-m-d",strtotime($rw->bod))."</td>";
|
|
$html.=" <td style='font-size:9px'>Economy</td>";
|
|
$html.=" <td style='font-size:9px'>Timor Leste</td>";
|
|
$html.=" <td style='font-size:9px'>".$rw->cardtype." / ".$rw->cardnumber."</td>";
|
|
$html.=" <td style='font-size:9px'></td>";
|
|
$html.="</tr>";
|
|
$i+=1;
|
|
// $totalprice+=$rw->totalprice;
|
|
}
|
|
// $html.="<tr>";
|
|
// $html.=" <td colspan='9' style='border-top:1px dotted black;text-align:right'>Grand Total : </td>";
|
|
// $html.=" <td style='border-top:1px dotted black;text-align:right;font-weight:bold'>\$".number_format($totalprice,2)."</td>";
|
|
// $html.="</tr>";
|
|
|
|
}
|
|
$html.="</table>";
|
|
//$html=$qry;
|
|
//$mpdf->SetDisplayMode('fullwidth');
|
|
$mpdf->WriteHTML($html);
|
|
// $mpdf->Output();
|
|
$mpdf->Output('mnfestRepot_'.date("Ymd").'.pdf','I');
|
|
|
|
exit;
|
|
}
|
|
}
|
|
?>
|