|
@@ -2048,7 +2048,8 @@ class common {
|
|
|
$eventdate.= " " . $event["eventtime"];
|
|
$eventdate.= " " . $event["eventtime"];
|
|
|
}
|
|
}
|
|
|
$location_code = $event["eventcode"];
|
|
$location_code = $event["eventcode"];
|
|
|
- $content[] = array("code" =>$event['event'],"title" =>$event['description'],"date"=>$eventdate,"country"=>$location_code,"timezone"=>$event['timezone']);
|
|
|
|
|
|
|
+ $content[] = array("code" =>$event['event'],"title" =>$event['description'],"date"=>$eventdate,"country"=>$location_code,"timezone"=>$event['timezone'],
|
|
|
|
|
+ "uncity"=>$event['uncity']);
|
|
|
if(strtolower($event['event']) == "vd" && !empty($eventdate)){
|
|
if(strtolower($event['event']) == "vd" && !empty($eventdate)){
|
|
|
$VD = $eventdate;
|
|
$VD = $eventdate;
|
|
|
}
|
|
}
|
|
@@ -2079,6 +2080,7 @@ class common {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$containerStatusDataTemp['label'] = $cd['ctnr']." / ".$cd['size'];
|
|
$containerStatusDataTemp['label'] = $cd['ctnr']." / ".$cd['size'];
|
|
|
|
|
+ $containerStatusDataTemp['ctnr_label'] = $cd['ctnr'];
|
|
|
$containerStatusDataTemp['content'] = $content;
|
|
$containerStatusDataTemp['content'] = $content;
|
|
|
$containerStatusData[] = $containerStatusDataTemp;
|
|
$containerStatusData[] = $containerStatusDataTemp;
|
|
|
}
|
|
}
|
|
@@ -3461,7 +3463,7 @@ class common {
|
|
|
$kln_pic_email = $data['kln_pic'];
|
|
$kln_pic_email = $data['kln_pic'];
|
|
|
//这票的创建者email
|
|
//这票的创建者email
|
|
|
$customer_email = common::excuteOneSql("select email from public.ra_online_user where user_login = '".$data['create_by']."'");
|
|
$customer_email = common::excuteOneSql("select email from public.ra_online_user where user_login = '".$data['create_by']."'");
|
|
|
- if ($status == "Rejected" || $status == "Cancelled") {
|
|
|
|
|
|
|
+ if ($status == "Reject" || $status == "Cancel") {
|
|
|
$log = common::excuteObjectSql("select *,
|
|
$log = common::excuteObjectSql("select *,
|
|
|
TO_CHAR(created_time, 'Mon-DD-YYYY') as _created_time
|
|
TO_CHAR(created_time, 'Mon-DD-YYYY') as _created_time
|
|
|
from public.kln_destination_delivery_operation_log
|
|
from public.kln_destination_delivery_operation_log
|
|
@@ -3477,12 +3479,13 @@ class common {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//邮件模板填充字段准备
|
|
//邮件模板填充字段准备
|
|
|
|
|
+ $address = json_decode($data["delivery_address_detail"],true);
|
|
|
$tplData = array("customer_email"=>$customer_email,
|
|
$tplData = array("customer_email"=>$customer_email,
|
|
|
"customer_name"=>$data['create_by'],
|
|
"customer_name"=>$data['create_by'],
|
|
|
"delivery_mode"=>$data['delivery_mode'],
|
|
"delivery_mode"=>$data['delivery_mode'],
|
|
|
"delivery_date"=>$data['_delivery_date'],
|
|
"delivery_date"=>$data['_delivery_date'],
|
|
|
- "location_name"=>"",
|
|
|
|
|
- "address_1"=>"",
|
|
|
|
|
|
|
+ "location_name"=>empty($address['contact_person']) ? "" : $address['contact_person'].":".$address['contact_number'],
|
|
|
|
|
+ "address_1"=>$address['address_1'],
|
|
|
"contact"=>"",
|
|
"contact"=>"",
|
|
|
"kln_pic_email"=>$kln_pic_email,
|
|
"kln_pic_email"=>$kln_pic_email,
|
|
|
"booking_no" =>$data['booking_no'],
|
|
"booking_no" =>$data['booking_no'],
|
|
@@ -3753,7 +3756,7 @@ class common {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//固定
|
|
//固定
|
|
|
- $legal = true;
|
|
|
|
|
|
|
+ //$legal = true;
|
|
|
if(!$legal){
|
|
if(!$legal){
|
|
|
$data = array("msg" =>"Illegal access");
|
|
$data = array("msg" =>"Illegal access");
|
|
|
common::echo_json_encode(200,$data);
|
|
common::echo_json_encode(200,$data);
|
|
@@ -3764,6 +3767,7 @@ class common {
|
|
|
public static function saveDAddressTempTable($delivery_serial_no,$consignee_id){
|
|
public static function saveDAddressTempTable($delivery_serial_no,$consignee_id){
|
|
|
//deliver address is new
|
|
//deliver address is new
|
|
|
$addressSql = "";
|
|
$addressSql = "";
|
|
|
|
|
+ $_sync_key_add = "";
|
|
|
$address_1 = $_POST['address_1'];
|
|
$address_1 = $_POST['address_1'];
|
|
|
foreach($address_1 as $key => $_address_1){
|
|
foreach($address_1 as $key => $_address_1){
|
|
|
$_address_1 = common::check_input($_address_1);
|
|
$_address_1 = common::check_input($_address_1);
|
|
@@ -3780,6 +3784,7 @@ class common {
|
|
|
$_sync_key = common::check_input($_POST['sync_key'][$key]);
|
|
$_sync_key = common::check_input($_POST['sync_key'][$key]);
|
|
|
$_from_station = common::check_input($_POST['from_station'][$key]);
|
|
$_from_station = common::check_input($_POST['from_station'][$key]);
|
|
|
$_contact_type = common::check_input($_POST['contact_type'][$key]);
|
|
$_contact_type = common::check_input($_POST['contact_type'][$key]);
|
|
|
|
|
+ $_create_user = common::check_input($_POST['create_user'][$key]);
|
|
|
|
|
|
|
|
$uniqueAC =array();
|
|
$uniqueAC =array();
|
|
|
if ($_contact_type == "Add"){
|
|
if ($_contact_type == "Add"){
|
|
@@ -3801,10 +3806,14 @@ class common {
|
|
|
'$_country','$_city','$_postal_code',
|
|
'$_country','$_city','$_postal_code',
|
|
|
'$_add_create_user',now(),'$_add_create_user',now(),
|
|
'$_add_create_user',now(),'$_add_create_user',now(),
|
|
|
true,'$_sync_key','$_from_station','$_contact_person','$_contact_number');";
|
|
true,'$_sync_key','$_from_station','$_contact_person','$_contact_number');";
|
|
|
|
|
+ $_sync_key_add = $_sync_key;
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
if(!empty($_sync_key)){
|
|
if(!empty($_sync_key)){
|
|
|
$_add_create_user = "Online_D_Address";
|
|
$_add_create_user = "Online_D_Address";
|
|
|
|
|
+ if($_contact_type == "Unedit"){
|
|
|
|
|
+ $_add_create_user = $_create_user;
|
|
|
|
|
+ }
|
|
|
$exist = common::excuteObjectSql("select sync_key,action from public.contacts_address_online where sync_key = '$_sync_key' and delivery_serial_no = '$delivery_serial_no'");
|
|
$exist = common::excuteObjectSql("select sync_key,action from public.contacts_address_online where sync_key = '$_sync_key' and delivery_serial_no = '$delivery_serial_no'");
|
|
|
if(empty($exist)){
|
|
if(empty($exist)){
|
|
|
$addressSql .= "INSERT INTO public.contacts_address_online(
|
|
$addressSql .= "INSERT INTO public.contacts_address_online(
|
|
@@ -3822,28 +3831,38 @@ class common {
|
|
|
if ($_contact_type == "Delete" && $exist['action'] == "Add"){
|
|
if ($_contact_type == "Delete" && $exist['action'] == "Add"){
|
|
|
//代表未审核新加的,这次提交为删除
|
|
//代表未审核新加的,这次提交为删除
|
|
|
$addressSql .= "delete from public.contacts_address_online where sync_key = '$_sync_key' and delivery_serial_no = '$delivery_serial_no';";
|
|
$addressSql .= "delete from public.contacts_address_online where sync_key = '$_sync_key' and delivery_serial_no = '$delivery_serial_no';";
|
|
|
- } elseif ($_contact_type == "Delete" && ($exist['action'] == "Modify" || $exist['action'] == "Unedit")){
|
|
|
|
|
- //代表未审核编辑的,这次提交为删除,修改action固定为Detele
|
|
|
|
|
- $addressSql .="UPDATE public.contacts_address_online
|
|
|
|
|
- SET addr1='$_address_1', addr2='$_address_2', addr3='$_address_3', addr4='$_address_4',
|
|
|
|
|
- ctry_code='$_country', city_code='$_city', postal_code='$_postal_code',
|
|
|
|
|
- modify_user='$_add_create_user', modify_date=now(),
|
|
|
|
|
- contact_person='$_contact_person', contact_number='$_contact_number',
|
|
|
|
|
- action='Delete'
|
|
|
|
|
- WHERE sync_key = '$_sync_key' and delivery_serial_no = '$delivery_serial_no';";
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ // elseif ($_contact_type == "Delete" && ($exist['action'] == "Modify" || $exist['action'] == "Unedit")){
|
|
|
|
|
+ // //代表未审核编辑的,这次提交为删除,修改action固定为Detele
|
|
|
|
|
+ // $addressSql .="UPDATE public.contacts_address_online
|
|
|
|
|
+ // SET addr1='$_address_1', addr2='$_address_2', addr3='$_address_3', addr4='$_address_4',
|
|
|
|
|
+ // ctry_code='$_country', city_code='$_city', postal_code='$_postal_code',
|
|
|
|
|
+ // modify_user='$_add_create_user', modify_date=now(),
|
|
|
|
|
+ // contact_person='$_contact_person', contact_number='$_contact_number',
|
|
|
|
|
+ // action='Delete'
|
|
|
|
|
+ // WHERE sync_key = '$_sync_key' and delivery_serial_no = '$delivery_serial_no';";
|
|
|
|
|
+ // }
|
|
|
|
|
+ else {
|
|
|
|
|
+ //Modify Unedit :如果是用户完全新加的,这里不做action的修改,保留记录的Add
|
|
|
|
|
+ $temp_action = $_contact_type;
|
|
|
|
|
+ if ($exist['action'] == "Add"){
|
|
|
|
|
+ $temp_action = "Add";
|
|
|
|
|
+ }
|
|
|
$addressSql .="UPDATE public.contacts_address_online
|
|
$addressSql .="UPDATE public.contacts_address_online
|
|
|
SET addr1='$_address_1', addr2='$_address_2', addr3='$_address_3', addr4='$_address_4',
|
|
SET addr1='$_address_1', addr2='$_address_2', addr3='$_address_3', addr4='$_address_4',
|
|
|
ctry_code='$_country', city_code='$_city', postal_code='$_postal_code',
|
|
ctry_code='$_country', city_code='$_city', postal_code='$_postal_code',
|
|
|
modify_user='$_add_create_user', modify_date=now(),
|
|
modify_user='$_add_create_user', modify_date=now(),
|
|
|
- contact_person='$_contact_person', contact_number='$_contact_number'
|
|
|
|
|
|
|
+ contact_person='$_contact_person', contact_number='$_contact_number',
|
|
|
|
|
+ action='$temp_action'
|
|
|
WHERE sync_key = '$_sync_key' and delivery_serial_no = '$delivery_serial_no';";
|
|
WHERE sync_key = '$_sync_key' and delivery_serial_no = '$delivery_serial_no';";
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
common::excuteUpdateSql($addressSql);
|
|
common::excuteUpdateSql($addressSql);
|
|
|
|
|
+ return $_sync_key_add;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static function returnDAddressRecord($address_country,$onine_address){
|
|
public static function returnDAddressRecord($address_country,$onine_address){
|
|
@@ -3868,12 +3887,12 @@ class common {
|
|
|
$_contact_type = common::check_input($_onine_address['action']);
|
|
$_contact_type = common::check_input($_onine_address['action']);
|
|
|
|
|
|
|
|
//适应前端逻辑,如果遇到Unedit 代表该地址未变动,移除变动记录里
|
|
//适应前端逻辑,如果遇到Unedit 代表该地址未变动,移除变动记录里
|
|
|
- if ( $_contact_type == "Unedit"){
|
|
|
|
|
|
|
+ if ($_contact_type == "Unedit"){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
foreach($address_country as $ck => $_country){
|
|
foreach($address_country as $ck => $_country){
|
|
|
- //如果需要新加的时候 用户固定名称,用作标记
|
|
|
|
|
|
|
+ //如果需要新加的时候 用户固定名称,用作标记 //contact_person,contact_number '$_contact_person','$_contact_number'
|
|
|
$_add_create_user = "Online_D_Address";
|
|
$_add_create_user = "Online_D_Address";
|
|
|
if ($_contact_type == "Add"){
|
|
if ($_contact_type == "Add"){
|
|
|
$sync_key = common::uuid();
|
|
$sync_key = common::uuid();
|
|
@@ -3882,14 +3901,14 @@ class common {
|
|
|
addr_type,contact_id, addr1, addr2,addr3, addr4,
|
|
addr_type,contact_id, addr1, addr2,addr3, addr4,
|
|
|
ctry_code, city_code, postal_code,
|
|
ctry_code, city_code, postal_code,
|
|
|
create_user, create_date, modify_user, modify_date,
|
|
create_user, create_date, modify_user, modify_date,
|
|
|
- is_sync_country, sync_key, from_station,contact_person,contact_number)
|
|
|
|
|
|
|
+ is_sync_country, sync_key, from_station)
|
|
|
VALUES ('D','$_contact_id','$_address_1','$_address_2','$_address_3','$_address_4',
|
|
VALUES ('D','$_contact_id','$_address_1','$_address_2','$_address_3','$_address_4',
|
|
|
'$_country','$_city','$_postal_code',
|
|
'$_country','$_city','$_postal_code',
|
|
|
'$_add_create_user',now(),'$_add_create_user',now(),
|
|
'$_add_create_user',now(),'$_add_create_user',now(),
|
|
|
- true,'$sync_key','$from_station','$_contact_person','$_contact_number');";
|
|
|
|
|
|
|
+ true,'$sync_key','$from_station');";
|
|
|
}
|
|
}
|
|
|
if ($_contact_type == "Modify"){
|
|
if ($_contact_type == "Modify"){
|
|
|
- //代表在一个国家内的编辑
|
|
|
|
|
|
|
+ //代表在一个国家内的编辑 //contact_person='$_contact_person', contact_number='$_contact_number'
|
|
|
$from_station_country = "";
|
|
$from_station_country = "";
|
|
|
if (strpos($_from_station, "Online_") === 0) { // 确保字符串以 Online_ 开头
|
|
if (strpos($_from_station, "Online_") === 0) { // 确保字符串以 Online_ 开头
|
|
|
$from_station_country = substr($_from_station, strlen("Online_"));
|
|
$from_station_country = substr($_from_station, strlen("Online_"));
|
|
@@ -3898,8 +3917,7 @@ class common {
|
|
|
$addressSql .= "UPDATE public.contacts_address
|
|
$addressSql .= "UPDATE public.contacts_address
|
|
|
SET addr1='$_address_1', addr2='$_address_2',
|
|
SET addr1='$_address_1', addr2='$_address_2',
|
|
|
ctry_code='$_country', city_code='$_city', postal_code='$_postal_code',
|
|
ctry_code='$_country', city_code='$_city', postal_code='$_postal_code',
|
|
|
- modify_user='"._getLoginName()."', modify_date=now(),
|
|
|
|
|
- contact_person='$_contact_person', contact_number='$_contact_number'
|
|
|
|
|
|
|
+ modify_user='"._getLoginName()."', modify_date=now()
|
|
|
WHERE sync_key = '$_sync_key';";
|
|
WHERE sync_key = '$_sync_key';";
|
|
|
} else {
|
|
} else {
|
|
|
$sync_key = common::uuid();
|
|
$sync_key = common::uuid();
|
|
@@ -3908,11 +3926,11 @@ class common {
|
|
|
addr_type,contact_id, addr1, addr2,addr3, addr4,
|
|
addr_type,contact_id, addr1, addr2,addr3, addr4,
|
|
|
ctry_code, city_code, postal_code,
|
|
ctry_code, city_code, postal_code,
|
|
|
create_user, create_date, modify_user, modify_date,
|
|
create_user, create_date, modify_user, modify_date,
|
|
|
- is_sync_country, sync_key, from_station,contact_person,contact_number)
|
|
|
|
|
|
|
+ is_sync_country, sync_key, from_station)
|
|
|
VALUES ('D','$_contact_id','$_address_1','$_address_2','$_address_3','$_address_4',
|
|
VALUES ('D','$_contact_id','$_address_1','$_address_2','$_address_3','$_address_4',
|
|
|
'$_country','$_city','$_postal_code',
|
|
'$_country','$_city','$_postal_code',
|
|
|
'$_add_create_user',now(),'$_add_create_user',now(),
|
|
'$_add_create_user',now(),'$_add_create_user',now(),
|
|
|
- true,'$sync_key','$from_station','$_contact_person','$_contact_number');";
|
|
|
|
|
|
|
+ true,'$sync_key','$from_station');";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if ($_contact_type == "Delete"){
|
|
if ($_contact_type == "Delete"){
|
|
@@ -3930,7 +3948,7 @@ class common {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- public static function returnDAddress(){
|
|
|
|
|
|
|
+ public static function returnDAddress($_sync_key_add=""){
|
|
|
//deliver address is new
|
|
//deliver address is new
|
|
|
$$delivery_address = "";
|
|
$$delivery_address = "";
|
|
|
$address_1 = $_POST['address_1'];
|
|
$address_1 = $_POST['address_1'];
|
|
@@ -3950,6 +3968,10 @@ class common {
|
|
|
$_from_station = $_POST['from_station'][$key];
|
|
$_from_station = $_POST['from_station'][$key];
|
|
|
$_contact_type = $_POST['contact_type'][$key];
|
|
$_contact_type = $_POST['contact_type'][$key];
|
|
|
|
|
|
|
|
|
|
+ if($_contact_type == "Add"){
|
|
|
|
|
+ //add 这么生成的唯一key
|
|
|
|
|
+ $_sync_key = $_sync_key_add;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if ($_contact_type <> "Delete"){
|
|
if ($_contact_type <> "Delete"){
|
|
|
$delivery_address = array("address_1"=>$_address_1,
|
|
$delivery_address = array("address_1"=>$_address_1,
|