ShuanghongS 11 months ago
parent
commit
c082545ccc
5 changed files with 66 additions and 46 deletions
  1. 29 29
      main_new_version.php
  2. 7 7
      service/login.class.php
  3. 16 2
      service/tools.class.php
  4. 6 6
      utils/common.class.php
  5. 8 2
      utils/utils.class.php

+ 29 - 29
main_new_version.php

@@ -587,7 +587,7 @@ switch ($action) {
         exit();
         break;
     case 'main_map_new':
-        include ONLINE_ROOT . 'libs' . DS . 'map_config.ini.php';
+        //include ONLINE_ROOT . 'libs' . DS . 'map_config.ini.php';
         //修改添加port_of_transshipment 和port_of_transshipment_name的坐标获取(有为空的可能)
         $serial_no = $_REQUEST["serial_no"];
         //$serial_no = "F41E6016-1A97-4C93-8198-53D8B3B26220";
@@ -620,35 +620,35 @@ switch ($action) {
         //           {"lng":"100.88333333","lat":"13.08333333","label":"Destination","infor":"LAEM CHABANG PORT,THAILAND","sort":"1","stime":null,"ptype":"pol"},
         //           {"lng":"-122.28640000","lat":"37.79784000","label":"Transfer","infor":"OAKLAND, CA, USA","sort":"2","stime":null,"ptype":"pod"}]';
         //$rss = json_decode($json,true);
-        global $mapdb;
-        //查询线(包含所有的线)
-        error_log("select * from get_track_data('$serial_no',true)");
-        $map_sql = "select * from get_track_data('$serial_no',true)";
-        $Line = $mapdb->GetAll($map_sql) or ( (!$mapdb->ErrorMsg()) or error_log(common::dbLog($mapdb, $map_sql), 0));
+        // global $mapdb;
+        // //查询线(包含所有的线)
+        // error_log("select * from get_track_data('$serial_no',true)");
+        // $map_sql = "select * from get_track_data('$serial_no',true)";
+        // $Line = $mapdb->GetAll($map_sql) or ( (!$mapdb->ErrorMsg()) or error_log(common::dbLog($mapdb, $map_sql), 0));
 
-        error_log("total:".count($Line));
-        $solidLine = array();
-        $dottedLine = array();
-        $rangePoint = array();
-        foreach($Line as $line){
-            if($line['tp'] == "1"){
-                $solidLine[] = $line;
-            }elseif($line['tp'] == "0"){
-                $dottedLine[] = $line;
-            }else{
-                $rangePoint[] = $line;
-            }
-        }
-        error_log("total_1:".count($solidLine));
-        error_log("total_2:".count($dottedLine));
-        error_log("total_3:".count($rangePoint));
-        //如果没有虚线,这这个范围点也是异常的,不需要显示
-        if(empty($dottedLine)){
-            $rangePoint = array();
-        }
-        $data = array("point"=>$rss,"solidLine"=>$solidLine,"dottedLine"=>$dottedLine,"rangePoint"=>$rangePoint);
-        common::echo_json_encode(200, $data);
-        //common::echo_json_encode(200, $rss);
+        // error_log("total:".count($Line));
+        // $solidLine = array();
+        // $dottedLine = array();
+        // $rangePoint = array();
+        // foreach($Line as $line){
+        //     if($line['tp'] == "1"){
+        //         $solidLine[] = $line;
+        //     }elseif($line['tp'] == "0"){
+        //         $dottedLine[] = $line;
+        //     }else{
+        //         $rangePoint[] = $line;
+        //     }
+        // }
+        // error_log("total_1:".count($solidLine));
+        // error_log("total_2:".count($dottedLine));
+        // error_log("total_3:".count($rangePoint));
+        // //如果没有虚线,这这个范围点也是异常的,不需要显示
+        // if(empty($dottedLine)){
+        //     $rangePoint = array();
+        // }
+        // $data = array("point"=>$rss,"solidLine"=>$solidLine,"dottedLine"=>$dottedLine,"rangePoint"=>$rangePoint);
+        // common::echo_json_encode(200, $data);
+        common::echo_json_encode(200, $rss);
         exit();
         break;
     case 'main_welcome':

+ 7 - 7
service/login.class.php

@@ -432,13 +432,13 @@ class login {
                     }
                     //处理登录成功后的记录保存
                     //$user_type,$user_name,$page,$operation,$operation_detail
-                    $user_type = _isCustomerLogin() ? "Customer" : "Employee";
-                    $user_name = _getLoginName();
-                    $detail = 'System Account';
-                    if(isset($_POST['token']) && !empty($_POST['token'])){
-                        $detail = 'From Apex Online';
-                    }
-                    utils::single_operation_log_save($user_type,$user_name,"Login","Login",$detail);
+                    // $user_type = _isCustomerLogin() ? "Customer" : "Employee";
+                    // $user_name = _getLoginName();
+                    // $detail = 'System Account,Login successful';
+                    // if(isset($_POST['token']) && !empty($_POST['token'])){
+                    //     $detail = 'From Apex Online,Login successful';
+                    // }
+                    // utils::single_operation_log_save($user_type,$user_name,"Login","Login",$detail);
                     exit();
                 } else {
                     $data = array(

+ 16 - 2
service/tools.class.php

@@ -75,13 +75,27 @@ class tools {
             $clear_information = common::check_input($_POST['Clear_information']);
             $easy_to_use = common::check_input($_POST['Easy_to_use']);
             $system_Performance = common::check_input($_POST['System_Performance']);
+            $username = common::check_input($_POST['username']);
 
             $user_type = _isApexLogin() ? "employee" : "customer";
+            if(!isset($_SESSION['ONLINE_USER'])){
+                $user_type = "other";
+            }
+            $loginName = _getLoginName();
+            $loginEamil = _getLoginEamil();
+            //如果在没有登录前,没有登录信息,指定用户-- 这里逻辑取消,没有登录相当于匿名用户的评价,无法获取用户名
+            // if(!isset($_SESSION['ONLINE_USER'])){
+            //     $user_type = "Customer";
+            //     if(!empty($username)){
+            //         $loginName = $username;
+            //         $loginEamil = common::excuteOneSql("select email from public.ra_online_user u where lower(user_login) = '" . strtolower($username) . "'");
+            //     }
+            // }
             $sql = "INSERT INTO public.customer_service_user_mark(user_type, user_name, suggestion, proposal, expression, complete_funtionality, 
                     accurate_data, clear_information, easy_to_use, system_performance, 
                     created_time,email)
-            VALUES ('$user_type', '"._getLoginName()."', '$suggestion', '$proposal', '$expression', '$complete_funtionality', 
-                    '$accurate_data', '$clear_information', '$easy_to_use', '$system_Performance', now(),'"._getLoginEamil()."')";
+            VALUES ('$user_type', '$loginName', '$suggestion', '$proposal', '$expression', '$complete_funtionality', 
+                    '$accurate_data', '$clear_information', '$easy_to_use', '$system_Performance', now(),'$loginEamil')";
             common::excuteUpdateSql($sql);
 
             $data = array("msg" =>"success");

+ 6 - 6
utils/common.class.php

@@ -1664,12 +1664,12 @@ class common {
             "title"=>"Container Count",
             "switchValue"=>true,
             "text"=>"Pie chart showing figures of shipments which are soon to depart/arrive (Calculated from ETD/ETA).");
-        if(_isRevenueDisplay()){    
-            $Management[] = array("id"=>5 ,
-                "title"=>"Revenue Spent",
-                "switchValue"=>true,
-                "text"=>"Revenue data for the past 12 months."); 
-        }   
+        // if(_isRevenueDisplay()){    
+        //     $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,

+ 8 - 2
utils/utils.class.php

@@ -355,12 +355,10 @@ class utils {
             || empty($_REQUEST["operate"])
             || ($_REQUEST["action"] == "login" && $_REQUEST["operate"] == "verifcation_code")
             || ($_REQUEST["action"] == "login" && $_REQUEST["operate"] == "check_uname")
-            || ($_REQUEST["action"] == "login" && $_REQUEST["operate"] == "do_login")
             || ($_REQUEST["action"] == "ocean_order" && $_REQUEST["operate"] == "setting_ocean_order_display")
             || ($_REQUEST["action"] == "ocean_booking" && $_REQUEST["operate"] == "setting_display")){
             return;
         }
-        $user_type = _isCustomerLogin() ? "Customer" : "Employee";
         if($_REQUEST["action"] == "login" && $_REQUEST["operate"] == "tracking_checked"){
             //public tracking_checked 的user name 记录对应IP 地址
             $user_type = "Customer";
@@ -372,6 +370,12 @@ class utils {
             $user_name = _getLoginName();
         }
 
+        $user_type = _isApexLogin() ? "Employee" : "Customer";
+        //如果在没有登录前,没有登录信息,指定用户
+        if(!isset($_SESSION['ONLINE_USER'])){
+            $user_type = common::excuteOneSql("select user_type from public.ra_online_user u where lower(user_login) = '" . strtolower($user_name) . "'");
+        }
+
         $operateInfo = utils::getPageByAction($_REQUEST["action"],$_REQUEST["operate"],$_REQUEST["model_name"]);
         $page = $operateInfo["page"];
         $operation = $operateInfo["operate"];
@@ -397,6 +401,7 @@ class utils {
         //取消
         $operationConvertName = array(
             "login=do_login" => array("page" =>"Login","operate"=>"Login"),
+            "login=forgot_password" => array("page" =>"Login","operate"=>"Forgot_PPassword"),
             "login=logout" => array("page" =>"logout","operate"=>"logout"),
             "login=update_pwd_expires" => array("page" =>"Login","operate"=>"Reset password"),
             "ocean_booking=search" => array("page" =>"Booking","operate"=>"Search"),
@@ -413,6 +418,7 @@ class utils {
             "ocean_booking=save_communication" => array("page" =>"Tracking","operate"=>"Send Email"),
             "ocean_booking=ams_isf_log" => array("page" =>"Tracking","operate"=>"AMS/ISF"),
 
+            "tools=mark_save" => array("page" =>"Tools","operate"=>"Mark_Save"),
             "password=" => array("page" =>"Profile","operate"=>"Change password"));
         if($action == "ajax" && $operate == "save_setting_display"){
             return $operationConvertName[$model_name."=".$operate];