ShuanghongS 1 год назад
Родитель
Сommit
2f76184868

+ 8 - 7
include.ini.php

@@ -124,13 +124,14 @@ function _customerFilerSearchHandNew($user, $schemas = "public", $p = 'place_of_
             $sqlWhere1 .= " or lower($c) " . common::getInNotInSql($_contact_id);
         }
     }
-    if (utils::checkExist($tt, 'b') && !empty($b)) {
-        if (empty($sqlWhere1)) {
-            $sqlWhere1 = " lower($b) " . common::getInNotInSql($_contact_id);
-        } else {
-            $sqlWhere1 .= " or lower($b) " . common::getInNotInSql($_contact_id);
-        }
-    }
+    //暂时注释掉,ocean_booking 没有这个字段
+    // if (utils::checkExist($tt, 'b') && !empty($b)) {
+    //     if (empty($sqlWhere1)) {
+    //         $sqlWhere1 = " lower($b) " . common::getInNotInSql($_contact_id);
+    //     } else {
+    //         $sqlWhere1 .= " or lower($b) " . common::getInNotInSql($_contact_id);
+    //     }
+    // }
     if (utils::checkExist($tt, 'n') && !empty($n)) {
         if (empty($sqlWhere1)) {
             $sqlWhere1 = " lower($n) " . common::getInNotInSql($_contact_id);

+ 11 - 3
service/login.class.php

@@ -480,7 +480,7 @@ class login {
     public function verifcation_code(){
         // 生成一个4位随机数作为验证码
         //$random_num = mt_rand(1000, 9999);
-        $random_num = $this->generateCaptcha(6);
+        $random_num = $this->generateCaptcha(4);
         $_SESSION['captcha'] = $random_num;
         
         // 创建一个宽度为80像素、高度为30像素的图片
@@ -497,9 +497,9 @@ class login {
         
         // 在图片上绘制四个字符
         $font_size = 18;
-        $x = 14;
+        $x = 34;
         $y = 12;
-        for ($i = 0; $i < 6; $i++) {
+        for ($i = 0; $i < 4; $i++) {
             $char = substr($random_num, $i, 1);
             imagestring($image, $font_size, $x, $y, $char, $black);
             $x += $font_size+1;
@@ -1108,6 +1108,14 @@ class login {
         }else{
             $data =  $this->getTrackingInfo($reference_number);
             common::echo_json_encode(200, $data);
+            //记录查询log情况
+            $detail = "";
+            if($data['msg'] == "success"){
+                $detail = "Public tracking number:".$$reference_number."; search successful";
+            } else {
+                $detail = "Public tracking number:".$$reference_number."; search fail(".$data['msg'].")";
+            }
+            utils::single_operation_log_save("Tracking","Public tracking",$detail);
             exit();
         }
     }

+ 29 - 17
service/ocean_booking.class.php

@@ -249,16 +249,10 @@ class ocean_booking {
             //TopOcean的不用考虑
             $ocean_dest_sql = "";
             //合并显示两个特殊字段 voyage_m_voyage/vessel_m_vessel
-            if (!empty($_POST["_textSearch"])) {
-                $sql = "SELECT order_from as _schemas, serial_no as __serial_no, created_time as __created_time, color,
-                        m_voyage as __m_voyage,m_vessel as __m_vessel," .
-                        column::getInstance()->getSearchSqlForDisplay('Booking_Search') . " from public.online_booking $ocean_dest_sql " . $sqlWhere . " "
-                        . "order by $order_by limit " . $ps . " offset " . ($cp - 1) * $ps;       
-            } else {
-                $sql = "SELECT order_from as _schemas, serial_no as __serial_no, created_time as __created_time, color, 
+            $sql = "SELECT order_from as _schemas, serial_no as __serial_no, created_time as __created_time, color, 
                         f_voyage as __f_voyage, m_voyage as __m_voyage,f_vessel as __f_vessel, m_vessel as __m_vessel," .
                         column::getInstance()->getSearchSqlForDisplay('Booking_Search') . " from public.online_booking $ocean_dest_sql " . $sqlWhere . " order by $order_by limit " . $ps . " offset " . ($cp - 1) * $ps;
-            }
+            
             $rs = common::excuteListSql($sql);
             error_log("online_booking_search_SQL: ".$sql);
 
@@ -394,21 +388,30 @@ class ocean_booking {
         $containers = array("container_column"=>$booking_container_column,"container_data" =>$rss);
 
         //packing
-        $quantity_tolal = 0;
+        $quantity_unit = array();
         $packages = "CTN";
         $g_weight_tolal = 0;
         $ch_weight_tolal = 0;
         $cbm_tolal = 0;
         foreach($rss as $pk => $pv){
-            $quantity_tolal += $pv['qty'];
+            //相同的unit 的合并成一个
+            $unit = $pv['unit'];
+            if (array_key_exists($unit, $quantity_unit)) {
+                $quantity_unit[$unit] = $quantity_unit[$unit] + $pv['qty'];
+            } else {
+                $quantity_unit[$unit] =  $pv['qty'];
+            }
             $g_weight_tolal += $pv['kgs'];
             $ch_weight_tolal += $pv['kgs'];
             $cbm_tolal += $pv['cbm'];
-            $packages = " ".$pv['unit'];
+        }
+        $quantity_tolal = "";
+        foreach($quantity_unit as $uk => $uv){
+            $quantity_tolal.=$uv." ".$uk." ";
         }
 
         //$packing = array("Quantity/Unit"=>"47 CTN","G. Weight" => "480.25 KGS","Ch. Weight" => "689.26 KGS","Volume" => "3.801 CBM");
-        $packing = array("Quantity/Unit"=>$quantity_tolal.$packages,"G. Weight" => $g_weight_tolal." KGS","Ch. Weight" => $ch_weight_tolal." LBS","Volume" => $cbm_tolal." CBM");
+        $packing = array("Quantity/Unit"=>$quantity_tolal,"G. Weight" => $g_weight_tolal." KGS","Ch. Weight" => "","Volume" => $cbm_tolal." CBM");
         
         //处理邮件信息返回
         $emailRecords = $this->getCommunicationNew($ocean["serial_no"]);
@@ -434,11 +437,20 @@ class ocean_booking {
         exit(); 
     }
 
-    private function _booking_excel() {
-        //现在下载交给前端,后台最后只返回全部字段的列,
-        $allColumn = column::getInstance()->getDisplayColumnAll('Booking_Search');
-        $allBookingColumns = column::getInstance()->tableColumns('Booking_Search',$allColumn);
-        common::echo_json_encode(200,array("msg"=>"success","allColums" => $allBookingColumns));
+    private function _booking_excel() {  
+        $sql = common::deCode($_POST ['tmp_search'], 'D');
+        $sql = substr($sql, 0, strripos($sql, " limit"));
+        if(!empty($sql)){
+            $rss = common::excuteListSql($sql);
+        }
+
+        $allBookingColumns = array();
+        if(strtolower($_POST['is_all_colums']) == "yes"){
+            //现在下载交给前端,后台最后只返回全部字段的列,
+            $allColumn = column::getInstance()->getDisplayColumnAll('Booking_Search');
+            $allBookingColumns = column::getInstance()->tableColumns('Booking_Search',$allColumn);
+        }
+        common::echo_json_encode(200,array("msg"=>"success","allColums" => $allBookingColumns,"Data" => $rss));
         exit;
     }
 

+ 30 - 15
service/ocean_order.class.php

@@ -607,7 +607,6 @@ class ocean_order {
     private function _ocean_detail() {
         $serial_no = common::deCode($_GET['a'], 'D');
         $sql = $this->getOceanDetail($serial_no);
-        error_log($sql);
         $ocean = common::excuteObjectSql($sql);
         
         if (!empty($ocean)) {
@@ -673,19 +672,23 @@ class ocean_order {
         foreach($container_column as $cc){
             $ocean_container_column[] =array("field" =>$cc['database_column_name'],"title" =>$cc['name'],"formatter" =>"","type" =>"normal");
         }
-        $sql = "SELECT " . column::getInstance()->getSearchSql('Ocean_Container') . " from oc_container where lower(serial_no) = '" . strtolower($serial_no) . "'";
+        $sql = "SELECT " . column::getInstance()->getSearchSql('Ocean_Container') . ",net_lbs from oc_container where lower(serial_no) = '" . strtolower($serial_no) . "'";
         $rss = common::excuteListSql($sql);
-        $quantity_tolal = 0;
-        $packages = "CTN";
+
+        $quantity_unit = array();
         $g_weight_tolal = 0;
         $ch_weight_tolal = 0;
         $cbm_tolal = 0;
         foreach ($rss as $key => $rs) {
-            $quantity_tolal += $rs['qty'];
+            $unit = $rs['unit'];
+            if (array_key_exists($unit, $quantity_unit)) {
+                $quantity_unit[$unit] = $quantity_unit[$unit] + $rs['qty'];
+            } else {
+                $quantity_unit[$unit] =  $rs['qty'];
+            }
             $g_weight_tolal += $rs['grs_kgs'];
-            $ch_weight_tolal += $rs['grs_lbs'];
+            $ch_weight_tolal += $rs['net_lbs'];
             $cbm_tolal += $rs['cbm'];
-            $packages = $rs['unit'];
             //特殊处理weight
             if(!empty($rss[$key]['grs_kgs'])){
                 $rss[$key]['grs_kgs'] = $rs['grs_kgs']."KG";
@@ -694,10 +697,14 @@ class ocean_order {
                 $rss[$key]['grs_lbs'] = $rs['grs_lbs']."LB";
             }
         }
+        $quantity_tolal = "";
+        foreach($quantity_unit as $uk => $uv){
+            $quantity_tolal.=$uv." ".$uk." ";
+        }
         //Containers信息
         $containers = array("container_column"=>$ocean_container_column,"container_data" =>$rss);
         //Packing信息
-        $packing = array("Quantity/Unit"=>$quantity_tolal." ".$packages,"G. Weight" => $g_weight_tolal." KGS","Ch. Weight" => $ch_weight_tolal." LBS","Volume" => $cbm_tolal." CBM");
+        $packing = array("Quantity/Unit"=>$quantity_tolal,"G. Weight" => $g_weight_tolal." KGS","Ch. Weight" => $ch_weight_tolal." LBS","Volume" => $cbm_tolal." CBM");
        
         /* Container Status */
         //数据库里配置好
@@ -856,10 +863,18 @@ class ocean_order {
     }
 
     private function _ocean_excel() {
-        //现在下载交给前端,后台最后只返回全部字段的列,
-        $allColumn = column::getInstance()->getDisplayColumnAll('Ocean_Search');
-        $allBookingColumns = column::getInstance()->tableColumns('Ocean_Search',$allColumn);
-        common::echo_json_encode(200,array("msg"=>"success","allColums" => $allBookingColumns));
+        $sql = common::deCode($_POST ['tmp_search'], 'D');
+        $sql = substr($sql, 0, strripos($sql, " limit"));
+        if(!empty($sql)){
+            $rss = common::excuteListSql($sql);
+        }
+        $allBookingColumns = array();
+        if(strtolower($_POST['is_all_colums']) == "yes"){
+            //现在下载交给前端,后台最后只返回全部字段的列,
+            $allColumn = column::getInstance()->getDisplayColumnAll('Ocean_Search');
+            $allBookingColumns = column::getInstance()->tableColumns('Ocean_Search',$allColumn);
+        }
+        common::echo_json_encode(200,array("msg"=>"success","allColums" => $allBookingColumns,"Data" => $rss));
         exit;
     }
     
@@ -1310,7 +1325,7 @@ class ocean_order {
         $port_of_Loading_stauts = array("index" =>2,"label" =>"Port of Loading",
             "path" =>$ocean['fport_of_loading_exp_exp']."/".$ocean['fport_of_loading_exp'],"isArrival" =>$state >= 1 ? true : false);
         $children = array();  
-        if ($state <= 1){
+        if ($state < 1){
             //未发生前
             if(!empty($ocean_milestone_status_code['IFFDEP']['est_date'])){
                 $children[] = array("label" =>"Departure(ETD)","date" =>$ocean_milestone_status_code['IFFDEP']['est_date']);
@@ -1333,7 +1348,7 @@ class ocean_order {
         $port_of_Discharge_status = array("index" =>3,"label" =>"Port of Discharge",
             "path" =>$ocean['mport_of_discharge_exp']."/".$ocean['mport_of_discharge'],"isArrival" =>$state >= 2 ? true : false);
         $children = array(); 
-        if ($state <= 2){
+        if ($state < 2){
             //未发生前
             if(!empty($ocean_milestone_status_code['IFFARR']['est_date'])){
                 $children[] = array("label" =>"Arrival(ETA)","date" =>$ocean_milestone_status_code['IFFARR']['est_date']);
@@ -1353,7 +1368,7 @@ class ocean_order {
         $place_of_Delivery_status = array("index" =>4,"label" =>"Place of Delivery",
             "path" =>$ocean['place_of_delivery_exp']."/".$ocean['place_of_delivery'],"isArrival" =>$state == 3 ? true : false);
         $children = array(); 
-        if ($state <= 3){
+        if ($state < 3){
             //未发生前
         } else{
             if(!empty($ocean_milestone_status_code['IFFDEL']['act_date'])){

+ 1 - 1
service/operation_log.class.php

@@ -88,7 +88,7 @@ class operation_log{
             $rc = common::excuteOneSql($sql);
         }
         $tp = ceil($rc / $ps);
-        $order_by = " id";
+        $order_by = " id desc";
         if ($rc > 0) {
             $sql = "SELECT ".column::getInstance()->getSearchSqlForDisplay('Operation_Search')." from public.customer_service_operation_log " . $sqlWhere . 
                         " order by $order_by limit " . $ps . " offset " . ($cp - 1) * $ps;

+ 4 - 2
utils/common.class.php

@@ -554,6 +554,8 @@ 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();
@@ -1301,8 +1303,8 @@ class common {
                     null::timestamp without time zone as stime,''::text as ptype 
 				from vessel.vt_unlocode where lon<>0 and lat<>0 and lon is not null and lat is not null and uncode='".$orgin['shippr_uncode']."'";
             $map = common::excuteObjectSql($map_sql);   
-            // $json = '{"lng":121.8525,"lat":29.926545,"label":"'.$orgin['origin'].'","infor":"LAT KRABANG, THAILAND","sort":"0","stime":null,"ptype":"por"}';
-            // $map = json_decode($json,true);
+            //$json = '{"lng":121.8525,"lat":29.926545,"label":"'.$orgin['origin'].'","infor":"LAT KRABANG, THAILAND","sort":"0","stime":null,"ptype":"por"}';
+            //$map = json_decode($json,true);
             if(!empty($map)){
                 $toporiginMap[] = array("qandl"=>array(floatval($map['lng']),floatval($map['lat'])),
                     "divIcon" => array("iconSize"=>0),

+ 151 - 12
utils/utils.class.php

@@ -350,46 +350,162 @@ class utils {
         //排除opreation_log操作
         if($_REQUEST["action"] == "opreation_log" 
             || empty($_REQUEST["operate"])
-            || ($_REQUEST["action"] == "login" && $_REQUEST["operate"] == "verifcation_code")){
+            || ($_REQUEST["action"] == "login" && $_REQUEST["operate"] == "verifcation_code")
+            || ($_REQUEST["action"] == "login" && $_REQUEST["operate"] == "check_uname")
+            || ($_REQUEST["action"] == "ocean_order" && $_REQUEST["operate"] == "setting_ocean_order_display")
+            || ($_REQUEST["action"] == "ocean_booking" && $_REQUEST["operate"] == "setting_display")){
             return;
         }
         $user_type = _isCustomerLogin() ? "Customer" : "Employee";
-        $user_name = _getLoginName();
+        if($_REQUEST["action"] == "login" && $_REQUEST["operate"] == "tracking_checked"){
+            //public tracking_checked 的user name 记录对应IP 地址
+            $user_name = common::ip();
+        } elseif($_REQUEST["action"] == "login" && $_REQUEST["operate"] == "do_login"){
+            $user_name = $_REQUEST["uname"];
+        } else{
+            $user_name = _getLoginName();
+        }
 
-        $operateInfo = utils::getPageByAction($_REQUEST["action"],$_REQUEST["operate"]);
+        $operateInfo = utils::getPageByAction($_REQUEST["action"],$_REQUEST["operate"],$_REQUEST["model_name"]);
         $page = $operateInfo["page"];
         $operation = $operateInfo["operate"];
-        $operation_detail = common::check_input(utils::jsonFiltration("null", "\"\"", json_encode($_REQUEST)));
-        $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())";
-        common::excuteUpdateSql($sql);
+        $operation_detail = utils::analyzeOperationDetail($_REQUEST["action"],$_REQUEST["operate"]);
+        if(empty($operation_detail)){
+            $operation_detail = common::check_input(utils::jsonFiltration("null", "\"\"", json_encode($_REQUEST)));
+        }
+        //过滤一分钟以内,相同用户的重复请求
+        $exist_sql = "select count(1) from public.customer_service_operation_log 
+            where user_name = '$user_name' 
+                and page = '$page' and operation = '$operation' and operation_detail = '$operation_detail' 
+                and operation_time > NOW() - INTERVAL '1 minute' limit 1;";
+        $exist_obj = common::excuteOneSql($exist_sql); 
+        if(empty($exist_obj)){     
+            $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())";
+            common::excuteUpdateSql($sql);
+        }
     }
 
-    public static function getPageByAction($action,$operate){
+    public static function getPageByAction($action,$operate,$model_name){
         //取消
         $operationConvertName = array(
             "login=do_login" => array("page" =>"Login","operate"=>"Login"),
             "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"),
-            "ocean_booking=setting_display" => array("page" =>"Booking","operate"=>"Customize Coulumns"),
+            "Booking_Search=save_setting_display" => array("page" =>"Booking","operate"=>"Customize Coulumns"),
             "ocean_booking=detail" => array("page" =>"Booking","operate"=>"Open Detailed Page"),
             "ocean_booking=excel" => array("page" =>"Booking","operate"=>"Download"),
             "ocean_booking=save_communication" => array("page" =>"Booking","operate"=>"Send Email"),
 
             "login=tracking_checked" => array("page" =>"Tracking","operate"=>"Public tracking"),
             "ocean_order=search" => array("page" =>"Tracking","operate"=>"Search"),
-            "ocean_order=setting_display" => array("page" =>"Tracking","operate"=>"Customize Coulumns"),
+            "Ocean_Search=save_setting_display" => array("page" =>"Tracking","operate"=>"Customize Coulumns"),
             "ocean_order=detail" => array("page" =>"Tracking","operate"=>"Open Detailed Page"),
             "ocean_order=excel" => array("page" =>"Tracking","operate"=>"Download"),
             "ocean_booking=save_communication" => array("page" =>"Tracking","operate"=>"Send Email"),
+            "ocean_booking=ams_isf_log" => array("page" =>"Tracking","operate"=>"AMS/ISF"),
 
             "password=" => array("page" =>"Profile","operate"=>"Change password"));
-
+        if($action == "ajax" && $operate == "save_setting_display"){
+            return $operationConvertName[$model_name."=".$operate];
+        }    
         return $operationConvertName[$action."=".$operate];
     }
 
+    public static function analyzeOperationDetail($action,$operate){
+        if($action == "login" && $operate == "do_login"){
+            $detail = 'System account';
+        }
+        if($action == "login" && $operate == "logout"){
+            $detail = 'User Logout';
+        }
+        if($action == "login" && $operate == "tracking_checked"){
+            $detail = 'Join public tracking action';
+        }
+        if($action == "password"){
+            $detail = 'User Change password';
+        }
+        if(($action == "ocean_booking" || $action == "ocean_order") && $operate == "search"){
+            $detail = "";
+            //还有一个同以分钟内,不记录相同的查询  这个需要建表查询
+            //{"action":"ocean_booking","operate":"search","_ntype":"ocean_booking","cp":"1","ps":"100","rc":"-1","other_filed":"","uname":"ra.admin","psw":"abc123456789"}
+            $filter_common_field = array("action","operate","_ntype","cp","ps","rc","other_filed","uname","psw");
+            foreach($_REQUEST as $selected_key => $selected){
+                if(!utils::in_array($selected_key, $filter_common_field)){
+                    if(is_array($selected)){
+                        $selected = utils::implode(",",$selected);
+                    }
+                    $detail .="$selected_key:".$selected."; ";
+                }
+            }
+            if(empty($detail)){
+                $detail .="No search condition";
+            }
+        }
+        if($action == "ajax" && $operate == "save_setting_display"){
+            $detail = "";
+            $type = $_REQUEST['model_name'] == "Booking_Search" ? "Booking_Search" : "Ocean_Search";
+            //记录最终save 和 default 字段相比的结果
+            $default_ids = common::excuteListSql("select id,display_name from public.ra_online_search_display_cso where model_name = '$type' 
+                and display_name in('Booking No.','MBL No.','HBL No.','Transportation Mode','Status',
+                    'Shipper','Consignee','Origin Agent','Destination Agent','Creation Time','ETD','ETA',
+                    'Voyage','Vessel','Week','Created by') order by default_order");
+
+            $ids = utils::implode(";", $_POST['ids']);
+            $save_ids = common::excuteListSql("select id,display_name from public.ra_online_search_display_cso where model_name = '$type' 
+                    and id::text = any(regexp_split_to_array('$ids', ';')) order by default_order"); 
+
+            $detele_detail = "";
+            foreach($default_ids as $did){
+                if(!utils::exist_array($did['id'],$save_ids)){
+                    $detele_detail .=$did['display_name']."/";
+                }
+            }
+            $add_detail = "";
+            foreach($save_ids as $sid){
+                if(!utils::exist_array($sid['id'],$default_ids)){
+                    $add_detail .=$sid['display_name']."/";
+                }
+            }
+            if(!empty($detele_detail)){
+                $detail.="Detele fields: (".$detele_detail."). ";
+            }
+            if(!empty($add_detail)){
+                $detail.="Add fields: (".$add_detail."). ";
+            }
+            if(empty($detail)){
+                $detail = "The default field has not changed";
+            }
+        }
+
+        if(($action == "ocean_booking" || $action == "ocean_order") && $operate == "detail"){
+            $tabel = $action == "ocean_booking" ? "online_booking" : "online_ocean";
+            $serial_no = common::deCode($_GET['a'], 'D');
+            $sql = "SELECT booking_no,h_bol from public.$tabel where serial_no = '$serial_no' limit 1";
+            $data = common::excuteObjectSql($sql);
+            if(!empty($data['booking_no'])){
+                $detail = 'Booking No.: '.$data['booking_no'];
+            }else{
+                $detail = 'HBOL: '.$data['h_bol'];
+            }
+        }
+
+        if(($action == "ocean_booking" || $action == "ocean_order") && $operate == "save_communication"){
+            $text = $_POST["text"];
+            $detail = urldecode($text);  
+        }
+        if(($action == "ocean_order") && $operate == "ams_isf_log"){
+            $detail = "AMS/ISF";  
+        }
+        if(($action == "ocean_booking" || $action == "ocean_order") && $operate == "excel"){
+            $detail = "Filter_condition:" . $_REQUEST['excel_filter_condition']." Selected Fields:". $_REQUEST['selected fields'];
+        }
+        return $detail;
+
+    }
+
     public static function calculateTicks($minValue, $maxValue, $targetTickCount = 10) {
         $tickSpacing = ($maxValue - $minValue);
         $tickSpacing = intval($tickSpacing);
@@ -401,6 +517,19 @@ class utils {
         return $interval;
     }
 
+    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";
+        }
+        $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())";
+        common::excuteUpdateSql($sql);
+    }
+
     public static function uuid() {
         return strtoupper(md5(uniqid("", TRUE) . mt_rand()));
     }
@@ -427,6 +556,16 @@ class utils {
         }
     }
 
+    public static function exist_array($key,$arr){
+        $flag = false;
+        foreach($arr as $v){
+            if($v['id'] == $key ){
+                $flag = true;
+            }
+        }
+        return $flag;
+    }
+
     public static function _getSql($ids, $type,$shipment_mode) {
         $ids_arr = explode(',', $ids);
         $sql = "";