|
@@ -42,7 +42,6 @@ class ocean_order {
|
|
|
$data['TrackingTableColumns'] = $BookingTableColumns;
|
|
$data['TrackingTableColumns'] = $BookingTableColumns;
|
|
|
common::echo_json_encode(200,$data);
|
|
common::echo_json_encode(200,$data);
|
|
|
exit();
|
|
exit();
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
/*
|
|
/*
|
|
|
* ocean order search
|
|
* ocean order search
|
|
@@ -136,6 +135,124 @@ class ocean_order {
|
|
|
exit();
|
|
exit();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if ($operate == "ocean_vgm") {
|
|
|
|
|
+ if (!_canEdiVgm()) {
|
|
|
|
|
+ $data = array("msg" =>"Vgm Permission Error");
|
|
|
|
|
+ common::echo_json_encode(200, $data);
|
|
|
|
|
+ exit();
|
|
|
|
|
+ }
|
|
|
|
|
+ $serial_no = common::deCode(($_GET["a"]), 'D');
|
|
|
|
|
+ $sqlWhere = " and o.serial_no='" . $serial_no . "'";
|
|
|
|
|
+ $column = "*";
|
|
|
|
|
+ $schemas = $_GET["_schemas"];
|
|
|
|
|
+ if (empty($schemas)) {
|
|
|
|
|
+ $schemas = "public";
|
|
|
|
|
+ }
|
|
|
|
|
+ $ocean_info_sql = "select o.from_station as o_from_station, o.h_bol as o_h_bol, o.carrier_booking, o.m_vessel, o.m_voyage, to_char(o.f_etd, 'MM/DD/YYYY') as f_etd, to_char(o.m_eta, 'MM/DD/YYYY') as m_eta, v.*, o.master_base_number from "
|
|
|
|
|
+ . "$schemas.ocean o left join $schemas.ocean_vgm v on o.serial_no=v.serial_no or o.master_base_number=v.master_base_number where 1=1 and o.status::text <> 'Cancelled'::text AND o.bol_type::text <> 'BOOKING'::text AND o.bol_type::text <> 'QUOTE'::text" . $sqlWhere;
|
|
|
|
|
+ $ocean_info = common::excuteObjectSql($ocean_info_sql);
|
|
|
|
|
+
|
|
|
|
|
+ $rs_sql = "select o.service, o.ctnr, v.carrier_booking_no, o.ctnr, o.size, v.vgm_weight, v.unit, v.vgm_time, v.vgm_method, o.grs_kgs, o.grs_lbs, ov.id as ocean_vgm_id, v.id as ocean_vgm_container_id from "
|
|
|
|
|
+ . "$schemas.oc_container o left join $schemas.ocean oc on o.serial_no=oc.serial_no "
|
|
|
|
|
+ . " left join $schemas.ocean_vgm ov on oc.serial_no=ov.serial_no or oc.master_base_number=ov.master_base_number "
|
|
|
|
|
+ . " left join $schemas.ocean_vgm_container v on ov.serial_no=v.serial_no and o.ctnr=v.ctnr "
|
|
|
|
|
+ . " where 1=1 and oc.status::text <> 'Cancelled'::text AND oc.bol_type::text <> 'BOOKING'::text AND oc.bol_type::text <> 'QUOTE'::text and oc.master_base_number='" . $ocean_info["master_base_number"] . "' and oc.from_station='" . $ocean_info["o_from_station"] . "'";
|
|
|
|
|
+ $rs = common::excuteListSql($rs_sql);
|
|
|
|
|
+ $ocean_info["is_send"] = (empty($ocean_info["is_send"]) ? "f" : $ocean_info["is_send"]);
|
|
|
|
|
+ if (empty($ocean_info["id"])) {
|
|
|
|
|
+ $ocean_info["is_send"] = "t";
|
|
|
|
|
+ }
|
|
|
|
|
+ $err_msg = "";
|
|
|
|
|
+ if (empty($ocean_info["carrier_booking"])) {
|
|
|
|
|
+ $err_msg = "Carrier Booking is empty.";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($schemas <> "public") {
|
|
|
|
|
+ $err_msg .= "This hbol do not support.";
|
|
|
|
|
+ }
|
|
|
|
|
+ foreach ($rs as $cv) {
|
|
|
|
|
+ if (empty($cv["ctnr"])) {
|
|
|
|
|
+ $err_msg .= "Container# is empty.";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (substr($cv["service"], 0, 3) == "CFS") {
|
|
|
|
|
+ $err_msg .= "CFS cannot support update.";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!empty($err_msg)) {
|
|
|
|
|
+ $err_msg = "You cant't add this VGM, (" . $err_msg . ")";
|
|
|
|
|
+ }
|
|
|
|
|
+ $serial_no = common::deCode($serial_no, "E");
|
|
|
|
|
+
|
|
|
|
|
+ //default
|
|
|
|
|
+ if (empty($rs["id"])) {
|
|
|
|
|
+ $default = common::excuteObjectSql("select * from ocean_vgm_setting where login_name ilike '" . _getLoginName() . "'");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $log = common::excuteListSql("select * from ocean_vermas where from_serial_no ilike '" . $ocean_info["master_base_number"] . "'");
|
|
|
|
|
+
|
|
|
|
|
+ //detail information
|
|
|
|
|
+ $detail_information_column = array();
|
|
|
|
|
+ $detail_information_column[] = array("title" =>"SN","field" =>"sn","formatter" =>"","type" =>"normal");
|
|
|
|
|
+ $detail_information_column[] = array("title" =>"Carrier Booking No.","field" =>"carrier_booking_no","formatter" =>"","type" =>"normal");
|
|
|
|
|
+ $detail_information_column[] = array("title" =>"Container No","field" =>"ctnr","formatter" =>"","type" =>"normal");
|
|
|
|
|
+ $detail_information_column[] = array("title" =>"VGM Weight","field" =>"vgm_weight","formatter" =>"","type" =>"normal");
|
|
|
|
|
+ $detail_information_column[] = array("title" =>"VGM Unit","field" =>"unit","formatter" =>"","type" =>"normal");
|
|
|
|
|
+ $detail_information_column[] = array("title" =>"VGM Time","field" =>"vgm_time","formatter" =>"","type" =>"normal");
|
|
|
|
|
+ $detail_information_column[] = array("title" =>"VGM Method","field" =>"vgm_method","formatter" =>"","type" =>"normal");
|
|
|
|
|
+ foreach($rs as $rk => $rv){
|
|
|
|
|
+ $log[$rk]['sn'] = $rk +1;
|
|
|
|
|
+ }
|
|
|
|
|
+ $detail_information =array("detail_information_column" =>$detail_information_column,
|
|
|
|
|
+ "detail_information_data" =>$rs);
|
|
|
|
|
+
|
|
|
|
|
+ $data = array("msg" =>$err_msg);
|
|
|
|
|
+
|
|
|
|
|
+ $Submitter = $ocean_info["authorized_company"];
|
|
|
|
|
+ if(empty($ocean_info["id"])){
|
|
|
|
|
+ $Submitter = $default["submitter"];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $signature = $ocean_info["signature"];
|
|
|
|
|
+ if(empty($ocean_info["id"])){
|
|
|
|
|
+ $signature = $default["signature"];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $authorized_email = $ocean_info["authorized_email"];
|
|
|
|
|
+ if(empty($ocean_info["id"])){
|
|
|
|
|
+ $authorized_email = $default["authorized_email"];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $authorized_tel = $ocean_info["authorized_tel"];
|
|
|
|
|
+ if(empty($ocean_info["id"])){
|
|
|
|
|
+ $authorized_tel = $default["authorized_tel"];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $data["general_information"] = array("HBL No."=>$ocean_info["o_h_bol"],
|
|
|
|
|
+ "Carrier Booking No."=>$ocean_info["carrier_booking"],
|
|
|
|
|
+ "Vessel"=>$ocean_info["m_vessel"],"Voyage"=>$ocean_info["m_voyage"],
|
|
|
|
|
+ "ETD"=>$ocean_info["f_etd"],"ETA"=>$ocean_info["m_eta"],
|
|
|
|
|
+ "Last updated User"=>$ocean_info["modify_user"],"Last updated Time"=>$ocean_info["modify_time"],
|
|
|
|
|
+ "Submitter" =>$Submitter,"$signature" =>$signature,"authorized_email" =>$authorized_email,"authorized_tel" =>$authorized_tel,"is_send" =>$ocean_info['is_send']);
|
|
|
|
|
+
|
|
|
|
|
+ $data["detail_information"] = $detail_information;
|
|
|
|
|
+ $data["schemas"] = $schemas;
|
|
|
|
|
+ $data["serial_no"] = $serial_no;
|
|
|
|
|
+
|
|
|
|
|
+ common::echo_json_encode(200, $data);
|
|
|
|
|
+ exit();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($operate == "save_ocean_vgm") {
|
|
|
|
|
+ if (!_canEdiVgm()) {
|
|
|
|
|
+ $data = array("msg" =>"Vgm Permission Error");
|
|
|
|
|
+ common::echo_json_encode(200, $data);
|
|
|
|
|
+ exit();
|
|
|
|
|
+ }
|
|
|
|
|
+ $msg = $this->save_vgm();
|
|
|
|
|
+ $data = array("msg" =>$msg);
|
|
|
|
|
+ common::echo_json_encode(200, $data);
|
|
|
|
|
+ exit();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -296,6 +413,7 @@ class ocean_order {
|
|
|
'tagsList' => array(),
|
|
'tagsList' => array(),
|
|
|
'TransportList' => $TransportList,
|
|
'TransportList' => $TransportList,
|
|
|
'allColums' => $allBookingColumns,
|
|
'allColums' => $allBookingColumns,
|
|
|
|
|
+ 'canEdiVgm' => _canEdiVgm(),
|
|
|
'rc' => $rc,
|
|
'rc' => $rc,
|
|
|
'ps' => $ps,
|
|
'ps' => $ps,
|
|
|
'cp' => $cp,
|
|
'cp' => $cp,
|
|
@@ -307,6 +425,7 @@ class ocean_order {
|
|
|
'tagsList' => array(),
|
|
'tagsList' => array(),
|
|
|
'TransportList' => $TransportList,
|
|
'TransportList' => $TransportList,
|
|
|
'allColums' => $allBookingColumns,
|
|
'allColums' => $allBookingColumns,
|
|
|
|
|
+ 'allColcanEdiVgmums' => _canEdiVgm(),
|
|
|
'rc' => $rc,
|
|
'rc' => $rc,
|
|
|
'ps' => $ps,
|
|
'ps' => $ps,
|
|
|
'cp' => $cp,
|
|
'cp' => $cp,
|
|
@@ -429,13 +548,13 @@ class ocean_order {
|
|
|
"Incoterm" =>$ocean['terms'],"Service_Type" =>$ocean['service']);
|
|
"Incoterm" =>$ocean['terms'],"Service_Type" =>$ocean['service']);
|
|
|
|
|
|
|
|
//处理 拼接地址 ocean表单exp 字段无法精准分割电话和地址信息,只能从contacts表里查询
|
|
//处理 拼接地址 ocean表单exp 字段无法精准分割电话和地址信息,只能从contacts表里查询
|
|
|
- $shipper_address = $this->retStationInfo($ocean['sh_address_1'], $ocean['sh_address_2'], $ocean['sh_address_3'], $ocean['sh_address_4'],
|
|
|
|
|
|
|
+ $shipper_address = common::retStationInfo($ocean['sh_address_1'], $ocean['sh_address_2'], $ocean['sh_address_3'], $ocean['sh_address_4'],
|
|
|
$ocean['sh_city'], $ocean['sh_state'], $ocean['sh_zipcode'], $ocean['sh_country']);
|
|
$ocean['sh_city'], $ocean['sh_state'], $ocean['sh_zipcode'], $ocean['sh_country']);
|
|
|
- $consignee_address = $this->retStationInfo($ocean['cn_address_1'], $ocean['cn_address_2'], $ocean['cn_address_3'], $ocean['cn_address_4'],
|
|
|
|
|
|
|
+ $consignee_address = common::retStationInfo($ocean['cn_address_1'], $ocean['cn_address_2'], $ocean['cn_address_3'], $ocean['cn_address_4'],
|
|
|
$ocean['cn_city'], $ocean['cn_state'], $ocean['cn_zipcode'], $ocean['cn_country']);
|
|
$ocean['cn_city'], $ocean['cn_state'], $ocean['cn_zipcode'], $ocean['cn_country']);
|
|
|
- $origin_address = $this->retStationInfo($ocean['aa_address_1'], $ocean['aa_address_2'], $ocean['aa_address_3'], $ocean['aa_address_4'],
|
|
|
|
|
|
|
+ $origin_address = common::retStationInfo($ocean['aa_address_1'], $ocean['aa_address_2'], $ocean['aa_address_3'], $ocean['aa_address_4'],
|
|
|
$ocean['aa_city'], $ocean['aa_state'], $ocean['aa_zipcode'], $ocean['aa_country']);
|
|
$ocean['aa_city'], $ocean['aa_state'], $ocean['aa_zipcode'], $ocean['aa_country']);
|
|
|
- $destination_address = $this->retStationInfo($ocean['dd_address_1'], $ocean['dd_address_2'], $ocean['dd_address_3'], $ocean['dd_address_4'],
|
|
|
|
|
|
|
+ $destination_address = common::retStationInfo($ocean['dd_address_1'], $ocean['dd_address_2'], $ocean['dd_address_3'], $ocean['dd_address_4'],
|
|
|
$ocean['dd_city'], $ocean['dd_state'], $ocean['dd_zipcode'], $ocean['dd_country']);
|
|
$ocean['dd_city'], $ocean['dd_state'], $ocean['dd_zipcode'], $ocean['dd_country']);
|
|
|
|
|
|
|
|
$shipperPartners = array("company" =>$ocean['sh_company'],"address"=>$shipper_address,"phone"=>$ocean['sh_phone']);
|
|
$shipperPartners = array("company" =>$ocean['sh_company'],"address"=>$shipper_address,"phone"=>$ocean['sh_phone']);
|
|
@@ -524,8 +643,14 @@ class ocean_order {
|
|
|
$Milestones_column[] = array("title" =>"Date Time","field" =>"date_time","formatter" =>"","type" =>"normal");
|
|
$Milestones_column[] = array("title" =>"Date Time","field" =>"date_time","formatter" =>"","type" =>"normal");
|
|
|
$Milestones_column[] = array("title" =>"Locations","field" =>"locations","formatter" =>"","type" =>"normal");
|
|
$Milestones_column[] = array("title" =>"Locations","field" =>"locations","formatter" =>"","type" =>"normal");
|
|
|
$Milestones_column[] = array("title" =>"Remarks","field" =>"remarks","formatter" =>"","type" =>"normal");
|
|
$Milestones_column[] = array("title" =>"Remarks","field" =>"remarks","formatter" =>"","type" =>"normal");
|
|
|
- //假数据
|
|
|
|
|
- $Milestones_data = array(array("milestones"=>"booking submit","date_time"=>"2024-02-21","locations" => "china", "remarks" =>""));
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //Milestones 数据信息待定
|
|
|
|
|
+ $Milestones_data = array();
|
|
|
|
|
+ $Milestones_data_arr = common::excuteListSql("select description,act_date||act_time as date_time, remark from ocean_milestone a
|
|
|
|
|
+ where a.serial_no='".$ocean["serial_no"]."' order by id");
|
|
|
|
|
+ foreach($Milestones_data_arr as $mda){
|
|
|
|
|
+ $Milestones_data[] = array("milestones"=>$mda['description'],"date_time"=>$mda['date_time'],"locations" => "", "remarks" =>$mda['remark']);
|
|
|
|
|
+ }
|
|
|
$Milestones = array("Milestones_column"=>$Milestones_column,"Milestones_data" =>$Milestones_data);
|
|
$Milestones = array("Milestones_column"=>$Milestones_column,"Milestones_data" =>$Milestones_data);
|
|
|
|
|
|
|
|
//页面固定写死的信息
|
|
//页面固定写死的信息
|
|
@@ -753,39 +878,6 @@ class ocean_order {
|
|
|
return $emialRecords;
|
|
return $emialRecords;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private function retStationInfo($address_1,$address_2,$address_3,$address_4,$city,$state,$country,$zipcode){
|
|
|
|
|
- $stationInfo = "";
|
|
|
|
|
- if(!empty($address_1)){
|
|
|
|
|
- $stationInfo .= $address_1;
|
|
|
|
|
- }
|
|
|
|
|
- if(!empty($address_2)){
|
|
|
|
|
- $stationInfo .= " ".$address_2;
|
|
|
|
|
- }
|
|
|
|
|
- if(!empty($address_3)){
|
|
|
|
|
- $stationInfo .= " ".$address_3;
|
|
|
|
|
- }
|
|
|
|
|
- if(!empty($address_4)){
|
|
|
|
|
- $stationInfo .= " ".$address_4;
|
|
|
|
|
- }
|
|
|
|
|
- $temp_str = "";
|
|
|
|
|
- if(!empty($city)){
|
|
|
|
|
- $temp_str .= $city." ";
|
|
|
|
|
- }
|
|
|
|
|
- if(!empty($state)){
|
|
|
|
|
- $temp_str .= $state." ";
|
|
|
|
|
- }
|
|
|
|
|
- if(!empty($zipcode)){
|
|
|
|
|
- $temp_str .= $zipcode." ";
|
|
|
|
|
- }
|
|
|
|
|
- if(!empty($country)){
|
|
|
|
|
- $temp_str .= $country." ";
|
|
|
|
|
- }
|
|
|
|
|
- if(!empty($temp_str)){
|
|
|
|
|
- return $stationInfo." ".trim($temp_str);
|
|
|
|
|
- }
|
|
|
|
|
- return $stationInfo;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
/*
|
|
/*
|
|
|
* get file by hbol/destination
|
|
* get file by hbol/destination
|
|
|
* H:HBL
|
|
* H:HBL
|
|
@@ -920,6 +1012,95 @@ class ocean_order {
|
|
|
order by id desc limit 1) dd on true" . $sqlWhere.$Completed_sqlWhere;
|
|
order by id desc limit 1) dd on true" . $sqlWhere.$Completed_sqlWhere;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private function save_vgm() {
|
|
|
|
|
+ $schemas = $_POST["schemas"];
|
|
|
|
|
+ $serial_no = common::deCode($_POST["serial_no"], 'D');
|
|
|
|
|
+ $ocean = common::excuteObjectSql("select m_bol, master_base_number, from_station, h_bol from $schemas.ocean where serial_no='" . common::check_input($serial_no) . "'");
|
|
|
|
|
+ $contact = common::excuteObjectSql("select company, city, state, zipcode, phone_1, fax, email_1, contactname_1, address_1, address_2, address_3, address_4 from ocean.contacts where contact_id='" . $ocean["from_station"] . "'");
|
|
|
|
|
+ $address = $contact["address_1"];
|
|
|
|
|
+ if (!empty($address)) {
|
|
|
|
|
+ $address .= "\r\n";
|
|
|
|
|
+ }
|
|
|
|
|
+ $address .= $contact["address_2"];
|
|
|
|
|
+ if (!empty($address)) {
|
|
|
|
|
+ $address .= "\r\n";
|
|
|
|
|
+ }
|
|
|
|
|
+ $address .= $contact["address_3"];
|
|
|
|
|
+ if (!empty($address)) {
|
|
|
|
|
+ $address .= "\r\n";
|
|
|
|
|
+ }
|
|
|
|
|
+ $address .= $contact["address_4"];
|
|
|
|
|
+
|
|
|
|
|
+ $exists = common::excuteOneSql("select serial_no from $schemas.ocean_vgm_masterbasenumber where master_base_number ilike '" . $ocean["master_base_number"] . "'");
|
|
|
|
|
+
|
|
|
|
|
+ global $db;
|
|
|
|
|
+ $db->StartTrans();
|
|
|
|
|
+ if (empty($_POST["is_send"])) {
|
|
|
|
|
+ $_POST["is_send"] = 'f';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (empty($exists)) {
|
|
|
|
|
+ $db->Execute("insert into ocean_vgm_masterbasenumber (master_base_number, serial_no) values ('" . $ocean["master_base_number"] . "', '$serial_no');");
|
|
|
|
|
+ $value["serial_no"] = $serial_no;
|
|
|
|
|
+ $value["carrier_booking_no"] = $_POST["all_carrier_booking"];
|
|
|
|
|
+ $value["modify_user"] = _getLoginName();
|
|
|
|
|
+ $value["modify_time"] = "now()";
|
|
|
|
|
+ $value["authorized_email"] = !empty($_POST["authorized_email"]) ? $_POST["authorized_email"] : "";
|
|
|
|
|
+ $value["authorized_tel"] = !empty($_POST["authorized_tel"]) ? $_POST["authorized_tel"] : "";
|
|
|
|
|
+ $value["authorized_company"] = !empty($_POST["submitter"]) ? $_POST["submitter"] : "";
|
|
|
|
|
+ $value["signature"] = !empty($_POST["signature"]) ? $_POST["signature"] : "";
|
|
|
|
|
+ $value["is_send"] = $_POST["is_send"];
|
|
|
|
|
+ $value["action"] = "New";
|
|
|
|
|
+ $value["type"] = "Shipper";
|
|
|
|
|
+
|
|
|
|
|
+ $value["m_bol"] = $ocean["m_bol"];
|
|
|
|
|
+ $value["master_base_number"] = $ocean["master_base_number"];
|
|
|
|
|
+ $value["shipper_id"] = $ocean["from_station"];
|
|
|
|
|
+ $value["shipper"] = $contact["company"];
|
|
|
|
|
+ $value["shipper_address"] = $address;
|
|
|
|
|
+ $value["shipper_contactname"] = $contact["contactname_1"];
|
|
|
|
|
+ $value["shipper_email"] = $contact["email_1"];
|
|
|
|
|
+ $value["shipper_fax"] = $contact["fax"];
|
|
|
|
|
+ $value["shipper_telephone"] = $contact["phone_1"];
|
|
|
|
|
+ $value["update_uuid"] = utils::uuid();
|
|
|
|
|
+ $value["h_bol"] = $ocean["h_bol"];
|
|
|
|
|
+ $value["from_station"] = $ocean["from_station"];
|
|
|
|
|
+
|
|
|
|
|
+ $sql = common::getInsertSqlNull("$schemas .ocean_vgm", $value);
|
|
|
|
|
+ $db->Execute($sql);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $serial_no = $exists;
|
|
|
|
|
+ $db->Execute("update ocean_vgm_masterbasenumber set id=id where master_base_number ilike '" . $ocean["master_base_number"] . "';");
|
|
|
|
|
+
|
|
|
|
|
+ $db->Execute("update $schemas.ocean_vgm set is_send='" . $_POST["is_send"] . "', carrier_booking_no='" . $_POST["all_carrier_booking"] . "', modify_user='" . _getLoginName() . "', modify_time=now(),"
|
|
|
|
|
+ . "authorized_email='" . $_POST["authorized_email"] . "', authorized_tel='" . $_POST["authorized_tel"] . "', authorized_company='" . $_POST["submitter"] . "', signature='" . $_POST["signature"] . "', send_time=null "
|
|
|
|
|
+ . ", update_uuid='" . utils::uuid() . "' where master_base_number ilike '" . $ocean["master_base_number"] . "';");
|
|
|
|
|
+ }
|
|
|
|
|
+ $db->Execute("delete from ocean_vgm_container where serial_no ilike '" . $serial_no . "';");
|
|
|
|
|
+
|
|
|
|
|
+ foreach ($_POST["container_no"] as $i => $cv) {
|
|
|
|
|
+ $value1["serial_no"] = $serial_no;
|
|
|
|
|
+ $value1["carrier_booking_no"] = !empty($_POST["carrier_booking_no"][$i]) ? $_POST["carrier_booking_no"][$i] : "";
|
|
|
|
|
+ $value1["ctnr"] = !empty($_POST["container_no"][$i]) ? $_POST["container_no"][$i] : "";
|
|
|
|
|
+ $value1["size"] = !empty($_POST["size"][$i]) ? $_POST["size"][$i] : "";
|
|
|
|
|
+ $value1["vgm_weight"] = !empty($_POST["vgm_weight"][$i]) ? $_POST["vgm_weight"][$i] : "";
|
|
|
|
|
+ $value1["unit"] = !empty($_POST["vgm_kg_lg"][$i]) ? $_POST["vgm_kg_lg"][$i] : "";
|
|
|
|
|
+ $value1["vgm_time"] = !empty($_POST["vgm_date"][$i]) ? $_POST["vgm_date"][$i] : "";
|
|
|
|
|
+ $value1["cargo_weight_kgs"] = !empty($_POST["cargo_weight_kg"][$i]) ? $_POST["cargo_weight_kg"][$i] : "";
|
|
|
|
|
+ $value1["cargo_weight_lbs"] = !empty($_POST["cargo_weight_lb"][$i]) ? $_POST["cargo_weight_lb"][$i] : "";
|
|
|
|
|
+ $value1["vgm_method"] = !empty($_POST["vgm_method"][$i]) ? $_POST["vgm_method"][$i] : "";
|
|
|
|
|
+ $value1["master_base_number"] = $ocean["master_base_number"];
|
|
|
|
|
+
|
|
|
|
|
+ $sql = common::getInsertSqlNull("$schemas.ocean_vgm_container", $value1);
|
|
|
|
|
+ $db->Execute($sql);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($db->CompleteTrans() === FALSE) {
|
|
|
|
|
+ return "error";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return "success";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
?>
|