Add version files and new GIF images for UI components

This commit is contained in:
2025-04-03 06:26:44 +07:00
commit 663c28a2ea
5219 changed files with 772528 additions and 0 deletions

View File

@ -0,0 +1,27 @@
<?php
class BASE_RPT extends MY_DHTMLX
{
public function fn_page_construct()
{
}
}
class RPT_HTML extends BASE_RPT
{
public function fn_page_home()
{
}
public function fn_url_home()
{
return "$('#uri').val('');$('#fm').prop('target','_self');$('#fm').submit();";
}
public function fn_url_rpt_daily()
{
return "$('#uri').val('ajax=0&sec=1&option=c437a49a4d38bc36b080e173f2571956&obj=d14750844e341accb9bf5d04bc12c11d&task=de7eb57f52fc4d8a6fef759e7bb0844b');$('#fm').prop('target','_self');$('#fm').submit();";
}
}
?>

39
objectx/obj_rpt/rpt.php Normal file
View File

@ -0,0 +1,39 @@
<?php
require_once($pg.".html.php");
class RPT extends RPT_HTML
{
}
$cl=new RPT();
if(isset($_REQUEST['task'])){$case=$_REQUEST['task'];}
if(isset($_POST['task'])){$case=$_POST['task'];}
if(isset($_REQUEST['obj'])){$obj=$_REQUEST['obj'];}
if(isset($_POST['obj'])){$obj=$_POST['obj'];}
if($_REQUEST){if($_REQUEST['sec']){$case=$cl->dec($case);$obj=$cl->dec($obj);}}
if(file_exists(PATH_OBJECT."/$option/$obj.php"))
{
require_once("$obj.php");
$className=strtoupper($obj);
$clfile=new $className();
$fn_init_java=$className."_javainit";
$init_java=trim($_REQUEST['init_java']);if($init_java){$clfile->$fn_init_java();}
$case=$obj;
}
if(!$case){$case=$obj;if(!file_exists(PATH_OBJECT."/$option/$obj.php")){$cl->under_construction();}}
$sptask=explode("_",$case);$modulename=$sptask[1];$fn_module_init="fn_".$modulename."_init";
switch($case)
{
case "rpt_$modulename":
$clfile->$fn_module_init();
break;
}
?>

View File

@ -0,0 +1,241 @@
<?php
class RPT_DAILY extends RPT
{
public function rpt_daily_javainit()
{
}
public function fn_daily_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_daily();
break;
case $task:
$task="fn_".$task;
if(method_exists($this,$task)){$this->$task();}
break;
default:
$this->fn_default_daily();
break;
}
}
public function fn_default_daily()
{
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,employeename')";
$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_daily")."&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="Ticketing Daily Report<br/>";
$htmlheader.="<span>";
$htmlheader.=" <table width='100%' style='font-size:11'>";
$htmlheader.=" <tr>
<td width='20%'>Reported By</td>
<td width='2px'>:</td>
<td>( ".$_SESSION['employeename']." )</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.=" </table>";
$htmlheader.="</span></br>";
$htmlheader.="<div style='border-top:1px solid black;'>&nbsp;</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:12' cellpadding='0' cellspacing='0'>";
$html.="<tr>";
$html.=" <td width='23' style='border-bottom:1px dotted black'>No.</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black'>Tiket Number</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black'>Voy. Number</td>";
//$html.=" <td width='80' style='border-bottom:1px dotted black'>Ship Number</td>";
$html.=" <td width='100' style='border-bottom:1px dotted black'>Passenger</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black'>Identity</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black'>Route</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black;text-align:right;'>Price&nbsp;</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black;text-align:right;vertical-align: middle;'>Baggage <br/>( kg )</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black;text-align:right'>Over<br/>Baggage</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black;text-align:right'>Total Price&nbsp;</td>";
$html.="</tr>";
$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 iby='$nik' and isdeleted=0 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'>$i.</td>";
$html.=" <td>".$rw->tiketnumber."</td>";
$html.=" <td>".$rw->voynumber."</td>";
//$html.=" <td>".$rw->shipnumber."</td>";
$html.=" <td>".$rw->passengername."</td>";
$html.=" <td>".$rw->cardtype."/".$rw->cardnumber."</td>";
$html.=" <td>".$rw->routenamestart."-".$rw->routenameend."</td>";
$html.=" <td style='text-align:right;'>\$".number_format($rw->price,2)."</td>";
$html.=" <td style='text-align:right;'>".$rw->baggageinkg." kg</td>";
$html.=" <td style='text-align:right;'>\$".number_format($rw->pricebaggage,2)."</td>";
$html.=" <td style='text-align:right;'>\$".number_format($rw->totalprice,2)."</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('DailyRepot_'.date("Ymd").'.pdf','I');
exit;
}
}
?>

View File

@ -0,0 +1,258 @@
<?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;'>&nbsp;</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&nbsp;</td>";
$html.=" <td width='110' style='border-bottom:1px dotted black;' rowspan='2'>No Passprte /ID&nbsp;</td>";
$html.=" <td style='border-bottom:1px dotted black;' rowspan='2'>Observacao&nbsp;</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;
}
}
?>

View File

@ -0,0 +1,402 @@
<?php
class RPT_MONTHLY extends RPT
{
public function rpt_monthly_javainit()
{
}
public function fn_monthly_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_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 "<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"=>"combo","name"=>"cbo_period1","label"=>"","info"=>"true","inputWidth"=>"110","value"=>(int)date("m"),"note"=>array("text"=>"[?] Start"),
"tooltip"=>"Masukkan Bulan Awal Terlebih dahulu","maxLength"=>"20","className"=>"txtcenter","labelWidth"=>"0","offsetLeft"=>"0"),
array("type"=>"newcolumn"),
array("type"=>"label","name"=>"lblsd","label"=>"s.d","offsetLeft"=>"10"),
array("type"=>"newcolumn"),
array("type"=>"combo","name"=>"cbo_period2","label"=>"","info"=>"true","inputWidth"=>"110","value"=>(int)date("m"),"note"=>array("text"=>"[?] End"),
"tooltip"=>"Masukkan Bulan Akhir Terlebih dahulu","maxLength"=>"20","className"=>"txtcenter","labelWidth"=>"0","offsetLeft"=>"0"),
array("type"=>"newcolumn"),
array("type"=>"input","name"=>"txt_years","label"=>"","info"=>"true","inputWidth"=>"110","value"=>date("Y"),"note"=>array("text"=>"[?] Years"),
"tooltip"=>"Masukkan Tahun Terlebih dahulu","maxLength"=>"9","className"=>"txtcenter","labelWidth"=>"0","offsetLeft"=>"10"),
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_years"=>"Error Found : Please Insert <b>Years</b> First. Thank You",
"cbo_period1"=>"Error Found : Please Insert <b>Start Month</b> First. Thank You",
"cbo_period2"=>"Error Found : Please Insert <b>End Month</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,employeename')";
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idemployee","tbl_employee","$urlcbo","");
$arrval=array();
array_push($arrval,array("value"=>"","text"=>""));
for($i=1;$i<=12;$i++)
{
$monthname=$this->FN_GETMONTHNAME($i);
array_push($arrval,array("value"=>$i,"text"=>$monthname));
}
$this->FN_COMBOVALIDATIONVALUEARRAY("myForm","cbo_period1",$arrval);
$this->FN_COMBOVALIDATIONVALUEARRAY("myForm","cbo_period2",$arrval);
$eventbtnsearch="var url='?ajax=1&sec=1&option=".$this->enc("obj_rpt")."&obj=".$this->enc("rpt_monthly")."&task=".$this->enc("rptload")."&years='+myForm.getItemValue('txt_years');";
$eventbtnsearch.=" url=url+'&period1='+myForm.getItemValue('cbo_period1')+'&period2='+myForm.getItemValue('cbo_period2')+'&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"=>""
)
)
);
$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_default_monthlyold()
{
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"=>"combo","name"=>"cbo_period1","label"=>"","info"=>"true","inputWidth"=>"110","value"=>(int)date("m"),"note"=>array("text"=>"[?] Start"),
"tooltip"=>"Masukkan Bulan Awal Terlebih dahulu","maxLength"=>"20","className"=>"txtcenter","labelWidth"=>"0","offsetLeft"=>"0"),
array("type"=>"newcolumn"),
array("type"=>"label","name"=>"lblsd","label"=>"s.d","offsetLeft"=>"10"),
array("type"=>"newcolumn"),
array("type"=>"combo","name"=>"cbo_period2","label"=>"","info"=>"true","inputWidth"=>"110","value"=>(int)date("m"),"note"=>array("text"=>"[?] End"),
"tooltip"=>"Masukkan Bulan Akhir Terlebih dahulu","maxLength"=>"20","className"=>"txtcenter","labelWidth"=>"0","offsetLeft"=>"0"),
array("type"=>"newcolumn"),
array("type"=>"input","name"=>"txt_years","label"=>"","info"=>"true","inputWidth"=>"110","value"=>date("Y"),"note"=>array("text"=>"[?] Years"),
"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_years"=>"Error Found : Please Insert <b>Years</b> First. Thank You",
"cbo_period1"=>"Error Found : Please Insert <b>Start Month</b> First. Thank You",
"cbo_period2"=>"Error Found : Please Insert <b>End Month</b> First. Thank You"
);
$this->FN_DHTMLXFORMVALIDATIONERROR("myForm",$arrerror);
$arrval=array();
array_push($arrval,array("value"=>"","text"=>""));
for($i=1;$i<=12;$i++)
{
$monthname=$this->FN_GETMONTHNAME($i);
array_push($arrval,array("value"=>$i,"text"=>$monthname));
}
$this->FN_COMBOVALIDATIONVALUEARRAY("myForm","cbo_period1",$arrval);
$this->FN_COMBOVALIDATIONVALUEARRAY("myForm","cbo_period2",$arrval);
// === Init Employee Name
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_employee|id,employeename')";
$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_monthly")."&task=".$this->enc("rptload")."&years='+myForm.getItemValue('txt_years');";
$eventbtnsearch.=" url=url+'&period1='+myForm.getItemValue('cbo_period1')+'&period2='+myForm.getItemValue('cbo_period2')+'&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'];
$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<br/>";
$htmlheader.="<span>";
$htmlheader.=" <table width='100%' style='font-size:11'>";
$htmlheader.=" <tr>
<td width='20%'>Reported By</td>
<td width='2px'>:</td>
<td>( ".$_SESSION['employeename']." )</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>".$period1name." s.d ".$period2name." $years</td>
</tr>";
$htmlheader.=" </table>";
$htmlheader.="</span></br>";
$htmlheader.="<div style='border-top:1px solid black;'>&nbsp;</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:12' cellpadding='0' cellspacing='0'>";
$html.="<tr>";
$html.=" <td width='23' style='border-bottom:1px dotted black'>No.</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black'>Tiket Number</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black'>Voy. Number</td>";
//$html.=" <td width='80' style='border-bottom:1px dotted black'>Ship Number</td>";
$html.=" <td width='100' style='border-bottom:1px dotted black'>Passenger</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black'>Identity</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black'>Route</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black;text-align:right;'>Price&nbsp;</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black;text-align:right;vertical-align: middle;'>Baggage <br/>( kg )</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black;text-align:right'>Over<br/>Baggage</td>";
$html.=" <td width='80' style='border-bottom:1px dotted black;text-align:right'>Total Price&nbsp;</td>";
$html.="</tr>";
$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.="<tr>";
$html.=" <td style='height:20px'>$i.</td>";
$html.=" <td>".$rw->tiketnumber."</td>";
$html.=" <td>".$rw->voynumber."</td>";
//$html.=" <td>".$rw->shipnumber."</td>";
$html.=" <td>".$rw->passengername."</td>";
$html.=" <td>".$rw->cardtype."/".$rw->cardnumber."</td>";
$html.=" <td>".$rw->routenamestart."-".$rw->routenameend."</td>";
$html.=" <td style='text-align:right;'>\$".number_format($rw->price,2)."</td>";
$html.=" <td style='text-align:right;'>".$rw->baggageinkg." kg</td>";
$html.=" <td style='text-align:right;'>\$".number_format($rw->pricebaggage,2)."</td>";
$html.=" <td style='text-align:right;'>\$".number_format($rw->totalprice,2)."</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('DailyRepot_'.date("Ymd").'.pdf','I');
exit;
}
}
?>