Add passenger type selection and improve tooltip messages in new ticket form

This commit is contained in:
2025-04-10 19:32:46 +07:00
parent 0700a715e4
commit c24bfe9f5c

View File

@ -42,10 +42,10 @@
echo "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\" />"; echo "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\" />";
echo "<style> echo "<style>
.besidebtnsave {margin-left:114px;margin-top:-6px;position:absolute;} .besidebtnsave {margin-left:118px;margin-top:-6px;position:absolute;}
.besidebtnupdate {margin-left:218px;margin-top:-6px;position:absolute;} .besidebtnupdate {margin-left:230px;margin-top:-6px;position:absolute;}
.besidebtnsubmit {margin-left:292px;margin-top:-6px;position:absolute;} .besidebtnsubmit {margin-left:292px;margin-top:-6px;position:absolute;}
.besidebtndelete {margin-left:318px;margin-top:-6px;position:absolute;} .besidebtndelete {margin-left:340px;margin-top:-6px;position:absolute;}
.besidelabel {margin-left:280px;margin-top:-5px;position:absolute;} .besidelabel {margin-left:280px;margin-top:-5px;position:absolute;}
.underpassengername {margin-left:180px;margin-top:-10px;position:static;} .underpassengername {margin-left:180px;margin-top:-10px;position:static;}
.besidelabelbaggage {margin-left:250px;margin-top:-5px;position:absolute;} .besidelabelbaggage {margin-left:250px;margin-top:-5px;position:absolute;}
@ -80,9 +80,10 @@
array("type"=>"block","width"=>"500", array("type"=>"block","width"=>"500",
"list"=>array( "list"=>array(
array("type"=>"hidden","name"=>"txt_id"), array("type"=>"hidden","name"=>"txt_id"),
array("type"=>"hidden","name"=>"txt_childspassenger"),
array("type"=>"hidden","name"=>"txt_modifcount"), array("type"=>"hidden","name"=>"txt_modifcount"),
array("type"=>"combo","name"=>"cbo_idship","label"=>"Ship Name","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"0", array("type"=>"combo","name"=>"cbo_idship","label"=>"Ship Name","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"0",
"tooltip"=>"Pilih Ship Name first. Thank You","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft"), "tooltip"=>"Choice Ship Name first. Thank You","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft"),
array("type"=>"input","name"=>"txt_tiketnumber","label"=>"Ticket Number","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"","readonly"=>"true", array("type"=>"input","name"=>"txt_tiketnumber","label"=>"Ticket Number","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"","readonly"=>"true",
"tooltip"=>"Insert Ticket Number first. Thank You","validate"=>"NotEmpty","maxLength"=>"40","className"=>"txtcenter txttiketnumber"), "tooltip"=>"Insert Ticket Number first. Thank You","validate"=>"NotEmpty","maxLength"=>"40","className"=>"txtcenter txttiketnumber"),
array("type"=>"input","name"=>"txt_voynumber","label"=>"Voyage Number","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"", array("type"=>"input","name"=>"txt_voynumber","label"=>"Voyage Number","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"",
@ -94,8 +95,8 @@
array("type"=>"input","name"=>"txt_passengername","label"=>"Name","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"", array("type"=>"input","name"=>"txt_passengername","label"=>"Name","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"",
"tooltip"=>"Insert Nama first. Thank You","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft"), "tooltip"=>"Insert Nama first. Thank You","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft"),
array("type"=>"label","name"=>"lbllookuphist","label"=>"<a href='javascript:void(0)' onClick='fn_showchildren()'><span id='spchild'>0</span> Children</a>","className"=>"underpassengername","offsetLeft"=>"0","offsetTop"=>"15"), array("type"=>"label","name"=>"lbllookuphist","label"=>"<a id='achilds' href='javascript:void(0)' onClick='fn_showchildren()'><span id='spchild'>0</span> Children</a>","className"=>"underpassengername","offsetLeft"=>"0","offsetTop"=>"15"),
array("type"=>"combo","name"=>"cbo_idgender","label"=>"Gender","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0", array("type"=>"combo","name"=>"cbo_idgender","label"=>"Gender","required"=>"true","info"=>"true","inputWidth"=>"140","value"=>"0",
"tooltip"=>"Please Choice gender first. Thank You","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft","note"=>array("text"=>"Ex : Female or Male")), "tooltip"=>"Please Choice gender first. Thank You","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft","note"=>array("text"=>"Ex : Female or Male")),
array("type"=>"calendar","name"=>"txt_bod","label"=>"Birth Of Dates","required"=>"false","info"=>"true","inputWidth"=>"90","readonly"=>"true","value"=>"", array("type"=>"calendar","name"=>"txt_bod","label"=>"Birth Of Dates","required"=>"false","info"=>"true","inputWidth"=>"90","readonly"=>"true","value"=>"",
"tooltip"=>"Insert Dates first. Thank You","maxLength"=>"","className"=>"txtcenter","dateFormat"=>"%Y-%m-%d","hidden"=>true), "tooltip"=>"Insert Dates first. Thank You","maxLength"=>"","className"=>"txtcenter","dateFormat"=>"%Y-%m-%d","hidden"=>true),
@ -104,15 +105,17 @@
"tooltip"=>"Insert Years Of Birthdate . Thank You","validate"=>"NotEmpty","maxLength"=>"4","className"=>"txtcenter","note"=>array("text"=>"ex : 1987")), "tooltip"=>"Insert Years Of Birthdate . Thank You","validate"=>"NotEmpty","maxLength"=>"4","className"=>"txtcenter","note"=>array("text"=>"ex : 1987")),
array("type"=>"newcolumn"), array("type"=>"newcolumn"),
array("type"=>"combo","name"=>"cbo_bodmonth","label"=>"","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"", array("type"=>"combo","name"=>"cbo_bodmonth","label"=>"","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"",
"tooltip"=>"Pilih ID Card first. Thank You","validate"=>"NotEmpty","maxLength"=>"","className"=>"besidetxtyears txtcenter","note"=>array("text"=>"ex : January")), "tooltip"=>"Choice Month Of Birthdate. Thank You","validate"=>"NotEmpty","maxLength"=>"","className"=>"besidetxtyears txtcenter","note"=>array("text"=>"ex : January")),
array("type"=>"newcolumn"), array("type"=>"newcolumn"),
array("type"=>"combo","name"=>"cbo_bodday","label"=>"","required"=>"true","info"=>"true","inputWidth"=>"60","value"=>"", array("type"=>"combo","name"=>"cbo_bodday","label"=>"","required"=>"true","info"=>"true","inputWidth"=>"60","value"=>"",
"tooltip"=>"Pilih ID Card first. Thank You","validate"=>"NotEmpty","maxLength"=>"","className"=>"besidecbobodmonth txtcenter","note"=>array("text"=>"ex : 31")), "tooltip"=>"Choice Day of Birthdate. Thank You","validate"=>"NotEmpty","maxLength"=>"","className"=>"besidecbobodmonth txtcenter","note"=>array("text"=>"ex : 31")),
array("type"=>"combo","name"=>"cbo_passengertype","label"=>"Passenger Type","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
"tooltip"=>"Choice Passenger Type. Thank You","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft"),
array("type"=>"combo","name"=>"cbo_idcardtype","label"=>"ID Card","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0", array("type"=>"combo","name"=>"cbo_idcardtype","label"=>"ID Card","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
"tooltip"=>"Pilih ID Card first. Thank You","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft"), "tooltip"=>"Choice ID Card first. Thank You","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft"),
array("type"=>"newColumn"), array("type"=>"newColumn"),
array("type"=>"input","name"=>"txt_cardnumber","label"=>"","required"=>"true","info"=>"true","inputWidth"=>"120","value"=>"", array("type"=>"input","name"=>"txt_cardnumber","label"=>"","required"=>"true","info"=>"true","inputWidth"=>"160","value"=>"",
"tooltip"=>"Insert Picture first. Thank You","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft besidecboidcard", "tooltip"=>"Insert Picture first. Thank You","validate"=>"NotEmpty","maxLength"=>"100","className"=>"txtleft besidecboidcard",
"note"=>array("text"=>"Insert ID card Number")), "note"=>array("text"=>"Insert ID card Number")),
@ -124,11 +127,11 @@
array("type"=>"calendar","name"=>"txt_dates","label"=>"Dates","required"=>"true","info"=>"true","inputWidth"=>"90","readonly"=>"true","value"=>date("Y-m-d"), array("type"=>"calendar","name"=>"txt_dates","label"=>"Dates","required"=>"true","info"=>"true","inputWidth"=>"90","readonly"=>"true","value"=>date("Y-m-d"),
"tooltip"=>"Insert Dates first. Thank You","validate"=>"NotEmpty","maxLength"=>"","className"=>"txtcenter","dateFormat"=>"%Y-%m-%d"), "tooltip"=>"Insert Dates first. Thank You","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", array("type"=>"combo","name"=>"cbo_idroutestart","label"=>"From","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
"tooltip"=>"Pilih From first. Thank You","validate"=>"NotEmpty","maxLength"=>"6","className"=>"txtcenter"), "tooltip"=>"Choice From first. Thank You","validate"=>"NotEmpty","maxLength"=>"6","className"=>"txtcenter"),
array("type"=>"newColumn"), array("type"=>"newColumn"),
array("type"=>"label","name"=>"lblmeter","label"=>"to","className"=>"besidelabel"), array("type"=>"label","name"=>"lblmeter","label"=>"to","className"=>"besidelabel"),
array("type"=>"combo","name"=>"cbo_idrouteend","label"=>"","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0", array("type"=>"combo","name"=>"cbo_idrouteend","label"=>"","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"0",
"tooltip"=>"Pilih To first. Thank You","validate"=>"NotEmpty","maxLength"=>"6","className"=>"txtcenter besidecbofrom"), "tooltip"=>"Choice To first. Thank You","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", // array("type"=>"input","name"=>"txt_seatnumber","label"=>"Seat Number","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>"","readonly"=>"true",
// "tooltip"=>"Insert Seat Number first. Thank You","validate"=>"NotEmpty","maxLength"=>"30","className"=>"txtcenter txtseatnumber"), // "tooltip"=>"Insert Seat Number first. Thank You","validate"=>"NotEmpty","maxLength"=>"30","className"=>"txtcenter txtseatnumber"),
// array("type"=>"newColumn"), // array("type"=>"newColumn"),
@ -149,13 +152,13 @@
"tooltip"=>"Insert Baggage first. Thank You","maxLength"=>"11","className"=>"txtright"), "tooltip"=>"Insert Baggage first. Thank You","maxLength"=>"11","className"=>"txtright"),
array("type"=>"newColumn"), array("type"=>"newColumn"),
array("type"=>"label","name"=>"lblmeter","label"=>"Kg","className"=>"besidelabelbaggage"), 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 )"), array("type"=>"input","name"=>"txt_limitbaggage","label"=>"","required"=>"false","info"=>"true","inputWidth"=>"60","value"=>"80","note"=>array("text"=>"Limit (kg)"),
"readonly"=>"true","tooltip"=>"Insert Price first. Thank You","validate"=>"","maxLength"=>"","className"=>"txtright besidebaggage"), "readonly"=>"true","tooltip"=>"Insert Price first. Thank You","validate"=>"","maxLength"=>"","className"=>"txtright besidebaggage"),
array("type"=>"column"), array("type"=>"column"),
array("type"=>"input","name"=>"txt_overlimitbaggage","label"=>"","info"=>"true","inputWidth"=>"70","value"=>"0","note"=>array("text"=>"Over Limit ( kg )"), array("type"=>"input","name"=>"txt_overlimitbaggage","label"=>"","info"=>"true","inputWidth"=>"73","value"=>"0","note"=>array("text"=>"Overload"),
"tooltip"=>"Insert Over limit baggage first. Thank You","validate"=>"","maxLength"=>"","className"=>"txtright besidelimitbaggage"), "tooltip"=>"Insert Over limit baggage first. Thank You","validate"=>"","maxLength"=>"","className"=>"txtright besidelimitbaggage"),
array("type"=>"column"), array("type"=>"column"),
array("type"=>"input","name"=>"txt_priceoverinkg","label"=>"","required"=>"false","info"=>"true","inputWidth"=>"90","value"=>"0","note"=>array("text"=>"Price ( kg ) in \$"), array("type"=>"input","name"=>"txt_priceoverinkg","label"=>"","required"=>"false","info"=>"true","inputWidth"=>"90","value"=>"0","note"=>array("text"=>"Price (kg) in \$"),
"tooltip"=>"Insert Price first. Thank You","validate"=>"","maxLength"=>"","className"=>"txtright besidelimitkgbaggage"), "tooltip"=>"Insert Price first. Thank You","validate"=>"","maxLength"=>"","className"=>"txtright besidelimitkgbaggage"),
array("type"=>"input","name"=>"txt_pricebaggage","label"=>"Over Baggage","required"=>"false","info"=>"true","inputWidth"=>"90","value"=>"0", array("type"=>"input","name"=>"txt_pricebaggage","label"=>"Over Baggage","required"=>"false","info"=>"true","inputWidth"=>"90","value"=>"0",
"tooltip"=>"Insert Over Price first / beri nilai 0. Thank You","maxLength"=>"","className"=>"txtright"), "tooltip"=>"Insert Over Price first / beri nilai 0. Thank You","maxLength"=>"","className"=>"txtright"),
@ -177,7 +180,8 @@
); );
$this->FN_DHTMLXFORM("myForm","divnewticketnew",$formdata); $this->FN_DHTMLXFORM("myForm","divnewticketnew",$formdata);
echo "myForm.setFontSize('12pt');";
//==== Add Months //==== Add Months
$arrval=array(); $arrval=array();
array_push($arrval,array("value"=>"","text"=>"")); array_push($arrval,array("value"=>"","text"=>""));
@ -196,6 +200,11 @@
} }
$this->FN_COMBOVALIDATIONVALUEARRAY("myForm","cbo_bodday",$arrval); $this->FN_COMBOVALIDATIONVALUEARRAY("myForm","cbo_bodday",$arrval);
$arrval=array();
array_push($arrval,array("value"=>"General","text"=>"General"),
array("value"=>"VIP","text"=>"VIP")
);
$this->FN_COMBOVALIDATIONVALUEARRAY("myForm","cbo_passengertype",$arrval);
$mycontainerpic="var divpicture=document.createElement('DIV');"; $mycontainerpic="var divpicture=document.createElement('DIV');";
$mycontainerpic.="divpicture.id='divpicture';divpicture.style.height='100%';"; $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.="var divpicturecontent='<table id=\"tbfindinvoice\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin-top:0px;margin-left:-5px;\">';";
@ -265,7 +274,7 @@
$arrayControls=array("txt_id"=>"","cbo_idship"=>"","txt_tiketnumber"=>"","txt_voynumber"=>"", $arrayControls=array("txt_id"=>"","cbo_idship"=>"","txt_tiketnumber"=>"","txt_voynumber"=>"",
"txt_passengername"=>"","cbo_idgender"=>"","txt_bod"=>"","txt_bodyears"=>"", "txt_passengername"=>"","cbo_idgender"=>"","txt_bod"=>"","txt_bodyears"=>"",
"cbo_idcardtype"=>"","txt_nationality"=>"Timor Leste", "cbo_idcardtype"=>"","txt_nationality"=>"Timor Leste","txt_childspassenger"=>"",
"txt_cardnumber"=>"","txt_picdata"=>"aportildefault.png","txt_dates"=>date("Y-m-d"),"txt_price"=>0, "txt_cardnumber"=>"","txt_picdata"=>"aportildefault.png","txt_dates"=>date("Y-m-d"),"txt_price"=>0,
"txt_timeschedule"=>"00:00:00","txt_baggageinkg"=>0,"txt_limitbaggage"=>80,"txt_overlimitbaggage"=>0, "txt_timeschedule"=>"00:00:00","txt_baggageinkg"=>0,"txt_limitbaggage"=>80,"txt_overlimitbaggage"=>0,
"txt_priceoverinkg"=>0,"txt_pricebaggage"=>0,"txt_totalprice"=>0,"cbo_idroutestart"=>"","cbo_idrouteend"=>"" "txt_priceoverinkg"=>0,"txt_pricebaggage"=>0,"txt_totalprice"=>0,"cbo_idroutestart"=>"","cbo_idrouteend"=>""
@ -332,6 +341,7 @@
{ {
fn_dhtmlxmessage('','Ticket Number <b>'+myForm.getItemValue('txt_tiketnumber')+'</b> has been saved');"; fn_dhtmlxmessage('','Ticket Number <b>'+myForm.getItemValue('txt_tiketnumber')+'</b> has been saved');";
//$onformsenddata.="document.getElementById('imgtiket').src='';"; //$onformsenddata.="document.getElementById('imgtiket').src='';";
$onformsenddata.="fn_childspassengerdefault();";
$onformsenddata.="fn_grid_loaddata();myForm.setItemFocus('cbo_idship');"; $onformsenddata.="fn_grid_loaddata();myForm.setItemFocus('cbo_idship');";
$onformsenddata.="myForm.setItemValue('cbo_bodmonth','');myForm.setItemValue('cbo_bodday','');"; $onformsenddata.="myForm.setItemValue('cbo_bodmonth','');myForm.setItemValue('cbo_bodday','');";
$onformsenddata.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"cbo_idship")." $onformsenddata.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"cbo_idship")."
@ -363,6 +373,7 @@
if(sp[0]=='ok') if(sp[0]=='ok')
{ {
fn_dhtmlxmessage('','Ticket Number <b>'+myForm.getItemValue('txt_tiketnumber')+'</b> has been update');"; fn_dhtmlxmessage('','Ticket Number <b>'+myForm.getItemValue('txt_tiketnumber')+'</b> has been update');";
$onformsenddata.="fn_childspassengerdefault();";
$onformsenddata.="myForm.enableItem('btnsave');"; $onformsenddata.="myForm.enableItem('btnsave');";
//$onformsenddata.="document.getElementById('imgtiket').src='';"; //$onformsenddata.="document.getElementById('imgtiket').src='';";
$onformsenddata.="myForm.disableItem('btndelete');"; $onformsenddata.="myForm.disableItem('btndelete');";
@ -392,7 +403,7 @@
$eventafterdeleted.="myForm.enableItem('btnsave');"; $eventafterdeleted.="myForm.enableItem('btnsave');";
$eventafterdeleted.="myForm.disableItem('btnupdate');"; $eventafterdeleted.="myForm.disableItem('btnupdate');";
$eventafterdeleted.="myForm.disableItem('btndelete');"; $eventafterdeleted.="myForm.disableItem('btndelete');";
$eventafterdeleted.="fn_grid_loaddata();"; $eventafterdeleted.="fn_grid_loaddata();fn_childspassengerdefault();";
$onbuttonclickbtndeleted=$this->FN_DHTMLXREMARKFORDELETED2("obj_tra","tra_newticket","myForm.getItemValue('txt_id')","myForm.getItemValue('txt_tiketnumber')",$eventafterdeleted); $onbuttonclickbtndeleted=$this->FN_DHTMLXREMARKFORDELETED2("obj_tra","tra_newticket","myForm.getItemValue('txt_id')","myForm.getItemValue('txt_tiketnumber')",$eventafterdeleted);
//$onbuttonclickbtncancel="document.getElementById('imgtiket').src='';"; //$onbuttonclickbtncancel="document.getElementById('imgtiket').src='';";
@ -402,7 +413,7 @@
$onbuttonclickbtncancel.="myForm.enableItem('txt_tiketnumber');"; $onbuttonclickbtncancel.="myForm.enableItem('txt_tiketnumber');";
$onbuttonclickbtncancel.="myForm.disableItem('btndelete');"; $onbuttonclickbtncancel.="myForm.disableItem('btndelete');";
$onbuttonclickbtncancel.="myForm.setItemFocus('cbo_idship');"; $onbuttonclickbtncancel.="myForm.setItemFocus('cbo_idship');";
$onbuttonclickbtncancel.="fn_grid_loaddata();"; $onbuttonclickbtncancel.="fn_grid_loaddata();fn_childspassengerdefault();";
$onbuttonclickbtncancel.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls); $onbuttonclickbtncancel.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls);
$onbuttonclickbtncancel.="myForm.setItemValue('cbo_bodmonth','');myForm.setItemValue('cbo_bodday','');"; $onbuttonclickbtncancel.="myForm.setItemValue('cbo_bodmonth','');myForm.setItemValue('cbo_bodday','');";
@ -489,6 +500,8 @@
"Baggage&nbsp;"=>"right,ro,136,right,int,false", "Baggage&nbsp;"=>"right,ro,136,right,int,false",
"Price&nbsp;"=>"right,ro,120,right,int,false"); "Price&nbsp;"=>"right,ro,120,right,int,false");
$this->FN_DHTMLXGRIDVIEW($grdinit,$gridproperties,"bricks","","fn_grid_loaddata()"); $this->FN_DHTMLXGRIDVIEW($grdinit,$gridproperties,"bricks","","fn_grid_loaddata()");
echo "dgnewticket.setStyle('font-size:14px','font-size:14px','');";
$arrfields=array("txt_id"=>"","cbo_idship"=>"idship|shipname","txt_tiketnumber"=>"","txt_inctiket"=>"","txt_shipnumber"=>"", $arrfields=array("txt_id"=>"","cbo_idship"=>"idship|shipname","txt_tiketnumber"=>"","txt_inctiket"=>"","txt_shipnumber"=>"",
"txt_passengername"=>"","cbo_idgender"=>"","txt_bod"=>"","cbo_idcardtype"=>"idcardtype|cardtype","txt_cardnumber"=>"", "txt_passengername"=>"","cbo_idgender"=>"","txt_bod"=>"","cbo_idcardtype"=>"idcardtype|cardtype","txt_cardnumber"=>"",
"txt_nationality"=>"","txt_voynumber"=>"","txt_picdata"=>"","txt_dates"=>"","cbo_idroutestart"=>"idroutestart|routenamestart", "txt_nationality"=>"","txt_voynumber"=>"","txt_picdata"=>"","txt_dates"=>"","cbo_idroutestart"=>"idroutestart|routenamestart",
@ -509,17 +522,24 @@
$otherevent.="myForm.disableItem('cbo_idship');"; $otherevent.="myForm.disableItem('cbo_idship');";
$otherevent.="myForm.disableItem('txt_tiketnumber');"; $otherevent.="myForm.disableItem('txt_tiketnumber');";
$otherevent.="myForm.setItemFocus('txt_voynumber');"; $otherevent.="myForm.setItemFocus('txt_voynumber');";
$otherevent.="var childspassenger=ajaxuridhtmlx('".$this->enc("obj_tra")."','obj=".$this->enc("tra_newticket")."&task=".$this->enc("getchilds")."&idtiketpassenger='+spres[0]);";
$otherevent.="if(trim(childspassenger)!=''){";
$otherevent.=" myForm.setItemValue('txt_childspassenger',childspassenger);fn_recalchilds();";
$otherevent.="}";
//$otherevent.="document.getElementById('imgtiket').src='uploads/temps/'+spres[11];"; //$otherevent.="document.getElementById('imgtiket').src='uploads/temps/'+spres[11];";
$this->FN_DHTMLXGRIDVIEWTOFORMNEW("dgnewticket","myForm","tbl_passenger_tiket",0,$arrfields,"",$otherevent); $this->FN_DHTMLXGRIDVIEWTOFORMNEW("dgnewticket","myForm","tbl_passenger_tiket",0,$arrfields,"",$otherevent);
echo " } echo " }
function fn_showchildren(){ function fn_showchildren(){
// fn_dhtmlxmessage('error','Your module still underconstruction');return false; // fn_dhtmlxmessage('error','Your module still underconstruction');return false;
var tiketnumber=myForm.getItemValue('txt_tiketnumber'); var tiketnumber=myForm.getItemValue('txt_tiketnumber');
var childspassenger=myForm.getItemValue('txt_childspassenger');
if(!tiketnumber){ if(!tiketnumber){
fn_dhtmlxmessage('error','Please Insert passenger first!');return false; fn_dhtmlxmessage('error','Please Insert passenger first!');return false;
} }
var url='?ajax=1&sec=1&option=".$this->enc("obj_tra")."&obj=".$this->enc("tra_newticketc")."&task=".$this->enc("default")."&tiketnumber='+tiketnumber; var url='?ajax=1&sec=1&option=".$this->enc("obj_tra")."&obj=".$this->enc("tra_newticketc")."&task=".$this->enc("default")."&tiketnumber='+tiketnumber+'&childspassenger='+childspassenger;
dwins=new dhtmlXWindows(); dwins=new dhtmlXWindows();
dwins.createWindow(\"winchild\",0,0,screen.width-500,screen.height-350); dwins.createWindow(\"winchild\",0,0,screen.width-500,screen.height-350);
dwins.window('winchild').progressOn(); dwins.window('winchild').progressOn();
@ -528,6 +548,21 @@
dwins.window('winchild').setModal(true); dwins.window('winchild').setModal(true);
dwins.window('winchild').progressOff(); dwins.window('winchild').progressOff();
} }
function fn_closechildren(data){
myForm.setItemValue('txt_childspassenger',data);
dwins.window('winchild').close();
fn_recalchilds();
}
function fn_recalchilds(){
var datachilds=myForm.getItemValue('txt_childspassenger');
var sp=datachilds.split(';');
var labelchilds='<a id=\'achilds\' href=\'javascript:void(0)\' onClick=\'fn_showchildren()\'><span id=\'spchild\'>'+sp.length+'</span> Children</a>';
myForm.setItemLabel('lbllookuphist',labelchilds);
// console.log(document.getElementbyId('spchild'));
// document.getElementbyId('spchild').innerHTML = sp.length;
}
function fn_printtraold(tiketnumber,idtransaction){ function fn_printtraold(tiketnumber,idtransaction){
var sp=ajaxuridhtmlx('".$this->enc("obj_tra")."','obj=".$this->enc("tra_newticket")."&task=".$this->enc("printtra")."&idtransaction='+idtransaction+'&txt_tiketnumber='+tiketnumber).split('|'); var sp=ajaxuridhtmlx('".$this->enc("obj_tra")."','obj=".$this->enc("tra_newticket")."&task=".$this->enc("printtra")."&idtransaction='+idtransaction+'&txt_tiketnumber='+tiketnumber).split('|');
@ -544,6 +579,7 @@
} }
// alert(sepnumber); // alert(sepnumber);
var url='?ajax=1&sec=1&option=".$this->enc("obj_tra")."&obj=".$this->enc("tra_newticket")."&task=".$this->enc("printtra")."&idtransaction='+idtransaction+'&tiketnumber='+tiketnumber; var url='?ajax=1&sec=1&option=".$this->enc("obj_tra")."&obj=".$this->enc("tra_newticket")."&task=".$this->enc("printtra")."&idtransaction='+idtransaction+'&tiketnumber='+tiketnumber;
console.log(url);
dwins=new dhtmlXWindows(); dwins=new dhtmlXWindows();
dwins.createWindow(\"winchild\",0,0,screen.width-400,screen.height-350); dwins.createWindow(\"winchild\",0,0,screen.width-400,screen.height-350);
dwins.window('winchild').progressOn(); dwins.window('winchild').progressOn();
@ -604,8 +640,12 @@
myForm.setItemValue('txt_picdata',filename); myForm.setItemValue('txt_picdata',filename);
myForm.setItemFocus('txt_dates'); myForm.setItemFocus('txt_dates');
dwins.unload(); dwins.unload();
document.getElementById('imgtiket').src='uploads/temps/'+filename; document.getElementById('imgtiket').src='uploads/temps/'+filename;
}
function fn_childspassengerdefault(){
var datachilds='<a id=\'achilds\' href=\'javascript:void(0)\' onClick=\'fn_showchildren()\'><span id=\'spchild\'>0</span> Children</a>';
myForm.setItemLabel('lbllookuphist', datachilds);
} }
function fn_showBookingSeat() function fn_showBookingSeat()
@ -805,6 +845,7 @@
$sp=$this->fn_get_fieldsvalues("shipname,shipnumber","select shipname,shipnumber from ".DB_APORTIL.".tbl_ship_information where id='$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]; $shipnumber=$sp[1];$shipname=$sp[0];
$tiketnumber=$_REQUEST['txt_tiketnumber']; $tiketnumber=$_REQUEST['txt_tiketnumber'];
$childspassenger=$_REQUEST['txt_childspassenger'];
$voynumber=$_REQUEST['txt_voynumber']; $voynumber=$_REQUEST['txt_voynumber'];
$passengername=$_REQUEST['txt_passengername']; $passengername=$_REQUEST['txt_passengername'];
$idgender=$_REQUEST['cbo_idgender']; $idgender=$_REQUEST['cbo_idgender'];
@ -876,6 +917,29 @@
if($this->executequery($qry)) if($this->executequery($qry))
{ {
if(!$id){$id=mysql_insert_id();}
// === Childs passenger
if($childspassenger){
$spchilds=explode(";", $childspassenger);
for($j=0;$j<count($spchilds);$j++){
$spdata=explode("|", $spchilds[$j]);
$idchilds=$spdata[0];
$names=$spdata[1];
$birthofdate=$spdata[2];
$ages=$spdata[3];
$notes=$spdata[4];
$qryins="insert into ".DB_APORTIL.".tbl_passenger_childs
set idtiketpassenger='$id',tiketnumber='$tiketnumber',names='$names',birthofdate='$birthofdate',
ages='$ages',notes='$notes',iby='".$_SESSION['nik']."',idt=now()";
if($this->fn_row_isexists("select id from ".DB_APORTIL.".tbl_passenger_childs where id='$idchilds' order by id asc limit 1")){
$qryins="update ".DB_APORTIL.".tbl_passenger_childs
set names='$names',birthofdate='$birthofdate',ages='$ages',notes='$notes',
uby='".$_SESSION['nik']."',udt=now()
where id='$idchilds'";
}
$this->executequery($qryins);
}
}
if(!$isupdate){ if(!$isupdate){
// $idpassengerticket=mysql_insert_id(); // $idpassengerticket=mysql_insert_id();
@ -912,27 +976,56 @@
} }
} }
public function fn_getchilds(){
$idtiketpassenger=$_REQUEST['idtiketpassenger'];
$qry="select * from ".DB_APORTIL.".tbl_passenger_childs where idtiketpassenger='$idtiketpassenger' and isdeleted=0 order by id asc";
$rs=$this->selectquery($qry);
if($rs)
{
$i=1;$data="";
while($row=$this->data_row_array($rs))
{
$id=$row['id'];
$names=$row['names'];
$birthofdate=$row['birthofdate'];
$ages=$row['ages'];
$notes=$row['notes'];
$data.=$id."|".$names."|".$birthofdate."|".$ages."|".$notes.";";
$i+=1;
}
if($data){
$data=substr($data,0,strlen($data)-1);
}
echo $data;
}
}
public function fn_printtra($idtransaction=''){ public function fn_printtra($idtransaction=''){
// echo "test";
date_default_timezone_set("Asia/Bangkok"); date_default_timezone_set("Asia/Bangkok");
include("lib/mpdf/mpdf.php"); include("lib/mpdf/mpdf.php");
$top=10; $top=10;
// $mpdf = new mPDF('c', 'A4', '', '', 5, 5, $top, 10, 3, 3, 'P'); // $mpdf = new mPDF('c', 'A4', '', '', 5, 5, $top, 10, 3, 3, 'P');
$mpdf = new mPDF('utf-8', array(200,100) ,'', '', 2, 2, 2); $mpdf = new mPDF('utf-8', array(200,100) ,'', '', 2, 2, 2);
$mpdf->SetDisplayMode('fullpage'); $mpdf->SetDisplayMode('fullpage');
$tiketnumber=$_REQUEST['tiketnumber']; $tiketnumber=$_REQUEST['tiketnumber'];
$idtransaction=$_REQUEST['idtransaction'];
// // LOAD a stylesheet
// $stylesheet = file_get_contents('lib/mpdf/css/mpdfstyleA4.css');
$qry="select * from ".DB_APORTIL.".tbl_passenger_tiket where id='".$idtransaction."' and isdeleted=0";
// echo $qry;return false;
$rs=$this->selectquery($qry);
$rw=$this->data_row_array($rs);
// LOAD a stylesheet
$stylesheet = file_get_contents('lib/mpdf/css/mpdfstyleA4.css');
$html="<div style=\"position: fixed; left: 0mm; middle: -100mm; rotate: -90;\">"; $html="<div style=\"position: fixed; left: 0mm; middle: -100mm; rotate: -90;\">";
// $html.=" <div style=\"font-size:12pt;font-weight:bold\">".str_repeat("&nbsp;",6)."$tiketnumber</div>"; // $html.=" <div style=\"font-size:12pt;font-weight:bold\">".str_repeat("&nbsp;",6)."$tiketnumber</div>";
// $html.=" <div><barcode code=\"$tiketnumber\" type=\"C39\" class=\"barcode\" size=\"1.2\"/></div>"; // $html.=" <div><barcode code=\"$tiketnumber\" type=\"C39\" class=\"barcode\" size=\"1.2\"/></div>";
$html.=" TICKET ".$rw['shipname']; $html.=" TICKET ".$rw['shipname'];
$html.="</div>"; $html.="</div>";
// echo $html;return false;
$qry="select * from ".DB_APORTIL.".tbl_passenger_tiket where id='".$_REQUEST['idtransaction']."' and isdeleted=0";
$rs=$this->selectquery($qry);
$rw=$this->data_row_array($rs);
$html.="<table width=\"80%\" style=\"margin-left:30px;padding-top:6px\" align=\"center\" border=\"0\">"; $html.="<table width=\"80%\" style=\"margin-left:30px;padding-top:6px\" align=\"center\" border=\"0\">";
$html.="<tr><td colspan=\"6\">"; $html.="<tr><td colspan=\"6\">";
$html.=" <div style=\"font-size:12pt;font-weight:bold\">".str_repeat("&nbsp;",6)."$tiketnumber</div>"; $html.=" <div style=\"font-size:12pt;font-weight:bold\">".str_repeat("&nbsp;",6)."$tiketnumber</div>";