Add version files and new GIF images for UI components
This commit is contained in:
27
objectx/obj_tra/tra.html.php
Normal file
27
objectx/obj_tra/tra.html.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
class BASE_TRA extends MY_DHTMLX
|
||||
{
|
||||
public function fn_page_construct()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class TRA_HTML extends BASE_TRA
|
||||
{
|
||||
public function fn_page_home()
|
||||
{
|
||||
|
||||
}
|
||||
public function fn_url_home()
|
||||
{
|
||||
return "$('#uri').val('');$('#fm').prop('target','_self');$('#fm').submit();";
|
||||
}
|
||||
|
||||
public function fn_url_tra_newticket()
|
||||
{
|
||||
return "$('#uri').val('ajax=0&sec=1&option=a7b7776903495dfed95a73a30c7e65f0&obj=bbc810a866c22a56d8382ee06b97c723&task=de7eb57f52fc4d8a6fef759e7bb0844b');$('#fm').prop('target','_self');$('#fm').submit();";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
39
objectx/obj_tra/tra.php
Normal file
39
objectx/obj_tra/tra.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
require_once($pg.".html.php");
|
||||
class TRA extends TRA_HTML
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
$cl=new TRA();
|
||||
|
||||
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 "tra_$modulename":
|
||||
$clfile->$fn_module_init();
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
348
objectx/obj_tra/tra_cancelcrg.php
Normal file
348
objectx/obj_tra/tra_cancelcrg.php
Normal file
@ -0,0 +1,348 @@
|
||||
<?php
|
||||
class TRA_CANCELCRG extends TRA
|
||||
{
|
||||
public function tra_cancelcrg_javainit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function fn_cancelcrg_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_cancelcrg();
|
||||
break;
|
||||
|
||||
case $task:
|
||||
$task="fn_".$task;
|
||||
if(method_exists($this,$task)){$this->$task();}
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->fn_default_cancelcrg();
|
||||
break;
|
||||
}
|
||||
}
|
||||
public function fn_default_cancelcrg()
|
||||
{
|
||||
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,dwins;
|
||||
function initObject()
|
||||
{
|
||||
dwins=new dhtmlXWindows();dwins.attachViewportTo(\"divchecklistdetail\");";
|
||||
// === FORM SEARCH AND GRID
|
||||
$formdata=array(
|
||||
array("type"=>"settings","position"=>"label-left","labelWidth"=>"180","inputWidth"=>"120"),
|
||||
array("type"=>"fieldset","width"=>"1080","label"=>"Search",
|
||||
"list"=>array(
|
||||
array("type"=>"hidden","name"=>"txt_idcargo"),
|
||||
array("type"=>"input","name"=>"txtsearch","label"=>"Insert Your Keyword","info"=>"true","inputWidth"=>"240",
|
||||
"tooltip"=>"Insert Your Keyword","maxLength"=>"","className"=>"txtleft","labelWidth"=>"210"),
|
||||
array("type"=>"newcolumn"),
|
||||
array("type"=>"button","name"=>"btnfind","value"=>"","className"=>"button_find","offsetLeft"=>"10","offsetTop"=>"0")
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->FN_DHTMLXFORM("myFormsearch","divcancelchecklistsearch",$formdata,true);
|
||||
$ontxtsearchkeydown="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();myFormsearch.setItemFocus('btnfind');}";
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onbuttonclick","eventparam"=>"id,val",
|
||||
"switch"=>array(
|
||||
"btnfind"=>"fn_grid_loaddata()"
|
||||
)
|
||||
),
|
||||
array("eventname"=>"onkeydown","eventparam"=>"inp,ev,id,val",
|
||||
"switch"=>array(
|
||||
"txtsearch"=>"$ontxtsearchkeydown"
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->FN_DHTMLXFORMEVENT("myFormsearch",$arrevent);
|
||||
|
||||
$footerevent="<div style='height:20px;padding-top:5px;'>";
|
||||
$footerevent.="<a id='a_exporttoxls' href='javascript:void(0)' style='color:blue;font-size:10pt;' onClick='fn_cancelcrg()'>Cancel Cargo</a> ";
|
||||
$footerevent.="</div>";
|
||||
|
||||
$grdinit=array("gridname"=>"dgresult","divtarget"=>"div_dgresult","divpaging"=>"div_dgresultpaging","paginglimit"=>PAGE_LIMIT,
|
||||
"showloader"=>"true","enableMultiline"=>"true","footer"=>"$footerevent","footerspan"=>"17");
|
||||
$gridproperties=array("id"=>"right,ro,96,right,int,false,true",
|
||||
"<font color='green'><b>C </b></font>"=>"center,ra,30,center,int,false",
|
||||
"No. "=>"right,ro,35,center,int,false",
|
||||
"Status"=>"center,ro,110,center,str,false",
|
||||
"statuscode"=>"center,ro,110,center,str,false,true",
|
||||
"Ship Name"=>"left,ro,140,left,str,false",
|
||||
"Ticket Number"=>"center,ro,130,center,str,false",
|
||||
"Voyage Number"=>"center,ro,130,center,str,false",
|
||||
"Passenger Name"=>"left,ro,262,left,str,false",
|
||||
"ID Card"=>"center,ro,136,center,str,false",
|
||||
"Dates"=>"center,ro,120,center,date,false",
|
||||
"From"=>"left,ro,112,left,str,false",
|
||||
"Category"=>"left,ro,144,left,str,false",
|
||||
"Price "=>"right,ro,120,right,int,false",
|
||||
"Quantity "=>"right,ro,144,right,int,false",
|
||||
"Weight "=>"right,ro,144,right,int,false",
|
||||
"Total "=>"right,ro,120,right,int,false");
|
||||
$this->FN_DHTMLXGRIDVIEW($grdinit,$gridproperties,"bricks","","fn_grid_loaddata()");
|
||||
|
||||
$oneditcell="if(colid==1&&stage==1)";
|
||||
$oneditcell.="{";
|
||||
$oneditcell.=" var status=dgresult.cells(rowid,4).getValue();";
|
||||
$oneditcell.=" var idcargo=dgresult.cells(rowid,0).getValue();";
|
||||
$oneditcell.=" var tiketnumber=dgresult.cells(rowid,7).getValue();";
|
||||
$oneditcell.=" if(status!=0){fn_dhtmlxmessage('error','I\'m sorry you can\'t cancel this Tiket number!!');return false;}";
|
||||
$oneditcell.=" myFormsearch.setItemValue('txt_idcargo',idcargo+'|'+tiketnumber);";
|
||||
$oneditcell.="}";
|
||||
$oneditcell.="return true;";
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onEditCell","eventparam"=>"stage,rowid,colid",
|
||||
"statement"=>"$oneditcell"
|
||||
),
|
||||
array("eventname"=>"onXLE","eventparam"=>"",
|
||||
"statement"=>""
|
||||
)
|
||||
);
|
||||
|
||||
$this->FN_DHTMLXGRIDVIEWEVENT("dgresult",$arrevent);
|
||||
|
||||
echo " }
|
||||
|
||||
|
||||
|
||||
function fn_cancelcrg()
|
||||
{";
|
||||
//var idcargo=myFormsearch.getItemValue('txt_idcargo');
|
||||
//var url='?ajax=1&sec=1&option=".$this->enc("obj_ss")."&obj=".$this->enc("ss_necheck")."&task=".$this->enc("viewchecklist")."&idchecklist='+idchecklist+'&checklistnumber='+checklistnumber+'&category='+category;";
|
||||
$rtn="var idcargo=myFormsearch.getItemValue('txt_idcargo');";
|
||||
$rtn.="var dhxcancel=new dhtmlXWindows();";
|
||||
$rtn.="var wincancelcrgket=dhxcancel.createWindow(\"wincancelcrgket\",0,0,410,190);";
|
||||
$rtn.="dhxcancel.window('wincancelcrgket').progressOn();";
|
||||
$rtn.="wincancelcrgket.setText('Confirmation Ticket Cancel');";
|
||||
$rtn.="dhxcancel.window('wincancelcrgket').denyResize();";
|
||||
$rtn.="dhxcancel.window('wincancelcrgket').setModal(true);";
|
||||
$rtn.="dhxcancel.window('wincancelcrgket').bringToTop();";
|
||||
$rtn.="dhxcancel.window('wincancelcrgket').center();";
|
||||
|
||||
// === FOrm Deleted
|
||||
$formdata=array(
|
||||
array("type"=>"settings","position"=>"label-left","labelWidth"=>"160","inputWidth"=>"120"),
|
||||
array("type"=>"fieldset","label"=>"<font color='red'>Insert Remark</font> First","width"=>"255","offsetLeft"=>"5",
|
||||
"list"=>array(
|
||||
array("type"=>"hidden","name"=>"txt_id"),
|
||||
array("type"=>"input","name"=>"txtremark","inputWidth"=>"320","className"=>"txtleft","maxLength"=>"90",
|
||||
"note"=>array("text"=>"<span id='spjlhchar' style='color:blue;'>0/90</span> characters.")),
|
||||
array("type"=>"button","name"=>"btncancelcrg","value"=>"Cancel Booking","offsetLeft"=>"0","offsetTop"=>"0",
|
||||
"className"=>"button_delete")
|
||||
)
|
||||
)
|
||||
);
|
||||
$formdata=json_encode($formdata);
|
||||
$rtn.="var myformcancel=wincancelcrgket.attachForm($formdata, true);";
|
||||
$rtn.="myformcancel.setFocusOnFirstActive();";
|
||||
//$rtn.="myformcancel.setSkin('dhx_skyblue');";
|
||||
|
||||
// === FOrm Event
|
||||
$ontxtremarkonkeydown="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();myformcancel.setItemFocus('btndeleted');}";
|
||||
$ontxtremarkonkeydown.="if(ev.keyCode==27){dhxcancel.unload();}";
|
||||
$ontxtremarkonkeyup="var remarklength=myformcancel.getItemValue('txtremark');";
|
||||
$ontxtremarkonkeyup.="document.getElementById('spjlhchar').innerHTML=remarklength.toString().length+'/90';";
|
||||
|
||||
|
||||
$onbuttonclickbtncancel="var lengthremark=myformcancel.getItemValue('txtremark').trim().length;";
|
||||
$onbuttonclickbtncancel.="var sptiket=myFormsearch.getItemValue('txt_idcargo').split('|');";
|
||||
$onbuttonclickbtncancel.="var idcargo=sptiket[0];";
|
||||
$onbuttonclickbtncancel.="var tiketnumber=sptiket[1];";
|
||||
$onbuttonclickbtncancel.="if(lengthremark<=15){fn_dhtmlxmessage('error','Minimal 15 Character for the reason. Thank You!');myformcancel.setItemFocus('txtremark');return false;}";
|
||||
$onbuttonclickbtncancel.="if(myformcancel.validate())
|
||||
{
|
||||
dhtmlx.confirm({
|
||||
title:'Confirmation',text:'Are you sure to cancel this ticketing ?',type:'confirm',
|
||||
callback:function(result){
|
||||
if(result)
|
||||
{";
|
||||
$params="'obj=".$this->enc("tra_cancelcrg")."&task=".$this->enc("cancelcrg")."&idcargo='+idcargo+'&remark='+myformcancel.getItemValue('txtremark')";
|
||||
$onformsenddata="url=fn_dhtmlxsenddata('".$this->enc("obj_tra")."',$params);
|
||||
myformcancel.send(url,\"get\",function(loader, response){";
|
||||
$onformsenddata.=$this->FN_DHTMLXWINDOWSHIDEPROGRESS();
|
||||
$onformsenddata.="var sp=trim(response).split('|');
|
||||
//alert(response);
|
||||
if(sp[0]=='ok')
|
||||
{
|
||||
fn_dhtmlxmessage('','Data <b>'+tiketnumber+'</b> has been deleted');";
|
||||
$onformsenddata.=$eventafterdeleted;
|
||||
$onformsenddata.="dhxcancel.unload();fn_grid_loaddata();
|
||||
}
|
||||
else if(sp[0]=='failed')
|
||||
{fn_dhtmlxmessage('error','Error Found : '+sp[1]);}
|
||||
else
|
||||
{fn_dhtmlxmessage('error','Error Found : '+response);}
|
||||
});";
|
||||
$onbuttonclickbtncancel.=$this->FN_DHTMLXWINDOWSHOWPROGESS($onformsenddata);
|
||||
$onbuttonclickbtncancel.=" }
|
||||
}
|
||||
});
|
||||
}";
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onButtonClick","eventparam"=>"id,val",
|
||||
"switch"=>array("btncancelcrg"=>"$onbuttonclickbtncancel")
|
||||
),
|
||||
array("eventname"=>"onkeyup","eventparam"=>"inp,ev,id,val",
|
||||
"switch"=>array("txtremark"=>"$ontxtremarkonkeyup")
|
||||
),
|
||||
array("eventname"=>"onkeydown","eventparam"=>"inp,ev,id,val",
|
||||
"switch"=>array("txtremark"=>"$ontxtremarkonkeydown")
|
||||
)
|
||||
);
|
||||
$rtn.="myformcancel.setItemValue('txt_id',$idrecord);";
|
||||
$rtn.=$this->FN_DHTMLXFORMEVENT("myformcancel",$arrevent,true);
|
||||
$rtn.="dhxcancel.window('wincancelcrgket').progressOff();";
|
||||
$rtn.="dhxcancel.attachEvent('onClose',function(win){return true;})";
|
||||
echo $rtn;
|
||||
|
||||
echo " }
|
||||
|
||||
function fn_grid_loaddata()
|
||||
{
|
||||
var keyword=myFormsearch.getItemValue('txtsearch');
|
||||
url=fn_dhtmlxloadobject('".$this->enc("obj_tra")."','obj=".$this->enc("tra_cancelcrg")."&task=".$this->enc("grdrecord")."&keyword='+keyword);
|
||||
//alert(url);
|
||||
dgresult.clearAndLoad(url);";
|
||||
echo " }
|
||||
</script>";
|
||||
echo $this->FN_CLOSEHEADER();
|
||||
echo $this->FN_CREATEBODY("e8f1ff");
|
||||
|
||||
echo "<div id=\"divchecklistdetail\" style=\"height:1020px;\">";
|
||||
echo "<table width=\"98%\" border=\"0\">
|
||||
<tr>
|
||||
<td>";
|
||||
$qry="select filepdf from ".DB_APORTIL.".tbl_manualbook where isdeleted=0 and filepdf='cancelcrgket_passenger.pdf'";
|
||||
$filepdf=$this->fn_get_fieldvalue("filepdf",$qry);
|
||||
$urlmanualbook="<a href='".UPLOAD_DIR."/manualbook/$filepdf"."' target='_blank'><img src='".PATH_THEME."/images/pdf.png' /> <b>MANUAL BOOK</b></a>";
|
||||
$url="location.reload();";
|
||||
$myuri=array("<b>CARGO INFORMATION</b>"=>"$url|id='a_newticket'","$urlmanualbook"=>"|id='a_manualbook'");
|
||||
echo $this->MULTIPLE_LINK($myuri);
|
||||
echo " </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"divcancelchecklistcontent\" style=\"margin-left:0px;\">
|
||||
<table width=\"98%\" border=\"0\">
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<table width=\"98%\" cellpadding=\"0\" cellspacing=\"0\">
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<div id=\"divcancelchecklistsearch\" style=\"width:1060px;margin-top:-6px;\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgresult\" style=\"height:480px;width:1080px;overflow:hidden\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgresultpaging\" style=\"width:1080px;margin-top:1px\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td valign=\"top\"><div id=\"loadergrid\" style=\"z-index:100;position:absolute;margin-top:-320px;margin-left:587px;display:visibility;\">".$this->CREATE_IMAGE("loadergrid.gif")."</div></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>";
|
||||
|
||||
echo $this->FN_CREATEFOOTER();
|
||||
}
|
||||
|
||||
public function fn_grdrecord()
|
||||
{
|
||||
$keyword=$_REQUEST["keyword"];
|
||||
header("Content-type: text/xml");
|
||||
echo('<?xml version="1.0" encoding="utf-8"?>');
|
||||
echo "<rows id='0'>";
|
||||
|
||||
$qry="select id,0 ischecklist,idship,shipname,tiketnumber,tiketnumberpassenger,voynumber,inctiket,idcategory,cargodescription,passengername,
|
||||
idcardtype,cardtype,cardnumber,dates,idroutestart,routenamestart,idrouteend,
|
||||
routenameend,price,quantity,weight,totalprice,units,modifcount,status
|
||||
from ".DB_APORTIL.".tbl_cargo_tiket
|
||||
where (tiketnumber like '%$keyword%' or voynumber like '%$keyword%' or passengername like '%$keyword%') and isdeleted=0 and status=0
|
||||
order by id desc limit ".TBL_PAGE_LIMIT;
|
||||
|
||||
$rs=$this->selectquery($qry);
|
||||
if($rs)
|
||||
{
|
||||
$i=1;
|
||||
while($row=$this->data_row_array($rs))
|
||||
{
|
||||
$color='green';
|
||||
if($row["status"]==1){$color='blue';}
|
||||
echo ("<row id='".$row["id"]."'>");
|
||||
print("<cell><![CDATA[".$row["id"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["ischecklist"]."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>".$i."</span>"."]]></cell>");
|
||||
$status=$this->fn_get_fieldvalue("description","select description from ".DB_APORTIL.".tbl_cargo_tiket_status where status='".$row['status']."'");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$status."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA[".$row['status']."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["shipname"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["tiketnumber"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["voynumber"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["passengername"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["cardtype"]."/".$row["cardnumber"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".date("Y-m-d",strtotime($row["dates"]))."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["routenamestart"]." to ".$row['routenameend']."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["cargodescription"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["price"]." \$</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["quantity"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["weight"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["totalprice"]." \$</span>"."]]></cell>");
|
||||
echo ("</row>");
|
||||
$i+=1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo mysql_errno().": ".mysql_error()." at ".__LINE__." line in ".__FILE__." file<br>";
|
||||
}
|
||||
echo "</rows>";
|
||||
|
||||
}
|
||||
|
||||
public function fn_cancelcrg()
|
||||
{
|
||||
$idcargo=$_REQUEST['idcargo'];
|
||||
$remark=$_REQUEST['remark'];
|
||||
$qry="update ".DB_APORTIL.".tbl_cargo_tiket set status=-2,remark='$remark',uby='".$_SESSION['nik']."',udt=now() ";
|
||||
$qry.="where id='$idcargo'";
|
||||
if($this->executequery($qry)){
|
||||
$qry="insert into ".DB_APORTIL.".tbl_cargo_tiket_log
|
||||
set idcargoticket='$idcargo',dates='".date("Y-m-d")."',status=-2,remarkstatus='Cancel Cargo Tiket',
|
||||
remark='$remark',iby='".$_SESSION['nik']."',idt=now()";
|
||||
if($this->executequery($qry)){
|
||||
echo "ok|$idcargo";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
353
objectx/obj_tra/tra_canceltic.php
Normal file
353
objectx/obj_tra/tra_canceltic.php
Normal file
@ -0,0 +1,353 @@
|
||||
<?php
|
||||
class TRA_CANCELTIC extends TRA
|
||||
{
|
||||
public function tra_canceltic_javainit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function fn_canceltic_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_canceltic();
|
||||
break;
|
||||
|
||||
case $task:
|
||||
$task="fn_".$task;
|
||||
if(method_exists($this,$task)){$this->$task();}
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->fn_default_canceltic();
|
||||
break;
|
||||
}
|
||||
}
|
||||
public function fn_default_canceltic()
|
||||
{
|
||||
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,dwins;
|
||||
function initObject()
|
||||
{
|
||||
dwins=new dhtmlXWindows();dwins.attachViewportTo(\"divchecklistdetail\");";
|
||||
// === FORM SEARCH AND GRID
|
||||
$formdata=array(
|
||||
array("type"=>"settings","position"=>"label-left","labelWidth"=>"180","inputWidth"=>"120"),
|
||||
array("type"=>"fieldset","width"=>"1080","label"=>"Search",
|
||||
"list"=>array(
|
||||
array("type"=>"hidden","name"=>"txt_idticketing"),
|
||||
array("type"=>"input","name"=>"txtsearch","label"=>"Insert Your Keyword","info"=>"true","inputWidth"=>"240",
|
||||
"tooltip"=>"Insert Your Keyword","maxLength"=>"","className"=>"txtleft","labelWidth"=>"210"),
|
||||
array("type"=>"newcolumn"),
|
||||
array("type"=>"button","name"=>"btnfind","value"=>"","className"=>"button_find","offsetLeft"=>"10","offsetTop"=>"0")
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->FN_DHTMLXFORM("myFormsearch","divcancelchecklistsearch",$formdata,true);
|
||||
$ontxtsearchkeydown="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();myFormsearch.setItemFocus('btnfind');}";
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onbuttonclick","eventparam"=>"id,val",
|
||||
"switch"=>array(
|
||||
"btnfind"=>"fn_grid_loaddata()"
|
||||
)
|
||||
),
|
||||
array("eventname"=>"onkeydown","eventparam"=>"inp,ev,id,val",
|
||||
"switch"=>array(
|
||||
"txtsearch"=>"$ontxtsearchkeydown"
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->FN_DHTMLXFORMEVENT("myFormsearch",$arrevent);
|
||||
|
||||
$footerevent="<div style='height:20px;padding-top:5px;'>";
|
||||
$footerevent.="<a id='a_exporttoxls' href='javascript:void(0)' style='color:blue;font-size:10pt;' onClick='fn_cancelticketing()'>Cancel Ticketing</a> ";
|
||||
$footerevent.="</div>";
|
||||
|
||||
$grdinit=array("gridname"=>"dgresult","divtarget"=>"div_dgresult","divpaging"=>"div_dgresultpaging","paginglimit"=>PAGE_LIMIT,
|
||||
"showloader"=>"true","enableMultiline"=>"true","footer"=>"$footerevent","footerspan"=>"16");
|
||||
$gridproperties=array("id"=>"right,ro,96,right,int,false,true",
|
||||
"<font color='green'><b>C </b></font>"=>"center,ra,30,center,int,false",
|
||||
"No. "=>"right,ro,35,center,int,false",
|
||||
"Status"=>"center,ro,110,center,str,false",
|
||||
"statuscode"=>"center,ro,110,center,str,false,true",
|
||||
"Ship Name"=>"left,ro,152,left,int,false",
|
||||
"Ticket Number"=>"center,ro,194,center,str,false",
|
||||
"tiketNumber"=>"center,ro,194,center,str,false,true",
|
||||
"No. Sequence "=>"right,ro,110,right,int,false",
|
||||
"Ship Number"=>"left,ro,238,left,str,false",
|
||||
"Mrs/ Mr"=>"left,ro,206,left,str,false",
|
||||
"Picture"=>"left,ro,206,left,str,false",
|
||||
"Dates"=>"center,ro,120,center,date,false",
|
||||
"From"=>"center,ro,112,center,str,false",
|
||||
"To"=>"center,ro,112,center,str,false",
|
||||
"Seat Number"=>"center,ro,90,center,str,false",
|
||||
"Quantity "=>"right,ro,110,right,int,false",
|
||||
"Price "=>"right,ro,120,right,int,false",
|
||||
"Baggage "=>"right,ro,136,right,int,false",
|
||||
"Price "=>"right,ro,120,right,int,false");
|
||||
$this->FN_DHTMLXGRIDVIEW($grdinit,$gridproperties,"bricks","","fn_grid_loaddata()");
|
||||
|
||||
$oneditcell="if(colid==1&&stage==1)";
|
||||
$oneditcell.="{";
|
||||
$oneditcell.=" var status=dgresult.cells(rowid,4).getValue();";
|
||||
$oneditcell.=" var idticketing=dgresult.cells(rowid,0).getValue();";
|
||||
$oneditcell.=" var tiketnumber=dgresult.cells(rowid,7).getValue();";
|
||||
$oneditcell.=" if(status!=0){fn_dhtmlxmessage('error','I\'m sorry you can\'t cancel this Tiket number!!');return false;}";
|
||||
$oneditcell.=" myFormsearch.setItemValue('txt_idticketing',idticketing+'|'+tiketnumber);";
|
||||
$oneditcell.="}";
|
||||
$oneditcell.="return true;";
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onEditCell","eventparam"=>"stage,rowid,colid",
|
||||
"statement"=>"$oneditcell"
|
||||
),
|
||||
array("eventname"=>"onXLE","eventparam"=>"",
|
||||
"statement"=>""
|
||||
)
|
||||
);
|
||||
|
||||
$this->FN_DHTMLXGRIDVIEWEVENT("dgresult",$arrevent);
|
||||
|
||||
echo " }
|
||||
|
||||
|
||||
|
||||
function fn_cancelticketing()
|
||||
{";
|
||||
//var idticketing=myFormsearch.getItemValue('txt_idticketing');
|
||||
//var url='?ajax=1&sec=1&option=".$this->enc("obj_ss")."&obj=".$this->enc("ss_necheck")."&task=".$this->enc("viewchecklist")."&idchecklist='+idchecklist+'&checklistnumber='+checklistnumber+'&category='+category;";
|
||||
$rtn="var idticketing=myFormsearch.getItemValue('txt_idticketing');";
|
||||
$rtn.="var dhxcancel=new dhtmlXWindows();";
|
||||
$rtn.="var wincancelticket=dhxcancel.createWindow(\"wincancelticket\",0,0,410,190);";
|
||||
$rtn.="dhxcancel.window('wincancelticket').progressOn();";
|
||||
$rtn.="wincancelticket.setText('Confirmation Ticket Cancel');";
|
||||
$rtn.="dhxcancel.window('wincancelticket').denyResize();";
|
||||
$rtn.="dhxcancel.window('wincancelticket').setModal(true);";
|
||||
$rtn.="dhxcancel.window('wincancelticket').bringToTop();";
|
||||
$rtn.="dhxcancel.window('wincancelticket').center();";
|
||||
|
||||
// === FOrm Deleted
|
||||
$formdata=array(
|
||||
array("type"=>"settings","position"=>"label-left","labelWidth"=>"160","inputWidth"=>"120"),
|
||||
array("type"=>"fieldset","label"=>"<font color='red'>Insert Remark</font> First","width"=>"255","offsetLeft"=>"5",
|
||||
"list"=>array(
|
||||
array("type"=>"hidden","name"=>"txt_id"),
|
||||
array("type"=>"input","name"=>"txtremark","inputWidth"=>"320","className"=>"txtleft","maxLength"=>"90",
|
||||
"note"=>array("text"=>"<span id='spjlhchar' style='color:blue;'>0/90</span> characters.")),
|
||||
array("type"=>"button","name"=>"btncancelticketing","value"=>"Cancel Booking","offsetLeft"=>"0","offsetTop"=>"0",
|
||||
"className"=>"button_delete")
|
||||
)
|
||||
)
|
||||
);
|
||||
$formdata=json_encode($formdata);
|
||||
$rtn.="var myformcancel=wincancelticket.attachForm($formdata, true);";
|
||||
$rtn.="myformcancel.setFocusOnFirstActive();";
|
||||
//$rtn.="myformcancel.setSkin('dhx_skyblue');";
|
||||
|
||||
// === FOrm Event
|
||||
$ontxtremarkonkeydown="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();myformcancel.setItemFocus('btndeleted');}";
|
||||
$ontxtremarkonkeydown.="if(ev.keyCode==27){dhxcancel.unload();}";
|
||||
$ontxtremarkonkeyup="var remarklength=myformcancel.getItemValue('txtremark');";
|
||||
$ontxtremarkonkeyup.="document.getElementById('spjlhchar').innerHTML=remarklength.toString().length+'/90';";
|
||||
|
||||
|
||||
$onbuttonclickbtncancel="var lengthremark=myformcancel.getItemValue('txtremark').trim().length;";
|
||||
$onbuttonclickbtncancel.="var sptiket=myFormsearch.getItemValue('txt_idticketing').split('|');";
|
||||
$onbuttonclickbtncancel.="var idticketing=sptiket[0];";
|
||||
$onbuttonclickbtncancel.="var tiketnumber=sptiket[1];";
|
||||
$onbuttonclickbtncancel.="if(lengthremark<=15){fn_dhtmlxmessage('error','Minimal 15 Character for the reason. Thank You!');myformcancel.setItemFocus('txtremark');return false;}";
|
||||
$onbuttonclickbtncancel.="if(myformcancel.validate())
|
||||
{
|
||||
dhtmlx.confirm({
|
||||
title:'Confirmation',text:'Are you sure to cancel this ticketing ?',type:'confirm',
|
||||
callback:function(result){
|
||||
if(result)
|
||||
{";
|
||||
$params="'obj=".$this->enc("tra_canceltic")."&task=".$this->enc("canceltic")."&idticketing='+idticketing+'&remark='+myformcancel.getItemValue('txtremark')";
|
||||
$onformsenddata="url=fn_dhtmlxsenddata('".$this->enc("obj_tra")."',$params);
|
||||
myformcancel.send(url,\"get\",function(loader, response){";
|
||||
$onformsenddata.=$this->FN_DHTMLXWINDOWSHIDEPROGRESS();
|
||||
$onformsenddata.="var sp=trim(response).split('|');
|
||||
//alert(response);
|
||||
if(sp[0]=='ok')
|
||||
{
|
||||
fn_dhtmlxmessage('','Data <b>'+tiketnumber+'</b> has been deleted');";
|
||||
$onformsenddata.=$eventafterdeleted;
|
||||
$onformsenddata.="dhxcancel.unload();fn_grid_loaddata();
|
||||
}
|
||||
else if(sp[0]=='failed')
|
||||
{fn_dhtmlxmessage('error','Error Found : '+sp[1]);}
|
||||
else
|
||||
{fn_dhtmlxmessage('error','Error Found : '+response);}
|
||||
});";
|
||||
$onbuttonclickbtncancel.=$this->FN_DHTMLXWINDOWSHOWPROGESS($onformsenddata);
|
||||
$onbuttonclickbtncancel.=" }
|
||||
}
|
||||
});
|
||||
}";
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onButtonClick","eventparam"=>"id,val",
|
||||
"switch"=>array("btncancelticketing"=>"$onbuttonclickbtncancel")
|
||||
),
|
||||
array("eventname"=>"onkeyup","eventparam"=>"inp,ev,id,val",
|
||||
"switch"=>array("txtremark"=>"$ontxtremarkonkeyup")
|
||||
),
|
||||
array("eventname"=>"onkeydown","eventparam"=>"inp,ev,id,val",
|
||||
"switch"=>array("txtremark"=>"$ontxtremarkonkeydown")
|
||||
)
|
||||
);
|
||||
$rtn.="myformcancel.setItemValue('txt_id',$idrecord);";
|
||||
$rtn.=$this->FN_DHTMLXFORMEVENT("myformcancel",$arrevent,true);
|
||||
$rtn.="dhxcancel.window('wincancelticket').progressOff();";
|
||||
$rtn.="dhxcancel.attachEvent('onClose',function(win){return true;})";
|
||||
echo $rtn;
|
||||
|
||||
echo " }
|
||||
|
||||
function fn_grid_loaddata()
|
||||
{
|
||||
var keyword=myFormsearch.getItemValue('txtsearch');
|
||||
url=fn_dhtmlxloadobject('".$this->enc("obj_tra")."','obj=".$this->enc("tra_canceltic")."&task=".$this->enc("grdrecord")."&keyword='+keyword);
|
||||
//alert(url);
|
||||
dgresult.clearAndLoad(url);";
|
||||
echo " }
|
||||
</script>";
|
||||
echo $this->FN_CLOSEHEADER();
|
||||
echo $this->FN_CREATEBODY("e8f1ff");
|
||||
|
||||
echo "<div id=\"divchecklistdetail\" style=\"height:1020px;\">";
|
||||
echo "<table width=\"98%\" border=\"0\">
|
||||
<tr>
|
||||
<td>";
|
||||
$qry="select filepdf from ".DB_APORTIL.".tbl_manualbook where isdeleted=0 and filepdf='cancelticket_passenger.pdf'";
|
||||
$filepdf=$this->fn_get_fieldvalue("filepdf",$qry);
|
||||
$urlmanualbook="<a href='".UPLOAD_DIR."/manualbook/$filepdf"."' target='_blank'><img src='".PATH_THEME."/images/pdf.png' /> <b>MANUAL BOOK</b></a>";
|
||||
$url="location.reload();";
|
||||
$myuri=array("<b>PASSENGER TICKET INFORMATION</b>"=>"$url|id='a_newticket'","$urlmanualbook"=>"|id='a_manualbook'");
|
||||
echo $this->MULTIPLE_LINK($myuri);
|
||||
echo " </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"divcancelchecklistcontent\" style=\"margin-left:0px;\">
|
||||
<table width=\"98%\" border=\"0\">
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<table width=\"98%\" cellpadding=\"0\" cellspacing=\"0\">
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<div id=\"divcancelchecklistsearch\" style=\"width:1060px;margin-top:-6px;\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgresult\" style=\"height:480px;width:1080px;overflow:hidden\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgresultpaging\" style=\"width:1080px;margin-top:1px\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td valign=\"top\"><div id=\"loadergrid\" style=\"z-index:100;position:absolute;margin-top:-320px;margin-left:587px;display:visibility;\">".$this->CREATE_IMAGE("loadergrid.gif")."</div></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>";
|
||||
|
||||
echo $this->FN_CREATEFOOTER();
|
||||
}
|
||||
|
||||
public function fn_grdrecord()
|
||||
{
|
||||
$keyword=$_REQUEST["keyword"];
|
||||
header("Content-type: text/xml");
|
||||
echo('<?xml version="1.0" encoding="utf-8"?>');
|
||||
echo "<rows id='0'>";
|
||||
|
||||
$qry="select id,0 ischecklist,idship,tiketnumber,inctiket,shipname,shipnumber,passengername,picdata,dates,idroutestart,
|
||||
routenamestart,idrouteend,routenameend,seatnumber,quantity,price,baggageinkg,pricebaggage,modifcount,status
|
||||
from ".DB_APORTIL.".tbl_passenger_tiket
|
||||
where (tiketnumber like '%$keyword%' or passengername like '%$keyword%') and isdeleted=0 and status=0
|
||||
order by id desc limit ".TBL_PAGE_LIMIT;
|
||||
|
||||
$rs=$this->selectquery($qry);
|
||||
if($rs)
|
||||
{
|
||||
$i=1;
|
||||
while($row=$this->data_row_array($rs))
|
||||
{
|
||||
$color='green';
|
||||
if($row["status"]==1){$color='blue';}
|
||||
echo ("<row id='".$row["id"]."'>");
|
||||
print("<cell><![CDATA[".$row["id"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["ischecklist"]."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>".$i."</span>"."]]></cell>");
|
||||
$status=$this->fn_get_fieldvalue("description","select description from ".DB_APORTIL.".tbl_passenger_tiket_status where status='".$row['status']."'");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$status."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA[".$row['status']."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>".$row["shipname"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>".$row["tiketnumber"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["tiketnumber"]."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>".$row["inctiket"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>".$row["shipnumber"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>".$row["passengername"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>".$row["picdata"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>".date("Y-m-d",strtotime($row["dates"]))."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>".$row["routenamestart"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>".$row["routenameend"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>".$row["seatnumber"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>".$row["quantity"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>"."\$".$row["price"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>".$row["baggageinkg"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:black'>"."\$".$row["pricebaggage"]."</span>"."]]></cell>");
|
||||
echo ("</row>");
|
||||
$i+=1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo mysql_errno().": ".mysql_error()." at ".__LINE__." line in ".__FILE__." file<br>";
|
||||
}
|
||||
echo "</rows>";
|
||||
|
||||
}
|
||||
|
||||
public function fn_canceltic()
|
||||
{
|
||||
$idticketing=$_REQUEST['idticketing'];
|
||||
$remark=$_REQUEST['remark'];
|
||||
$qry="update ".DB_APORTIL.".tbl_passenger_tiket set status=-2,remark='$remark',uby='".$_SESSION['nik']."',udt=now() ";
|
||||
$qry.="where id='$idticketing'";
|
||||
if($this->executequery($qry)){
|
||||
$qry="insert into ".DB_APORTIL.".tbl_passenger_tiket_log
|
||||
set idpassengerticket='$idticketing',dates='".date("Y-m-d")."',status=-2,remarkstatus='Cancel Passenger Tiket',
|
||||
remark='$remark',iby='".$_SESSION['nik']."',idt=now()";
|
||||
if($this->executequery($qry)){
|
||||
echo "ok|$idticketing";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
1107
objectx/obj_tra/tra_cargticket.php
Normal file
1107
objectx/obj_tra/tra_cargticket.php
Normal file
File diff suppressed because it is too large
Load Diff
947
objectx/obj_tra/tra_cargticket_20200206.php
Normal file
947
objectx/obj_tra/tra_cargticket_20200206.php
Normal file
@ -0,0 +1,947 @@
|
||||
<?php
|
||||
class TRA_CARGTICKET extends TRA
|
||||
{
|
||||
public function tra_cargticket_javainit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function fn_cargticket_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_cargticket();
|
||||
break;
|
||||
|
||||
case $task:
|
||||
$task="fn_".$task;
|
||||
if(method_exists($this,$task)){$this->$task();}
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->fn_default_cargticket();
|
||||
break;
|
||||
}
|
||||
}
|
||||
public function fn_default_cargticket()
|
||||
{
|
||||
echo $this->FN_CREATEHEADER();
|
||||
echo "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\" />";
|
||||
echo "<style>
|
||||
.besidecboidcard {margin-left:280px;margin-top:-5px;position:absolute;}
|
||||
.besidetxttiketnumber {margin-left:325px;margin-top:-6px;position:absolute;}
|
||||
.besidelabel {margin-left:280px;margin-top:-5px;position:absolute;}
|
||||
.containerpicture {margin-left:0px;margin-top:0px;}
|
||||
.containerbtnlookcategory {margin-left:400px;margin-top:-19px;position:absolute;}
|
||||
.besidelabelprice {margin-left:275px;margin-top:-6px;position:absolute;}
|
||||
.besidecbofrom {margin-left:305px;margin-top:-5px;position:absolute;}
|
||||
.besidebtnsave {margin-left:104px;margin-top:-6px;position:absolute;}
|
||||
.besidebtnupdate {margin-left:198px;margin-top:-6px;position:absolute;}
|
||||
.besidebtnsubmit {margin-left:292px;margin-top:-6px;position:absolute;}
|
||||
.besidebtndelete {margin-left:288px;margin-top:-6px;position:absolute;}
|
||||
</style>";
|
||||
echo "<script>
|
||||
var myForm,myFormsearch,myFormcat,dgcargticket,dwins,dhxwin,dgfindcategory;
|
||||
function initObject()
|
||||
{";
|
||||
$formdata=array(
|
||||
array("type"=>"settings","position"=>"label-left","labelWidth"=>"180","inputWidth"=>"120"),
|
||||
array("type"=>"block","width"=>"500",
|
||||
"list"=>array(
|
||||
array("type"=>"hidden","name"=>"txt_id"),
|
||||
array("type"=>"hidden","name"=>"txt_idcategory"),
|
||||
array("type"=>"hidden","name"=>"txt_modifcount"),
|
||||
array("type"=>"hidden","name"=>"txt_units"),
|
||||
array("type"=>"combo","name"=>"cbo_idship","label"=>"Ship Name","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"0","placeholder"=>"Please enter your email",
|
||||
"tooltip"=>"Pilih Ship Name First. Obrigado","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtcenter"),
|
||||
array("type"=>"input","name"=>"txt_tiketnumber","label"=>"Ticket Number","info"=>"true","inputWidth"=>"135","value"=>"",
|
||||
"tooltip"=>"Entry Ticket Number First. Obrigado","maxLength"=>"40","className"=>"txtcenter","readonly"=>"true"),
|
||||
array("type"=>"input","name"=>"txt_tiketnumberpassenger","label"=>"","info"=>"true","inputWidth"=>"135","value"=>"-","note"=>array("text"=>"Passenger Tiket ( Optional )"),
|
||||
"tooltip"=>"Entry Ticket Number First. Obrigado","maxLength"=>"40","className"=>"txtleft besidetxttiketnumber"),
|
||||
array("type"=>"input","name"=>"txt_voynumber","label"=>"Voyage Number","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"","offsetTop"=>"20",
|
||||
"tooltip"=>"Entry Voyage Number First. Obrigado","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft"),
|
||||
// array("type"=>"input","name"=>"txt_inctiket","label"=>"No. Sequence","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
// "tooltip"=>"Entry No. Sequence First. Obrigado","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtcenter"),
|
||||
array("type"=>"input","name"=>"txt_passengername","label"=>"Passenger Name","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"",
|
||||
"tooltip"=>"Entry Passenger Name First. Obrigado","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft"),
|
||||
array("type"=>"combo","name"=>"cbo_idcardtype","label"=>"ID Card","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Pilih ID Card First. Obrigado","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtcenter"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"input","name"=>"txt_cardnumber","label"=>"","required"=>"true","info"=>"true","inputWidth"=>"120","value"=>"",
|
||||
"tooltip"=>"Entry Picture First. Obrigado","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft besidecboidcard",
|
||||
"note"=>array("text"=>"Insert ID card Number")),
|
||||
array("type"=>"container","name"=>"containerpicture","label"=>"Take Picture","className"=>"containerpicture","offsetTop"=>"20"),
|
||||
|
||||
array("type"=>"hidden","name"=>"txt_picdata","label"=>"Picture","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"",
|
||||
"tooltip"=>"Entry Picture First. Obrigado","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft"),
|
||||
|
||||
array("type"=>"calendar","name"=>"txt_dates","label"=>"Dates","required"=>"true","info"=>"true","inputWidth"=>"90","readonly"=>"true","value"=>date("Y-m-d"),
|
||||
"tooltip"=>"Entry Dates First. Obrigado","validate"=>"NotEmpty","maxLength"=>"","className"=>"txtcenter","dateFormat"=>"%Y-%m-%d"),
|
||||
|
||||
array("type"=>"combo","name"=>"cbo_idroutestart","label"=>"From","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Pilih From First. Obrigado","validate"=>"NotEmpty","maxLength"=>"6","className"=>"txtcenter"),
|
||||
array("type"=>"newColumn"),
|
||||
|
||||
array("type"=>"label","name"=>"lblmeter","label"=>"to","className"=>"besidelabel"),
|
||||
array("type"=>"combo","name"=>"cbo_idrouteend","label"=>"","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Pilih To First. Obrigado","validate"=>"NotEmpty","maxLength"=>"6","className"=>"txtcenter besidecbofrom"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"container","name"=>"containerlookcategory","label"=>"","className"=>"containerbtnlookcategory","offsetTop"=>"20"),
|
||||
|
||||
array("type"=>"input","name"=>"txt_cargodescription","label"=>"Category","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"",
|
||||
"tooltip"=>"Insert Category First. Thank you","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft","readonly"=>true),
|
||||
|
||||
array("type"=>"input","name"=>"txt_quantity","label"=>"Quantity","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Entry Quantity First. Obrigado","validate"=>"NotEmpty,ValidNumeric","maxLength"=>"","className"=>"txtright"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"label","name"=>"lblmeasure","label"=>"Measure","className"=>"besidelabelprice"),
|
||||
|
||||
array("type"=>"input","name"=>"txt_weight","label"=>"Weight","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Entry Weight First. Obrigado","validate"=>"NotEmpty,ValidNumeric","maxLength"=>"","className"=>"txtright"),
|
||||
|
||||
array("type"=>"input","name"=>"txt_price","label"=>"Price","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0","readonly"=>true,
|
||||
"tooltip"=>"Entry Price First. Obrigado","validate"=>"NotEmpty","maxLength"=>"","className"=>"txtright","readonly"=>"true"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"label","name"=>"lblmeter","label"=>"\$","className"=>"besidelabelprice"),
|
||||
|
||||
array("type"=>"input","name"=>"txt_totalprice","label"=>"Total","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Entry Total First. Obrigado","validate"=>"NotEmpty","maxLength"=>"","className"=>"txtright","readonly"=>"true"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"label","name"=>"lblmeter","label"=>"\$","className"=>"besidelabelprice"),
|
||||
|
||||
array("type"=>"button","name"=>"btnsave","value"=>"Save","className"=>"button_update","offsetLeft"=>"20","offsetTop"=>"15"),
|
||||
array("type"=>"button","name"=>"btnupdate","value"=>"Update","className"=>"button_saveas besidebtnsave","offsetLeft"=>"10","disabled"=>"1"),
|
||||
//array("type"=>"button","name"=>"btnsubmit","value"=>"Submit","className"=>"button_submit besidebtnupdate","offsetLeft"=>"0","disabled"=>"1"),
|
||||
array("type"=>"button","name"=>"btndelete","value"=>"Delete","className"=>"button_delete besidebtnupdate","offsetLeft"=>"20","disabled"=>"1"),
|
||||
array("type"=>"button","name"=>"btncancel","value"=>"Cancel","className"=>"button_cancel besidebtndelete","offsetLeft"=>"30","disabled"=>"0")
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->FN_DHTMLXFORM("myForm","divcargticketnew",$formdata);
|
||||
$mycontainerpic="var divpicture=document.createElement('DIV');";
|
||||
$mycontainerpic.="divpicture.id='divpicture';divpicture.style.height='100%';";
|
||||
$mycontainerpic.="var divpicturecontent='<table id=\"tbfindinvoice\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin-top:0px;margin-left:-5px;\">';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+'<tbody>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <tr>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <td>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <div id=\"divimage\" style=\"height:180px;width:280px;background-color:#2c3e50;margin-left:5px;\">';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <image id=\"imgtiket\" style=\"height:180px;width:280px;\" />';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' </div>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <div style=\"position:absolute;z-index:100;margin-top:-50px;margin-left:10px\">';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <button id=\"btntake\" onClick=\"fn_showCamera()\"><i class=\"fa fa-camera\" style=\"font-size:30pt\"></i></button>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' </div>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' </td>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' </tr>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+'</tbody>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+'</table>';";
|
||||
|
||||
$mycontainerpic.="divpicture.innerHTML=divpicturecontent;";
|
||||
$mycontainerpic.="myForm.getContainer('containerpicture').appendChild(divpicture);";
|
||||
|
||||
|
||||
//$mycontainerpic.="myForm.setItemValue('txtsearch',objidposition);";
|
||||
|
||||
echo $mycontainerpic;
|
||||
|
||||
$mycontainerbtncat="var divbtncat=document.createElement('DIV');";
|
||||
$mycontainerbtncat.="divbtncat.id='divbtncat';divbtncat.style.height='100%';";
|
||||
$mycontainerbtncat.="var divbtncatcontent='<button id=\"btntake\" onClick=\"fn_showcategory()\"><i class=\"fa fa-upload\" style=\"font-size:14pt\"></i></button>';";
|
||||
$mycontainerbtncat.="divbtncat.innerHTML=divbtncatcontent;";
|
||||
$mycontainerbtncat.="myForm.getContainer('containerlookcategory').appendChild(divbtncat);";
|
||||
|
||||
echo $mycontainerbtncat;
|
||||
|
||||
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_ship_information|id,shipname')";
|
||||
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idship","tbl_ship_information","$urlcbo","");
|
||||
|
||||
// $urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_cargoprice_information|id,cargodescription')";
|
||||
// $this->FN_COMBOVALIDATIONVALUENEW("myForm","txt_cargodescription","tbl_cargoprice_information","$urlcbo","");
|
||||
|
||||
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_passenger_identifycardtype|id,cardtype')";
|
||||
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idcardtype","tbl_passenger_identifycardtype","$urlcbo","");
|
||||
|
||||
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_route_information|id,routename')";
|
||||
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idroutestart","tbl_route_information","$urlcbo","");
|
||||
|
||||
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_route_information|id,routename')";
|
||||
//$urlother="myForm.getCombo('txt_cargodescription').clearAll();myForm.getCombo('txt_cargodescription').setComboText('');";
|
||||
//$urlother.="var url=fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_cargoprice_information|id,cargocategory,cargodescription:cargodescription,id&and=idroutestart|'+myForm.getItemValue('cbo_idroutestart')+',idrouteend|'+val);";
|
||||
//$urlother.="alert(url);";
|
||||
//$urlother.=$this->FN_COMBOVALIDATIONVALUENEW("myForm","txt_cargodescription","tbl_cargoprice_information","url","",true);
|
||||
//$urlother="fn_showcategory(myForm.getItemValue('cbo_idroutestart'),val);";
|
||||
//$urlother="fn_showcategory();";
|
||||
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idrouteend","tbl_route_information","$urlcbo","");
|
||||
|
||||
|
||||
|
||||
$arrerror=array("cbo_idship"=>"Error Found : Please Insert <b>Ship Name</b> First.Obrigado",
|
||||
"txt_idcategory"=>"Error Found : Please Insert <b>Category</b> First.Obrigado",
|
||||
"txt_tiketnumber"=>"Error Found : Please Insert <b>Ticket Number</b> First.Obrigado",
|
||||
"txt_voynumber"=>"Error Found : Please Insert <b>Voyage Number</b> First.Obrigado",
|
||||
"txt_cargodescription"=>"Error Found : Insert Category <b>Category</b> first.Obrigado",
|
||||
"txt_passengername"=>"Error Found : Please Insert <b>Passenger Name</b> First.Obrigado",
|
||||
"txt_picdata"=>"Error Found : Please Take Camera your <b>Identity</b> First.Obrigado",
|
||||
"cbo_idcardtype"=>"Error Found : Please Insert <b>ID Card</b> First.Obrigado",
|
||||
"txt_cardnumber"=>"Error Found : Please Insert <b>Card Number</b> First.Obrigado",
|
||||
"txt_dates"=>"Error Found : Please Insert <b>Dates</b> First.Obrigado",
|
||||
"cbo_idroutestart"=>"Error Found : Please Insert <b>From</b> First.Obrigado",
|
||||
"cbo_idrouteend"=>"Error Found : Please Insert <b>To</b> First.Obrigado",
|
||||
"txt_price"=>"Error Found : Please Insert <b>Price</b> First.Obrigado",
|
||||
"txt_quantity"=>"Error Found : Please Insert <b>Quantity</b> First.Obrigado",
|
||||
"txt_weight"=>"Error Found : Please Insert <b>Weight</b> First.Obrigado",
|
||||
"txt_totalprice"=>"Error Found : Please Insert <b>Total</b> First.Obrigado"
|
||||
);
|
||||
$this->FN_DHTMLXFORMVALIDATIONERROR("myForm",$arrerror);
|
||||
|
||||
$arrayControls=array("txt_id"=>"","txt_idcategory"=>"","txt_modifcount"=>"","cbo_idship"=>"","txt_tiketnumber"=>"",
|
||||
"txt_tiketnumberpassenger"=>"-","txt_voynumber"=>"","txt_cargodescription"=>"","txt_passengername"=>"",
|
||||
"txt_picdata"=>"","cbo_idcardtype"=>"","txt_dates"=>date("Y-m-d"),"txt_cardnumber"=>"","cbo_idroutestart"=>"",
|
||||
"cbo_idrouteend"=>"","txt_price"=>"0","txt_quantity"=>"0","txt_weight"=>"0","txt_totalprice"=>"0"
|
||||
);
|
||||
|
||||
// === Cbo Ship Change
|
||||
$cboship="if(myForm.getItemValue('cbo_idship')!='')";
|
||||
$cboship.="{";
|
||||
$cboship.=" var sp=ajaxuridhtmlx('".$this->enc("obj_tra")."','obj=".$this->enc("tra_cargticket")."&task=".$this->enc("getheaderinfo")."&idship='+myForm.getItemValue('cbo_idship')).split('|');";
|
||||
$cboship.=" if(trim(sp[0])=='failed'){fn_dhtmlxmessage('error',sp[1]);".$this->FN_DHTMLXWINDOWSHIDEPROGRESS().";return false;}";
|
||||
$cboship.=" var tiketnumber=sp[1];";
|
||||
$cboship.=" myForm.setItemValue('txt_tiketnumber',tiketnumber);";
|
||||
$cboship.="}";
|
||||
$onkeypresscboshipname=$this->FN_DHTMLXWINDOWSHOWPROGESS($cboship);
|
||||
$onkeypresscboshipname.=$this->FN_DHTMLXWINDOWSHIDEPROGRESS();
|
||||
|
||||
// === Cbo Route End Change
|
||||
//$onchangecboidrouteend="if(myForm.getItemValue('cbo_idrouteend')!='')";
|
||||
//$onchangecboidrouteend.="{";
|
||||
//$onchangecboidrouteend.=" var sp=ajaxuridhtmlx('".$this->enc("obj_tra")."','obj=".$this->enc("tra_cargticket")."&task=".$this->enc("getprice")."&idroutestart='+myForm.getItemValue('cbo_idroutestart')+'&idrouteend='+myForm.getItemValue('cbo_idrouteend')).split('|');";
|
||||
//$onchangecboidrouteend.=" if(trim(sp[0])=='failed'){fn_dhtmlxmessage('error',sp[1]);".$this->FN_DHTMLXWINDOWSHIDEPROGRESS().";return false;}";
|
||||
//$onchangecboidrouteend.=" myForm.setItemValue('txt_price',sp[2]);";
|
||||
//$onchangecboidrouteend.=" myForm.setItemValue('txt_totalprice',sp[2]);";
|
||||
//$onchangecboidrouteend.="}";
|
||||
|
||||
// === Form Event
|
||||
$onobjkeydown="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();if(myForm.isItemEnabled('btnupdate')){myForm.setItemFocus('btnupdate');dhtmlXclickButton('btnupdate');}else{myForm.setItemFocus('btnsave');}return false;}";
|
||||
|
||||
$onobjtxtquantity="if(ev.keyCode==13){";
|
||||
$onobjtxtquantity.=" ev.stopPropagation();ev.preventDefault();";
|
||||
$onobjtxtquantity.=" var totalprice=myForm.getItemValue('txt_price')*myForm.getItemValue('txt_quantity');";
|
||||
//$onobjtxtquantity.=" alert(val);";
|
||||
$onobjtxtquantity.=" myForm.setItemValue('txt_totalprice',totalprice);";
|
||||
$onobjtxtquantity.=" myForm.setItemFocus('txt_weight');";
|
||||
$onobjtxtquantity.="}";
|
||||
|
||||
$ontxtcboidrouteend="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();fn_showcategory();";
|
||||
|
||||
$onbuttonclickbtnsave="if(myForm.validate())
|
||||
{
|
||||
dhtmlx.confirm({
|
||||
title:'Confirmation',text:'Are you will be saved and data is correctly?',type:'confirm',
|
||||
callback:function(result){
|
||||
if(result)
|
||||
{";
|
||||
$params="'obj=".$this->enc("tra_cargticket")."&task=".$this->enc("saverecord")."'";
|
||||
$onformsenddata="url=fn_dhtmlxsenddata('".$this->enc("obj_tra")."',$params);
|
||||
myForm.send(url,\"get\",function(loader, response){";
|
||||
$onformsenddata.=$this->FN_DHTMLXWINDOWSHIDEPROGRESS();
|
||||
$onformsenddata.="var sp=trim(response).split('|');
|
||||
//alert(response);
|
||||
if(sp[0]=='ok')
|
||||
{
|
||||
fn_dhtmlxmessage('','Ticket Number <b>'+myForm.getItemValue('txt_tiketnumber')+'</b> has been saved');";
|
||||
$onformsenddata.="document.getElementById('imgtiket').src='';";
|
||||
$onformsenddata.="myForm.setItemLabel('lblmeasure','Measure');";
|
||||
$onformsenddata.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"cbo_idship");
|
||||
$onformsenddata.="fn_grid_loaddata();
|
||||
}
|
||||
else if(sp[0]=='failed')
|
||||
{fn_dhtmlxmessage('error','Error Found : '+sp[1]);}
|
||||
else
|
||||
{fn_dhtmlxmessage('error','Error Found : '+response);}
|
||||
});";
|
||||
$onbuttonclickbtnsave.=$this->FN_DHTMLXWINDOWSHOWPROGESS($onformsenddata);
|
||||
$onbuttonclickbtnsave.=" }
|
||||
}
|
||||
});
|
||||
}";
|
||||
|
||||
$onbuttonclickbtnupdt="if(myForm.validate())
|
||||
{
|
||||
dhtmlx.confirm({
|
||||
title:'Confirmation',text:'Are you will be updated and data is correctly?',type:'confirm',
|
||||
callback:function(result){
|
||||
if(result)
|
||||
{";
|
||||
$params="'obj=".$this->enc("tra_cargticket")."&task=".$this->enc("updrecord")."'";
|
||||
$onformsenddata="url=fn_dhtmlxsenddata('".$this->enc("obj_tra")."',$params);
|
||||
myForm.send(url,\"get\",function(loader, response){";
|
||||
$onformsenddata.=$this->FN_DHTMLXWINDOWSHIDEPROGRESS();
|
||||
$onformsenddata.="var sp=trim(response).split('|');
|
||||
//alert(response);
|
||||
if(sp[0]=='ok')
|
||||
{
|
||||
fn_dhtmlxmessage('','Ticket Number <b>'+myForm.getItemValue('txt_tiketnumber')+'</b> has been update');";
|
||||
$onformsenddata.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"cbo_idship");
|
||||
$onformsenddata.="document.getElementById('imgtiket').src='';";
|
||||
$onformsenddata.="myForm.setItemLabel('lblmeasure','Measure');";
|
||||
$onformsenddata.="myForm.enableItem('btnsave');";
|
||||
$onformsenddata.="myForm.disableItem('btnupdate');";
|
||||
$onformsenddata.="myForm.disableItem('btndelete');";
|
||||
$onformsenddata.="myForm.enableItem('cbo_idship');";
|
||||
$onformsenddata.="myForm.enableItem('txt_tiketnumber');";
|
||||
|
||||
$onformsenddata.="fn_grid_loaddata();
|
||||
}
|
||||
else if(sp[0]=='failed')
|
||||
{fn_dhtmlxmessage('error','Error Found : '+sp[1]);}
|
||||
else
|
||||
{fn_dhtmlxmessage('error','Error Found : '+response);}
|
||||
});";
|
||||
$onbuttonclickbtnupdt.=$this->FN_DHTMLXWINDOWSHOWPROGESS($onformsenddata);
|
||||
$onbuttonclickbtnupdt.=" }
|
||||
}
|
||||
});
|
||||
}";
|
||||
|
||||
$eventafterdeleted=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"cbo_idship");
|
||||
$eventafterdeleted.="document.getElementById('imgtiket').src='';";
|
||||
$eventafterdeleted.="myForm.setItemLabel('lblmeasure','Measure');";
|
||||
$eventafterdeleted.="myForm.enableItem('btnsave');";
|
||||
$eventafterdeleted.="myForm.disableItem('btnupdate');";
|
||||
$eventafterdeleted.="myForm.disableItem('btndelete');";
|
||||
$eventafterdeleted.="fn_grid_loaddata();";
|
||||
$onbuttonclickbtndeleted=$this->FN_DHTMLXREMARKFORDELETED2("obj_tra","tra_cargticket","myForm.getItemValue('txt_id')","myForm.getItemValue('txt_tiketnumber')",$eventafterdeleted);
|
||||
|
||||
$onbuttonclickbtncancel="document.getElementById('imgtiket').src='';";
|
||||
$onbuttonclickbtncancel.="myForm.setItemLabel('lblmeasure','Measure');";
|
||||
$onbuttonclickbtncancel.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls);
|
||||
$onbuttonclickbtncancel.="myForm.enableItem('btnsave');";
|
||||
$onbuttonclickbtncancel.="myForm.disableItem('btnupdate');";
|
||||
$onbuttonclickbtncancel.="myForm.disableItem('btndelete');";
|
||||
$onbuttonclickbtncancel.="myForm.enableItem('cbo_idship');";
|
||||
$onbuttonclickbtncancel.="myForm.enableItem('txt_tiketnumber');";
|
||||
// $onbuttonclickbtncancel.="myForm.disableItem('btndelete');";
|
||||
$onbuttonclickbtncancel.="myForm.setItemFocus('cbo_idship');";
|
||||
|
||||
$onbuttonclickbtncancel.="myForm.setItemFocus('cbo_idship');";
|
||||
$onbuttonclickbtncancel.="fn_grid_loaddata();";
|
||||
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onbuttonclick","eventparam"=>"id,val",
|
||||
"switch"=>array(
|
||||
"btnsave"=>"$onbuttonclickbtnsave",
|
||||
"btnupdate"=>"$onbuttonclickbtnupdt",
|
||||
"btndelete"=>"$onbuttonclickbtndeleted",
|
||||
"btncancel"=>"$onbuttonclickbtncancel"
|
||||
)
|
||||
),
|
||||
array("eventname"=>"onkeydown","eventparam"=>"inp,ev,id,val",
|
||||
"switch"=>array(
|
||||
"txt_totalprice"=>"$onobjkeydown",
|
||||
"txt_quantity"=>"$onobjtxtquantity",
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$this->FN_DHTMLXFORMEVENT("myForm",$arrevent);
|
||||
|
||||
echo "myForm.getCombo('cbo_idship').attachEvent('onKeyPressed',function(keycode){
|
||||
if(keycode==13){".$onkeypresscboshipname."}
|
||||
});";
|
||||
echo "myForm.getCombo('cbo_idrouteend').attachEvent(\"onKeyPressed\", function(keycode){
|
||||
if(keycode==13){
|
||||
fn_showcategory();
|
||||
}
|
||||
});";
|
||||
|
||||
// === FORM SEARCH AND GRID
|
||||
$formdata=array(
|
||||
array("type"=>"settings","position"=>"label-left","labelWidth"=>"180","inputWidth"=>"120"),
|
||||
array("type"=>"fieldset","width"=>"580","label"=>"Search",
|
||||
"list"=>array(
|
||||
array("type"=>"input","name"=>"txtsearch","label"=>"Insert Your Keyword","info"=>"true","inputWidth"=>"240",
|
||||
"tooltip"=>"Insert Your Keyword","maxLength"=>"","className"=>"txtleft","labelWidth"=>"210"),
|
||||
array("type"=>"newcolumn"),
|
||||
array("type"=>"button","name"=>"btnfind","value"=>"","className"=>"button_find","offsetLeft"=>"10","offsetTop"=>"0")
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->FN_DHTMLXFORM("myFormsearch","divcargticketsearch",$formdata,true);
|
||||
$ontxtsearchkeydown="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();myFormsearch.setItemFocus('btnfind');}";
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onbuttonclick","eventparam"=>"id,val",
|
||||
"switch"=>array(
|
||||
"btnfind"=>"fn_grid_loaddata()"
|
||||
)
|
||||
),
|
||||
array("eventname"=>"onchange","eventparam"=>"id,val",
|
||||
"switch"=>array(
|
||||
//"cbo_idrouteend"=>"alert('t');",
|
||||
|
||||
)
|
||||
),
|
||||
array("eventname"=>"onkeydown","eventparam"=>"inp,ev,id,val",
|
||||
"switch"=>array(
|
||||
"txtsearch"=>"$ontxtsearchkeydown"
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->FN_DHTMLXFORMEVENT("myFormsearch",$arrevent);
|
||||
|
||||
$grdinit=array("gridname"=>"dgcargticket","divtarget"=>"div_dgcargticket","divpaging"=>"div_dgcargticketpaging",
|
||||
"paginglimit"=>PAGE_LIMIT,"showloader"=>"true");
|
||||
$gridproperties=array("id"=>"right,ro,96,right,int,false,true",
|
||||
"No. "=>"right,ro,35,center,int,false",
|
||||
"Ship Name"=>"left,ro,140,left,str,false",
|
||||
"Ticket Number"=>"center,ro,130,center,str,false",
|
||||
"Voyage Number"=>"center,ro,130,center,str,false",
|
||||
"Passenger Name"=>"left,ro,262,left,str,false",
|
||||
"ID Card"=>"center,ro,136,center,str,false",
|
||||
"Dates"=>"center,ro,120,center,date,false",
|
||||
"From"=>"left,ro,112,left,str,false",
|
||||
"Category"=>"left,ro,144,left,str,false",
|
||||
"Price "=>"right,ro,120,right,int,false",
|
||||
"Quantity "=>"right,ro,144,right,int,false",
|
||||
"Weight "=>"right,ro,144,right,int,false",
|
||||
"Total "=>"right,ro,120,right,int,false");
|
||||
$this->FN_DHTMLXGRIDVIEW($grdinit,$gridproperties,"bricks","","fn_grid_loaddata()");
|
||||
$arrfields=array("txt_id"=>"","cbo_idship"=>"idship|shipname","txt_tiketnumber"=>"","txt_voynumber"=>"",
|
||||
"txt_cargodescription"=>"","txt_passengername"=>"","cbo_idcardtype"=>"idcardtype|cardtype","txt_cardnumber"=>"","txt_dates"=>"",
|
||||
"cbo_idroutestart"=>"idroutestart|routenamestart","cbo_idrouteend"=>"idrouteend|routenameend","txt_price"=>"",
|
||||
"txt_quantity"=>"","txt_totalprice"=>"","txt_modifcount"=>"","txt_units"=>"","txt_picdata"=>"","txt_idcategory"=>"","txt_weight"=>"");
|
||||
$otherevent="if(spres[14]>1)";
|
||||
$otherevent.="{";
|
||||
$otherevent.=" fn_dhtmlxmessage('error','I\'m sorry you cannot edit this record, only twice for editing! or Cancel this request to your administrator');return false;";
|
||||
$otherevent.="}";
|
||||
$otherevent.="myForm.disableItem('cbo_idship');";
|
||||
$otherevent.="myForm.disableItem('txt_tiketnumber');";
|
||||
$otherevent.="myForm.setItemFocus('txt_voynumber');";
|
||||
$otherevent.="myForm.setItemLabel('lblmeasure',spres[15]);";
|
||||
$otherevent.="document.getElementById('imgtiket').src='uploads/temps/'+spres[16];";
|
||||
|
||||
$this->FN_DHTMLXGRIDVIEWTOFORMNEW("dgcargticket","myForm","tbl_cargo_tiket",0,$arrfields,"",$otherevent);
|
||||
echo " }
|
||||
|
||||
function fn_showcategory()
|
||||
{
|
||||
if(myForm.getItemValue('cbo_idroutestart')==''){
|
||||
fn_dhtmlxmessage('error','Please choice route arrival first ! ');myForm.setItemFocus('cbo_idroutestart');return false;
|
||||
}
|
||||
if(myForm.getItemValue('cbo_idrouteend')==''){
|
||||
fn_dhtmlxmessage('error','Please choice route destination first ! ');myForm.setItemFocus('cbo_idrouteend');return false;
|
||||
}
|
||||
|
||||
dwins=new dhtmlXWindows();dwins.attachViewportTo(\"winVP\");
|
||||
var idroutestart=myForm.getItemValue('cbo_idroutestart');
|
||||
var idrouteend=myForm.getItemValue('cbo_idrouteend');
|
||||
var url='?ajax=1&sec=1&option=".$this->enc("obj_tra")."&obj=".$this->enc("tra_cargticket")."&task=".$this->enc("getcategory")."&idroutestart='+idroutestart+'&idrouteend='+idrouteend;";
|
||||
$rtn="dwins.createWindow(\"winbook\",0,0,850,580);";
|
||||
$rtn.="dwins.window('winbook').denyResize();";
|
||||
$rtn.="dwins.window('winbook').progressOn();";
|
||||
$rtn.="dwins.window(\"winbook\").setText(\"Get Cargo Item\");";
|
||||
$rtn.="dwins.window(\"winbook\").attachURL(url);";
|
||||
$rtn.="dwins.window('winbook').setModal(true);";
|
||||
$rtn.="dwins.window('winbook').progressOff();";
|
||||
echo $rtn;
|
||||
echo " }
|
||||
|
||||
function fn_getCategory(idcategory,categorydescription,price,measure){
|
||||
myForm.setItemValue('txt_idcategory',idcategory);
|
||||
myForm.setItemValue('txt_cargodescription',categorydescription);
|
||||
myForm.setItemLabel('lblmeasure',measure);
|
||||
var qty=myForm.getItemValue('txt_quantity');
|
||||
if(qty<=0){qty=1;}
|
||||
myForm.setItemValue('txt_quantity',qty);
|
||||
myForm.setItemValue('txt_price',price);
|
||||
var totalprice=qty*price;
|
||||
myForm.setItemValue('txt_totalprice',totalprice);
|
||||
myForm.setItemFocus('txt_quantity');
|
||||
dwins.unload();
|
||||
|
||||
}
|
||||
|
||||
function fn_showCamera()
|
||||
{
|
||||
dwins=new dhtmlXWindows();dwins.attachViewportTo(\"winVP\");
|
||||
var picdata=myForm.getItemValue('txt_picdata');
|
||||
var url='?ajax=1&sec=1&option=".$this->enc("obj_tra")."&obj=".$this->enc("tra_cargticket")."&task=".$this->enc("getpic")."&picdata='+picdata;";
|
||||
$url="?ajax=1&sec=1&option=".$this->enc("obj_tra")."&obj=".$this->enc("tra_newticket")."&task=".$this->enc("getpic");
|
||||
$this->FN_DHTMLXWINDOWSURL("dwins","winpic","Get Picture","50","50","560","400",$url,false,true);
|
||||
|
||||
echo " }
|
||||
|
||||
function fn_getPicName(filename){
|
||||
myForm.setItemValue('txt_picdata',filename);
|
||||
myForm.setItemFocus('txt_dates');
|
||||
dwins.unload();
|
||||
document.getElementById('imgtiket').src='uploads/temps/'+filename;
|
||||
|
||||
}
|
||||
|
||||
function fn_grid_loaddata()
|
||||
{
|
||||
var keyword=myFormsearch.getItemValue('txtsearch');
|
||||
url=fn_dhtmlxloadobject('".$this->enc("obj_tra")."','obj=".$this->enc("tra_cargticket")."&task=".$this->enc("grdrecord")."&keyword='+keyword);
|
||||
//alert(url);
|
||||
dgcargticket.clearAndLoad(url);";
|
||||
echo " }
|
||||
</script>";
|
||||
echo $this->FN_CLOSEHEADER();
|
||||
echo $this->FN_CREATEBODY("e8f1ff");
|
||||
|
||||
echo "<div id=\"winVP\" style=\"height:1020px;\">";
|
||||
echo "<table width=\"98%\" border=\"0\">
|
||||
<tr>
|
||||
<td>";
|
||||
$url="location.reload();";
|
||||
$myuri=array("<b>CARGO TICKETING INFORMATION</b>"=>"$url|id='a_cargticket'");
|
||||
echo $this->MULTIPLE_LINK($myuri);
|
||||
echo " </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"divcargticketcontent\" style=\"margin-left:0px;\">
|
||||
<table width=\"98%\" border=\"0\">
|
||||
<tr>
|
||||
<td width=\"45%\" valign=\"top\">
|
||||
<div id=\"divcargticketnew\" style=\"\"></div>
|
||||
</td>
|
||||
<td valign=\"top\">
|
||||
<table width=\"98%\" cellpadding=\"0\" cellspacing=\"0\">
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<div id=\"divcargticketsearch\" style=\"width:560px;margin-top:-6px;\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgcargticket\" style=\"height:380px;width:580px;overflow:hidden\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgcargticketpaging\" style=\"width:598px;margin-top:1px\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td valign=\"top\"><div id=\"loadergrid\" style=\"z-index:100;position:absolute;margin-top:-220px;margin-left:287px;display:visibility;\">".$this->CREATE_IMAGE("loadergrid.gif")."</div></td></tr>
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<table>
|
||||
<tr>
|
||||
<td style='color:red;font-weight:bold;'>Notes</td>
|
||||
<td>:</td>
|
||||
<td>- Click Row For Edit</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>";
|
||||
echo $this->FN_CREATEFOOTER();
|
||||
|
||||
}
|
||||
|
||||
public function fn_grdrecord()
|
||||
{
|
||||
$keyword=$_REQUEST["keyword"];
|
||||
header("Content-type: text/xml");
|
||||
echo('<?xml version="1.0" encoding="utf-8"?>');
|
||||
echo "<rows id='0'>";
|
||||
|
||||
$qry="select id,idship,shipname,tiketnumber,tiketnumberpassenger,voynumber,inctiket,idcategory,cargodescription,passengername,
|
||||
idcardtype,cardtype,cardnumber,dates,idroutestart,routenamestart,idrouteend,
|
||||
routenameend,price,quantity,weight,totalprice,units,modifcount
|
||||
from ".DB_APORTIL.".tbl_cargo_tiket
|
||||
where (tiketnumber like '%$keyword%' or voynumber like '%$keyword%' or passengername like '%$keyword%') and isdeleted=0
|
||||
order by id asc limit ".TBL_PAGE_LIMIT;
|
||||
|
||||
$rs=$this->selectquery($qry);
|
||||
if($rs)
|
||||
{
|
||||
$i=1;
|
||||
while($row=$this->data_row_array($rs))
|
||||
{
|
||||
$color='black';
|
||||
if($row["modifcount"]>=2){$color='grey';}
|
||||
echo ("<row id='".$row["id"]."'>");
|
||||
print("<cell><![CDATA[".$row["id"]."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$i."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["shipname"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["tiketnumber"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["voynumber"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["passengername"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["cardtype"]."/".$row["cardnumber"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".date("Y-m-d",strtotime($row["dates"]))."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["routenamestart"]." to ".$row['routenameend']."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["cargodescription"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["price"]." \$</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["quantity"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["weight"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["totalprice"]." \$</span>"."]]></cell>");
|
||||
echo ("</row>");
|
||||
$i+=1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo mysql_errno().": ".mysql_error()." at ".__LINE__." line in ".__FILE__." file<br>";
|
||||
}
|
||||
echo "</rows>";
|
||||
|
||||
}
|
||||
|
||||
public function fn_saverecord($isupdate=null)
|
||||
{
|
||||
$year=date("Y");
|
||||
if($isupdate){$id=$_REQUEST['txt_id'];}
|
||||
$idship=$_REQUEST['cbo_idship'];
|
||||
$sp=$this->fn_get_fieldsvalues("shipname,shipnumber","select shipname,shipnumber from ".DB_APORTIL.".tbl_ship_information where id='$idship'");
|
||||
$shipnumber=$sp[1];$shipname=$sp[0];
|
||||
$tiketnumber=$_REQUEST['txt_tiketnumber'];
|
||||
$tiketnumberpassenger=$_REQUEST['txt_tiketnumberpassenger'];
|
||||
$voynumber=$_REQUEST['txt_voynumber'];
|
||||
$inctiket=$_REQUEST['txt_inctiket'];
|
||||
$idcategory=$_REQUEST['txt_idcategory'];
|
||||
$spcategory=$this->fn_get_fieldsvalues("id,cargocategory,cargodescription,idunits,units","select id,cargocategory,cargodescription,idunits,units from tbl_cargoprice_information where id='$idcategory'");
|
||||
$cargocategory=$spcategory[1];
|
||||
$cargodescription=$spcategory[2];
|
||||
$idunits=$spcategory[3];
|
||||
$units=$spcategory[4];
|
||||
|
||||
$inctiket=0;
|
||||
if(!$isupdate){
|
||||
$inctiket=$this->fn_get_fieldvalue("incnumber","select count(id) incnumber from ".DB_APORTIL.".tbl_cargo_tiket where isdeleted=0 and years='$year'");
|
||||
$inctiket+=1;
|
||||
}
|
||||
|
||||
$passengername=$_REQUEST['txt_passengername'];
|
||||
$idcardtype=$_REQUEST['cbo_idcardtype'];
|
||||
$cardtype=$this->fn_get_fieldvalue("cardtype","select cardtype from ".DB_APORTIL.".tbl_passenger_identifycardtype where id='$idcardtype'");
|
||||
$cardnumber=$_REQUEST['txt_cardnumber'];
|
||||
$picdata=$_REQUEST['txt_picdata'];
|
||||
$dates=$_REQUEST['txt_dates'];
|
||||
$idroutestart=$_REQUEST['cbo_idroutestart'];
|
||||
$routenamestart=$this->fn_get_fieldvalue("routename","select routename from ".DB_APORTIL.".tbl_route_information where id='$idroutestart'");
|
||||
$idrouteend=$_REQUEST['cbo_idrouteend'];
|
||||
$routenameend=$this->fn_get_fieldvalue("routename","select routename from ".DB_APORTIL.".tbl_route_information where id='$idrouteend'");
|
||||
|
||||
$price=$_REQUEST['txt_price'];
|
||||
$quantity=$_REQUEST['txt_quantity'];
|
||||
$weight=$_REQUEST['txt_weight'];
|
||||
$totalprice=$_REQUEST['txt_totalprice'];
|
||||
|
||||
$qry="insert into ".DB_APORTIL.".tbl_cargo_tiket
|
||||
set idship='$idship',tiketnumber='$tiketnumber',tiketnumberpassenger='$tiketnumberpassenger',voynumber='$voynumber',inctiket='$inctiket',
|
||||
idcategory='$idcategory',cargocategory='$cargocategory',cargodescription='$cargodescription',shipnumber='$shipnumber',shipname='$shipname',
|
||||
passengername='$passengername',idcardtype='$idcardtype',cardtype='$cardtype',cardnumber='$cardnumber',picdata='$picdata',dates='$dates',
|
||||
idroutestart='$idroutestart',routenamestart='$routenamestart',idrouteend='$idrouteend',routenameend='$routenameend',idunits='$idunits',status=0,
|
||||
units='$units',price='$price',quantity='$quantity',weight='$weight',totalprice='$totalprice',years='$year',iby='".$_SESSION['nik']."',idt=now()";
|
||||
if($isupdate)
|
||||
{
|
||||
$qry="update ".DB_APORTIL.".tbl_cargo_tiket
|
||||
set idship='$idship',tiketnumber='$tiketnumber',tiketnumberpassenger='$tiketnumberpassenger',voynumber='$voynumber',
|
||||
idcategory='$idcategory',cargocategory='$cargocategory',cargodescription='$cargodescription',shipnumber='$shipnumber',shipname='$shipname',
|
||||
passengername='$passengername',idcardtype='$idcardtype',cardtype='$cardtype',cardnumber='$cardnumber',picdata='$picdata',dates='$dates',
|
||||
idroutestart='$idroutestart',routenamestart='$routenamestart',idrouteend='$idrouteend',routenameend='$routenameend',idunits='$idunits',
|
||||
units='$units',price='$price',quantity='$quantity',weight='$weight',totalprice='$totalprice',modifcount=modifcount+1,uby='".$_SESSION['nik']."',udt=now()
|
||||
where id='$id'";
|
||||
}
|
||||
|
||||
if($this->executequery($qry))
|
||||
{
|
||||
if(!$isupdate)
|
||||
{
|
||||
$idtransaction=mysql_insert_id();
|
||||
$rtn=$this->fn_printtra($idtransaction);
|
||||
echo $rtn;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "ok|";return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
public function fn_updrecord(){$this->fn_saverecord(true);}
|
||||
|
||||
public function fn_delrecord()
|
||||
{
|
||||
$id=$_REQUEST['txt_id'];
|
||||
$remark=$_REQUEST['txtremark'];
|
||||
$qry="update ".DB_APORTIL.".tbl_cargo_tiket
|
||||
set isdeleted=1,remark='$remark',dby='".$_SESSION['nik']."',ddt=now()
|
||||
where id='$id'";
|
||||
if($this->executequery($qry)){echo "ok|";return true;}
|
||||
else
|
||||
{
|
||||
echo "failed|".$this->getErrorQuery();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function fn_printtra($idtransaction)
|
||||
{
|
||||
$tiketnumber=$_REQUEST['txt_tiketnumber'];
|
||||
$idcategory=$_REQUEST['txt_idcategory'];
|
||||
$spcategory=$this->fn_get_fieldsvalues("id,cargocategory,cargodescription,idunits,units","select id,cargocategory,cargodescription,idunits,units from tbl_cargoprice_information where id='$idcategory'");
|
||||
$cargocategory=$spcategory[1];
|
||||
$cargodescription=$spcategory[2];
|
||||
$ipprintclient=$this->get_client_ip();
|
||||
$jobgroup="TICV";
|
||||
|
||||
if($cargocategory!=='Veiculos'){$jobgroup="TICNV";}
|
||||
$qry="insert into ".DB_APORTIL.".tbl_printjob
|
||||
set idtransaction='$idtransaction',ipprintclient='$ipprintclient',idemployee='".$_SESSION['idemployee']."',nik='".$_SESSION['nik']."',
|
||||
employeename='".$_SESSION['employeename']."',jobgroup='$jobgroup',jobremark='$tiketnumber',iby='".$_SESSION['nik']."',idt=now()";
|
||||
$qrychk="select id from ".DB_APORTIL.".tbl_printjob where ipprintclient='$ipprintclient' order by id desc limit 1";
|
||||
if($this->fn_row_isexists($qrychk))
|
||||
{
|
||||
$id=$this->fn_get_fieldvalue("id",$qrychk);
|
||||
$qry="update ".DB_APORTIL.".tbl_printjob
|
||||
set idtransaction='$idtransaction',ipprintclient='$ipprintclient',idemployee='".$_SESSION['idemployee']."',nik='".$_SESSION['nik']."',
|
||||
employeename='".$_SESSION['employeename']."',jobgroup='$jobgroup',jobremark='$tiketnumber',uby='".$_SESSION['nik']."',udt=now()
|
||||
where id='$id'";
|
||||
}
|
||||
|
||||
$rtn="failed|Print Tiket $tiketnumber failed, please contact your administrator. Thank you";
|
||||
if($this->executequery($qry))
|
||||
{
|
||||
$rtn="ok|";
|
||||
}
|
||||
return $rtn;
|
||||
}
|
||||
|
||||
|
||||
public function fn_getticket(){
|
||||
$valticket="";
|
||||
for($i=1;$i<=8;$i++){
|
||||
$valticket.=rand(0,9);
|
||||
}
|
||||
$sql="select tiketnumber from ".DB_APORTIL.".tbl_cargo_tiket where tiketnumber='".$tiketnumber."' order by id desc limit 1";
|
||||
if($this->fn_row_isexists($sql)){
|
||||
$this->fn_getticket();
|
||||
}
|
||||
return $valticket;
|
||||
}
|
||||
public function fn_getheaderinfo(){
|
||||
$idship=$_REQUEST['idship'];
|
||||
$tiketnumber=$this->fn_getticket();
|
||||
echo "ok|".$tiketnumber;
|
||||
}
|
||||
|
||||
|
||||
public function fn_getpic(){
|
||||
$picdata=$_REQUEST['picdata'];
|
||||
if($picdata){unlink('uploads/temps/'.$picdata);}
|
||||
|
||||
echo $this->FN_CREATEHEADER();
|
||||
echo "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\" />";
|
||||
echo "<script src=\"".PATH_THEME."/js/camupload.js\"></script>";
|
||||
echo "<script>
|
||||
function initObject()
|
||||
{}
|
||||
function fn_setImage(filename){
|
||||
//window.opener.document.getElementById(\"blah_ReturnValue\").value = rv;
|
||||
window.parent.fn_getPicName(filename);
|
||||
|
||||
}";
|
||||
echo "</script>
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
margin: 0px;
|
||||
/*background-color: #EBEBEB;*/
|
||||
}
|
||||
</style>";
|
||||
echo $this->FN_CLOSEHEADER();
|
||||
echo $this->FN_CREATEBODY("e8f1ff");
|
||||
// echo "<div id=\"vid-controls\" style=\"margin-left:-80px\">
|
||||
//
|
||||
// </div>";
|
||||
echo "<video id=\"vid-show\" autoplay height=\"400\"></video>
|
||||
<div style=\"position:absolute;z-index:999;margin-top:-18%;margin-left:90%\">
|
||||
<a href=\"javascript:void(0)\" id=\"vid-take\" style=\"color:white\"><i class=\"fa fa-camera\" style=\"font-size:26pt;\"></i></a>
|
||||
</div>
|
||||
<div id=\"vid-canvas\" style=\"\"></div>";
|
||||
//echo "<button onClick='fn_setImage()'>Show Parent</button>";
|
||||
echo $this->FN_CREATEFOOTER();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function fn_getcategory()
|
||||
{
|
||||
echo $this->FN_CREATEHEADER();
|
||||
$idroutestart=$_REQUEST['idroutestart'];
|
||||
$idrouteend=$_REQUEST['idrouteend'];
|
||||
echo "<style>
|
||||
.besidebtnsave {margin-left:110px;margin-top:-6px;position:absolute;}
|
||||
.besidebtnupdate {margin-left:212px;margin-top:-6px;position:absolute;}
|
||||
.besidebtnsubmit {margin-left:292px;margin-top:-6px;position:absolute;}
|
||||
.besidebtndelete {margin-left:310px;margin-top:-6px;position:absolute;}
|
||||
.besidelabel {margin-left:300px;margin-top:-6px;position:absolute;}
|
||||
</style>";
|
||||
echo "<script>
|
||||
var myForm,myFormsearch,dgcargoprice;
|
||||
function initObject()
|
||||
{";
|
||||
// === FORM SEARCH AND GRID
|
||||
$formdata=array(
|
||||
array("type"=>"settings","position"=>"label-left","labelWidth"=>"180","inputWidth"=>"120"),
|
||||
array("type"=>"fieldset","width"=>"780","label"=>"Search",
|
||||
"list"=>array(
|
||||
array("type"=>"input","name"=>"txtsearch","label"=>"Insert Your Keyword","info"=>"true","inputWidth"=>"240",
|
||||
"tooltip"=>"Insert Your Keyword","maxLength"=>"","className"=>"txtleft","labelWidth"=>"210"),
|
||||
array("type"=>"newcolumn"),
|
||||
array("type"=>"button","name"=>"btnfind","value"=>"","className"=>"button_find","offsetLeft"=>"10","offsetTop"=>"5")
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->FN_DHTMLXFORM("myFormsearch","divcargopricesearch",$formdata,true);
|
||||
$ontxtsearchkeydown="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();myFormsearch.setItemFocus('btnfind');}";
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onbuttonclick","eventparam"=>"id,val",
|
||||
"switch"=>array(
|
||||
"btnfind"=>"fn_grid_loaddata()"
|
||||
)
|
||||
),
|
||||
array("eventname"=>"onkeydown","eventparam"=>"inp,ev,id,val",
|
||||
"switch"=>array(
|
||||
"txtsearch"=>"$ontxtsearchkeydown"
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->FN_DHTMLXFORMEVENT("myFormsearch",$arrevent);
|
||||
|
||||
$grdinit=array("gridname"=>"dgcargoprice","divtarget"=>"div_dgcargoprice","divpaging"=>"div_dgcargopricepaging","paginglimit"=>PAGE_LIMIT,
|
||||
"showloader"=>"true");
|
||||
$gridproperties=array("id"=>"right,ro,96,right,int,false,true",
|
||||
"No. "=>"right,ro,35,center,int,false",
|
||||
"Category"=>"left,ro,144,left,str,false",
|
||||
"Category Description"=>"left,ro,200,left,str,false",
|
||||
"Destination"=>"left,ro,160,left,str,false",
|
||||
"Prices "=>"right,ro,110,right,int,false",
|
||||
"Priceshide "=>"right,ro,110,right,int,false,true",
|
||||
"Units "=>"right,ro,110,right,str,false",
|
||||
"Years"=>"center,ro,110,center,int,false");
|
||||
$this->FN_DHTMLXGRIDVIEW($grdinit,$gridproperties,"bricks","","fn_grid_loaddata()");
|
||||
echo "dgcargoprice.attachEvent(\"onRowDblClicked\", function(rId,cInd){
|
||||
var idcategory=dgcargoprice.cells(rId,0).getValue();
|
||||
var categorydescription=dgcargoprice.cells(rId,3).getValue();
|
||||
var price=dgcargoprice.cells(rId,6).getValue();
|
||||
var units=dgcargoprice.cells(rId,7).getValue();
|
||||
window.parent.fn_getCategory(idcategory,categorydescription,price,units);
|
||||
});";
|
||||
echo " }
|
||||
|
||||
function fn_grid_loaddata()
|
||||
{
|
||||
var keyword=myFormsearch.getItemValue('txtsearch');
|
||||
url=fn_dhtmlxloadobject('".$this->enc("obj_tra")."','obj=".$this->enc("tra_cargticket")."&task=".$this->enc("grdcategory")."&idroutestart=$idroutestart&idrouteend=$idrouteend&keyword='+keyword);
|
||||
//alert(url);
|
||||
dgcargoprice.clearAndLoad(url);";
|
||||
echo " }
|
||||
</script>";
|
||||
echo $this->FN_CLOSEHEADER();
|
||||
echo $this->FN_CREATEBODY("e8f1ff");
|
||||
|
||||
echo "<table width=\"98%\" border=\"0\">
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<table width=\"98%\" cellpadding=\"0\" cellspacing=\"0\">
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<div id=\"divcargopricesearch\" style=\"width:760px;margin-top:-6px;\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgcargoprice\" style=\"height:380px;width:780px;overflow:hidden\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgcargopricepaging\" style=\"width:598px;margin-top:1px\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td valign=\"top\"><div id=\"loadergrid\" style=\"z-index:100;position:absolute;margin-top:-220px;margin-left:387px;display:visibility;\">".$this->CREATE_IMAGE("loadergrid.gif")."</div></td></tr>
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<table>
|
||||
<tr>
|
||||
<td style='color:red;font-weight:bold;'>Notes</td>
|
||||
<td>:</td>
|
||||
<td>- Double Click Row For Get Data</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>";
|
||||
echo $this->FN_CREATEFOOTER();
|
||||
|
||||
}
|
||||
|
||||
public function fn_grdcategory()
|
||||
{
|
||||
$idroutestart=$_REQUEST["idroutestart"];
|
||||
$idrouteend=$_REQUEST["idrouteend"];
|
||||
$keyword=$_REQUEST["keyword"];
|
||||
header("Content-type: text/xml");
|
||||
echo('<?xml version="1.0" encoding="utf-8"?>');
|
||||
echo "<rows id='0'>";
|
||||
|
||||
$qry="select id,idcategory,cargocategory,cargodescription,routenamestart,routenameend,units,prices,years
|
||||
from ".DB_APORTIL.".tbl_cargoprice_information
|
||||
where (cargodescription like '%$keyword%' or cargocategory like '%$keyword%') and (idroutestart='$idroutestart' and idrouteend='$idrouteend') and isdeleted=0
|
||||
order by id asc limit ".TBL_PAGE_LIMIT;
|
||||
|
||||
$rs=$this->selectquery($qry);
|
||||
if($rs)
|
||||
{
|
||||
$i=1;
|
||||
while($row=$this->data_row_array($rs))
|
||||
{
|
||||
echo ("<row id='".$row["id"]."'>");
|
||||
print("<cell><![CDATA[".$row["id"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$i."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["cargocategory"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["cargodescription"]."]]></cell>");
|
||||
$destination=$row['routenamestart']."-".$row['routenameend'];
|
||||
print("<cell><![CDATA[".$destination."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["prices"]." \$]]></cell>");
|
||||
print("<cell><![CDATA[".$row["prices"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["units"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["years"]."]]></cell>");
|
||||
echo ("</row>");
|
||||
$i+=1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo mysql_errno().": ".mysql_error()." at ".__LINE__." line in ".__FILE__." file<br>";
|
||||
}
|
||||
echo "</rows>";
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
958
objectx/obj_tra/tra_cargticket_20200327.php
Normal file
958
objectx/obj_tra/tra_cargticket_20200327.php
Normal file
@ -0,0 +1,958 @@
|
||||
<?php
|
||||
class TRA_CARGTICKET extends TRA
|
||||
{
|
||||
public function tra_cargticket_javainit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function fn_cargticket_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_cargticket();
|
||||
break;
|
||||
|
||||
case $task:
|
||||
$task="fn_".$task;
|
||||
if(method_exists($this,$task)){$this->$task();}
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->fn_default_cargticket();
|
||||
break;
|
||||
}
|
||||
}
|
||||
public function fn_default_cargticket()
|
||||
{
|
||||
echo $this->FN_CREATEHEADER();
|
||||
echo "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\" />";
|
||||
echo "<style>
|
||||
.besidecboidcard {margin-left:280px;margin-top:-5px;position:absolute;}
|
||||
.besidetxttiketnumber {margin-left:325px;margin-top:-6px;position:absolute;}
|
||||
.besidelabel {margin-left:280px;margin-top:-5px;position:absolute;}
|
||||
.containerpicture {margin-left:0px;margin-top:0px;}
|
||||
.containerbtnlookcategory {margin-left:400px;margin-top:-19px;position:absolute;}
|
||||
.besidelabelprice {margin-left:275px;margin-top:-6px;position:absolute;}
|
||||
.besidecbofrom {margin-left:305px;margin-top:-5px;position:absolute;}
|
||||
.besidebtnsave {margin-left:104px;margin-top:-6px;position:absolute;}
|
||||
.besidebtnupdate {margin-left:198px;margin-top:-6px;position:absolute;}
|
||||
.besidebtnsubmit {margin-left:292px;margin-top:-6px;position:absolute;}
|
||||
.besidebtndelete {margin-left:288px;margin-top:-6px;position:absolute;}
|
||||
</style>";
|
||||
echo "<script>
|
||||
var myForm,myFormsearch,myFormcat,dgcargticket,dwins,dhxwin,dgfindcategory;
|
||||
function initObject()
|
||||
{";
|
||||
$formdata=array(
|
||||
array("type"=>"settings","position"=>"label-left","labelWidth"=>"180","inputWidth"=>"120"),
|
||||
array("type"=>"block","width"=>"500",
|
||||
"list"=>array(
|
||||
array("type"=>"hidden","name"=>"txt_id"),
|
||||
array("type"=>"hidden","name"=>"txt_idcategory"),
|
||||
array("type"=>"hidden","name"=>"txt_modifcount"),
|
||||
array("type"=>"hidden","name"=>"txt_units"),
|
||||
array("type"=>"combo","name"=>"cbo_idship","label"=>"Ship Name","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"0","placeholder"=>"Please enter your email",
|
||||
"tooltip"=>"Pilih Ship Name First. Obrigado","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtcenter"),
|
||||
array("type"=>"input","name"=>"txt_tiketnumber","label"=>"Ticket Number","info"=>"true","inputWidth"=>"135","value"=>"",
|
||||
"tooltip"=>"Entry Ticket Number First. Obrigado","maxLength"=>"40","className"=>"txtcenter","readonly"=>"true"),
|
||||
array("type"=>"input","name"=>"txt_tiketnumberpassenger","label"=>"","info"=>"true","inputWidth"=>"135","value"=>"-","note"=>array("text"=>"Passenger Tiket ( Optional )"),
|
||||
"tooltip"=>"Entry Ticket Number First. Obrigado","maxLength"=>"40","className"=>"txtleft besidetxttiketnumber"),
|
||||
array("type"=>"input","name"=>"txt_voynumber","label"=>"Voyage Number","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"","offsetTop"=>"20",
|
||||
"tooltip"=>"Entry Voyage Number First. Obrigado","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft"),
|
||||
// array("type"=>"input","name"=>"txt_inctiket","label"=>"No. Sequence","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
// "tooltip"=>"Entry No. Sequence First. Obrigado","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtcenter"),
|
||||
array("type"=>"input","name"=>"txt_passengername","label"=>"Passenger Name","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"",
|
||||
"tooltip"=>"Entry Passenger Name First. Obrigado","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft"),
|
||||
array("type"=>"combo","name"=>"cbo_idcardtype","label"=>"ID Card","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Pilih ID Card First. Obrigado","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtcenter"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"input","name"=>"txt_cardnumber","label"=>"","required"=>"true","info"=>"true","inputWidth"=>"120","value"=>"",
|
||||
"tooltip"=>"Entry Picture First. Obrigado","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft besidecboidcard",
|
||||
"note"=>array("text"=>"Insert ID card Number")),
|
||||
//array("type"=>"container","name"=>"containerpicture","label"=>"Take Picture","className"=>"containerpicture","offsetTop"=>"20"),
|
||||
|
||||
array("type"=>"hidden","name"=>"txt_picdata","label"=>"Picture","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"aportildefault.png",
|
||||
"tooltip"=>"Entry Picture First. Obrigado","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft"),
|
||||
|
||||
array("type"=>"calendar","name"=>"txt_dates","label"=>"Dates","required"=>"true","info"=>"true","inputWidth"=>"90","readonly"=>"true","value"=>date("Y-m-d"),
|
||||
"tooltip"=>"Entry Dates First. Obrigado","validate"=>"NotEmpty","maxLength"=>"","className"=>"txtcenter","dateFormat"=>"%Y-%m-%d"),
|
||||
|
||||
array("type"=>"combo","name"=>"cbo_idroutestart","label"=>"From","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Pilih From First. Obrigado","validate"=>"NotEmpty","maxLength"=>"6","className"=>"txtcenter"),
|
||||
array("type"=>"newColumn"),
|
||||
|
||||
array("type"=>"label","name"=>"lblmeter","label"=>"to","className"=>"besidelabel"),
|
||||
array("type"=>"combo","name"=>"cbo_idrouteend","label"=>"","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Pilih To First. Obrigado","validate"=>"NotEmpty","maxLength"=>"6","className"=>"txtcenter besidecbofrom"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"container","name"=>"containerlookcategory","label"=>"","className"=>"containerbtnlookcategory","offsetTop"=>"20"),
|
||||
|
||||
array("type"=>"input","name"=>"txt_cargodescription","label"=>"Category","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"",
|
||||
"tooltip"=>"Insert Category First. Thank you","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft","readonly"=>true),
|
||||
|
||||
array("type"=>"input","name"=>"txt_quantity","label"=>"Quantity","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Entry Quantity First. Obrigado","validate"=>"NotEmpty,ValidNumeric","maxLength"=>"","className"=>"txtright"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"label","name"=>"lblmeasure","label"=>"Measure","className"=>"besidelabelprice"),
|
||||
|
||||
array("type"=>"input","name"=>"txt_weight","label"=>"Weight","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Entry Weight First. Obrigado","validate"=>"NotEmpty,ValidNumeric","maxLength"=>"","className"=>"txtright"),
|
||||
|
||||
array("type"=>"input","name"=>"txt_price","label"=>"Price","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0","readonly"=>true,
|
||||
"tooltip"=>"Entry Price First. Obrigado","validate"=>"NotEmpty","maxLength"=>"","className"=>"txtright","readonly"=>"true"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"label","name"=>"lblmeter","label"=>"\$","className"=>"besidelabelprice"),
|
||||
|
||||
array("type"=>"input","name"=>"txt_totalprice","label"=>"Total","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Entry Total First. Obrigado","validate"=>"NotEmpty","maxLength"=>"","className"=>"txtright","readonly"=>"true"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"label","name"=>"lblmeter","label"=>"\$","className"=>"besidelabelprice"),
|
||||
|
||||
array("type"=>"button","name"=>"btnsave","value"=>"Save","className"=>"button_update","offsetLeft"=>"20","offsetTop"=>"15"),
|
||||
array("type"=>"button","name"=>"btnupdate","value"=>"Update","className"=>"button_saveas besidebtnsave","offsetLeft"=>"10","disabled"=>"1"),
|
||||
//array("type"=>"button","name"=>"btnsubmit","value"=>"Submit","className"=>"button_submit besidebtnupdate","offsetLeft"=>"0","disabled"=>"1"),
|
||||
array("type"=>"button","name"=>"btndelete","value"=>"Delete","className"=>"button_delete besidebtnupdate","offsetLeft"=>"20","disabled"=>"1"),
|
||||
array("type"=>"button","name"=>"btncancel","value"=>"Cancel","className"=>"button_cancel besidebtndelete","offsetLeft"=>"30","disabled"=>"0")
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->FN_DHTMLXFORM("myForm","divcargticketnew",$formdata);
|
||||
$mycontainerpic="var divpicture=document.createElement('DIV');";
|
||||
$mycontainerpic.="divpicture.id='divpicture';divpicture.style.height='100%';";
|
||||
$mycontainerpic.="var divpicturecontent='<table id=\"tbfindinvoice\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin-top:0px;margin-left:-5px;\">';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+'<tbody>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <tr>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <td>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <div id=\"divimage\" style=\"height:180px;width:280px;background-color:#2c3e50;margin-left:5px;\">';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <image id=\"imgtiket\" style=\"height:180px;width:280px;\" />';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' </div>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <div style=\"position:absolute;z-index:100;margin-top:-50px;margin-left:10px\">';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <button id=\"btntake\" onClick=\"fn_showCamera()\"><i class=\"fa fa-camera\" style=\"font-size:30pt\"></i></button>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' </div>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' </td>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' </tr>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+'</tbody>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+'</table>';";
|
||||
|
||||
$mycontainerpic.="divpicture.innerHTML=divpicturecontent;";
|
||||
$mycontainerpic.="myForm.getContainer('containerpicture').appendChild(divpicture);";
|
||||
|
||||
//echo $mycontainerpic;
|
||||
|
||||
$mycontainerbtncat="var divbtncat=document.createElement('DIV');";
|
||||
$mycontainerbtncat.="divbtncat.id='divbtncat';divbtncat.style.height='100%';";
|
||||
$mycontainerbtncat.="var divbtncatcontent='<button id=\"btntake\" onClick=\"fn_showcategory()\"><i class=\"fa fa-upload\" style=\"font-size:14pt\"></i></button>';";
|
||||
$mycontainerbtncat.="divbtncat.innerHTML=divbtncatcontent;";
|
||||
$mycontainerbtncat.="myForm.getContainer('containerlookcategory').appendChild(divbtncat);";
|
||||
|
||||
echo $mycontainerbtncat;
|
||||
|
||||
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_ship_information|id,shipname')";
|
||||
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idship","tbl_ship_information","$urlcbo","");
|
||||
|
||||
// $urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_cargoprice_information|id,cargodescription')";
|
||||
// $this->FN_COMBOVALIDATIONVALUENEW("myForm","txt_cargodescription","tbl_cargoprice_information","$urlcbo","");
|
||||
|
||||
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_passenger_identifycardtype|id,cardtype')";
|
||||
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idcardtype","tbl_passenger_identifycardtype","$urlcbo","");
|
||||
|
||||
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_route_information|id,routename')";
|
||||
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idroutestart","tbl_route_information","$urlcbo","");
|
||||
|
||||
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_route_information|id,routename')";
|
||||
//$urlother="myForm.getCombo('txt_cargodescription').clearAll();myForm.getCombo('txt_cargodescription').setComboText('');";
|
||||
//$urlother.="var url=fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_cargoprice_information|id,cargocategory,cargodescription:cargodescription,id&and=idroutestart|'+myForm.getItemValue('cbo_idroutestart')+',idrouteend|'+val);";
|
||||
//$urlother.="alert(url);";
|
||||
//$urlother.=$this->FN_COMBOVALIDATIONVALUENEW("myForm","txt_cargodescription","tbl_cargoprice_information","url","",true);
|
||||
//$urlother="fn_showcategory(myForm.getItemValue('cbo_idroutestart'),val);";
|
||||
//$urlother="fn_showcategory();";
|
||||
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idrouteend","tbl_route_information","$urlcbo","");
|
||||
|
||||
|
||||
|
||||
$arrerror=array("cbo_idship"=>"Error Found : Please Insert <b>Ship Name</b> First.Obrigado",
|
||||
"txt_idcategory"=>"Error Found : Please Insert <b>Category</b> First.Obrigado",
|
||||
"txt_tiketnumber"=>"Error Found : Please Insert <b>Ticket Number</b> First.Obrigado",
|
||||
"txt_voynumber"=>"Error Found : Please Insert <b>Voyage Number</b> First.Obrigado",
|
||||
//"txt_cargodescription"=>"Error Found : Insert Category <b>Category</b> first.Obrigado",
|
||||
"txt_passengername"=>"Error Found : Please Insert <b>Passenger Name</b> First.Obrigado",
|
||||
//"txt_picdata"=>"Error Found : Please Take Camera your <b>Identity</b> First.Obrigado",
|
||||
"cbo_idcardtype"=>"Error Found : Please Insert <b>ID Card</b> First.Obrigado",
|
||||
"txt_cardnumber"=>"Error Found : Please Insert <b>Card Number</b> First.Obrigado",
|
||||
"txt_dates"=>"Error Found : Please Insert <b>Dates</b> First.Obrigado",
|
||||
"cbo_idroutestart"=>"Error Found : Please Insert <b>From</b> First.Obrigado",
|
||||
"cbo_idrouteend"=>"Error Found : Please Insert <b>To</b> First.Obrigado",
|
||||
"txt_price"=>"Error Found : Please Insert <b>Price</b> First.Obrigado",
|
||||
"txt_quantity"=>"Error Found : Please Insert <b>Quantity</b> First.Obrigado",
|
||||
"txt_weight"=>"Error Found : Please Insert <b>Weight</b> First.Obrigado",
|
||||
"txt_totalprice"=>"Error Found : Please Insert <b>Total</b> First.Obrigado"
|
||||
);
|
||||
$this->FN_DHTMLXFORMVALIDATIONERROR("myForm",$arrerror);
|
||||
|
||||
$arrayControls=array("txt_id"=>"","txt_idcategory"=>"","txt_modifcount"=>"","cbo_idship"=>"","txt_tiketnumber"=>"",
|
||||
"txt_tiketnumberpassenger"=>"-","txt_voynumber"=>"","txt_cargodescription"=>"","txt_passengername"=>"",
|
||||
"txt_picdata"=>"aportildefault.png","cbo_idcardtype"=>"","txt_dates"=>date("Y-m-d"),"txt_cardnumber"=>"","cbo_idroutestart"=>"",
|
||||
"cbo_idrouteend"=>"","txt_price"=>"0","txt_quantity"=>"0","txt_weight"=>"0","txt_totalprice"=>"0"
|
||||
);
|
||||
|
||||
// === Cbo Ship Change
|
||||
$cboship="if(myForm.getItemValue('cbo_idship')!='')";
|
||||
$cboship.="{";
|
||||
$cboship.=" var sp=ajaxuridhtmlx('".$this->enc("obj_tra")."','obj=".$this->enc("tra_cargticket")."&task=".$this->enc("getheaderinfo")."&idship='+myForm.getItemValue('cbo_idship')).split('|');";
|
||||
$cboship.=" if(trim(sp[0])=='failed'){fn_dhtmlxmessage('error',sp[1]);".$this->FN_DHTMLXWINDOWSHIDEPROGRESS().";return false;}";
|
||||
$cboship.=" var tiketnumber=sp[1];";
|
||||
$cboship.=" myForm.setItemValue('txt_tiketnumber',tiketnumber);";
|
||||
$cboship.="}";
|
||||
$onkeypresscboshipname=$this->FN_DHTMLXWINDOWSHOWPROGESS($cboship);
|
||||
$onkeypresscboshipname.=$this->FN_DHTMLXWINDOWSHIDEPROGRESS();
|
||||
|
||||
// === Cbo Route End Change
|
||||
//$onchangecboidrouteend="if(myForm.getItemValue('cbo_idrouteend')!='')";
|
||||
//$onchangecboidrouteend.="{";
|
||||
//$onchangecboidrouteend.=" var sp=ajaxuridhtmlx('".$this->enc("obj_tra")."','obj=".$this->enc("tra_cargticket")."&task=".$this->enc("getprice")."&idroutestart='+myForm.getItemValue('cbo_idroutestart')+'&idrouteend='+myForm.getItemValue('cbo_idrouteend')).split('|');";
|
||||
//$onchangecboidrouteend.=" if(trim(sp[0])=='failed'){fn_dhtmlxmessage('error',sp[1]);".$this->FN_DHTMLXWINDOWSHIDEPROGRESS().";return false;}";
|
||||
//$onchangecboidrouteend.=" myForm.setItemValue('txt_price',sp[2]);";
|
||||
//$onchangecboidrouteend.=" myForm.setItemValue('txt_totalprice',sp[2]);";
|
||||
//$onchangecboidrouteend.="}";
|
||||
|
||||
// === Form Event
|
||||
$onobjkeydown="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();if(myForm.isItemEnabled('btnupdate')){myForm.setItemFocus('btnupdate');dhtmlXclickButton('btnupdate');}else{myForm.setItemFocus('btnsave');}return false;}";
|
||||
|
||||
$onobjtxtquantity="if(ev.keyCode==13){";
|
||||
$onobjtxtquantity.=" ev.stopPropagation();ev.preventDefault();";
|
||||
$onobjtxtquantity.=" var totalprice=myForm.getItemValue('txt_price')*myForm.getItemValue('txt_quantity');";
|
||||
//$onobjtxtquantity.=" alert(val);";
|
||||
$onobjtxtquantity.=" myForm.setItemValue('txt_totalprice',totalprice);";
|
||||
$onobjtxtquantity.=" myForm.setItemFocus('txt_weight');";
|
||||
$onobjtxtquantity.="}";
|
||||
|
||||
$ontxtcboidrouteend="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();fn_showcategory();";
|
||||
//$onformsenddata.="document.getElementById('imgtiket').src='';";
|
||||
$onbuttonclickbtnsave="if(myForm.validate())
|
||||
{
|
||||
dhtmlx.confirm({
|
||||
title:'Confirmation',text:'Are you will be saved and data is correctly?',type:'confirm',
|
||||
callback:function(result){
|
||||
if(result)
|
||||
{";
|
||||
$params="'obj=".$this->enc("tra_cargticket")."&task=".$this->enc("saverecord")."'";
|
||||
$onformsenddata="url=fn_dhtmlxsenddata('".$this->enc("obj_tra")."',$params);
|
||||
myForm.send(url,\"get\",function(loader, response){";
|
||||
$onformsenddata.=$this->FN_DHTMLXWINDOWSHIDEPROGRESS();
|
||||
$onformsenddata.="var sp=trim(response).split('|');
|
||||
//alert(response);
|
||||
if(sp[0]=='ok')
|
||||
{
|
||||
fn_dhtmlxmessage('','Ticket Number <b>'+myForm.getItemValue('txt_tiketnumber')+'</b> has been saved');";
|
||||
$onformsenddata.="myForm.setItemLabel('lblmeasure','Measure');";
|
||||
$onformsenddata.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"cbo_idship");
|
||||
$onformsenddata.="fn_grid_loaddata();
|
||||
}
|
||||
else if(sp[0]=='failed')
|
||||
{fn_dhtmlxmessage('error','Error Found : '+sp[1]);}
|
||||
else
|
||||
{fn_dhtmlxmessage('error','Error Found : '+response);}
|
||||
});";
|
||||
$onbuttonclickbtnsave.=$this->FN_DHTMLXWINDOWSHOWPROGESS($onformsenddata);
|
||||
$onbuttonclickbtnsave.=" }
|
||||
}
|
||||
});
|
||||
}";
|
||||
|
||||
//$onformsenddata.="document.getElementById('imgtiket').src='';";
|
||||
$onbuttonclickbtnupdt="if(myForm.validate())
|
||||
{
|
||||
dhtmlx.confirm({
|
||||
title:'Confirmation',text:'Are you will be updated and data is correctly?',type:'confirm',
|
||||
callback:function(result){
|
||||
if(result)
|
||||
{";
|
||||
$params="'obj=".$this->enc("tra_cargticket")."&task=".$this->enc("updrecord")."'";
|
||||
$onformsenddata="url=fn_dhtmlxsenddata('".$this->enc("obj_tra")."',$params);
|
||||
myForm.send(url,\"get\",function(loader, response){";
|
||||
$onformsenddata.=$this->FN_DHTMLXWINDOWSHIDEPROGRESS();
|
||||
$onformsenddata.="var sp=trim(response).split('|');
|
||||
//alert(response);
|
||||
if(sp[0]=='ok')
|
||||
{
|
||||
fn_dhtmlxmessage('','Ticket Number <b>'+myForm.getItemValue('txt_tiketnumber')+'</b> has been update');";
|
||||
$onformsenddata.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"cbo_idship");
|
||||
$onformsenddata.="myForm.setItemLabel('lblmeasure','Measure');";
|
||||
$onformsenddata.="myForm.enableItem('btnsave');";
|
||||
$onformsenddata.="myForm.disableItem('btnupdate');";
|
||||
$onformsenddata.="myForm.disableItem('btndelete');";
|
||||
$onformsenddata.="myForm.enableItem('cbo_idship');";
|
||||
$onformsenddata.="myForm.enableItem('txt_tiketnumber');";
|
||||
|
||||
$onformsenddata.="fn_grid_loaddata();
|
||||
}
|
||||
else if(sp[0]=='failed')
|
||||
{fn_dhtmlxmessage('error','Error Found : '+sp[1]);}
|
||||
else
|
||||
{fn_dhtmlxmessage('error','Error Found : '+response);}
|
||||
});";
|
||||
$onbuttonclickbtnupdt.=$this->FN_DHTMLXWINDOWSHOWPROGESS($onformsenddata);
|
||||
$onbuttonclickbtnupdt.=" }
|
||||
}
|
||||
});
|
||||
}";
|
||||
|
||||
$eventafterdeleted=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"cbo_idship");
|
||||
//$eventafterdeleted.="document.getElementById('imgtiket').src='';";
|
||||
$eventafterdeleted.="myForm.setItemLabel('lblmeasure','Measure');";
|
||||
$eventafterdeleted.="myForm.enableItem('btnsave');";
|
||||
$eventafterdeleted.="myForm.disableItem('btnupdate');";
|
||||
$eventafterdeleted.="myForm.disableItem('btndelete');";
|
||||
$eventafterdeleted.="fn_grid_loaddata();";
|
||||
$onbuttonclickbtndeleted=$this->FN_DHTMLXREMARKFORDELETED2("obj_tra","tra_cargticket","myForm.getItemValue('txt_id')","myForm.getItemValue('txt_tiketnumber')",$eventafterdeleted);
|
||||
|
||||
//$onbuttonclickbtncancel="document.getElementById('imgtiket').src='';";
|
||||
$onbuttonclickbtncancel="myForm.setItemLabel('lblmeasure','Measure');";
|
||||
$onbuttonclickbtncancel.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls);
|
||||
$onbuttonclickbtncancel.="myForm.enableItem('btnsave');";
|
||||
$onbuttonclickbtncancel.="myForm.disableItem('btnupdate');";
|
||||
$onbuttonclickbtncancel.="myForm.disableItem('btndelete');";
|
||||
$onbuttonclickbtncancel.="myForm.enableItem('cbo_idship');";
|
||||
$onbuttonclickbtncancel.="myForm.enableItem('txt_tiketnumber');";
|
||||
// $onbuttonclickbtncancel.="myForm.disableItem('btndelete');";
|
||||
$onbuttonclickbtncancel.="myForm.setItemFocus('cbo_idship');";
|
||||
|
||||
$onbuttonclickbtncancel.="myForm.setItemFocus('cbo_idship');";
|
||||
$onbuttonclickbtncancel.="fn_grid_loaddata();";
|
||||
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onbuttonclick","eventparam"=>"id,val",
|
||||
"switch"=>array(
|
||||
"btnsave"=>"$onbuttonclickbtnsave",
|
||||
"btnupdate"=>"$onbuttonclickbtnupdt",
|
||||
"btndelete"=>"$onbuttonclickbtndeleted",
|
||||
"btncancel"=>"$onbuttonclickbtncancel"
|
||||
)
|
||||
),
|
||||
array("eventname"=>"onkeydown","eventparam"=>"inp,ev,id,val",
|
||||
"switch"=>array(
|
||||
"txt_totalprice"=>"$onobjkeydown",
|
||||
"txt_quantity"=>"$onobjtxtquantity",
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$this->FN_DHTMLXFORMEVENT("myForm",$arrevent);
|
||||
|
||||
echo "myForm.getCombo('cbo_idship').attachEvent('onKeyPressed',function(keycode){
|
||||
if(keycode==13){".$onkeypresscboshipname."}
|
||||
});";
|
||||
echo "myForm.getCombo('cbo_idrouteend').attachEvent(\"onKeyPressed\", function(keycode){
|
||||
if(keycode==13){
|
||||
fn_showcategory();
|
||||
}
|
||||
});";
|
||||
|
||||
// === FORM SEARCH AND GRID
|
||||
$formdata=array(
|
||||
array("type"=>"settings","position"=>"label-left","labelWidth"=>"180","inputWidth"=>"120"),
|
||||
array("type"=>"fieldset","width"=>"580","label"=>"Search",
|
||||
"list"=>array(
|
||||
array("type"=>"input","name"=>"txtsearch","label"=>"Insert Your Keyword","info"=>"true","inputWidth"=>"240",
|
||||
"tooltip"=>"Insert Your Keyword","maxLength"=>"","className"=>"txtleft","labelWidth"=>"210"),
|
||||
array("type"=>"newcolumn"),
|
||||
array("type"=>"button","name"=>"btnfind","value"=>"","className"=>"button_find","offsetLeft"=>"10","offsetTop"=>"0")
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->FN_DHTMLXFORM("myFormsearch","divcargticketsearch",$formdata,true);
|
||||
$ontxtsearchkeydown="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();myFormsearch.setItemFocus('btnfind');}";
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onbuttonclick","eventparam"=>"id,val",
|
||||
"switch"=>array(
|
||||
"btnfind"=>"fn_grid_loaddata()"
|
||||
)
|
||||
),
|
||||
array("eventname"=>"onchange","eventparam"=>"id,val",
|
||||
"switch"=>array(
|
||||
//"cbo_idrouteend"=>"alert('t');",
|
||||
|
||||
)
|
||||
),
|
||||
array("eventname"=>"onkeydown","eventparam"=>"inp,ev,id,val",
|
||||
"switch"=>array(
|
||||
"txtsearch"=>"$ontxtsearchkeydown"
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->FN_DHTMLXFORMEVENT("myFormsearch",$arrevent);
|
||||
|
||||
$grdinit=array("gridname"=>"dgcargticket","divtarget"=>"div_dgcargticket","divpaging"=>"div_dgcargticketpaging",
|
||||
"paginglimit"=>PAGE_LIMIT,"showloader"=>"true");
|
||||
$gridproperties=array("id"=>"right,ro,96,right,int,false,true",
|
||||
"No. "=>"right,ro,35,center,int,false",
|
||||
"Ship Name"=>"left,ro,140,left,str,false",
|
||||
"Ticket Number"=>"center,ro,130,center,str,false",
|
||||
"Voyage Number"=>"center,ro,130,center,str,false",
|
||||
"Passenger Name"=>"left,ro,262,left,str,false",
|
||||
"ID Card"=>"center,ro,136,center,str,false",
|
||||
"Dates"=>"center,ro,120,center,date,false",
|
||||
"From"=>"left,ro,112,left,str,false",
|
||||
"Category"=>"left,ro,144,left,str,false",
|
||||
"Price "=>"right,ro,120,right,int,false",
|
||||
"Quantity "=>"right,ro,144,right,int,false",
|
||||
"Weight "=>"right,ro,144,right,int,false",
|
||||
"Total "=>"right,ro,120,right,int,false");
|
||||
$this->FN_DHTMLXGRIDVIEW($grdinit,$gridproperties,"bricks","","fn_grid_loaddata()");
|
||||
$arrfields=array("txt_id"=>"","cbo_idship"=>"idship|shipname","txt_tiketnumber"=>"","txt_voynumber"=>"",
|
||||
"txt_cargodescription"=>"","txt_passengername"=>"","cbo_idcardtype"=>"idcardtype|cardtype","txt_cardnumber"=>"","txt_dates"=>"",
|
||||
"cbo_idroutestart"=>"idroutestart|routenamestart","cbo_idrouteend"=>"idrouteend|routenameend","txt_price"=>"",
|
||||
"txt_quantity"=>"","txt_totalprice"=>"","txt_modifcount"=>"","txt_units"=>"","txt_picdata"=>"","txt_idcategory"=>"","txt_weight"=>"");
|
||||
$otherevent="if(spres[14]>1)";
|
||||
$otherevent.="{";
|
||||
$otherevent.=" fn_dhtmlxmessage('error','I\'m sorry you cannot edit this record, only twice for editing! or Cancel this request to your administrator');return false;";
|
||||
$otherevent.="}";
|
||||
$otherevent.="myForm.disableItem('cbo_idship');";
|
||||
$otherevent.="myForm.disableItem('txt_tiketnumber');";
|
||||
$otherevent.="myForm.setItemFocus('txt_voynumber');";
|
||||
$otherevent.="myForm.setItemLabel('lblmeasure',spres[15]);";
|
||||
//$otherevent.="document.getElementById('imgtiket').src='uploads/temps/'+spres[16];";
|
||||
|
||||
$this->FN_DHTMLXGRIDVIEWTOFORMNEW("dgcargticket","myForm","tbl_cargo_tiket",0,$arrfields,"",$otherevent);
|
||||
echo " }
|
||||
|
||||
function fn_showcategory()
|
||||
{
|
||||
if(myForm.getItemValue('cbo_idroutestart')==''){
|
||||
fn_dhtmlxmessage('error','Please choice route arrival first ! ');myForm.setItemFocus('cbo_idroutestart');return false;
|
||||
}
|
||||
if(myForm.getItemValue('cbo_idrouteend')==''){
|
||||
fn_dhtmlxmessage('error','Please choice route destination first ! ');myForm.setItemFocus('cbo_idrouteend');return false;
|
||||
}
|
||||
|
||||
dwins=new dhtmlXWindows();dwins.attachViewportTo(\"winVP\");
|
||||
var idroutestart=myForm.getItemValue('cbo_idroutestart');
|
||||
var idrouteend=myForm.getItemValue('cbo_idrouteend');
|
||||
var url='?ajax=1&sec=1&option=".$this->enc("obj_tra")."&obj=".$this->enc("tra_cargticket")."&task=".$this->enc("getcategory")."&idroutestart='+idroutestart+'&idrouteend='+idrouteend;";
|
||||
$rtn="dwins.createWindow(\"winbook\",0,0,850,580);";
|
||||
$rtn.="dwins.window('winbook').denyResize();";
|
||||
$rtn.="dwins.window('winbook').progressOn();";
|
||||
$rtn.="dwins.window(\"winbook\").setText(\"Get Cargo Item\");";
|
||||
$rtn.="dwins.window(\"winbook\").attachURL(url);";
|
||||
$rtn.="dwins.window('winbook').setModal(true);";
|
||||
$rtn.="dwins.window('winbook').progressOff();";
|
||||
echo $rtn;
|
||||
echo " }
|
||||
|
||||
function fn_getCategory(idcategory,categorydescription,price,measure){
|
||||
myForm.setItemValue('txt_idcategory',idcategory);
|
||||
myForm.setItemValue('txt_cargodescription',categorydescription);
|
||||
myForm.setItemLabel('lblmeasure',measure);
|
||||
var qty=myForm.getItemValue('txt_quantity');
|
||||
if(qty<=0){qty=1;}
|
||||
myForm.setItemValue('txt_quantity',qty);
|
||||
myForm.setItemValue('txt_price',price);
|
||||
var totalprice=qty*price;
|
||||
myForm.setItemValue('txt_totalprice',totalprice);
|
||||
myForm.setItemFocus('txt_quantity');
|
||||
dwins.unload();
|
||||
|
||||
}
|
||||
|
||||
function fn_showCamera()
|
||||
{
|
||||
dwins=new dhtmlXWindows();dwins.attachViewportTo(\"winVP\");
|
||||
var picdata=myForm.getItemValue('txt_picdata');
|
||||
var url='?ajax=1&sec=1&option=".$this->enc("obj_tra")."&obj=".$this->enc("tra_cargticket")."&task=".$this->enc("getpic")."&picdata='+picdata;";
|
||||
$url="?ajax=1&sec=1&option=".$this->enc("obj_tra")."&obj=".$this->enc("tra_newticket")."&task=".$this->enc("getpic");
|
||||
$this->FN_DHTMLXWINDOWSURL("dwins","winpic","Get Picture","50","50","560","400",$url,false,true);
|
||||
|
||||
echo " }
|
||||
|
||||
function fn_getPicName(filename){
|
||||
myForm.setItemValue('txt_picdata',filename);
|
||||
myForm.setItemFocus('txt_dates');
|
||||
dwins.unload();
|
||||
document.getElementById('imgtiket').src='uploads/temps/'+filename;
|
||||
|
||||
}
|
||||
|
||||
function fn_grid_loaddata()
|
||||
{
|
||||
var keyword=myFormsearch.getItemValue('txtsearch');
|
||||
url=fn_dhtmlxloadobject('".$this->enc("obj_tra")."','obj=".$this->enc("tra_cargticket")."&task=".$this->enc("grdrecord")."&keyword='+keyword);
|
||||
//alert(url);
|
||||
dgcargticket.clearAndLoad(url);";
|
||||
echo " }
|
||||
</script>";
|
||||
echo $this->FN_CLOSEHEADER();
|
||||
echo $this->FN_CREATEBODY("e8f1ff");
|
||||
|
||||
echo "<div id=\"winVP\" style=\"height:1020px;\">";
|
||||
|
||||
echo "<table width=\"98%\" border=\"0\">
|
||||
<tr>
|
||||
<td>";
|
||||
$qry="select filepdf from ".DB_APORTIL.".tbl_manualbook where isdeleted=0 and filepdf='cargobooking_ticket.pdf'";
|
||||
$filepdf=$this->fn_get_fieldvalue("filepdf",$qry);
|
||||
$urlmanualbook="<a href='".UPLOAD_DIR."/manualbook/$filepdf"."' target='_blank'><img src='".PATH_THEME."/images/pdf.png' /> <b>MANUAL BOOK</b></a>";
|
||||
$url="location.reload();";
|
||||
$myuri=array("<b>CARGO TICKET INFORMATION</b>"=>"$url|id='a_newticket'","$urlmanualbook"=>"|id='a_manualbook'");
|
||||
echo $this->MULTIPLE_LINK($myuri);
|
||||
echo " </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"divcargticketcontent\" style=\"margin-left:0px;\">
|
||||
<table width=\"98%\" border=\"0\">
|
||||
<tr>
|
||||
<td width=\"45%\" valign=\"top\">
|
||||
<div id=\"divcargticketnew\" style=\"\"></div>
|
||||
</td>
|
||||
<td valign=\"top\">
|
||||
<table width=\"98%\" cellpadding=\"0\" cellspacing=\"0\">
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<div id=\"divcargticketsearch\" style=\"width:560px;margin-top:-6px;\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgcargticket\" style=\"height:380px;width:580px;overflow:hidden\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgcargticketpaging\" style=\"width:598px;margin-top:1px\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td valign=\"top\"><div id=\"loadergrid\" style=\"z-index:100;position:absolute;margin-top:-220px;margin-left:287px;display:visibility;\">".$this->CREATE_IMAGE("loadergrid.gif")."</div></td></tr>
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<table>
|
||||
<tr>
|
||||
<td style='color:red;font-weight:bold;'>Notes</td>
|
||||
<td>:</td>
|
||||
<td>- Click Row For Edit</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>";
|
||||
echo $this->FN_CREATEFOOTER();
|
||||
|
||||
}
|
||||
|
||||
public function fn_grdrecord()
|
||||
{
|
||||
$keyword=$_REQUEST["keyword"];
|
||||
header("Content-type: text/xml");
|
||||
echo('<?xml version="1.0" encoding="utf-8"?>');
|
||||
echo "<rows id='0'>";
|
||||
|
||||
$qry="select id,idship,shipname,tiketnumber,tiketnumberpassenger,voynumber,inctiket,idcategory,cargodescription,passengername,
|
||||
idcardtype,cardtype,cardnumber,dates,idroutestart,routenamestart,idrouteend,
|
||||
routenameend,price,quantity,weight,totalprice,units,modifcount
|
||||
from ".DB_APORTIL.".tbl_cargo_tiket
|
||||
where (tiketnumber like '%$keyword%' or voynumber like '%$keyword%' or passengername like '%$keyword%') and isdeleted=0
|
||||
order by id asc limit ".TBL_PAGE_LIMIT;
|
||||
|
||||
$rs=$this->selectquery($qry);
|
||||
if($rs)
|
||||
{
|
||||
$i=1;
|
||||
while($row=$this->data_row_array($rs))
|
||||
{
|
||||
$color='black';
|
||||
if($row["modifcount"]>=2){$color='grey';}
|
||||
echo ("<row id='".$row["id"]."'>");
|
||||
print("<cell><![CDATA[".$row["id"]."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$i."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["shipname"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["tiketnumber"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["voynumber"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["passengername"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["cardtype"]."/".$row["cardnumber"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".date("Y-m-d",strtotime($row["dates"]))."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["routenamestart"]." to ".$row['routenameend']."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["cargodescription"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["price"]." \$</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["quantity"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["weight"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA["."<span style='color:$color'>".$row["totalprice"]." \$</span>"."]]></cell>");
|
||||
echo ("</row>");
|
||||
$i+=1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo mysql_errno().": ".mysql_error()." at ".__LINE__." line in ".__FILE__." file<br>";
|
||||
}
|
||||
echo "</rows>";
|
||||
|
||||
}
|
||||
|
||||
public function fn_saverecord($isupdate=null)
|
||||
{
|
||||
$year=date("Y");
|
||||
if($isupdate){$id=$_REQUEST['txt_id'];}
|
||||
$idship=$_REQUEST['cbo_idship'];
|
||||
$sp=$this->fn_get_fieldsvalues("shipname,shipnumber","select shipname,shipnumber from ".DB_APORTIL.".tbl_ship_information where id='$idship'");
|
||||
$shipnumber=$sp[1];$shipname=$sp[0];
|
||||
$tiketnumber=$_REQUEST['txt_tiketnumber'];
|
||||
$tiketnumberpassenger=$_REQUEST['txt_tiketnumberpassenger'];
|
||||
$voynumber=$_REQUEST['txt_voynumber'];
|
||||
$inctiket=$_REQUEST['txt_inctiket'];
|
||||
$idcategory=$_REQUEST['txt_idcategory'];
|
||||
$spcategory=$this->fn_get_fieldsvalues("id,cargocategory,cargodescription,idunits,units","select id,cargocategory,cargodescription,idunits,units from tbl_cargoprice_information where id='$idcategory'");
|
||||
$cargocategory=$spcategory[1];
|
||||
$cargodescription=$spcategory[2];
|
||||
$idunits=$spcategory[3];
|
||||
$units=$spcategory[4];
|
||||
|
||||
$inctiket=0;$inctiketyear=0;
|
||||
if(!$isupdate){
|
||||
$qry="select count(id) incnumber from ".DB_APORTIL.".tbl_cargo_tiket
|
||||
where isdeleted=0 and years='$year' and status>=0";
|
||||
$inctiketyear=$this->fn_get_fieldvalue("incnumber",$qry);
|
||||
$inctiketyear+=1;
|
||||
|
||||
$qry="select count(id) incnumber from ".DB_APORTIL.".tbl_cargo_tiket
|
||||
where idship='$idship' and isdeleted=0 and cast(dates as date)=cast(now() as date) and idroutestart='$idroutestart' and idrouteend='$idrouteend' and status>=0";
|
||||
$inctiket=$this->fn_get_fieldvalue("incnumber",$qry);
|
||||
$inctiket+=1;
|
||||
|
||||
//$inctiket=$this->fn_get_fieldvalue("incnumber","select count(id) incnumber from ".DB_APORTIL.".tbl_cargo_tiket where isdeleted=0 and years='$year'");
|
||||
//$inctiket+=1;
|
||||
}
|
||||
|
||||
$passengername=$_REQUEST['txt_passengername'];
|
||||
$idcardtype=$_REQUEST['cbo_idcardtype'];
|
||||
$cardtype=$this->fn_get_fieldvalue("cardtype","select cardtype from ".DB_APORTIL.".tbl_passenger_identifycardtype where id='$idcardtype'");
|
||||
$cardnumber=$_REQUEST['txt_cardnumber'];
|
||||
$picdata="aportildefault.png";//$_REQUEST['txt_picdata'];
|
||||
$dates=$_REQUEST['txt_dates'];
|
||||
$idroutestart=$_REQUEST['cbo_idroutestart'];
|
||||
$routenamestart=$this->fn_get_fieldvalue("routename","select routename from ".DB_APORTIL.".tbl_route_information where id='$idroutestart'");
|
||||
$idrouteend=$_REQUEST['cbo_idrouteend'];
|
||||
$routenameend=$this->fn_get_fieldvalue("routename","select routename from ".DB_APORTIL.".tbl_route_information where id='$idrouteend'");
|
||||
|
||||
$price=$_REQUEST['txt_price'];
|
||||
$quantity=$_REQUEST['txt_quantity'];
|
||||
$weight=$_REQUEST['txt_weight'];
|
||||
$totalprice=$_REQUEST['txt_totalprice'];
|
||||
|
||||
$qry="insert into ".DB_APORTIL.".tbl_cargo_tiket
|
||||
set idship='$idship',tiketnumber='$tiketnumber',tiketnumberpassenger='$tiketnumberpassenger',voynumber='$voynumber',inctiket='$inctiket',inctiketyear='$inctiketyear',
|
||||
idcategory='$idcategory',cargocategory='$cargocategory',cargodescription='$cargodescription',shipnumber='$shipnumber',shipname='$shipname',
|
||||
passengername='$passengername',idcardtype='$idcardtype',cardtype='$cardtype',cardnumber='$cardnumber',picdata='$picdata',dates='$dates',
|
||||
idroutestart='$idroutestart',routenamestart='$routenamestart',idrouteend='$idrouteend',routenameend='$routenameend',idunits='$idunits',status=0,
|
||||
units='$units',price='$price',quantity='$quantity',weight='$weight',totalprice='$totalprice',years='$year',iby='".$_SESSION['nik']."',idt=now()";
|
||||
if($isupdate)
|
||||
{
|
||||
$qry="update ".DB_APORTIL.".tbl_cargo_tiket
|
||||
set idship='$idship',tiketnumber='$tiketnumber',tiketnumberpassenger='$tiketnumberpassenger',voynumber='$voynumber',
|
||||
idcategory='$idcategory',cargocategory='$cargocategory',cargodescription='$cargodescription',shipnumber='$shipnumber',shipname='$shipname',
|
||||
passengername='$passengername',idcardtype='$idcardtype',cardtype='$cardtype',cardnumber='$cardnumber',picdata='$picdata',dates='$dates',
|
||||
idroutestart='$idroutestart',routenamestart='$routenamestart',idrouteend='$idrouteend',routenameend='$routenameend',idunits='$idunits',
|
||||
units='$units',price='$price',quantity='$quantity',weight='$weight',totalprice='$totalprice',modifcount=modifcount+1,uby='".$_SESSION['nik']."',udt=now()
|
||||
where id='$id'";
|
||||
}
|
||||
|
||||
if($this->executequery($qry))
|
||||
{
|
||||
if(!$isupdate)
|
||||
{
|
||||
$idtransaction=mysql_insert_id();
|
||||
$rtn=$this->fn_printtra($idtransaction);
|
||||
echo $rtn;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "ok|";return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
public function fn_updrecord(){$this->fn_saverecord(true);}
|
||||
|
||||
public function fn_delrecord()
|
||||
{
|
||||
$id=$_REQUEST['txt_id'];
|
||||
$remark=$_REQUEST['txtremark'];
|
||||
$qry="update ".DB_APORTIL.".tbl_cargo_tiket
|
||||
set isdeleted=1,remark='$remark',dby='".$_SESSION['nik']."',ddt=now()
|
||||
where id='$id'";
|
||||
if($this->executequery($qry)){echo "ok|";return true;}
|
||||
else
|
||||
{
|
||||
echo "failed|".$this->getErrorQuery();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function fn_printtra($idtransaction)
|
||||
{
|
||||
$tiketnumber=$_REQUEST['txt_tiketnumber'];
|
||||
$idcategory=$_REQUEST['txt_idcategory'];
|
||||
$spcategory=$this->fn_get_fieldsvalues("id,cargocategory,cargodescription,idunits,units","select id,cargocategory,cargodescription,idunits,units from tbl_cargoprice_information where id='$idcategory'");
|
||||
$cargocategory=$spcategory[1];
|
||||
$cargodescription=$spcategory[2];
|
||||
$ipprintclient=$this->get_client_ip();
|
||||
$jobgroup="TICV";
|
||||
|
||||
if($cargocategory!=='Veiculos'){$jobgroup="TICNV";}
|
||||
$qry="insert into ".DB_APORTIL.".tbl_printjob
|
||||
set idtransaction='$idtransaction',ipprintclient='$ipprintclient',idemployee='".$_SESSION['idemployee']."',nik='".$_SESSION['nik']."',
|
||||
employeename='".$_SESSION['employeename']."',jobgroup='$jobgroup',jobremark='$tiketnumber',iby='".$_SESSION['nik']."',idt=now()";
|
||||
$qrychk="select id from ".DB_APORTIL.".tbl_printjob where ipprintclient='$ipprintclient' order by id desc limit 1";
|
||||
if($this->fn_row_isexists($qrychk))
|
||||
{
|
||||
$id=$this->fn_get_fieldvalue("id",$qrychk);
|
||||
$qry="update ".DB_APORTIL.".tbl_printjob
|
||||
set idtransaction='$idtransaction',ipprintclient='$ipprintclient',idemployee='".$_SESSION['idemployee']."',nik='".$_SESSION['nik']."',
|
||||
employeename='".$_SESSION['employeename']."',jobgroup='$jobgroup',jobremark='$tiketnumber',uby='".$_SESSION['nik']."',udt=now()
|
||||
where id='$id'";
|
||||
}
|
||||
|
||||
$rtn="failed|Print Tiket $tiketnumber failed, please contact your administrator. Thank you";
|
||||
if($this->executequery($qry))
|
||||
{
|
||||
$rtn="ok|";
|
||||
}
|
||||
return $rtn;
|
||||
}
|
||||
|
||||
|
||||
public function fn_getticket(){
|
||||
$valticket="";
|
||||
for($i=1;$i<=8;$i++){
|
||||
$valticket.=rand(0,9);
|
||||
}
|
||||
$sql="select tiketnumber from ".DB_APORTIL.".tbl_cargo_tiket where tiketnumber='".$tiketnumber."' order by id desc limit 1";
|
||||
if($this->fn_row_isexists($sql)){
|
||||
$this->fn_getticket();
|
||||
}
|
||||
return $valticket;
|
||||
}
|
||||
|
||||
public function fn_getheaderinfo(){
|
||||
$idship=$_REQUEST['idship'];
|
||||
$tiketnumber=$this->fn_getticket();
|
||||
echo "ok|".$tiketnumber;
|
||||
}
|
||||
|
||||
|
||||
public function fn_getpic(){
|
||||
$picdata=$_REQUEST['picdata'];
|
||||
if($picdata){unlink('uploads/temps/'.$picdata);}
|
||||
|
||||
echo $this->FN_CREATEHEADER();
|
||||
echo "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\" />";
|
||||
echo "<script src=\"".PATH_THEME."/js/camupload.js\"></script>";
|
||||
echo "<script>
|
||||
function initObject()
|
||||
{}
|
||||
function fn_setImage(filename){
|
||||
//window.opener.document.getElementById(\"blah_ReturnValue\").value = rv;
|
||||
window.parent.fn_getPicName(filename);
|
||||
|
||||
}";
|
||||
echo "</script>
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
margin: 0px;
|
||||
/*background-color: #EBEBEB;*/
|
||||
}
|
||||
</style>";
|
||||
echo $this->FN_CLOSEHEADER();
|
||||
echo $this->FN_CREATEBODY("e8f1ff");
|
||||
// echo "<div id=\"vid-controls\" style=\"margin-left:-80px\">
|
||||
//
|
||||
// </div>";
|
||||
echo "<video id=\"vid-show\" autoplay height=\"400\"></video>
|
||||
<div style=\"position:absolute;z-index:999;margin-top:-18%;margin-left:90%\">
|
||||
<a href=\"javascript:void(0)\" id=\"vid-take\" style=\"color:white\"><i class=\"fa fa-camera\" style=\"font-size:26pt;\"></i></a>
|
||||
</div>
|
||||
<div id=\"vid-canvas\" style=\"\"></div>";
|
||||
//echo "<button onClick='fn_setImage()'>Show Parent</button>";
|
||||
echo $this->FN_CREATEFOOTER();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function fn_getcategory()
|
||||
{
|
||||
echo $this->FN_CREATEHEADER();
|
||||
$idroutestart=$_REQUEST['idroutestart'];
|
||||
$idrouteend=$_REQUEST['idrouteend'];
|
||||
echo "<style>
|
||||
.besidebtnsave {margin-left:110px;margin-top:-6px;position:absolute;}
|
||||
.besidebtnupdate {margin-left:212px;margin-top:-6px;position:absolute;}
|
||||
.besidebtnsubmit {margin-left:292px;margin-top:-6px;position:absolute;}
|
||||
.besidebtndelete {margin-left:310px;margin-top:-6px;position:absolute;}
|
||||
.besidelabel {margin-left:300px;margin-top:-6px;position:absolute;}
|
||||
</style>";
|
||||
echo "<script>
|
||||
var myForm,myFormsearch,dgcargoprice;
|
||||
function initObject()
|
||||
{";
|
||||
// === FORM SEARCH AND GRID
|
||||
$formdata=array(
|
||||
array("type"=>"settings","position"=>"label-left","labelWidth"=>"180","inputWidth"=>"120"),
|
||||
array("type"=>"fieldset","width"=>"780","label"=>"Search",
|
||||
"list"=>array(
|
||||
array("type"=>"input","name"=>"txtsearch","label"=>"Insert Your Keyword","info"=>"true","inputWidth"=>"240",
|
||||
"tooltip"=>"Insert Your Keyword","maxLength"=>"","className"=>"txtleft","labelWidth"=>"210"),
|
||||
array("type"=>"newcolumn"),
|
||||
array("type"=>"button","name"=>"btnfind","value"=>"","className"=>"button_find","offsetLeft"=>"10","offsetTop"=>"5")
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->FN_DHTMLXFORM("myFormsearch","divcargopricesearch",$formdata,true);
|
||||
$ontxtsearchkeydown="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();myFormsearch.setItemFocus('btnfind');}";
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onbuttonclick","eventparam"=>"id,val",
|
||||
"switch"=>array(
|
||||
"btnfind"=>"fn_grid_loaddata()"
|
||||
)
|
||||
),
|
||||
array("eventname"=>"onkeydown","eventparam"=>"inp,ev,id,val",
|
||||
"switch"=>array(
|
||||
"txtsearch"=>"$ontxtsearchkeydown"
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->FN_DHTMLXFORMEVENT("myFormsearch",$arrevent);
|
||||
|
||||
$grdinit=array("gridname"=>"dgcargoprice","divtarget"=>"div_dgcargoprice","divpaging"=>"div_dgcargopricepaging","paginglimit"=>PAGE_LIMIT,
|
||||
"showloader"=>"true");
|
||||
$gridproperties=array("id"=>"right,ro,96,right,int,false,true",
|
||||
"No. "=>"right,ro,35,center,int,false",
|
||||
"Category"=>"left,ro,144,left,str,false",
|
||||
"Category Description"=>"left,ro,200,left,str,false",
|
||||
"Destination"=>"left,ro,160,left,str,false",
|
||||
"Prices "=>"right,ro,110,right,int,false",
|
||||
"Priceshide "=>"right,ro,110,right,int,false,true",
|
||||
"Units "=>"right,ro,110,right,str,false",
|
||||
"Years"=>"center,ro,110,center,int,false");
|
||||
$this->FN_DHTMLXGRIDVIEW($grdinit,$gridproperties,"bricks","","fn_grid_loaddata()");
|
||||
echo "dgcargoprice.attachEvent(\"onRowDblClicked\", function(rId,cInd){
|
||||
var idcategory=dgcargoprice.cells(rId,0).getValue();
|
||||
var categorydescription=dgcargoprice.cells(rId,3).getValue();
|
||||
var price=dgcargoprice.cells(rId,6).getValue();
|
||||
var units=dgcargoprice.cells(rId,7).getValue();
|
||||
window.parent.fn_getCategory(idcategory,categorydescription,price,units);
|
||||
});";
|
||||
echo " }
|
||||
|
||||
function fn_grid_loaddata()
|
||||
{
|
||||
var keyword=myFormsearch.getItemValue('txtsearch');
|
||||
url=fn_dhtmlxloadobject('".$this->enc("obj_tra")."','obj=".$this->enc("tra_cargticket")."&task=".$this->enc("grdcategory")."&idroutestart=$idroutestart&idrouteend=$idrouteend&keyword='+keyword);
|
||||
//alert(url);
|
||||
dgcargoprice.clearAndLoad(url);";
|
||||
echo " }
|
||||
</script>";
|
||||
echo $this->FN_CLOSEHEADER();
|
||||
echo $this->FN_CREATEBODY("e8f1ff");
|
||||
|
||||
echo "<table width=\"98%\" border=\"0\">
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<table width=\"98%\" cellpadding=\"0\" cellspacing=\"0\">
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<div id=\"divcargopricesearch\" style=\"width:760px;margin-top:-6px;\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgcargoprice\" style=\"height:380px;width:780px;overflow:hidden\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgcargopricepaging\" style=\"width:598px;margin-top:1px\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td valign=\"top\"><div id=\"loadergrid\" style=\"z-index:100;position:absolute;margin-top:-220px;margin-left:387px;display:visibility;\">".$this->CREATE_IMAGE("loadergrid.gif")."</div></td></tr>
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<table>
|
||||
<tr>
|
||||
<td style='color:red;font-weight:bold;'>Notes</td>
|
||||
<td>:</td>
|
||||
<td>- Double Click Row For Get Data</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>";
|
||||
echo $this->FN_CREATEFOOTER();
|
||||
|
||||
}
|
||||
|
||||
public function fn_grdcategory()
|
||||
{
|
||||
$idroutestart=$_REQUEST["idroutestart"];
|
||||
$idrouteend=$_REQUEST["idrouteend"];
|
||||
$keyword=$_REQUEST["keyword"];
|
||||
header("Content-type: text/xml");
|
||||
echo('<?xml version="1.0" encoding="utf-8"?>');
|
||||
echo "<rows id='0'>";
|
||||
|
||||
$qry="select id,idcategory,cargocategory,cargodescription,routenamestart,routenameend,units,prices,years
|
||||
from ".DB_APORTIL.".tbl_cargoprice_information
|
||||
where (cargodescription like '%$keyword%' or cargocategory like '%$keyword%') and (idroutestart='$idroutestart' and idrouteend='$idrouteend') and isdeleted=0
|
||||
order by id asc limit ".TBL_PAGE_LIMIT;
|
||||
|
||||
$rs=$this->selectquery($qry);
|
||||
if($rs)
|
||||
{
|
||||
$i=1;
|
||||
while($row=$this->data_row_array($rs))
|
||||
{
|
||||
echo ("<row id='".$row["id"]."'>");
|
||||
print("<cell><![CDATA[".$row["id"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$i."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["cargocategory"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["cargodescription"]."]]></cell>");
|
||||
$destination=$row['routenamestart']."-".$row['routenameend'];
|
||||
print("<cell><![CDATA[".$destination."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["prices"]." \$]]></cell>");
|
||||
print("<cell><![CDATA[".$row["prices"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["units"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["years"]."]]></cell>");
|
||||
echo ("</row>");
|
||||
$i+=1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo mysql_errno().": ".mysql_error()." at ".__LINE__." line in ".__FILE__." file<br>";
|
||||
}
|
||||
echo "</rows>";
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
1359
objectx/obj_tra/tra_newticket.php
Normal file
1359
objectx/obj_tra/tra_newticket.php
Normal file
File diff suppressed because it is too large
Load Diff
950
objectx/obj_tra/tra_newticket_20191206.php
Normal file
950
objectx/obj_tra/tra_newticket_20191206.php
Normal file
@ -0,0 +1,950 @@
|
||||
<?php
|
||||
class TRA_NEWTICKET extends TRA
|
||||
{
|
||||
public function tra_newticket_javainit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function fn_newticket_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_newticket();
|
||||
break;
|
||||
|
||||
case $task:
|
||||
$task="fn_".$task;
|
||||
if(method_exists($this,$task)){$this->$task();}
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->fn_default_newticket();
|
||||
break;
|
||||
}
|
||||
}
|
||||
public function fn_default_newticket()
|
||||
{
|
||||
//for($i=1;$i<=30;$i++){
|
||||
// for($j=1;$j<=10;$j++)
|
||||
// {
|
||||
// $seat="$i.".chr(64+$j);
|
||||
// $qry="insert into ".DB_APORTIL.".tbl_ship_seatnumber set idship=1,shipnumber='NAC-151',seatnumber='".$seat."',iby='82010',idt=now()";
|
||||
// $this->executequery($qry);
|
||||
// }
|
||||
// }
|
||||
echo $this->FN_CREATEHEADER();
|
||||
|
||||
echo "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\" />";
|
||||
echo "<style>
|
||||
.besidebtnsave {margin-left:114px;margin-top:-6px;position:absolute;}
|
||||
.besidebtnupdate {margin-left:218px;margin-top:-6px;position:absolute;}
|
||||
.besidebtnsubmit {margin-left:292px;margin-top:-6px;position:absolute;}
|
||||
.besidebtndelete {margin-left:318px;margin-top:-6px;position:absolute;}
|
||||
.besidelabel {margin-left:280px;margin-top:-5px;position:absolute;}
|
||||
.besidelabelbaggage {margin-left:250px;margin-top:-5px;position:absolute;}
|
||||
.besidelabelprice {margin-left:275px;margin-top:-6px;position:absolute;}
|
||||
.besideseatnumber {margin-left:275px;margin-top:-6px;position:absolute;}
|
||||
.besidecbofrom {margin-left:305px;margin-top:-5px;position:absolute;}
|
||||
.besidecboidcard {margin-left:280px;margin-top:-5px;position:absolute;}
|
||||
.besidebaggage {margin-left:280px;margin-top:-5px;position:absolute;}
|
||||
.besidelimitkgbaggage {margin-left:430px;margin-top:-5px;position:absolute;}
|
||||
.besidelimitbaggage {margin-left:350px;margin-top:-5px;position:absolute;}
|
||||
.besidebtnbook {margin-left:360px;margin-top:-5px;position:absolute;}
|
||||
.txttiketnumber {font-size:18pt;}
|
||||
.txtseatnumber {font-size:10pt;}
|
||||
.txttotalbiaya {font-size:14pt;}
|
||||
.containerpicture {margin-left:0px;margin-top:0px;}
|
||||
</style>";
|
||||
|
||||
echo "<script>
|
||||
var myForm,myFormsearch,dgnewticket,dwins;
|
||||
var mm,ss;
|
||||
var tbooking;
|
||||
function initObject()
|
||||
{
|
||||
mm=5;ss=0;";
|
||||
$formdata=array(
|
||||
array("type"=>"settings","position"=>"label-left","labelWidth"=>"180","inputWidth"=>"120"),
|
||||
array("type"=>"block","width"=>"500",
|
||||
"list"=>array(
|
||||
array("type"=>"hidden","name"=>"txt_id"),
|
||||
array("type"=>"hidden","name"=>"txt_picdata"),
|
||||
array("type"=>"combo","name"=>"cbo_idship","label"=>"Ship Name","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"0",
|
||||
"tooltip"=>"Pilih Ship Name terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft"),
|
||||
array("type"=>"input","name"=>"txt_tiketnumber","label"=>"Ticket Number","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"",
|
||||
"tooltip"=>"Masukkan Ticket Number terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"40","className"=>"txtcenter txttiketnumber"),
|
||||
array("type"=>"input","name"=>"txt_voynumber","label"=>"Voyage Number","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"",
|
||||
"tooltip"=>"Masukkan Voyage Number terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtcenter"),
|
||||
|
||||
// array("type"=>"input","name"=>"txt_inctiket","label"=>"No. Sequence","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
// "tooltip"=>"Masukkan No. Sequence terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtcenter"),
|
||||
//array("type"=>"input","name"=>"txt_shipnumber","label"=>"Ship Number","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"",
|
||||
// "tooltip"=>"Masukkan Ship Number terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft"),
|
||||
array("type"=>"input","name"=>"txt_passengername","label"=>"Name","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"",
|
||||
"tooltip"=>"Masukkan Nama terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft"),
|
||||
array("type"=>"combo","name"=>"cbo_idcardtype","label"=>"ID Card","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Pilih ID Card terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"input","name"=>"txt_cardnumber","label"=>"","required"=>"true","info"=>"true","inputWidth"=>"120","value"=>"",
|
||||
"tooltip"=>"Masukkan Picture terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft besidecboidcard",
|
||||
"note"=>array("text"=>"Insert ID card Number")),
|
||||
|
||||
array("type"=>"container","name"=>"containerpicture","label"=>"Take Picture","className"=>"containerpicture","offsetTop"=>"20"),
|
||||
|
||||
array("type"=>"hidden","name"=>"txt_picdata","label"=>"Picture","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"",
|
||||
"tooltip"=>"Masukkan Picture terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft"),
|
||||
array("type"=>"calendar","name"=>"txt_dates","label"=>"Dates","required"=>"true","info"=>"true","inputWidth"=>"90","readonly"=>"true","value"=>date("Y-m-d"),
|
||||
"tooltip"=>"Masukkan Dates terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"","className"=>"txtcenter","dateFormat"=>"%Y-%m-%d"),
|
||||
array("type"=>"combo","name"=>"cbo_idroutestart","label"=>"From","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Pilih From terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"6","className"=>"txtcenter"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"label","name"=>"lblmeter","label"=>"to","className"=>"besidelabel"),
|
||||
array("type"=>"combo","name"=>"cbo_idrouteend","label"=>"","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Pilih To terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"6","className"=>"txtcenter besidecbofrom"),
|
||||
array("type"=>"input","name"=>"txt_seatnumber","label"=>"Seat Number","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"","readonly"=>"true",
|
||||
"tooltip"=>"Masukkan Seat Number terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"30","className"=>"txtcenter txtseatnumber"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"button","name"=>"btnbookseat","label"=>"Booking","className"=>"besideseatnumber","value"=>"Booking"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"label","name"=>"lbllimitbook","label"=>"Limit Booking in 5 Minutes","className"=>"besidebtnbook"),
|
||||
// array("type"=>"input","name"=>"txt_quantity","label"=>"Quantity","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
// "tooltip"=>"Masukkan Quantity terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"6","className"=>"txtcenter"),
|
||||
array("type"=>"input","name"=>"txt_price","label"=>"Price","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0","readonly"=>"true",
|
||||
"tooltip"=>"Masukkan Price terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"","className"=>"txtright"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"label","name"=>"lblmeter","label"=>"\$","className"=>"besidelabelprice"),
|
||||
|
||||
array("type"=>"input","name"=>"txt_baggageinkg","label"=>"Baggage","required"=>"true","info"=>"true","inputWidth"=>"60","value"=>"0",
|
||||
"tooltip"=>"Masukkan Baggage terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtright"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"label","name"=>"lblmeter","label"=>"Kg","className"=>"besidelabelbaggage"),
|
||||
array("type"=>"input","name"=>"txt_limitbaggage","label"=>"","required"=>"false","info"=>"true","inputWidth"=>"60","value"=>"80","note"=>array("text"=>"Limit ( kg )"),
|
||||
"readonly"=>"true","tooltip"=>"Masukkan Price terlebih dahulu. TERIMA KASIH","validate"=>"","maxLength"=>"","className"=>"txtright besidebaggage"),
|
||||
array("type"=>"column"),
|
||||
array("type"=>"input","name"=>"txt_overlimitbaggage","label"=>"","required"=>"false","info"=>"true","inputWidth"=>"70","value"=>"0","note"=>array("text"=>"Over Limit ( kg )"),
|
||||
"tooltip"=>"Masukkan Over limit baggage terlebih dahulu. TERIMA KASIH","validate"=>"","maxLength"=>"","className"=>"txtright besidelimitbaggage"),
|
||||
array("type"=>"column"),
|
||||
array("type"=>"input","name"=>"txt_pricelimitbaggage","label"=>"","required"=>"false","info"=>"true","inputWidth"=>"90","value"=>"0","note"=>array("text"=>"Price ( kg ) in \$"),
|
||||
"tooltip"=>"Masukkan Price terlebih dahulu. TERIMA KASIH","validate"=>"","maxLength"=>"","className"=>"txtright besidelimitkgbaggage"),
|
||||
array("type"=>"input","name"=>"txt_overprice","label"=>"Over Baggage","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Masukkan Over Price terlebih dahulu / beri nilai 0. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"","className"=>"txtright"),
|
||||
array("type"=>"column"),
|
||||
array("type"=>"label","name"=>"lblmeter","label"=>"\$","className"=>"besidelabelprice"),
|
||||
|
||||
array("type"=>"input","name"=>"txt_totalbiaya","label"=>"Total","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
|
||||
"tooltip"=>"Masukkan total terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtright txttotalbiaya"),
|
||||
array("type"=>"newColumn"),
|
||||
array("type"=>"label","name"=>"lblmeter","label"=>"\$","className"=>"besidelabelprice"),
|
||||
|
||||
array("type"=>"button","name"=>"btnsave","value"=>"Save","className"=>"button_update","offsetLeft"=>"20","offsetTop"=>"25"),
|
||||
array("type"=>"button","name"=>"btnupdate","value"=>"Update","className"=>"button_saveas besidebtnsave","offsetLeft"=>"0","disabled"=>"1"),
|
||||
//array("type"=>"button","name"=>"btnsubmit","value"=>"Submit","className"=>"button_submit besidebtnupdate","offsetLeft"=>"0","disabled"=>"1"),
|
||||
array("type"=>"button","name"=>"btndelete","value"=>"Delete","className"=>"button_delete besidebtnupdate","offsetLeft"=>"0","disabled"=>"1"),
|
||||
array("type"=>"button","name"=>"btncancel","value"=>"Cancel","className"=>"button_cancel besidebtndelete","offsetLeft"=>"0","disabled"=>"0")
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->FN_DHTMLXFORM("myForm","divnewticketnew",$formdata);
|
||||
|
||||
$mycontainerpic="var divpicture=document.createElement('DIV');";
|
||||
$mycontainerpic.="divpicture.id='divpicture';divpicture.style.height='100%';";
|
||||
$mycontainerpic.="var divpicturecontent='<table id=\"tbfindinvoice\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin-top:0px;margin-left:-5px;\">';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+'<tbody>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <tr>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <td>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <div id=\"divimage\" style=\"height:180px;width:280px;background-color:#2c3e50;margin-left:5px;\">';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <image id=\"imgtiket\" style=\"height:180px;width:280px;\" />';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' </div>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <div style=\"position:absolute;z-index:100;margin-top:-50px;margin-left:10px\">';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' <button id=\"btntake\" onClick=\"fn_showCamera()\"><i class=\"fa fa-camera\" style=\"font-size:30pt\"></i></button>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' </div>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' </td>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+' </tr>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+'</tbody>';";
|
||||
$mycontainerpic.="divpicturecontent=divpicturecontent+'</table>';";
|
||||
|
||||
$mycontainerpic.="divpicture.innerHTML=divpicturecontent;";
|
||||
$mycontainerpic.="myForm.getContainer('containerpicture').appendChild(divpicture);";
|
||||
//$mycontainerpic.="myForm.setItemValue('txtsearch',objidposition);";
|
||||
|
||||
echo $mycontainerpic;
|
||||
|
||||
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_ship_information|id,shipname')";
|
||||
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idship","tbl_ship_information","$urlcbo","");
|
||||
|
||||
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_passenger_identifycardtype|id,cardtype')";
|
||||
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idcardtype","tbl_passenger_identifycardtype","$urlcbo","");
|
||||
|
||||
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_route_information|id,routename')";
|
||||
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idroutestart","tbl_route_information","$urlcbo","");
|
||||
|
||||
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_route_information|id,routename')";
|
||||
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idrouteend","tbl_route_information","$urlcbo","");
|
||||
|
||||
$arrerror=array("cbo_idship"=>"Error Found : Harap Isikan <b>Ship Name</b> terlebih dahulu.TERIMA KASIH",
|
||||
"txt_tiketnumber"=>"Error Found : Harap Isikan <b>Ticket Number</b> terlebih dahulu.TERIMA KASIH",
|
||||
"txt_voynumber"=>"Error Found : Harap Isikan <b>Voyage Number</b> terlebih dahulu.TERIMA KASIH",
|
||||
//"txt_inctiket"=>"Error Found : Harap Isikan <b>No. Sequence</b> terlebih dahulu.TERIMA KASIH",
|
||||
// "txt_shipnumber"=>"Error Found : Harap Isikan <b>Ship Number</b> terlebih dahulu.TERIMA KASIH",
|
||||
"txt_passengername"=>"Error Found : Harap Isikan <b>Mrs/ Mr</b> terlebih dahulu.TERIMA KASIH",
|
||||
"cbo_idcardtype"=>"Error Found : Harap Masukin identity Card terlebih dahulu.TERIMA KASIH",
|
||||
"txt_picdata"=>"Error Found : Harap Isikan <b>Picture</b> terlebih dahulu.TERIMA KASIH",
|
||||
"txt_dates"=>"Error Found : Harap Isikan <b>Dates</b> terlebih dahulu.TERIMA KASIH",
|
||||
"cbo_idroutestart"=>"Error Found : Harap Isikan <b>From</b> terlebih dahulu.TERIMA KASIH",
|
||||
"cbo_idrouteend"=>"Error Found : Harap Isikan <b>To</b> terlebih dahulu.TERIMA KASIH",
|
||||
"txt_seatnumber"=>"Error Found : Harap Isikan <b>Seat Number</b> terlebih dahulu.TERIMA KASIH",
|
||||
"txt_quantity"=>"Error Found : Harap Isikan <b>Quantity</b> terlebih dahulu.TERIMA KASIH",
|
||||
"txt_price"=>"Error Found : Harap Isikan <b>Price</b> terlebih dahulu.TERIMA KASIH",
|
||||
"txt_baggageinkg"=>"Error Found : Harap Isikan <b>Baggage</b> terlebih dahulu.TERIMA KASIH",
|
||||
"txt_limitbaggage"=>"Error Found : Harap Isikan <b>Price</b> terlebih dahulu.TERIMA KASIH"
|
||||
);
|
||||
$this->FN_DHTMLXFORMVALIDATIONERROR("myForm",$arrerror);
|
||||
|
||||
$arrayControls=array("txt_id"=>"","cbo_idship"=>"","txt_tiketnumber"=>"","txt_voynumber"=>"",
|
||||
"txt_passengername"=>"","cbo_idcardtype"=>"","txt_picdata"=>"",
|
||||
"txt_dates"=>date("Y-m-d"),"cbo_idroutestart"=>"","cbo_idrouteend"=>"",
|
||||
"txt_seatnumber"=>"","txt_quantity"=>"","txt_price"=>0,"txt_baggageinkg"=>0,
|
||||
"txt_limitbaggage"=>80,"txt_overlimitbaggage"=>0,"txt_pricelimitbaggage"=>0,
|
||||
"txt_overlimitbaggage"=>0,"txt_totalbiaya"=>0
|
||||
|
||||
);
|
||||
|
||||
// === Form Event
|
||||
$onobjkeydown="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();if(myForm.isItemEnabled('btnupdate')){myForm.setItemFocus('btnupdate');dhtmlXclickButton('btnupdate');}else{myForm.setItemFocus('btnsave');}return false;}";
|
||||
|
||||
// === Cbo Ship Change
|
||||
$cboship="var sp=ajaxuridhtmlx('".$this->enc("obj_tra")."','obj=".$this->enc("tra_newticket")."&task=".$this->enc("getheaderinfo")."&idship='+myForm.getItemValue('cbo_idship')).split('|');";
|
||||
$cboship.="if(trim(sp[0])=='failed'){fn_dhtmlxmessage('error',sp[1]);".$this->FN_DHTMLXWINDOWSHIDEPROGRESS().";return false;}";
|
||||
$cboship.="var tiketnumber=sp[1];";
|
||||
$cboship.="myForm.setItemValue('txt_tiketnumber',tiketnumber);";
|
||||
$onkeypresscboshipname=$this->FN_DHTMLXWINDOWSHOWPROGESS($cboship);
|
||||
$onkeypresscboshipname.=$this->FN_DHTMLXWINDOWSHIDEPROGRESS();
|
||||
|
||||
// === Cbo Route End Change
|
||||
$onchangecboidrouteend="var sp=ajaxuridhtmlx('".$this->enc("obj_tra")."','obj=".$this->enc("tra_newticket")."&task=".$this->enc("getprice")."&idroutestart='+myForm.getItemValue('cbo_idroutestart')+'&idrouteend='+myForm.getItemValue('cbo_idrouteend')).split('|');";
|
||||
$onchangecboidrouteend.="if(trim(sp[0])=='failed'){fn_dhtmlxmessage('error',sp[1]);".$this->FN_DHTMLXWINDOWSHIDEPROGRESS().";return false;}";
|
||||
$onchangecboidrouteend.="myForm.setItemValue('txt_price',sp[2]);";
|
||||
$onchangecboidrouteend.="myForm.setItemValue('txt_pricelimitbaggage',sp[3]);";
|
||||
|
||||
// === Text baggage Change
|
||||
$onchangetxtbaggage="if(ev.keyCode==13)";
|
||||
$onchangetxtbaggage.="{";
|
||||
$onchangetxtbaggage.=" var baggage=parseInt(myForm.getItemValue('txt_baggageinkg'));";
|
||||
$onchangetxtbaggage.=" var limitbaggage=parseInt(myForm.getItemValue('txt_limitbaggage'));";
|
||||
$onchangetxtbaggage.=" var priceoverbaggage=0;";
|
||||
$onchangetxtbaggage.=" myForm.setItemValue('txt_overlimitbaggage',0);";
|
||||
$onchangetxtbaggage.=" if(baggage>limitbaggage)";
|
||||
$onchangetxtbaggage.=" {";
|
||||
$onchangetxtbaggage.=" var overbaggage=(myForm.getItemValue('txt_baggageinkg')-myForm.getItemValue('txt_limitbaggage')).toFixed(2);";
|
||||
$onchangetxtbaggage.=" myForm.setItemValue('txt_overlimitbaggage',overbaggage);";
|
||||
$onchangetxtbaggage.=" priceoverbaggage=parseInt(overbaggage)*myForm.getItemValue('txt_pricelimitbaggage');";
|
||||
$onchangetxtbaggage.=" }";
|
||||
$onchangetxtbaggage.=" myForm.setItemValue('txt_overprice',priceoverbaggage);";
|
||||
$onchangetxtbaggage.=" var totalbiaya=(parseFloat(myForm.getItemValue('txt_price')))+(parseFloat(myForm.getItemValue('txt_overprice')));";
|
||||
//$onchangetxtbaggage.=" alert(totalbiaya);";
|
||||
$onchangetxtbaggage.=" myForm.setItemValue('txt_totalbiaya',totalbiaya.toFixed(2));";
|
||||
$onchangetxtbaggage.="}";
|
||||
|
||||
$onbuttonclickbtnsave="if(myForm.validate())
|
||||
{
|
||||
dhtmlx.confirm({
|
||||
title:'Confirmation',text:'Are you will be saved and data is correctly?',type:'confirm',
|
||||
callback:function(result){
|
||||
if(result)
|
||||
{";
|
||||
$params="'obj=".$this->enc("tra_newticket")."&task=".$this->enc("saverecord")."'";
|
||||
$onformsenddata="url=fn_dhtmlxsenddata('".$this->enc("obj_tra")."',$params);
|
||||
myForm.send(url,\"get\",function(loader, response){";
|
||||
$onformsenddata.=$this->FN_DHTMLXWINDOWSHIDEPROGRESS();
|
||||
$onformsenddata.="var sp=trim(response).split('|');
|
||||
//alert(response);
|
||||
if(sp[0]=='ok')
|
||||
{
|
||||
fn_dhtmlxmessage('','Data <b>'+myForm.getItemValue('cbo_idship')+'</b> has been saved');";
|
||||
$onformsenddata.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"cbo_idship");
|
||||
$onformsenddata.="fn_grid_loaddata();
|
||||
}
|
||||
else if(sp[0]=='failed')
|
||||
{fn_dhtmlxmessage('error','Error Found : '+sp[1]);}
|
||||
else
|
||||
{fn_dhtmlxmessage('error','Error Found : '+response);}
|
||||
});";
|
||||
$onbuttonclickbtnsave.=$this->FN_DHTMLXWINDOWSHOWPROGESS($onformsenddata);
|
||||
$onbuttonclickbtnsave.=" }
|
||||
}
|
||||
});
|
||||
}";
|
||||
|
||||
$onbuttonclickbtnupdt="if(myForm.validate())
|
||||
{
|
||||
dhtmlx.confirm({
|
||||
title:'Confirmation',text:'Are you will be updated and data is correctly?',type:'confirm',
|
||||
callback:function(result){
|
||||
if(result)
|
||||
{";
|
||||
$params="'obj=".$this->enc("tra_newticket")."&task=".$this->enc("updrecord")."'";
|
||||
$onformsenddata="url=fn_dhtmlxsenddata('".$this->enc("obj_tra")."',$params);
|
||||
myForm.send(url,\"get\",function(loader, response){";
|
||||
$onformsenddata.=$this->FN_DHTMLXWINDOWSHIDEPROGRESS();
|
||||
$onformsenddata.="var sp=trim(response).split('|');
|
||||
//alert(response);
|
||||
if(sp[0]=='ok')
|
||||
{
|
||||
fn_dhtmlxmessage('','Data <b>'+myForm.getItemValue('cbo_idship')+'</b> has been update');";
|
||||
$onformsenddata.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"cbo_idship");
|
||||
$onformsenddata.="myForm.enableItem('btnsave');";
|
||||
$onformsenddata.="myForm.disableItem('btnupdate');";
|
||||
$onformsenddata.="myForm.disableItem('btndelete');";
|
||||
$onformsenddata.="fn_grid_loaddata();
|
||||
}
|
||||
else if(sp[0]=='failed')
|
||||
{fn_dhtmlxmessage('error','Error Found : '+sp[1]);}
|
||||
else
|
||||
{fn_dhtmlxmessage('error','Error Found : '+response);}
|
||||
});";
|
||||
$onbuttonclickbtnupdt.=$this->FN_DHTMLXWINDOWSHOWPROGESS($onformsenddata);
|
||||
$onbuttonclickbtnupdt.=" }
|
||||
}
|
||||
});
|
||||
}";
|
||||
|
||||
$eventafterdeleted=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"cbo_idship");
|
||||
$eventafterdeleted.="myForm.enableItem('btnsave');";
|
||||
$eventafterdeleted.="myForm.disableItem('btnupdate');";
|
||||
$eventafterdeleted.="myForm.disableItem('btndelete');";
|
||||
$eventafterdeleted.="fn_grid_loaddata();";
|
||||
$onbuttonclickbtndeleted=$this->FN_DHTMLXREMARKFORDELETED2("obj_tra","tra_newticket","myForm.getItemValue('txt_id')","myForm.getItemValue('cbo_idship')",$eventafterdeleted);
|
||||
|
||||
$onbuttonclickbtncancel=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls);
|
||||
$onbuttonclickbtncancel.="myForm.enableItem('btnsave');";
|
||||
$onbuttonclickbtncancel.="myForm.disableItem('btnupdate');";
|
||||
$onbuttonclickbtncancel.="myForm.disableItem('btndelete');";
|
||||
$onbuttonclickbtncancel.="myForm.setItemFocus('cbo_idship');";
|
||||
$onbuttonclickbtncancel.="fn_grid_loaddata();";
|
||||
|
||||
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onbuttonclick","eventparam"=>"id,val",
|
||||
"switch"=>array(
|
||||
"btnbookseat"=>"fn_showBookingSeat()",
|
||||
"btnsave"=>"$onbuttonclickbtnsave",
|
||||
"btnupdate"=>"$onbuttonclickbtnupdt",
|
||||
"btndelete"=>"$onbuttonclickbtndeleted",
|
||||
"btncancel"=>"$onbuttonclickbtncancel"
|
||||
)
|
||||
),
|
||||
array("eventname"=>"onkeydown","eventparam"=>"inp,ev,id,val",
|
||||
"switch"=>array(
|
||||
"txt_limitbaggage"=>"$onobjkeydown",
|
||||
"txt_baggageinkg"=>"$onchangetxtbaggage"
|
||||
)
|
||||
),
|
||||
array("eventname"=>"onchange","eventparam"=>"id,val",
|
||||
"switch"=>array(
|
||||
"cbo_idrouteend"=>"$onchangecboidrouteend $onchangetxtbaggage",
|
||||
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
|
||||
$this->FN_DHTMLXFORMEVENT("myForm",$arrevent);
|
||||
echo "myForm.getCombo('cbo_idship').attachEvent('onKeyPressed',function(keycode){
|
||||
if(keycode==13){".$onkeypresscboshipname."}
|
||||
});";
|
||||
|
||||
// === FORM SEARCH AND GRID
|
||||
$formdata=array(
|
||||
array("type"=>"settings","position"=>"label-left","labelWidth"=>"180","inputWidth"=>"120"),
|
||||
array("type"=>"fieldset","width"=>"580","label"=>"Search",
|
||||
"list"=>array(
|
||||
array("type"=>"input","name"=>"txtsearch","label"=>"Insert Your Keyword","info"=>"true","inputWidth"=>"240",
|
||||
"tooltip"=>"Insert Your Keyword","maxLength"=>"","className"=>"txtleft","labelWidth"=>"210"),
|
||||
array("type"=>"newcolumn"),
|
||||
array("type"=>"button","name"=>"btnfind","value"=>"","className"=>"button_find","offsetLeft"=>"10","offsetTop"=>"0")
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->FN_DHTMLXFORM("myFormsearch","divnewticketsearch",$formdata,true);
|
||||
$ontxtsearchkeydown="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();myFormsearch.setItemFocus('btnfind');}";
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onbuttonclick","eventparam"=>"id,val",
|
||||
"switch"=>array(
|
||||
"btnfind"=>"fn_grid_loaddata()"
|
||||
)
|
||||
),
|
||||
array("eventname"=>"onkeydown","eventparam"=>"inp,ev,id,val",
|
||||
"switch"=>array(
|
||||
"txtsearch"=>"$ontxtsearchkeydown"
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->FN_DHTMLXFORMEVENT("myFormsearch",$arrevent);
|
||||
|
||||
$grdinit=array("gridname"=>"dgnewticket","divtarget"=>"div_dgnewticket","divpaging"=>"div_dgnewticketpaging","paginglimit"=>PAGE_LIMIT,
|
||||
"showloader"=>"true");
|
||||
$gridproperties=array("id"=>"right,ro,96,right,int,false,true",
|
||||
"No. "=>"right,ro,35,center,int,false",
|
||||
"Ship Name"=>"left,ro,152,left,int,false",
|
||||
"Ticket Number"=>"center,ro,194,center,str,false",
|
||||
"No. Sequence "=>"right,ro,110,right,int,false",
|
||||
"Ship Number"=>"left,ro,238,left,str,false",
|
||||
"Mrs/ Mr"=>"left,ro,206,left,str,false",
|
||||
"Picture"=>"left,ro,206,left,str,false",
|
||||
"Dates"=>"center,ro,120,center,date,false",
|
||||
"From"=>"center,ro,112,center,str,false",
|
||||
"To"=>"center,ro,112,center,str,false",
|
||||
"Seat Number"=>"center,ro,90,center,str,false",
|
||||
"Quantity "=>"right,ro,110,right,int,false",
|
||||
"Price "=>"right,ro,120,right,int,false",
|
||||
"Baggage "=>"right,ro,136,right,int,false",
|
||||
"Price "=>"right,ro,120,right,int,false");
|
||||
$this->FN_DHTMLXGRIDVIEW($grdinit,$gridproperties,"bricks","","fn_grid_loaddata()");
|
||||
$arrfields=array("txt_id"=>"","cbo_idship"=>"","txt_tiketnumber"=>"","txt_inctiket"=>"","txt_shipnumber"=>"","txt_passengername"=>"","txt_picdata"=>"","txt_dates"=>"","cbo_idroutestart"=>"","cbo_idrouteend"=>"","txt_seatnumber"=>"","txt_quantity"=>"","txt_price"=>"","txt_baggageinkg"=>"","txt_limitbaggage"=>"");
|
||||
$otherevent="";
|
||||
$this->FN_DHTMLXGRIDVIEWTOFORMNEW("dgnewticket","myForm","tbl_passenger_tiket",0,$arrfields,"");
|
||||
echo " }
|
||||
|
||||
function fn_seattimelimit(){
|
||||
var textm,texts;
|
||||
if(ss==0){mm=mm-1;}
|
||||
|
||||
textm='0000'+mm.toString();
|
||||
textm=textm.substring(textm.length-2,textm.length);
|
||||
texts='0000'+ss.toString();
|
||||
texts=texts.substring(texts.length-2,texts.length);
|
||||
|
||||
myForm.setItemLabel('lbllimitbook','Limit in 5 min = '+textm+':'+texts);
|
||||
if(ss==0){ss=60;}
|
||||
|
||||
if(mm<0&&ss==60){
|
||||
myForm.setItemLabel('lbllimitbook','Limit in 5 min = 00:00');
|
||||
clearTimeout(tbooking);
|
||||
}
|
||||
else
|
||||
{
|
||||
ss=ss-1;
|
||||
if(myForm.getItemValue('txt_seatnumber')=='')
|
||||
{
|
||||
clearTimeout(tbooking);
|
||||
myForm.setItemLabel('lbllimitbook','Limit Booking in 5 Minutes');
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout(function(){
|
||||
fn_seattimelimit();
|
||||
},1000);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function fn_showCamera()
|
||||
{
|
||||
dwins=new dhtmlXWindows();dwins.attachViewportTo(\"winVP\");
|
||||
var url='?ajax=1&sec=1&option=".$this->enc("obj_tra")."&obj=".$this->enc("tra_newticket")."&task=".$this->enc("getpic")."';";
|
||||
$url="?ajax=1&sec=1&option=".$this->enc("obj_tra")."&obj=".$this->enc("tra_newticket")."&task=".$this->enc("getpic");
|
||||
$this->FN_DHTMLXWINDOWSURL("dwins","winpic","Get Picture","50","50","560","400",$url,false,true);
|
||||
|
||||
echo " }
|
||||
|
||||
function fn_getPicName(filename){
|
||||
//alert(filename);
|
||||
myForm.setItemValue('txt_picdata',filename);
|
||||
dwins.unload();
|
||||
document.getElementById('imgtiket').src='uploads/temps/'+filename;
|
||||
|
||||
}
|
||||
|
||||
function fn_showBookingSeat()
|
||||
{
|
||||
dwins=new dhtmlXWindows();dwins.attachViewportTo(\"winVP\");
|
||||
if(myForm.getItemValue('cbo_idship')==''){
|
||||
fn_dhtmlxmessage('error','Please Insert your ship first!');
|
||||
myForm.setItemFocus('cbo_idship');
|
||||
return false;
|
||||
}
|
||||
if(myForm.getItemValue('cbo_idroutestart')==''){
|
||||
fn_dhtmlxmessage('error','Please Insert your port arrival!');
|
||||
myForm.setItemFocus('cbo_idroutestart');
|
||||
return false;
|
||||
}
|
||||
if(myForm.getItemValue('cbo_idrouteend')==''){
|
||||
fn_dhtmlxmessage('error','Please Insert your port destination!');
|
||||
myForm.setItemFocus('cbo_idrouteend');
|
||||
return false;
|
||||
}
|
||||
|
||||
var url='?ajax=1&sec=1&option=".$this->enc("obj_tra")."&obj=".$this->enc("tra_newticket")."&task=".$this->enc("getseatnum")."&bookingdate='+myForm.getCalendar('txt_dates').getDate(true);
|
||||
url=url+'&idship='+myForm.getItemValue('cbo_idship')+'&shipname='+myForm.getCombo('cbo_idship').getComboText()+'&seatnumber='+myForm.getItemValue('txt_seatnumber');
|
||||
url=url+'&idroutestart='+myForm.getItemValue('cbo_idroutestart')+'&idrouteend='+myForm.getItemValue('cbo_idrouteend')+'&routestart='+myForm.getCombo('cbo_idroutestart').getComboText();
|
||||
url=url+'&routeend='+myForm.getCombo('cbo_idrouteend').getComboText();";
|
||||
//$url="?ajax=1&sec=1&option=".$this->enc("obj_tra")."&obj=".$this->enc("tra_newticket")."&task=".$this->enc("getseatnum");
|
||||
//$this->FN_DHTMLXWINDOWSURL("dwins","winpic","Booking Seat Number","0","0","580","650",$url,false,true);
|
||||
$rtn="dwins.createWindow(\"winbook\",0,0,580,650);";
|
||||
$rtn.="dwins.window('winbook').denyResize();";
|
||||
$rtn.="dwins.window('winbook').progressOn();";
|
||||
$rtn.="dwins.window(\"winbook\").setText(\"Booking Seat Number\");";
|
||||
$rtn.="dwins.window(\"winbook\").attachURL(url);";
|
||||
$rtn.="dwins.window('winbook').setModal(true);";
|
||||
$rtn.="dwins.window('winbook').progressOff();";
|
||||
echo $rtn;
|
||||
|
||||
echo " }
|
||||
|
||||
function fn_cancelbookseat(){
|
||||
myForm.setItemValue('txt_seatnumber','');
|
||||
clearTimeout(tbooking);
|
||||
myForm.setItemLabel('lbllimitbook','Limit Booking in 5 Minutes');
|
||||
mm=5;ss=0;
|
||||
setTimeout(function(){
|
||||
dwins.unload();
|
||||
},400);
|
||||
|
||||
}
|
||||
|
||||
function fn_getbookseat(seatnumber){
|
||||
//alert(seatnumber);
|
||||
myForm.setItemValue('txt_seatnumber',seatnumber);
|
||||
dwins.unload();
|
||||
|
||||
tbooking=setTimeout(function(){
|
||||
fn_seattimelimit();
|
||||
},1000);
|
||||
}
|
||||
|
||||
|
||||
function fn_grid_loaddata()
|
||||
{
|
||||
var keyword=myFormsearch.getItemValue('txtsearch');
|
||||
url=fn_dhtmlxloadobject('".$this->enc("obj_tra")."','obj=".$this->enc("tra_newticket")."&task=".$this->enc("grdrecord")."&keyword='+keyword);
|
||||
dgnewticket.clearAndLoad(url);";
|
||||
echo " }
|
||||
|
||||
</script>";
|
||||
echo $this->FN_CLOSEHEADER();
|
||||
echo $this->FN_CREATEBODY("e8f1ff");
|
||||
|
||||
|
||||
echo "<div id=\"winVP\" style=\"height:1020px;\">";
|
||||
echo "<table width=\"98%\" border=\"0\">
|
||||
<tr>
|
||||
<td>";
|
||||
$url="location.reload();";
|
||||
$myuri=array("<b>PASSENGER INFORMATION</b>"=>"$url|id='a_newticket'");
|
||||
echo $this->MULTIPLE_LINK($myuri);
|
||||
echo " </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"divnewticketcontent\" style=\"margin-left:0px;\">
|
||||
<table width=\"98%\" border=\"0\">
|
||||
<tr>
|
||||
<td width=\"45%\" valign=\"top\">
|
||||
<div id=\"divnewticketnew\" style=\"\"></div>
|
||||
</td>
|
||||
<td valign=\"top\">
|
||||
<table width=\"98%\" cellpadding=\"0\" cellspacing=\"0\">
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<div id=\"divnewticketsearch\" style=\"width:560px;margin-top:-6px;\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgnewticket\" style=\"height:380px;width:580px;overflow:hidden\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgnewticketpaging\" style=\"width:598px;margin-top:1px\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td valign=\"top\"><div id=\"loadergrid\" style=\"z-index:100;position:absolute;margin-top:-220px;margin-left:287px;display:visibility;\">".$this->CREATE_IMAGE("loadergrid.gif")."</div></td></tr>
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<table>
|
||||
<tr>
|
||||
<td style='color:red;font-weight:bold;'>Notes</td>
|
||||
<td>:</td>
|
||||
<td>- Click Row For Edit</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>";
|
||||
echo $this->FN_CREATEFOOTER();
|
||||
|
||||
}
|
||||
|
||||
public function fn_grdrecord()
|
||||
{
|
||||
$keyword=$_REQUEST["keyword"];
|
||||
header("Content-type: text/xml");
|
||||
echo('<?xml version="1.0" encoding="utf-8"?>');
|
||||
echo "<rows id='0'>";
|
||||
|
||||
$qry="select id,idship,tiketnumber,inctiket,shipnumber,passengername,picdata,dates,idroutestart,idrouteend,seatnumber,quantity,price,baggageinkg,pricebaggage
|
||||
from ".DB_APORTIL.".tbl_passenger_tiket
|
||||
where idship like '%$keyword%' and isdeleted=0
|
||||
order by id asc limit ".TBL_PAGE_LIMIT;
|
||||
|
||||
$rs=$this->selectquery($qry);
|
||||
if($rs)
|
||||
{
|
||||
$i=1;
|
||||
while($row=$this->data_row_array($rs))
|
||||
{
|
||||
echo ("<row id='".$row["id"]."'>");
|
||||
print("<cell><![CDATA[".$row["id"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$i."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["idship"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["tiketnumber"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["inctiket"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["shipnumber"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["passengername"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["picdata"]."]]></cell>");
|
||||
print("<cell><![CDATA[".date("Y-m-d",strtotime($row["dates"]))."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["idroutestart"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["idrouteend"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["seatnumber"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["quantity"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["price"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["baggageinkg"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["pricebaggage"]."]]></cell>");
|
||||
echo ("</row>");
|
||||
$i+=1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo mysql_errno().": ".mysql_error()." at ".__LINE__." line in ".__FILE__." file<br>";
|
||||
}
|
||||
echo "</rows>";
|
||||
|
||||
}
|
||||
|
||||
public function fn_saverecord($isupdate=null)
|
||||
{
|
||||
if($isupdate){$id=$_REQUEST['txt_id'];}
|
||||
$idship=$_REQUEST['cbo_idship'];
|
||||
$tiketnumber=$_REQUEST['txt_tiketnumber'];
|
||||
$inctiket=$_REQUEST['txt_inctiket'];
|
||||
$shipnumber=$_REQUEST['txt_shipnumber'];
|
||||
$passengername=$_REQUEST['txt_passengername'];
|
||||
$picdata=$_REQUEST['txt_picdata'];
|
||||
$dates=$_REQUEST['txt_dates'];
|
||||
$idroutestart=$_REQUEST['cbo_idroutestart'];
|
||||
$idrouteend=$_REQUEST['cbo_idrouteend'];
|
||||
$seatnumber=$_REQUEST['txt_seatnumber'];
|
||||
$quantity=$_REQUEST['txt_quantity'];
|
||||
$price=$_REQUEST['txt_price'];
|
||||
$baggageinkg=$_REQUEST['txt_baggageinkg'];
|
||||
$pricebaggage=$_REQUEST['txt_limitbaggage'];
|
||||
|
||||
$qry="insert into ".DB_APORTIL.".tbl_passenger_tiket
|
||||
set idship='$idship',tiketnumber='$tiketnumber',inctiket='$inctiket',shipnumber='$shipnumber',passengername='$passengername',picdata='$picdata',
|
||||
dates='$dates',idroutestart='$idroutestart',idrouteend='$idrouteend',seatnumber='$seatnumber',quantity='$quantity',price='$price',
|
||||
baggageinkg='$baggageinkg',pricebaggage='$pricebaggage',iby='".$_SESSION['nik']."',idt=now()";
|
||||
if($isupdate)
|
||||
{
|
||||
$qry="update ".DB_APORTIL.".tbl_passenger_tiket
|
||||
set idship='$idship',tiketnumber='$tiketnumber',inctiket='$inctiket',shipnumber='$shipnumber',passengername='$passengername',picdata='$picdata',
|
||||
dates='$dates',idroutestart='$idroutestart',idrouteend='$idrouteend',seatnumber='$seatnumber',quantity='$quantity',price='$price',
|
||||
baggageinkg='$baggageinkg',pricebaggage='$pricebaggage',uby='".$_SESSION['nik']."',udt=now()
|
||||
where id='$id'";
|
||||
}
|
||||
|
||||
if($this->executequery($qry)){echo "ok|";return true;}
|
||||
}
|
||||
public function fn_updrecord(){$this->fn_saverecord(true);}
|
||||
|
||||
public function fn_delrecord()
|
||||
{
|
||||
$id=$_REQUEST['txt_id'];
|
||||
$remark=$_REQUEST['txtremark'];
|
||||
$qry="update ".DB_APORTIL.".tbl_passenger_tiket
|
||||
set isdeleted=1,remark='$remark',dby='".$_SESSION['nik']."',ddt=now()
|
||||
where id='$id'";
|
||||
if($this->executequery($qry)){echo "ok|";return true;}
|
||||
else
|
||||
{
|
||||
echo "failed|".$this->getErrorQuery();
|
||||
}
|
||||
}
|
||||
|
||||
public function fn_getticket(){
|
||||
$valticket="";
|
||||
for($i=1;$i<=8;$i++){
|
||||
$valticket.=rand(0,9);
|
||||
}
|
||||
$sql="select tiketnumber from ".DB_APORTIL.".tbl_passenger_tiket where tiketnumber='".$tiketnumber."' order by id desc limit 1";
|
||||
if($this->fn_row_isexists($sql)){
|
||||
$this->fn_getticket();
|
||||
}
|
||||
return $valticket;
|
||||
}
|
||||
public function fn_getheaderinfo(){
|
||||
$idship=$_REQUEST['idship'];
|
||||
$tiketnumber=$this->fn_getticket();
|
||||
echo "ok|".$tiketnumber;
|
||||
}
|
||||
|
||||
public function fn_getprice(){
|
||||
$idroutestart=$_REQUEST['idroutestart'];
|
||||
$idrouteend=$_REQUEST['idrouteend'];
|
||||
$qry="select prices from ".DB_APORTIL.".tbl_price_information
|
||||
where idroutestart='".$idroutestart."' and idrouteend='".$idrouteend."' and isdeleted=0
|
||||
order by id desc limit 1";
|
||||
$price=0;$status="failed";$statuserr="Price not Found, Please contact your administrator";
|
||||
if($this->fn_row_isexists($qry)){
|
||||
$price=$this->fn_get_fieldvalue("prices",$qry);
|
||||
$status="ok";$statuserr="";
|
||||
}
|
||||
// === Price limit baggage
|
||||
$qry="select prices from ".DB_APORTIL.".tbl_cargoprice_information
|
||||
where idcategory=2 and idroutestart='$idroutestart' and idrouteend='$idrouteend' and isdeleted=0
|
||||
order by id desc limit 1";
|
||||
$pricebaggagelimit=0;
|
||||
if($this->fn_row_isexists($qry)){
|
||||
$pricebaggagelimit=$this->fn_get_fieldvalue("prices",$qry);
|
||||
}
|
||||
echo "$status|$statuserr|$price|$pricebaggagelimit";
|
||||
}
|
||||
|
||||
public function fn_setbookseat(){
|
||||
$idship=$_REQUEST['idship'];
|
||||
$bookingdate=$_REQUEST['bookingdate'];
|
||||
$spship=$this->fn_get_fieldsvalues("shipnumber,shipname","select shipnumber,shipname from ".DB_APORTIL.".tbl_ship_information where id='$idship'");
|
||||
$shipnumber=$spship[0];$shipname=$spship[1];
|
||||
$seatnumber=$_REQUEST['seatnumber'];
|
||||
$idroutestart=$_REQUEST['idroutestart'];
|
||||
$routestart=$this->fn_get_fieldvalue("routename","select routename from ".DB_APORTIL.".tbl_route_information where id='$idroutestart'");
|
||||
$idrouteend=$_REQUEST['idrouteend'];
|
||||
$routeend=$this->fn_get_fieldvalue("routename","select routename from ".DB_APORTIL.".tbl_route_information where id='$idrouteend'");
|
||||
$bookingdateend=date("Y-m-d H:i:s",strtotime("+15 minutes"));
|
||||
|
||||
$qry="insert into ".DB_APORTIL.".tbl_ship_seatbooking
|
||||
set idship='$idship',shipnumber='$shipnumber',shipname='$shipname',bookingdate='$bookingdate',bookingdateend='$bookingdateend',
|
||||
seatnumber='$seatnumber',idroutestart='$idroutestart',routestart='$routestart',idrouteend='$idrouteend',routeend='$routeend',
|
||||
status=0,iby='".$_SESSION['nik']."',idt=now()";
|
||||
$rtn="failed|Booking Failed please contact administrator!.";
|
||||
if($this->executequery($qry)){
|
||||
$rtn="ok|";
|
||||
}
|
||||
echo $rtn;
|
||||
}
|
||||
|
||||
public function fn_cancelseat(){
|
||||
$seatnumber=$_REQUEST['seatnumber'];
|
||||
$bookingdate=$_REQUEST['bookingdate'];
|
||||
$qry="update ".DB_APORTIL.".tbl_ship_seatbooking set status=-2,remark='Cancel Booking by ".$_SESSION['nik']."',uby='".$_SESSION['nik']."',udt=now()
|
||||
where seatnumber='$seatnumber' and cast(bookingdate as date)=cast('$bookingdate' as date) and isdeleted=0";
|
||||
//echo "failed|$qry";
|
||||
if($this->executequery($qry)){
|
||||
echo "ok|success";
|
||||
};
|
||||
}
|
||||
|
||||
public function fn_getseatnum(){
|
||||
$bookingdate=$_REQUEST['bookingdate'];
|
||||
$idship=$_REQUEST['idship'];
|
||||
$shipname=$_REQUEST['shipname'];
|
||||
$seatnumber=$_REQUEST['seatnumber'];
|
||||
$idroutestart=$_REQUEST['idroutestart'];
|
||||
$routestart=$_REQUEST['routestart'];
|
||||
$routeend=$_REQUEST['routeend'];
|
||||
$idrouteend=$_REQUEST['idrouteend'];
|
||||
echo $this->FN_CREATEHEADER();
|
||||
echo "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\" />";
|
||||
echo "<script>
|
||||
function initObject()
|
||||
{}
|
||||
function fn_setbookseat(seatnumber){
|
||||
var tempseatnumber='$seatnumber';
|
||||
if(tempseatnumber){
|
||||
fn_dhtmlxmessage('error','Please Cancel your booking Seat Number $seatnumber');
|
||||
return false;
|
||||
}";
|
||||
//window.parent.fn_getbookseat(seatnumber);
|
||||
$setbookseat="var sp=ajaxuridhtmlx('".$this->enc("obj_tra")."','obj=".$this->enc("tra_newticket")."&task=".$this->enc("setbookseat")."&bookingdate=$bookingdate&idship=$idship&seatnumber='+seatnumber+'&idroutestart=$idroutestart&idrouteend=$idrouteend').split('|');";
|
||||
$setbookseat.="if(trim(sp[0])=='failed'){fn_dhtmlxmessage('error',sp[1]);".$this->FN_DHTMLXWINDOWSHIDEPROGRESS().";return false;}";
|
||||
//$setbookseat.="var tiketnumber=sp[1];";
|
||||
$setbookseat.="window.parent.fn_getbookseat(seatnumber);";
|
||||
//$setbookseat="";
|
||||
$fn_setbookseat=$this->FN_DHTMLXWINDOWSHOWPROGESS($setbookseat);
|
||||
$fn_setbookseat.=$this->FN_DHTMLXWINDOWSHIDEPROGRESS();
|
||||
|
||||
echo $fn_setbookseat;
|
||||
|
||||
echo " }
|
||||
|
||||
function fn_cancelbooking(seatnumber){
|
||||
dhtmlx.confirm({
|
||||
title:'Confirmation',
|
||||
text:'Are sure to cancel the seat Number '+seatnumber+' ?',
|
||||
callback:function(res){
|
||||
if(res)
|
||||
{";
|
||||
$cancel="var sp=ajaxuridhtmlx('".$this->enc("obj_tra")."','obj=".$this->enc("tra_newticket")."&task=".$this->enc("cancelseat")."&seatnumber='+seatnumber+'&bookingdate=$bookingdate').split('|');";
|
||||
//$cancel.="if(trim(sp[0])=='failed'){fn_dhtmlxmessage('error',sp[1]);".$this->FN_DHTMLXWINDOWSHIDEPROGRESS().";return false;}";
|
||||
$cancel.="if(trim(sp[0])=='failed'){alert(sp[1]);".$this->FN_DHTMLXWINDOWSHIDEPROGRESS().";return false;}";
|
||||
$cancel.="window.parent.fn_cancelbookseat(seatnumber);";
|
||||
$eventcancel=$this->FN_DHTMLXWINDOWSHOWPROGESS($cancel);
|
||||
$eventcancel.=$this->FN_DHTMLXWINDOWSHIDEPROGRESS();
|
||||
echo $eventcancel;
|
||||
echo " }
|
||||
}
|
||||
})
|
||||
}";
|
||||
echo "</script>
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
margin: 0px;
|
||||
/*background-color: #EBEBEB;*/
|
||||
}
|
||||
</style>";
|
||||
echo $this->FN_CLOSEHEADER();
|
||||
echo $this->FN_CREATEBODY("e8f1ff");
|
||||
echo "<div style=\"margin-left:25px\">
|
||||
<table>
|
||||
<tr>
|
||||
<td>Ship Name</td>
|
||||
<td>:</td>
|
||||
<td>".$shipname."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Route</td>
|
||||
<td>:</td>
|
||||
<td>".$routestart." to ".$routeend."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Booking Date</td>
|
||||
<td>:</td>
|
||||
<td>".$bookingdate."</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>";
|
||||
echo "<div style=\"height:575px;overflow-y:scroll\">";
|
||||
echo "<table width=\"98%\" height=\"100%\" style=\"margin-left:20px;\">";
|
||||
echo " <tr>
|
||||
<td valign=\"top\">
|
||||
<div style=\"height:140\">
|
||||
<table width=\"100%\">";
|
||||
// === SEAT Number
|
||||
for($i=1;$i<=30;$i++){
|
||||
echo "<tr>";
|
||||
for($j=1;$j<=10;$j++)
|
||||
{
|
||||
$colors="#ecf0f1";
|
||||
echo "<td width=\"10px\" height=\"8px\" style=\"height:8px;background-color:none\">";
|
||||
$qry="select id,status,iby from ".DB_APORTIL.".tbl_ship_seatbooking ";
|
||||
$qry.="where seatnumber='".$i.".".chr(64+$j)."' and status>=0 and isdeleted=0 ";
|
||||
$qry.="and cast(bookingdate as date)=cast('$bookingdate' as date) ";
|
||||
$qry.="and idroutestart='$idroutestart' and idrouteend='$idrouteend' ";
|
||||
$qry.="order by id asc limit 1";
|
||||
|
||||
$bookingidle="<a href=\"javascript:void(0)\" style=\"text-decoration:none\" onClick=\"fn_setbookseat('".$i.".".chr(64+$j)."')\">$i.".chr(64+$j)."</a>";
|
||||
if($this->fn_row_isexists($qry)){
|
||||
$bookingidle="<span style=\"color:white\">".$i.".".chr(64+$j)."</span>";
|
||||
$colors="red";
|
||||
$sp=$this->fn_get_fieldsvalues("id,status,iby",$qry);
|
||||
$id=$sp[0];$status=$sp[1];$iby=$sp[2];
|
||||
if($_SESSION['nik']==$iby){
|
||||
$bookingidle="<a href=\"javascript:void(0)\" style=\"text-decoration:none\" onClick=\"fn_cancelbooking('".$i.".".chr(64+$j)."')\"><span style=\"color:white\">".$i.".".chr(64+$j)."</span></a>";
|
||||
if($status==1){
|
||||
$bookingidle="<span style=\"color:white\">".$i.".".chr(64+$j)."</span>";
|
||||
$colors="blue";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(($i.".".chr(64+$j)!=$seatnumber)){
|
||||
$bookingidle="<span style=\"color:white\">".$i.".".chr(64+$j)."</span>";
|
||||
$colors="#e74c3c";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "<div style=\"border: 1px solid transparent;border-radius: 2px;background-color:$colors;width:30px;height:23px;font-size:12px;text-align:center;vertical-align:middle;line-height: 25px;\">
|
||||
$bookingidle
|
||||
</div>";
|
||||
echo "</td>";
|
||||
if($j==5){
|
||||
echo "<td width=\"20px\"> </td>";
|
||||
}
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
echo " </table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>";
|
||||
echo "</table>
|
||||
</div>";
|
||||
|
||||
echo $this->FN_CREATEFOOTER();
|
||||
}
|
||||
|
||||
public function fn_getpic(){
|
||||
echo $this->FN_CREATEHEADER();
|
||||
echo "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\" />";
|
||||
echo "<script src=\"".PATH_THEME."/js/camupload.js\"></script>";
|
||||
echo "<script>
|
||||
function initObject()
|
||||
{}
|
||||
function fn_setImage(filename){
|
||||
//window.opener.document.getElementById(\"blah_ReturnValue\").value = rv;
|
||||
window.parent.fn_getPicName(filename);
|
||||
|
||||
}";
|
||||
echo "</script>
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
margin: 0px;
|
||||
/*background-color: #EBEBEB;*/
|
||||
}
|
||||
</style>";
|
||||
echo $this->FN_CLOSEHEADER();
|
||||
echo $this->FN_CREATEBODY("e8f1ff");
|
||||
// echo "<div id=\"vid-controls\" style=\"margin-left:-80px\">
|
||||
//
|
||||
// </div>";
|
||||
echo "<video id=\"vid-show\" autoplay height=\"400\"></video>
|
||||
<div style=\"position:absolute;z-index:999;margin-top:-18%;margin-left:90%\">
|
||||
<a href=\"javascript:void(0)\" id=\"vid-take\" style=\"color:white\"><i class=\"fa fa-camera\" style=\"font-size:26pt;\"></i></a>
|
||||
</div>
|
||||
<div id=\"vid-canvas\" style=\"\"></div>";
|
||||
//echo "<button onClick='fn_setImage()'>Show Parent</button>";
|
||||
echo $this->FN_CREATEFOOTER();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
1103
objectx/obj_tra/tra_newticket_20200206.php
Normal file
1103
objectx/obj_tra/tra_newticket_20200206.php
Normal file
File diff suppressed because it is too large
Load Diff
1135
objectx/obj_tra/tra_newticket_20201210.php
Normal file
1135
objectx/obj_tra/tra_newticket_20201210.php
Normal file
File diff suppressed because it is too large
Load Diff
1152
objectx/obj_tra/tra_newticket_20201217.php
Normal file
1152
objectx/obj_tra/tra_newticket_20201217.php
Normal file
File diff suppressed because it is too large
Load Diff
1298
objectx/obj_tra/tra_newticket_20250305.php
Normal file
1298
objectx/obj_tra/tra_newticket_20250305.php
Normal file
File diff suppressed because it is too large
Load Diff
67
objectx/obj_tra/tra_newticket_tabs.php
Normal file
67
objectx/obj_tra/tra_newticket_tabs.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
class TRA_NEWTICKET extends TRA
|
||||
{
|
||||
public function tra_newticket_javainit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function fn_newticket_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_newticket();
|
||||
break;
|
||||
|
||||
case $task:
|
||||
$task="fn_".$task;
|
||||
if(method_exists($this,$task)){$this->$task();}
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->fn_default_newticket();
|
||||
break;
|
||||
}
|
||||
}
|
||||
public function fn_default_newticket()
|
||||
{
|
||||
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()
|
||||
{
|
||||
myTabbar.tabs(\"a1\").setActive();
|
||||
var a2=myTabbar.tabs(\"a2\");
|
||||
url=fn_dhtmlxloadobject('".$this->enc("obj_tra")."','obj=".$this->enc("tra_cargticket")."&task=".$this->enc("default")."&tabid=tabcarg2');
|
||||
a2.attachURL(url);";
|
||||
|
||||
echo " }
|
||||
|
||||
function fn_grid_loaddata()
|
||||
{";
|
||||
|
||||
echo " }
|
||||
</script>";
|
||||
echo $this->FN_CLOSEHEADER();
|
||||
echo $this->FN_CREATEBODY("e8f1ff");
|
||||
|
||||
echo "<div id=\"myTabbar\" class=\"dhtmlxTabBar\" style=\"width:80%; height:700px;\" oninit=\"initObject()\" align=\"left\">
|
||||
<div id=\"a1\" name=\"Passenger\"></div>
|
||||
<div id=\"a2\" name=\"Cargo\"></div>
|
||||
</div>";
|
||||
echo $this->FN_CREATEFOOTER();
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
243
objectx/obj_tra/tra_newticketc.php
Normal file
243
objectx/obj_tra/tra_newticketc.php
Normal file
@ -0,0 +1,243 @@
|
||||
<?php
|
||||
class TRA_NEWTICKETC extends TRA
|
||||
{
|
||||
public function tra_newticketc_javainit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function fn_newticketc_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_newticketc();
|
||||
break;
|
||||
|
||||
case $task:
|
||||
$task="fn_".$task;
|
||||
if(method_exists($this,$task)){$this->$task();}
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->fn_default_newticketc();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function fn_default_newticketc()
|
||||
{
|
||||
echo $this->FN_CREATEHEADER();
|
||||
$tiketnumber=$_REQUEST['tiketnumber'];
|
||||
$idtiketpassenger=$this->fn_get_fieldvalue("id","select id from ".DB_APORTIL.".tbl_passenger_tiket where tiketnumber='$tiketnumber'");
|
||||
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,dgchild;
|
||||
var rowid=0;
|
||||
function initObject()
|
||||
{";
|
||||
$formdata=array(
|
||||
array("type"=>"settings","position"=>"label-left","labelWidth"=>"180","inputWidth"=>"120"),
|
||||
array("type"=>"block","width"=>"500","label"=>"",
|
||||
"list"=>array(
|
||||
array("type"=>"hidden","name"=>"txt_tiketnumber","value"=>$tiketnumber),
|
||||
array("type"=>"hidden","name"=>"txt_idtiketpassenger","value"=>$idtiketpassenger),
|
||||
array("type"=>"label","name"=>"lblinfoselect","label"=>"Tiket Number <b>$tiketnumber</b>","className"=>"","labelWidth"=>"280","offsetTop"=>"-5","offsetLeft"=>"0"),
|
||||
array("type"=>"newcolumn"),
|
||||
array("type"=>"button","name"=>"btnsetchild","value"=>"Set Child","className"=>"button_saveas","offsetLeft"=>"10","disabled"=>"0"),
|
||||
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->FN_DHTMLXFORM("myForm","divfrmchild",$formdata,true);
|
||||
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onbuttonclick","eventparam"=>"id,val",
|
||||
"switch"=>array(
|
||||
"btnsetchild"=>"fn_setchild()"
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->FN_DHTMLXFORMEVENT("myForm",$arrevent);
|
||||
|
||||
$footerevent="<div style='height:15pt;padding-top:3pt;font-size:10pt'>";
|
||||
// $footerevent.="<a href='javascript:void(0)' onClick='fn_grid_newrow()'><span>Tambah Record</span></a> ";
|
||||
$footerevent.="<a href='javascript:void(0)' onClick='fn_grid_new()' style='font-size:16px'><span>Add</span></a> ";
|
||||
$footerevent.="<a href='javascript:void(0)' onClick='fn_grid_delrow()' style='font-size:16px'><span>Delete Record</span></a> ";
|
||||
$footerevent.="</div>";
|
||||
$grdinit=array("gridname"=>"dgchild","divtarget"=>"div_dgchild","divpaging"=>"div_dgchildpaging","paginglimit"=>5,
|
||||
"showloader"=>"true","footer"=>"$footerevent","footerspan"=>"7","footeralign"=>"left",
|
||||
"enableMultiline"=>"true","setdateformat"=>"%Y-%m-%d"
|
||||
);
|
||||
$gridproperties=array("grid"=>"right,ro,96,right,str,false,true",
|
||||
"id "=>"left,ro,210,left,str,false,true",
|
||||
"Names "=>"left,ed,210,left,str,false",
|
||||
"Birthofdate "=>"center,dhxCalendarA,220,center,str,false",
|
||||
"Ages "=>"center,ed,220,center,str,false",
|
||||
"Notes "=>"left,ed,220,left,str,false",
|
||||
"idtiketpassenger"=>"left,ro,110,left,int,false,true",
|
||||
);
|
||||
$this->FN_DHTMLXGRIDVIEW($grdinit,$gridproperties,"bricks","","fn_grid_loaddata()");
|
||||
echo "dgchild.setStyle('font-size:14px','font-size:14px','');";
|
||||
echo "dgchild.setDateFormat('%Y-%m-%d', '%Y-%m-%d');";
|
||||
|
||||
$eventrowselect="rowid=(dgchild.cells(rId,0).getValue());";
|
||||
// $eventxle="rwcount=dgtrasoap.getRowsNum();";
|
||||
// $eventxle.="var isvitanam=0;";
|
||||
// $eventxle.="if(rwcount>0){isvitanam=1;}";
|
||||
// $eventxle.="window.parent.fn_setvalidationheader('isvitanam',isvitanam);";
|
||||
// $eventxle.="window.parent.fn_setvalidationheader('iscppt',isvitanam);";
|
||||
// $eventxle.="for(i=1;i<=rwcount;i++){";
|
||||
// $eventxle.=" var insertby=dgtrasoap.cells(i,11).getValue();";
|
||||
// $eventxle.=" if(trim(insertby)!==trim('".$_SESSION['nik']."')){";
|
||||
// $eventxle.=" dgtrasoap.setRowTextStyle(i, \"color:grey;\");";
|
||||
// $eventxle.=" }";
|
||||
// $eventxle.="}";
|
||||
$oncalendarshow="var dhxcalendar=myCal;";
|
||||
$oncalendarshow.="";
|
||||
$arrevent=array(
|
||||
array("eventname"=>"onRowSelect","eventparam"=>"rId",
|
||||
"statement"=>"$eventrowselect"
|
||||
),
|
||||
array("eventname"=>"onCalendarShow","eventparam"=>"myCal,row_id,col_ind",
|
||||
"statement"=>"$oncalendarshow"
|
||||
),
|
||||
// array("eventname"=>"onXLE","eventparam"=>"grid_obj,rcount",
|
||||
// "statement"=>"$eventxle"
|
||||
// )
|
||||
);
|
||||
$this->FN_DHTMLXGRIDVIEWEVENT("dgchild",$arrevent);
|
||||
|
||||
echo " }
|
||||
|
||||
function fn_grid_new(){
|
||||
var idx=rowid;
|
||||
var rowcount=dgchild.getRowsNum()+1;
|
||||
var idtiketpassenger=myForm.getItemValue('txt_idtiketpassenger');
|
||||
var gridid=dgchild.uid();";
|
||||
echo " dgchild.addRow(rowcount,[gridid,0,'','".date("Y-m-d")."','','',idtiketpassenger]);
|
||||
|
||||
}
|
||||
|
||||
function fn_setchild(){
|
||||
var rowcount=dgchild.getRowsNum();
|
||||
// alert(rowcount);
|
||||
if(rowcount<=0)
|
||||
{
|
||||
fn_dhtmlxmessage('error','Please add child first!');
|
||||
return false;
|
||||
}
|
||||
var valchilds='';
|
||||
for(i=1;i<=rowcount;i++)
|
||||
{
|
||||
var idchilds=dgchild.cells(i,1).getValue();
|
||||
var names=dgchild.cells(i,2).getValue();
|
||||
var birthofdate=dgchild.cells(i,3).getValue();
|
||||
var ages=dgchild.cells(i,4).getValue();
|
||||
var notes=dgchild.cells(i,5).getValue();
|
||||
var idtiketpassenger=dgchild.cells(i,6).getValue();
|
||||
|
||||
valchilds+=idchilds+'|'+names+'|'+birthofdate+'|'+ages+'|'+notes+'|'+idtiketpassenger+';';
|
||||
}
|
||||
valchilds=valchilds.substring(0,valchilds.length-1);
|
||||
window.parent.fn_closechildren(valchilds);
|
||||
}
|
||||
|
||||
function fn_grid_loaddata()
|
||||
{
|
||||
var idtiketpassenger=myForm.getItemValue('txt_idtiketpassenger');
|
||||
url=fn_dhtmlxloadobject('".$this->enc("obj_tra")."','obj=".$this->enc("tra_newticketc")."&task=".$this->enc("grdrecord")."&idtiketpassenger='+idtiketpassenger);
|
||||
dgchild.clearAndLoad(url);";
|
||||
echo " }
|
||||
|
||||
</script>";
|
||||
echo $this->FN_CLOSEHEADER();
|
||||
echo $this->FN_CREATEBODY("e8f1ff");
|
||||
|
||||
echo "<table width=\"98%\" cellpadding=\"0\" cellspacing=\"0\" style=\"\">
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
<div id=\"divfrmchild\" style=\"width:560px;margin-top:-6px;\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign=\"top\">
|
||||
".$this->CREATE_LINK('window.location.reload();','REFRESH','javascript:void(0)','_self','','','','')."
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgchild\" style=\"height:360px;width:99%;overflow:hidden\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id=\"div_dgchildpaging\" style=\"width:740px;margin-top:1px\"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td valign=\"top\"><div id=\"loadergrid\" style=\"z-index:100;position:absolute;margin-top:-220px;margin-left:50%;display:visibility;\">".$this->CREATE_IMAGE("loadergrid.gif")."</div></td></tr>
|
||||
<tr>
|
||||
<td valign=\"top\" align=\"left\">
|
||||
<table>
|
||||
<tr>
|
||||
<td style='color:red;font-weight:bold;'>Notes</td>
|
||||
<td>:</td>
|
||||
<td>- Double click row for edit</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>";
|
||||
|
||||
echo $this->FN_CREATEFOOTER();
|
||||
|
||||
}
|
||||
|
||||
public function fn_grdrecord()
|
||||
{
|
||||
$idtiketpassenger=$_REQUEST["idtiketpassenger"];
|
||||
header("Content-type: text/xml");
|
||||
echo('<?xml version="1.0" encoding="utf-8"?>');
|
||||
echo "<rows id='0'>";
|
||||
|
||||
$qry="select *
|
||||
from ".DB_APORTIL.".tbl_passenger_childs
|
||||
where idtiketpassenger='$idtiketpassenger' and isdeleted=0
|
||||
order by id desc limit ".TBL_PAGE_LIMIT;
|
||||
|
||||
$rs=$this->selectquery($qry);
|
||||
if($rs)
|
||||
{
|
||||
$i=1;
|
||||
while($row=$this->data_row_array($rs))
|
||||
{
|
||||
echo ("<row id='".$i."'>");
|
||||
print("<cell><![CDATA[".$row["id"]."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["names"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA[".date("Y-m-d H:i:s",strtotime($row["birthofdate"]))."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["ages"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["notes"]."</span>"."]]></cell>");
|
||||
print("<cell><![CDATA[".$row["id"]."</span>"."]]></cell>");
|
||||
echo ("</row>");
|
||||
$i+=1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// echo mysql_errno().": ".mysql_error()." at ".__LINE__." line in ".__FILE__." file<br>";
|
||||
echo "error at ".__LINE__." line in ".__FILE__." file<br>";
|
||||
}
|
||||
echo "</rows>";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user