ShuanghongS 1 anno fa
parent
commit
3ebec2e7e8
4 ha cambiato i file con 29 aggiunte e 18 eliminazioni
  1. 6 1
      main_new_version.php
  2. 2 2
      service/login.class.php
  3. 16 8
      utils/common.class.php
  4. 5 7
      utils/utils.class.php

+ 6 - 1
main_new_version.php

@@ -498,7 +498,12 @@ switch ($action) {
         $returnData = common::getTopBar();
         common::echo_json_encode(200, $returnData);
         exit();
-        break;        
+        break;
+    case 'main_report_revenue':
+        $returnData = common::getRevenue();
+        common::echo_json_encode(200, $returnData);
+        exit();
+        break;            
     case 'main_map':
         $uncode = $_POST["uncode"];
         $serial_no = $_POST["serial_no"];

+ 2 - 2
service/login.class.php

@@ -1152,9 +1152,9 @@ class login {
             //记录查询log情况
             $detail = "";
             if($data['msg'] == "success"){
-                $detail = "Public tracking number:".$$reference_number."; search successful";
+                $detail = "Public tracking number:".$reference_number."; search successful";
             } else {
-                $detail = "Public tracking number:".$$reference_number."; search fail(".$data['msg'].")";
+                $detail = "Public tracking number:".$reference_number."; search fail(".$data['msg'].")";
             }
             utils::single_operation_log_save("Tracking","Public tracking",$detail);
             exit();

+ 16 - 8
utils/common.class.php

@@ -585,7 +585,6 @@ class common {
 
      public static function timeoutPrintInfor($httpAccept, $ajax, $login) {
         //记录系统因session过期 退出登录
-        utils::single_operation_log_save("logout","logout","System logout");
         $data = array("msg"=>"session_time_out");
         self::echo_json_encode(403,$data);
         exit();
@@ -1161,6 +1160,10 @@ class common {
             $dashboard_filter['ContainerefaultData'] = array("transportation" =>array('Sea'),"date_type"=>"ETA","date_start"=>$ctnr_date_start_two,"date_start_two"=>$ctnr_date_start,
              "date_end"=>$ctnr_date_end_two,"date_end_two"=>$ctnr_date_end);
 
+            //RevenueDefaultData
+            //$dashboard_filter['RevenueDefaultData'] = array("transportation" =>array('All'),"date_type"=>"Invoice Issue Date","date_start"=>$ctnr_date_start_two,"date_start_two"=>$ctnr_date_start,
+            // "date_end"=>$ctnr_date_end_two,"date_end_two"=>$ctnr_date_end); 
+
             //Top10faultData
             $dashboard_filter['Top10faultData'] = array("transportation" =>array('All'),"date_type"=>"ETA","date_start"=>$top_date_start_two,"date_start_two"=>$top_date_start,
             "date_end"=>$top_date_end_two,"date_end_two"=>$top_date_end);
@@ -1541,6 +1544,11 @@ class common {
         return $returnData;
     }
 
+    public static function getRevenue(){
+       $data = '{"bar_title":"Total: 0","barList":["DEC,23","JAN,24","FEB,24","MAR,24","APR,24","MAY,24","JUN,24","JUL,24","AUG,24","SEP,24","OCT,24","NOV,24"],"barSeries":[{"name":"USD","type":"bar","data":[1,1,1,1,1,1,1,1,1,1,1,1],"emphasis":{"disabled":true,"focus":"none"},"itemStyle":{"color":"#FF7500","borderRadius":6},"label":{"show":false,"color":"#646A73","position":"top","fontFamily":"Lato-Light","hideWhenMouseLeave":false}},{"name":"THB","type":"bar","data":[2,2,2,2,2,2,2,2,2,2,2,2],"emphasis":{"disabled":true,"focus":"none"},"itemStyle":{"color":"#FFAC66","borderRadius":6},"label":{"show":false,"color":"#646A73","position":"top","fontFamily":"Lato-Light","hideWhenMouseLeave":false}},{"name":"SGD","type":"bar","data":[3,3,3,3,3,3,3,3,3,3,3,3],"emphasis":{"disabled":true,"focus":"none"},"itemStyle":{"color":"#FFE3CC","borderRadius":6},"label":{"show":false,"color":"#646A73","position":"top","fontFamily":"Lato-Light","hideWhenMouseLeave":false}}],"Max":5,"interval":1,"download_name":"Rvenue","isShowTooltips":true}';    
+       return json_decode($data,true); 
+    }
+
     public static function getdefaultManagement(){
         $Management = array();
         $Management[] = array("id"=>1 ,
@@ -1551,14 +1559,18 @@ class common {
             "title"=>"Pending",
             "switchValue"=>true,
             "text"=>"Pie chart showing figures of shipments which are soon to depart/arrive (Calculated from ETD/ETA).");
-        $Management[] = array("id"=>4 ,
+        $Management[] = array("id"=>3 ,
             "title"=>"ETD to ETA (Days)",
             "switchValue"=>true,
             "text"=>"Pie chart showing figures of shipments which are soon to depart/arrive (Calculated from ETD/ETA).");
-        $Management[] = array("id"=>5 ,
+        $Management[] = array("id"=>4 ,
             "title"=>"Container Count",
             "switchValue"=>true,
             "text"=>"Pie chart showing figures of shipments which are soon to depart/arrive (Calculated from ETD/ETA).");
+        // $Management[] = array("id"=>5 ,
+        //     "title"=>"Revenue Spent",
+        //     "switchValue"=>true,
+        //     "text"=>"Revenue data for the past 12 months.");    
         $Management[] = array("id"=>6 ,
             "title"=>"Top 10 Origin/Destination",
             "switchValue"=>true,
@@ -1576,11 +1588,7 @@ class common {
         $Management[] = array("id"=>9 ,
             "title"=>"Recent Status",
             "switchValue"=>true,
-            "text"=>"A shipment list with latest status update on top.");
-        // $Management[] = array("id"=>9 ,
-        //     "title"=>"Revenue Spent",
-        //     "switchValue"=>true,
-        //     "text"=>"Revenue Spent."); 
+            "text"=>"A shipment list with latest status update on top."); 
         return  $Management;   
     }
 

+ 5 - 7
utils/utils.class.php

@@ -362,6 +362,7 @@ class utils {
         $user_type = _isCustomerLogin() ? "Customer" : "Employee";
         if($_REQUEST["action"] == "login" && $_REQUEST["operate"] == "tracking_checked"){
             //public tracking_checked 的user name 记录对应IP 地址
+            $user_type = "Customer";
             $user_name = common::ip();
         } elseif($_REQUEST["action"] == "login" && $_REQUEST["operate"] == "do_login"){
             $user_name = $_REQUEST["uname"];
@@ -425,7 +426,7 @@ class utils {
             $detail = 'User Logout';
         }
         if($action == "login" && $operate == "tracking_checked"){
-            $detail = 'Join public tracking action';
+            $detail = 'Join public tracking action,Public tracking number:'.$_POST['reference_number'];
         }
         if($action == "password"){
             $detail = 'User Change password';
@@ -520,13 +521,10 @@ class utils {
         return $interval;
     }
 
+    //只记录Public tracking
     public static function single_operation_log_save($page,$operation,$operation_detail){
-        $user_type = _isCustomerLogin() ? "Customer" : "Employee";
-        $user_name = _getLoginName();
-        if(!isset($_SESSION['ONLINE_USER'])){
-            $user_type = "";
-            $user_name  = "No Login Record";
-        }
+        $user_type ="Customer";
+        $user_name = common::ip();
         $sql = "INSERT INTO public.customer_service_operation_log(user_type, user_name, page, operation, operation_detail, 
         operation_time) 
         VALUES ('$user_type', '$user_name', '$page', '$operation', '$operation_detail', now())";