425 lines
32 KiB
PHP
425 lines
32 KiB
PHP
<?php
|
|
class DATA_CARGOPRICE extends DATA
|
|
{
|
|
public function data_cargoprice_javainit()
|
|
{
|
|
|
|
}
|
|
|
|
public function fn_cargoprice_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_cargoprice();
|
|
break;
|
|
|
|
case $task:
|
|
$task="fn_".$task;
|
|
if(method_exists($this,$task)){$this->$task();}
|
|
break;
|
|
|
|
default:
|
|
$this->fn_default_cargoprice();
|
|
break;
|
|
}
|
|
}
|
|
public function fn_default_cargoprice()
|
|
{
|
|
echo $this->FN_CREATEHEADER();
|
|
|
|
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()
|
|
{";
|
|
$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"=>"combo","name"=>"cbo_idcategory","label"=>"Category","required"=>"true","info"=>"true","inputWidth"=>"110","value"=>"0",
|
|
"tooltip"=>"Pilih Category terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"6","className"=>"txtcenter"),
|
|
array("type"=>"input","name"=>"txt_cargodescription","label"=>"Cargo Description","required"=>"true","info"=>"true","inputWidth"=>"160","value"=>"",
|
|
"tooltip"=>"Insert Cargo Description first. Thank You","validate"=>"NotEmpty","maxLength"=>"","className"=>"txtleft"),
|
|
array("type"=>"combo","name"=>"cbo_idroutestart","label"=>"From","required"=>"true","info"=>"true","inputWidth"=>"160","value"=>"",
|
|
"tooltip"=>"Pilih From terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft"),
|
|
array("type"=>"combo","name"=>"cbo_idrouteend","label"=>"To","required"=>"true","info"=>"true","inputWidth"=>"160","value"=>"",
|
|
"tooltip"=>"Pilih To terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft"),
|
|
array("type"=>"combo","name"=>"cbo_idunits","label"=>"Units","required"=>"true","info"=>"true","inputWidth"=>"110","value"=>"",
|
|
"tooltip"=>"Pilih Units terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"20","className"=>"txtleft"),
|
|
array("type"=>"input","name"=>"txt_prices","label"=>"Prices","required"=>"true","info"=>"true","inputWidth"=>"110","value"=>"0",
|
|
"tooltip"=>"Masukkan Prices terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"","className"=>"txtright"),
|
|
array("type"=>"label","name"=>"lblmeter","label"=>"\$","className"=>"besidelabel"),
|
|
array("type"=>"input","name"=>"txt_years","label"=>"Years","required"=>"true","info"=>"true","inputWidth"=>"90","value"=>date("Y"),
|
|
"tooltip"=>"Masukkan Years terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"","className"=>"txtcenter"),
|
|
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"=>"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","divcargopricenew",$formdata);
|
|
|
|
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_cargo_category|id,cargocategory')";
|
|
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idcategory","tbl_cargo_category","$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","");
|
|
|
|
|
|
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_cargo_units|id,units')";
|
|
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idunits","tbl_cargo_units","$urlcbo","");
|
|
|
|
|
|
$arrerror=array("cbo_idcategory"=>"Error Found : Harap Isikan <b>Category</b> terlebih dahulu.TERIMA KASIH",
|
|
"txt_cargodescription"=>"Error Found : Harap Isikan <b>Cargo Description</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",
|
|
"cbo_idunits"=>"Error Found : Harap Isikan <b>Units</b> terlebih dahulu.TERIMA KASIH",
|
|
"txt_prices"=>"Error Found : Harap Isikan <b>Prices</b> terlebih dahulu.TERIMA KASIH",
|
|
"txt_years"=>"Error Found : Harap Isikan <b>Years</b> terlebih dahulu.TERIMA KASIH"
|
|
);
|
|
$this->FN_DHTMLXFORMVALIDATIONERROR("myForm",$arrerror);
|
|
|
|
$arrayControls=array("txt_id"=>"",
|
|
"cbo_idcategory"=>"",
|
|
"txt_cargodescription"=>"",
|
|
"cbo_idroutestart"=>"",
|
|
"cbo_idrouteend"=>"",
|
|
"cbo_idunits"=>"",
|
|
"txt_prices"=>0,
|
|
"txt_years"=>date("Y")
|
|
);
|
|
|
|
// === 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;}";
|
|
|
|
$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("data_cargoprice")."&task=".$this->enc("saverecord")."'";
|
|
$onformsenddata="url=fn_dhtmlxsenddata('".$this->enc("obj_data")."',$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_idcategory')+'</b> has been saved');";
|
|
$onformsenddata.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"cbo_idcategory");
|
|
$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("data_cargoprice")."&task=".$this->enc("updrecord")."'";
|
|
$onformsenddata="url=fn_dhtmlxsenddata('".$this->enc("obj_data")."',$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.getCombo('cbo_idcategory').getComboText()+'</b> has been update');";
|
|
$onformsenddata.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"cbo_idcategory");
|
|
$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_idcategory");
|
|
$eventafterdeleted.="myForm.enableItem('btnsave');";
|
|
$eventafterdeleted.="myForm.disableItem('btnupdate');";
|
|
$eventafterdeleted.="myForm.disableItem('btndelete');";
|
|
$eventafterdeleted.="fn_grid_loaddata();";
|
|
$onbuttonclickbtndeleted=$this->FN_DHTMLXREMARKFORDELETED2("obj_data","data_cargoprice","myForm.getItemValue('txt_id')","myForm.getItemValue('cbo_idcategory')",$eventafterdeleted);
|
|
|
|
$onbuttonclickbtncancel=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls);
|
|
$onbuttonclickbtncancel.="myForm.enableItem('btnsave');";
|
|
$onbuttonclickbtncancel.="myForm.disableItem('btnupdate');";
|
|
$onbuttonclickbtncancel.="myForm.disableItem('btndelete');";
|
|
$onbuttonclickbtncancel.="myForm.setItemFocus('cbo_idcategory');";
|
|
$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_years"=>"$onobjkeydown"
|
|
)
|
|
)
|
|
);
|
|
|
|
|
|
$this->FN_DHTMLXFORMEVENT("myForm",$arrevent);
|
|
|
|
// === 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",
|
|
"Units "=>"right,ro,110,right,str,false",
|
|
"Years"=>"center,ro,110,center,int,false");
|
|
$this->FN_DHTMLXGRIDVIEW($grdinit,$gridproperties,"bricks","","fn_grid_loaddata()");
|
|
$arrfields=array("txt_id"=>"","cbo_idcategory"=>"idcategory|cargocategory","txt_cargodescription"=>"",
|
|
"cbo_idroutestart"=>"idroutestart|routenamestart","cbo_idrouteend"=>"idrouteend|routenameend",
|
|
"cbo_idunits"=>"idunits|units","txt_prices"=>"","txt_years"=>"");
|
|
$otherevent="";
|
|
$this->FN_DHTMLXGRIDVIEWTOFORMNEW("dgcargoprice","myForm","tbl_cargoprice_information",0,$arrfields,"");
|
|
echo " }
|
|
|
|
function fn_grid_loaddata()
|
|
{
|
|
var keyword=myFormsearch.getItemValue('txtsearch');
|
|
url=fn_dhtmlxloadobject('".$this->enc("obj_data")."','obj=".$this->enc("data_cargoprice")."&task=".$this->enc("grdrecord")."&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>";
|
|
$qry="select filepdf from ".DB_APORTIL.".tbl_manualbook where isdeleted=0 and filepdf='cargoprice_information.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 PRICE INFORMATION</b>"=>"$url|id='a_newticket'","$urlmanualbook"=>"|id='a_manualbook'");
|
|
echo $this->MULTIPLE_LINK($myuri);
|
|
echo " </td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<div id=\"divcargopricecontent\" style=\"margin-left:0px;\">
|
|
<table width=\"98%\" border=\"0\">
|
|
<tr>
|
|
<td width=\"45%\" valign=\"top\">
|
|
<div id=\"divcargopricenew\" style=\"\"></div>
|
|
</td>
|
|
<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>- Click Row For Edit</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>";
|
|
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,idcategory,cargocategory,cargodescription,routenamestart,routenameend,units,prices,years
|
|
from ".DB_APORTIL.".tbl_cargoprice_information
|
|
where cargocategory 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["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["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>";
|
|
|
|
}
|
|
|
|
public function fn_saverecord($isupdate=null)
|
|
{
|
|
if($isupdate){$id=$_REQUEST['txt_id'];}
|
|
$idcategory=$_REQUEST['cbo_idcategory'];
|
|
$cargocategory=$this->fn_get_fieldvalue("cargocategory","select cargocategory from ".DB_APORTIL.".tbl_cargo_category where id='".$idcategory."'");
|
|
$cargodescription=$_REQUEST['txt_cargodescription'];
|
|
$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."'");
|
|
|
|
$idunits=$_REQUEST['cbo_idunits'];
|
|
$units=$this->fn_get_fieldvalue("units","select units from ".DB_APORTIL.".tbl_cargo_units where id='".$idunits."'");
|
|
$prices=$_REQUEST['txt_prices'];
|
|
$years=$_REQUEST['txt_years'];
|
|
|
|
|
|
// === Check Validation Cargo Price Information
|
|
$qry="select id from ".DB_APORTIL.".tbl_cargoprice_information
|
|
where idroutestart='$idroutestart' and idrouteend='$idrouteend' and years='$years' and cargodescription='$cargodescription' and isdeleted='0'
|
|
order by id desc limit 1";
|
|
if($this->fn_row_isexists($qry)&&!$isupdate){
|
|
echo "failed|Price is already exists, for editing please click your Table";return false;
|
|
}
|
|
// =============================================
|
|
|
|
$qry="insert into ".DB_APORTIL.".tbl_cargoprice_information
|
|
set idcategory='$idcategory',cargocategory='$cargocategory',cargodescription='$cargodescription',
|
|
idroutestart='$idroutestart',routenamestart='$routenamestart',idrouteend='$idrouteend',routenameend='$routenameend',
|
|
idunits='$idunits',units='$units',prices='$prices',years='$years',iby='".$_SESSION['nik']."',idt=now()";
|
|
if($isupdate)
|
|
{
|
|
$qry="update ".DB_APORTIL.".tbl_cargoprice_information
|
|
set idcategory='$idcategory',cargocategory='$cargocategory',cargodescription='$cargodescription',
|
|
idroutestart='$idroutestart',routenamestart='$routenamestart',idrouteend='$idrouteend',routenameend='$routenameend',
|
|
idunits='$idunits',units='$units',prices='$prices',years='$years',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_cargoprice_information
|
|
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();
|
|
}
|
|
}
|
|
}
|
|
?>
|