ShuanghongS 9 hónapja
szülő
commit
76823f8d83
2 módosított fájl, 17 hozzáadás és 5 törlés
  1. 14 2
      service/tools.class.php
  2. 3 3
      utils/common.class.php

+ 14 - 2
service/tools.class.php

@@ -245,7 +245,7 @@ class tools {
         }
 
         if ($operate == "subscribe_shipment"){
-            $serial_no = common::check_input($_POST['serial_no']);
+            $serial_no = common::deCode($_GET['serial_no'], 'D');
             $is_subscribe = common::check_input($_POST['is_subscribe']);
             if($is_subscribe == "yes"){
                 $exist = common::excuteOneSql("select user_login from public.kln_user_subscribed where lower(user_login) = '".strtolower(_getLoginName())."' and subscribed_serial_no = '$serial_no'");
@@ -265,7 +265,7 @@ class tools {
                 //取消订阅
                 $sql = "delete from public.kln_user_subscribed where lower(user_login) = '".strtolower(_getLoginName())."' and subscribed_serial_no = '$serial_no';";
                 common::excuteUpdateSql($sql);
-                $data = array("msg" => "Cancel successfully");
+                $data = array("msg" => "Cancel Subscribe successfully");
                 common::echo_json_encode(200,$data);
                 exit();
             }
@@ -617,16 +617,28 @@ class tools {
             $ocean_etd_change = $_POST['ocean_etd_change'];
             $ocean_etd_old_sub_new = $_POST['ocean_etd_old_sub_new'];
             $ocean_etd_old_sub_new_unit = $_POST['ocean_etd_old_sub_new_unit'];
+            if(!empty($ocean_etd_old_sub_new_unit)){
+                $ocean_etd_old_sub_new_unit = $ocean_etd_old_sub_new_unit=="Day(s)" ? "days":"hours";
+            }
             $ocean_eta_change = $_POST['ocean_eta_change'];
             $ocean_eta_old_sub_new = $_POST['ocean_eta_old_sub_new'];
             $ocean_eta_old_sub_new_unit = $_POST['ocean_eta_old_sub_new_unit'];
+            if(!empty($ocean_eta_old_sub_new_unit)){
+                $ocean_eta_old_sub_new_unit = $ocean_eta_old_sub_new_unit=="Day(s)" ? "days":"hours";
+            }
 
             $air_etd_change = $_POST['air_etd_change'];
             $air_etd_old_sub_new = $_POST['air_etd_old_sub_new'];
             $air_etd_old_sub_new_unit = $_POST['air_etd_old_sub_new_unit'];
+            if(!empty($air_etd_old_sub_new_unit)){
+                $air_etd_old_sub_new_unit = $air_etd_old_sub_new_unit=="Day(s)" ? "days":"hours";
+            }
             $air_eta_change = $_POST['air_eta_change'];
             $air_eta_old_sub_new = $_POST['air_eta_old_sub_new'];
             $air_eta_old_sub_new_unit = $_POST['air_eta_old_sub_new_unit'];
+            if(!empty($air_eta_old_sub_new_unit)){
+                $air_eta_old_sub_new_unit = $air_eta_old_sub_new_unit=="Day(s)" ? "days":"hours";
+            }
             
             $sql.="INSERT INTO public.notifications_rules(
                     user_login, notifications_type, rules_type,

+ 3 - 3
utils/common.class.php

@@ -238,7 +238,7 @@ class common {
         } else if ($user["is_kerry_shipment"] == "f") {
             $sqlWhere = " (COALESCE(is_kerry_shipment,false) = false)";
         } else {
-            $sqlWhere = " 1=1";
+            $sqlWhere = " 1=1 ";
         }
 
         if (!empty($_POST["_apex_or_sfs"])) {
@@ -808,7 +808,7 @@ class common {
         $sales = _getAirSales($schemas);
         $sales_or = _getAirSalesOr($schemas);
 
-        $sqlWhere = " 1=1";
+        $sqlWhere = " 1=1 ";
         if (_isCustomerLogin()) {
             $sqlWhere .= " and " . _customerAirFilerSearch($schemas);
         } else {
@@ -838,7 +838,7 @@ class common {
             if (!empty($sales_or))
                 $sqlWhere = "$sqlWhere or lower(sales_rep)" . utils::getInSql($sales_or) . " or lower(following_sales)" . utils::getInSql($sales_or);
         }
-        return "and ($sqlWhere)";
+        return " and ($sqlWhere)";
     }
 
     public static function isNewVersion() {