ShuanghongS 11 tháng trước cách đây
mục cha
commit
961c1338b6
2 tập tin đã thay đổi với 59 bổ sung35 xóa
  1. 37 24
      main_new_version.php
  2. 22 11
      utils/common.class.php

+ 37 - 24
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,28 +620,28 @@ 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;
-        //查询线(包含所有的线)
-        $Line = $mapdb->GetAll("select * from get_track_data('$serial_no',true)");
-        $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;
-            }
-        }
-        //如果没有虚线,这这个范围点也是异常的,不需要显示
-        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);
+        // global $mapdb;
+        // //查询线(包含所有的线)
+        // $Line = $mapdb->GetAll("select * from get_track_data('$serial_no',true)");
+        // $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;
+        //     }
+        // }
+        // //如果没有虚线,这这个范围点也是异常的,不需要显示
+        // 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':
@@ -840,7 +840,20 @@ switch ($action) {
         break;    
     case 'tools':
         tools::getInstance()->markSystem();
-        break;        
+        break; 
+    case 'user_guide':
+        $rootPath = realpath(dirname(__FILE__)) . DS;
+        //common::download_file($rootPath."images\ACE-M1_ISF_ACI_User_Guide\ACE-M1_ISF_ACI_User_Guide.pdf", "ACE-M1_ISF_ACI_User_Guide_V2.0.pdf");
+        // PDF文件在服务器上的位置
+        $filename = $rootPath."userFile\KLN_Online_User_Guide_24.11.26.pdf";
+        $display_name = "KLN_Online_User_Guide_24_11_26.pdf";
+        // Header content type
+        header("Content-type: application/pdf");
+        header("Content-Length: " . filesize($filename));
+        header("Content-Disposition:attachment;filename=\"" . $display_name . "\"");
+        // 将文件发送到浏览器。
+        readfile($filename);
+        break;           
     default:
         $data = array(
             'msg' => 'Page not found',

+ 22 - 11
utils/common.class.php

@@ -1590,6 +1590,7 @@ class common {
         $index = 0;
         $max = 0;
         foreach($groupedItems as $currency => $series){
+            $series_max = 0;
             $num = $index % 3;
             $index = $index +1; 
             $tem_series = array();
@@ -1606,7 +1607,17 @@ class common {
                 $data[]=$invoice_amount;
                 $total = $total + $invoice_amount;
                 $max = $max<$_series['invoice_amount'] ? $_series['invoice_amount'] : $max;
+                $series_max = $series_max<$_series['invoice_amount'] ? $_series['invoice_amount'] : $series_max;
             }
+
+            //计算Y坐标的间隔 每种货币的
+            $interval = utils::calculateTicks(0,$series_max,5);
+            if($interval == 0){
+                //处理返回默认值
+                $interval = 2;
+            }
+            $tem_series["Max"] = $interval*5;
+            $tem_series["interval"] = $interval;
             $tem_series["data"] = $data;
             $tem_series["total"] = floatval(number_format($total, 4, '.', ''));
             $barSeries[] = $tem_series;
@@ -1652,12 +1663,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,
@@ -1951,24 +1962,24 @@ class common {
             $containerStatusDataTemp = array();
             $content = array();
             //按顺序处理 新版只显示几个状态
-            foreach($container_status_column as $status){
+            //foreach($container_status_column as $status){
                 foreach($ctnr_status as $event){
-                    if(strtolower($event['event']) == strtolower($status)){
+                    //if(strtolower($event['event']) == strtolower($status)){
                         $eventdate = $event["eventdate"];
                         if (empty($event["source_id"]) || $event["source_id"]==0) {
                             $eventdate.= " " . $event["eventtime"];
                         }
                         $location_code = $event["eventcode"];
-                        $content[] = array("code" =>$status,"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']);
                         if(strtolower($event['event']) == "vd" && !empty($eventdate)){
                             $VD = $eventdate;
                         }
                         if(strtolower($event['event']) == "va" && !empty($eventdate)){
                             $VA = $eventdate;
                         }
-                    }
+                    //}
                 }
-            }
+            //}
             //记录所有的信息
             $EDI315TimeAndLocation = array();
             foreach($ctnr_status as $event){