|
@@ -81,12 +81,102 @@ class ocean_order {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
- * download document
|
|
|
|
|
|
|
+ * download document
|
|
|
*/
|
|
*/
|
|
|
if ($operate == "download") {
|
|
if ($operate == "download") {
|
|
|
$this->_download();
|
|
$this->_download();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
|
+ * document upload
|
|
|
|
|
+ */
|
|
|
|
|
+ if ($operate == "document_upload"){
|
|
|
|
|
+ $transport_mode = $_POST['transport_mode'];
|
|
|
|
|
+ if($transport_mode == 'sea'){
|
|
|
|
|
+ $document = _getViewDocType($_REQUEST["_schemas"]);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $document = _getAirViewDocType($_REQUEST["_schemas"]);
|
|
|
|
|
+ }
|
|
|
|
|
+ $file_serial_nos = array();
|
|
|
|
|
+ foreach ($document as $v) {
|
|
|
|
|
+ $types = $v['serial_no'];
|
|
|
|
|
+ $types = strtolower($types);
|
|
|
|
|
+ $types = explode(";", $types);
|
|
|
|
|
+ foreach ($types as $k => $type) {
|
|
|
|
|
+ $file_serial_nos[] = $type;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ $file_serial_nos = implode(';',$file_serial_nos);
|
|
|
|
|
+ if($transport_mode == 'sea'){
|
|
|
|
|
+ $sql = "select display_name,format_name as file_type,serial_no,m_h from ra_online_file_format where lower(serial_no) " . common::getInNotInSql($file_serial_nos) . "
|
|
|
|
|
+ and active = true and client_upload = true";
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $sql = "select display_name,format_name as file_type,serial_no,m_h from air_file_format where lower(serial_no) " . common::getInNotInSql($file_serial_nos) . "
|
|
|
|
|
+ and active = true and client_upload = true";
|
|
|
|
|
+ }
|
|
|
|
|
+ $display_name = common::excuteListSql($sql);
|
|
|
|
|
+ $data['File Type'] = $display_name;
|
|
|
|
|
+ common::echo_json_encode(200,$data);
|
|
|
|
|
+ exit();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /*
|
|
|
|
|
+ * document upload do
|
|
|
|
|
+ */
|
|
|
|
|
+ if ($operate == "document_upload_do"){
|
|
|
|
|
+ $_schemas = $_REQUEST["_schemas"];
|
|
|
|
|
+ $transport_mode = $_POST['transport_mode'];
|
|
|
|
|
+ $bol = $_POST['h_bol'];
|
|
|
|
|
+ $transport_mode = $_POST['file_type'];
|
|
|
|
|
+ if ($transport_mode == "sea") {
|
|
|
|
|
+ $aaa = common::excuteObjectSql("select from_station, origin_station, destination_station from ocean where lower(h_bol) = '" . strtolower($bol) . "'");
|
|
|
|
|
+ } elseif ($transport_mode == "air") {
|
|
|
|
|
+ $aaa = common::excuteObjectSql("select from_station, origin_station, destination_station from air where lower(hawb) = '" . strtolower($bol) . "'");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // try {
|
|
|
|
|
+ // $tmp_name = $_FILES['file']['tmp_name'];
|
|
|
|
|
+ // $file_name = $_FILES['file']["name"];
|
|
|
|
|
+ // $errorMsg = "";
|
|
|
|
|
+ // $sql = "";
|
|
|
|
|
+ // foreach ($file_name as $i => $v) {
|
|
|
|
|
+ // if (empty($v)) {
|
|
|
|
|
+ // continue;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // $size = floor($_FILES ["file"]['size'][$i] / 1024 / 1024);
|
|
|
|
|
+ // if ($size > 2) {
|
|
|
|
|
+ // $errorMsg .= $_FILES['file']["name"][$i] . " larger than 2M.";
|
|
|
|
|
+ // continue;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if ($_FILES["file"]["error"][$i] > 0) {
|
|
|
|
|
+ // $errorMsg .= "File Upload Error(" . $_FILES ["file"]["error"][$i] . ").";
|
|
|
|
|
+ // continue;
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // $file_path = FILE_UPLOAD_PAHT . date("Ymd") . DS;
|
|
|
|
|
+ // if (!is_dir($file_path)) {
|
|
|
|
|
+ // common::mkdirs($file_path);
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // $dest_file = $file_path . $path_parts['filename'] . "_" . common::uuid() . "." . $exten;
|
|
|
|
|
+ // move_uploaded_file($tmp_name[$i], $dest_file);
|
|
|
|
|
+
|
|
|
|
|
+ // $sql .= "INSERT INTO public.packing_attachment_list(serial_no, att_type,file_type, created_by, created_time, filename, sourcefilename, notes) VALUES "
|
|
|
|
|
+ // . "('$serial_no', 'EBooking','" . common::check_input($file_type[$i]) . "', '" . _getLoginName() . "', now(), '" . common::check_input($v) . "', '"
|
|
|
|
|
+ // . common::check_input($dest_file) . "', '" . common::check_input($file_note[$i]) . "');";
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (!empty($errorMsg)) {
|
|
|
|
|
+ // $this->echoJson(array('status' => 'Failed', 'msg' => "Save Booking Failed $errorMsg"));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // common::excuteUpdateSqlThrow($sql);
|
|
|
|
|
+ // exit(json_encode("success"));
|
|
|
|
|
+ // } catch (Exception $e) {
|
|
|
|
|
+ // error_log($e->getTraceAsString());
|
|
|
|
|
+ // $this->echoJson(array('status' => 'Failed', 'msg' => "Save Booking Failed:Upload Filed Failed."));
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if ($operate == "save_communication") {
|
|
if ($operate == "save_communication") {
|
|
|
try {
|
|
try {
|
|
|
$content = $_POST["content"];
|
|
$content = $_POST["content"];
|
|
@@ -425,18 +515,16 @@ class ocean_order {
|
|
|
$sqlWhere_befrom_filterTag = $sqlWhere;
|
|
$sqlWhere_befrom_filterTag = $sqlWhere;
|
|
|
|
|
|
|
|
$mode_param = "";
|
|
$mode_param = "";
|
|
|
- if(!isset($_POST["transport_mode"]) || empty($_POST["transport_mode"])){
|
|
|
|
|
- $_POST["transport_mode"] = "all";
|
|
|
|
|
|
|
+ $transport_mode = empty($_POST["transport_mode"]) ? "all" : $_POST["transport_mode"];
|
|
|
|
|
+ if(!is_array($transport_mode)){
|
|
|
|
|
+ $transport_mode = array($transport_mode);
|
|
|
}
|
|
}
|
|
|
- if (strtolower($_POST["transport_mode"]) == "all") {
|
|
|
|
|
- $mode_param = "'sea','air'";
|
|
|
|
|
- } else {
|
|
|
|
|
- $transport_mode = str_replace(",", ";", $_POST["transport_mode"]);
|
|
|
|
|
- //替换transport_mode对应的value
|
|
|
|
|
- $transport_mode = str_replace("Ocean Freight", "sea", $transport_mode);
|
|
|
|
|
- $transport_mode = str_replace("Air Freight", "air", $transport_mode);
|
|
|
|
|
- $mode_param = common::getInNotInSqlForSearch($transport_mode);
|
|
|
|
|
|
|
+ if((count($transport_mode) == 1 && strtolower($transport_mode[0]) == 'all')){
|
|
|
|
|
+ $transport_mode = array("sea","air","road");
|
|
|
}
|
|
}
|
|
|
|
|
+ $transport_mode = implode(";",$transport_mode);
|
|
|
|
|
+
|
|
|
|
|
+ $mode_param = common::getInNotInSqlForSearch($transport_mode);
|
|
|
$sqlWhere .= " and transport_mode in ($mode_param)";
|
|
$sqlWhere .= " and transport_mode in ($mode_param)";
|
|
|
$transport_mode_search = " and transport_mode in ($mode_param)";
|
|
$transport_mode_search = " and transport_mode in ($mode_param)";
|
|
|
|
|
|
|
@@ -556,24 +644,17 @@ class ocean_order {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$TransportList = array(
|
|
$TransportList = array(
|
|
|
- array("name"=>"Ocean Freight","number"=>intval($sea_rc),"checked"=>false,"icon"=>"#icon-icon_ocean_b"),
|
|
|
|
|
- array("name"=>"Air Freight","number"=>intval($air_rc),"checked"=>false,"icon"=>"#icon-icon_airplane_b"));
|
|
|
|
|
-
|
|
|
|
|
- if (strtolower($_POST["transport_mode"]) == "all") {
|
|
|
|
|
|
|
+ array("name"=>"Ocean Freight","sname"=>"Sea","number"=>intval($sea_rc),"checked"=>false,"icon"=>"#icon-icon_ocean_b"),
|
|
|
|
|
+ array("name"=>"Air Freight","sname"=>"Air","number"=>intval($air_rc),"checked"=>false,"icon"=>"#icon-icon_airplane_b"));
|
|
|
|
|
+
|
|
|
|
|
+ $transport_mode_arr = explode(";", $transport_mode);
|
|
|
|
|
+ foreach($transport_mode_arr as $mode){
|
|
|
foreach($TransportList as $tkey => $transport){
|
|
foreach($TransportList as $tkey => $transport){
|
|
|
- $TransportList[$tkey]["checked"] = true;
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- $transport_mode_arr = explode(",", $_POST["transport_mode"]);
|
|
|
|
|
- foreach($transport_mode_arr as $mode){
|
|
|
|
|
- foreach($TransportList as $tkey => $transport){
|
|
|
|
|
- if(trim($mode) == $TransportList[$tkey]["name"]){
|
|
|
|
|
- $TransportList[$tkey]["checked"] = true;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if(strtolower(trim($mode)) == strtolower($TransportList[$tkey]["sname"])){
|
|
|
|
|
+ $TransportList[$tkey]["checked"] = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
//现在下载交给前端,后台预先只返回全部字段的列,
|
|
//现在下载交给前端,后台预先只返回全部字段的列,
|
|
|
$allColumn = column::getInstance()->getDisplayColumnAllReomveDefault('Ocean_Search');
|
|
$allColumn = column::getInstance()->getDisplayColumnAllReomveDefault('Ocean_Search');
|
|
|
$allBookingColumns = column::getInstance()->tableColumns('Ocean_Search',$allColumn);
|
|
$allBookingColumns = column::getInstance()->tableColumns('Ocean_Search',$allColumn);
|
|
@@ -805,7 +886,7 @@ class ocean_order {
|
|
|
if (!empty($document)) {
|
|
if (!empty($document)) {
|
|
|
foreach ($document as $v) {
|
|
foreach ($document as $v) {
|
|
|
$file_type = $v['display_name'];
|
|
$file_type = $v['display_name'];
|
|
|
- $file_arr = $this->getFileByHbol($ocean['_m_bol'], $ocean['_h_bol'], $v['serial_no'], $v['m_h'], $v['display_name'], TRUE,$ocean['_job_bol']) ;
|
|
|
|
|
|
|
+ $file_arr = $this->getOceanFileByHbol($ocean['_m_bol'], $ocean['_h_bol'], $v['serial_no'], $v['m_h'], $v['display_name'], TRUE,$ocean['_job_bol']) ;
|
|
|
|
|
|
|
|
$tar = json_decode($ocean_can_view_file,true);
|
|
$tar = json_decode($ocean_can_view_file,true);
|
|
|
|
|
|
|
@@ -813,19 +894,22 @@ class ocean_order {
|
|
|
foreach ($tar[$v['display_name']] as $dkey => $dvalue) {
|
|
foreach ($tar[$v['display_name']] as $dkey => $dvalue) {
|
|
|
switch ($v['display_name']) {
|
|
switch ($v['display_name']) {
|
|
|
case 'HBL':
|
|
case 'HBL':
|
|
|
- $sql = "SELECT from_system,serial_no,file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date
|
|
|
|
|
|
|
+ $sql = "SELECT (SELECT format_name from $_schemas.ra_online_file_format where serial_no = ra_online_doc_upload.format_serailno) as format_name,
|
|
|
|
|
+ from_system,serial_no,file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date
|
|
|
from ra_online_doc_upload
|
|
from ra_online_doc_upload
|
|
|
where lower(bol) = lower('".$ocean['_h_bol']."') and lower(format_serailno) in ('".strtolower(str_replace(";","','",$dvalue['value']))."') and upper((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2]) = '".$dvalue['type']."'
|
|
where lower(bol) = lower('".$ocean['_h_bol']."') and lower(format_serailno) in ('".strtolower(str_replace(";","','",$dvalue['value']))."') and upper((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2]) = '".$dvalue['type']."'
|
|
|
order by id desc";
|
|
order by id desc";
|
|
|
break;
|
|
break;
|
|
|
case 'MBL':
|
|
case 'MBL':
|
|
|
- $sql = "SELECT from_system,serial_no,file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date
|
|
|
|
|
|
|
+ $sql = "SELECT (SELECT format_name from $_schemas.ra_online_file_format where serial_no = ra_online_doc_upload.format_serailno) as format_name,
|
|
|
|
|
+ from_system,serial_no,file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date
|
|
|
from ra_online_doc_upload
|
|
from ra_online_doc_upload
|
|
|
where ( lower(bol) = lower('".strtolower($ocean['_m_bol'])."') or lower(bol) = lower('".strtolower($ocean['_job_bol'])."')) and lower(format_serailno) in ('".strtolower(str_replace(";","','",$dvalue['value']))."') and upper((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2]) = '".$dvalue['type']."'
|
|
where ( lower(bol) = lower('".strtolower($ocean['_m_bol'])."') or lower(bol) = lower('".strtolower($ocean['_job_bol'])."')) and lower(format_serailno) in ('".strtolower(str_replace(";","','",$dvalue['value']))."') and upper((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2]) = '".$dvalue['type']."'
|
|
|
order by id desc";
|
|
order by id desc";
|
|
|
break;
|
|
break;
|
|
|
case 'Others':
|
|
case 'Others':
|
|
|
- $sql = "SELECT from_system,serial_no,file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date
|
|
|
|
|
|
|
+ $sql = "SELECT (SELECT format_name from $_schemas.ra_online_file_format where serial_no = ra_online_doc_upload.format_serailno) as format_name,
|
|
|
|
|
+ from_system,serial_no,file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date
|
|
|
from ra_online_doc_upload
|
|
from ra_online_doc_upload
|
|
|
where (lower(bol) = lower('".strtolower($ocean['_h_bol'])."') or lower(bol) = lower('".strtolower($ocean['_m_bol'])."') or lower(bol) = lower('".strtolower($ocean['_job_bol'])."')) and lower(format_serailno) in ('".strtolower(str_replace(";","','",$dvalue['value']))."') and upper((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2]) = '".$dvalue['type']."'
|
|
where (lower(bol) = lower('".strtolower($ocean['_h_bol'])."') or lower(bol) = lower('".strtolower($ocean['_m_bol'])."') or lower(bol) = lower('".strtolower($ocean['_job_bol'])."')) and lower(format_serailno) in ('".strtolower(str_replace(";","','",$dvalue['value']))."') and upper((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2]) = '".$dvalue['type']."'
|
|
|
order by id desc";
|
|
order by id desc";
|
|
@@ -841,12 +925,14 @@ class ocean_order {
|
|
|
if ($rs['from_system']=="TOPOCEAN"||$rs['from_system']=="KSMART") {
|
|
if ($rs['from_system']=="TOPOCEAN"||$rs['from_system']=="KSMART") {
|
|
|
$file_arr[] = array("url"=>$OutFileURL."/download.php?_schemas=&a=".base64_encode(base64_encode($rs['serial_no'])),
|
|
$file_arr[] = array("url"=>$OutFileURL."/download.php?_schemas=&a=".base64_encode(base64_encode($rs['serial_no'])),
|
|
|
"file_name" => $rs['file_name'],
|
|
"file_name" => $rs['file_name'],
|
|
|
|
|
+ "format_name" => $rs['format_name'],
|
|
|
"detail"=>$rs['upload_date'],
|
|
"detail"=>$rs['upload_date'],
|
|
|
"can_delete"=>_getLoginName() == $rs['upload_by'],
|
|
"can_delete"=>_getLoginName() == $rs['upload_by'],
|
|
|
"from_system" =>'TOPOCEAN_KSMART');
|
|
"from_system" =>'TOPOCEAN_KSMART');
|
|
|
}else{
|
|
}else{
|
|
|
$file_arr[] = array("url"=>"main_new_version.php?action=ocean_order&operate=download&url=". (common::deCode($rs['file_path'] . DS . $rs['file_name'], 'E')),
|
|
$file_arr[] = array("url"=>"main_new_version.php?action=ocean_order&operate=download&url=". (common::deCode($rs['file_path'] . DS . $rs['file_name'], 'E')),
|
|
|
"file_name" => $rs['file_name'],
|
|
"file_name" => $rs['file_name'],
|
|
|
|
|
+ "format_name" => $rs['format_name'],
|
|
|
"detail"=>$rs['upload_date'],
|
|
"detail"=>$rs['upload_date'],
|
|
|
"can_delete"=>_getLoginName() == $rs['upload_by'],
|
|
"can_delete"=>_getLoginName() == $rs['upload_by'],
|
|
|
"from_system" =>'');
|
|
"from_system" =>'');
|
|
@@ -859,7 +945,7 @@ class ocean_order {
|
|
|
//$document_data[] = array("file_type"=>$file_type,"file"=>$file_arr);
|
|
//$document_data[] = array("file_type"=>$file_type,"file"=>$file_arr);
|
|
|
//按现在的逻辑,有值才会显示
|
|
//按现在的逻辑,有值才会显示
|
|
|
foreach($file_arr as $f){
|
|
foreach($file_arr as $f){
|
|
|
- $document_data[] = array("file_type"=>$file_type,"file"=>$f);
|
|
|
|
|
|
|
+ $document_data[] = array("file_type"=>$f["format_name"],"file"=>$f);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -969,28 +1055,32 @@ class ocean_order {
|
|
|
if (!empty($document)) {
|
|
if (!empty($document)) {
|
|
|
foreach ($document as $v) {
|
|
foreach ($document as $v) {
|
|
|
$file_type = $v['display_name'];
|
|
$file_type = $v['display_name'];
|
|
|
- $file_arr = $this->getFileByHbol($air['_m_bol'], $air['_h_bol'], $v['serial_no'], $v['m_h'], $v['display_name'], TRUE);
|
|
|
|
|
|
|
+ $file_arr = $this->getAirFileByHbol($air['_mawb'] . '-' . $air['_mawb_name'], $air['_h_bol'], $v['serial_no'], $v['m_h'], $v['display_name'], TRUE);
|
|
|
|
|
|
|
|
$tar = json_decode($air_can_view_file,true);
|
|
$tar = json_decode($air_can_view_file,true);
|
|
|
if(!empty($tar[$v['display_name']])){
|
|
if(!empty($tar[$v['display_name']])){
|
|
|
foreach ($tar[$v['display_name']] as $dkey => $dvalue) {
|
|
foreach ($tar[$v['display_name']] as $dkey => $dvalue) {
|
|
|
switch ($v['display_name']) {
|
|
switch ($v['display_name']) {
|
|
|
case 'HBL':
|
|
case 'HBL':
|
|
|
- $sql = "SELECT file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date
|
|
|
|
|
|
|
+ $sql = "SELECT (SELECT format_name from $_schemas.ra_online_file_format where serial_no = air_doc_upload.format_serailno) as format_name,
|
|
|
|
|
+ file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date
|
|
|
from air_doc_upload
|
|
from air_doc_upload
|
|
|
where lower(bol) = lower('".$air['_h_bol']."') and lower(format_serailno) in ('".strtolower(str_replace(";","','",$dvalue['value']))."') and upper((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2]) = '".$dvalue['type']."'
|
|
where lower(bol) = lower('".$air['_h_bol']."') and lower(format_serailno) in ('".strtolower(str_replace(";","','",$dvalue['value']))."') and upper((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2]) = '".$dvalue['type']."'
|
|
|
order by id desc";
|
|
order by id desc";
|
|
|
break;
|
|
break;
|
|
|
case 'MBL':
|
|
case 'MBL':
|
|
|
- $sql = "SELECT file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date
|
|
|
|
|
|
|
+ $sql = "SELECT (SELECT format_name from $_schemas.ra_online_file_format where serial_no = air_doc_upload.format_serailno) as format_name,
|
|
|
|
|
+ file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date
|
|
|
from air_doc_upload
|
|
from air_doc_upload
|
|
|
- where lower(bol) = lower('".strtolower($air['_m_bol'])."') and lower(format_serailno) in ('".strtolower(str_replace(";","','",$dvalue['value']))."') and upper((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2]) = '".$dvalue['type']."'
|
|
|
|
|
|
|
+ where lower(bol) = lower('".strtolower($air['_mawb'] . '-' . $air['_mawb_name'])."') and lower(format_serailno) in ('".strtolower(str_replace(";","','",$dvalue['value']))."') and upper((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2]) = '".$dvalue['type']."'
|
|
|
order by id desc";
|
|
order by id desc";
|
|
|
break;
|
|
break;
|
|
|
case 'Others':
|
|
case 'Others':
|
|
|
- $sql = "SELECT file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date
|
|
|
|
|
|
|
+ $sql = "SELECT
|
|
|
|
|
+ (SELECT format_name from $_schemas.ra_online_file_format where serial_no = air_doc_upload.format_serailno) as format_name,
|
|
|
|
|
+ file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date
|
|
|
from air_doc_upload
|
|
from air_doc_upload
|
|
|
- where (lower(bol) = lower('".strtolower($air['_h_bol'])."') or lower(bol) = lower('".strtolower($air['_m_bol'])."')) and lower(format_serailno) in ('".strtolower(str_replace(";","','",$dvalue['value']))."') and upper((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2]) = '".$dvalue['type']."'
|
|
|
|
|
|
|
+ where (lower(bol) = lower('".strtolower($air['_h_bol'])."') or lower(bol) = lower('".strtolower($air['_mawb'] . '-' . $air['_mawb_name'])."')) and lower(format_serailno) in ('".strtolower(str_replace(";","','",$dvalue['value']))."') and upper((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2]) = '".$dvalue['type']."'
|
|
|
order by id desc";
|
|
order by id desc";
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
@@ -1262,7 +1352,8 @@ class ocean_order {
|
|
|
* F: FL
|
|
* F: FL
|
|
|
* I: C/I & Packing list
|
|
* I: C/I & Packing list
|
|
|
*/
|
|
*/
|
|
|
- private function getFileByHbol($m_bol, $h_bol, $types, $m_bs, $display, $detail = FALSE,$job_no="") {
|
|
|
|
|
|
|
+ private function getOceanFileByHbol($m_bol, $h_bol, $types, $m_bs, $display, $detail = FALSE,$job_no="") {
|
|
|
|
|
+ $_schemas = $_REQUEST['_schemas'];
|
|
|
$types = strtolower($types);
|
|
$types = strtolower($types);
|
|
|
$types = explode(";", $types);
|
|
$types = explode(";", $types);
|
|
|
$m_bs = explode(";", $m_bs);
|
|
$m_bs = explode(";", $m_bs);
|
|
@@ -1274,23 +1365,28 @@ class ocean_order {
|
|
|
foreach ($types as $k => $type) {
|
|
foreach ($types as $k => $type) {
|
|
|
$m_b = $m_bs[$k];
|
|
$m_b = $m_bs[$k];
|
|
|
if (strtolower($m_b) == 'm')
|
|
if (strtolower($m_b) == 'm')
|
|
|
- $sql = "SELECT from_system,serial_no,file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date from ra_online_doc_upload where (lower(bol) = '" . strtolower($m_bol) . "' or lower(bol) ='".strtolower($job_no)."' ) and lower(format_serailno) = '$type' and upper(coalesce((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2],'')) not in ".$filefilter." order by id desc";
|
|
|
|
|
|
|
+ $sql = "SELECT (SELECT format_name from $_schemas.ra_online_file_format where serial_no = ra_online_doc_upload.format_serailno) as format_name,
|
|
|
|
|
+ from_system,serial_no,file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date from ra_online_doc_upload where (lower(bol) = '" . strtolower($m_bol) . "' or lower(bol) ='".strtolower($job_no)."' ) and lower(format_serailno) = '$type' and upper(coalesce((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2],'')) not in ".$filefilter." order by id desc";
|
|
|
if (strtolower($m_b) == 'h')
|
|
if (strtolower($m_b) == 'h')
|
|
|
- $sql = "SELECT from_system,serial_no,file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date from ra_online_doc_upload where lower(bol) = '" . strtolower($h_bol) . "' and lower(format_serailno) = '$type' and upper(coalesce((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2],'')) not in ".$filefilter." order by id desc";
|
|
|
|
|
|
|
+ $sql = "SELECT (SELECT format_name from $_schemas.ra_online_file_format where serial_no = ra_online_doc_upload.format_serailno) as format_name,
|
|
|
|
|
+ from_system,serial_no,file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date from ra_online_doc_upload where lower(bol) = '" . strtolower($h_bol) . "' and lower(format_serailno) = '$type' and upper(coalesce((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2],'')) not in ".$filefilter." order by id desc";
|
|
|
if (strtolower($m_b) == 'a')
|
|
if (strtolower($m_b) == 'a')
|
|
|
- $sql = "SELECT from_system,serial_no,file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date from ra_online_doc_upload where (lower(bol) = '" . strtolower($m_bol) . "' or lower(bol) = '" . strtolower($h_bol) . "' or lower(bol) ='".strtolower($job_no)."') and lower(format_serailno) = '$type' and upper(coalesce((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2],'')) not in ".$filefilter." order by id desc";
|
|
|
|
|
|
|
+ $sql = "SELECT (SELECT format_name from $_schemas.ra_online_file_format where serial_no = ra_online_doc_upload.format_serailno) as format_name,
|
|
|
|
|
+ from_system,serial_no,file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date from ra_online_doc_upload where (lower(bol) = '" . strtolower($m_bol) . "' or lower(bol) = '" . strtolower($h_bol) . "' or lower(bol) ='".strtolower($job_no)."') and lower(format_serailno) = '$type' and upper(coalesce((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2],'')) not in ".$filefilter." order by id desc";
|
|
|
if (!empty($sql)) {
|
|
if (!empty($sql)) {
|
|
|
$rss = common::excuteListSql($sql);
|
|
$rss = common::excuteListSql($sql);
|
|
|
foreach ($rss as $rs) {
|
|
foreach ($rss as $rs) {
|
|
|
if ($rs['from_system']=="TOPOCEAN"||$rs['from_system']=="KSMART") {
|
|
if ($rs['from_system']=="TOPOCEAN"||$rs['from_system']=="KSMART") {
|
|
|
$file[] = array("url"=>$OutFileURL.'/download.php?_schemas=&a='.base64_encode(base64_encode($rs['serial_no'])),
|
|
$file[] = array("url"=>$OutFileURL.'/download.php?_schemas=&a='.base64_encode(base64_encode($rs['serial_no'])),
|
|
|
"file_name" => $rs['file_name'],
|
|
"file_name" => $rs['file_name'],
|
|
|
|
|
+ "format_name" => $rs['format_name'],
|
|
|
"detail"=>$rs['upload_date'],
|
|
"detail"=>$rs['upload_date'],
|
|
|
"can_delete"=>_getLoginName() == $rs['upload_by'],
|
|
"can_delete"=>_getLoginName() == $rs['upload_by'],
|
|
|
"from_system" =>'TOPOCEAN_KSMART');
|
|
"from_system" =>'TOPOCEAN_KSMART');
|
|
|
}else {
|
|
}else {
|
|
|
$file[] = array("url"=>"main_new_version.php?action=ocean_order&operate=download&url=". (common::deCode($rs['file_path'] . DS . $rs['file_name'], 'E')),
|
|
$file[] = array("url"=>"main_new_version.php?action=ocean_order&operate=download&url=". (common::deCode($rs['file_path'] . DS . $rs['file_name'], 'E')),
|
|
|
"file_name" => $rs['file_name'],
|
|
"file_name" => $rs['file_name'],
|
|
|
|
|
+ "format_name" => $rs['format_name'],
|
|
|
"detail"=>$rs['upload_date'],
|
|
"detail"=>$rs['upload_date'],
|
|
|
"can_delete"=>_getLoginName() == $rs['upload_by'],
|
|
"can_delete"=>_getLoginName() == $rs['upload_by'],
|
|
|
"from_system" =>'');
|
|
"from_system" =>'');
|
|
@@ -1301,6 +1397,46 @@ class ocean_order {
|
|
|
return $file;
|
|
return $file;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
|
+ * get file by hbol/destination
|
|
|
|
|
+ * H:HBL
|
|
|
|
|
+ * M: MBL
|
|
|
|
|
+ * F: FL
|
|
|
|
|
+ * I: C/I & Packing list
|
|
|
|
|
+ */
|
|
|
|
|
+ private function getAirFileByHbol($m_bol, $h_bol, $types, $m_bs, $display, $detail = FALSE) {
|
|
|
|
|
+ $_schemas = $_REQUEST['_schemas'];
|
|
|
|
|
+ $types = explode(";", $types);
|
|
|
|
|
+ $m_bs = explode(";", $m_bs);
|
|
|
|
|
+ $filefilter = " ('TELEX') ";//过滤掉类型,单独配置 3537
|
|
|
|
|
+
|
|
|
|
|
+ $file = array();
|
|
|
|
|
+ foreach ($types as $k => $type) {
|
|
|
|
|
+ $m_b = $m_bs[$k];
|
|
|
|
|
+ if (strtolower($m_b) == 'm')
|
|
|
|
|
+ $sql = "SELECT (SELECT format_name from $_schemas.ra_online_file_format where serial_no = air_doc_upload.format_serailno) as format_name,
|
|
|
|
|
+ file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date from air_doc_upload where lower(bol) = '" . strtolower($m_bol) . "' and lower(format_serailno) " . common::getInNotInSql($type) . " and upper(coalesce((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2],'')) not in ".$filefilter." order by id desc";
|
|
|
|
|
+ if (strtolower($m_b) == 'h')
|
|
|
|
|
+ $sql = "SELECT (SELECT format_name from $_schemas.ra_online_file_format where serial_no = air_doc_upload.format_serailno) as format_name,
|
|
|
|
|
+ file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date from air_doc_upload where lower(bol) = '" . strtolower($h_bol) . "' and lower(format_serailno) " . common::getInNotInSql($type) . " and upper(coalesce((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2],'')) not in ".$filefilter." order by id desc";
|
|
|
|
|
+ if (strtolower($m_b) == 'a')
|
|
|
|
|
+ $sql = "SELECT (SELECT format_name from $_schemas.ra_online_file_format where serial_no = air_doc_upload.format_serailno) as format_name,
|
|
|
|
|
+ file_path, file_name, upload_by, to_char(upload_date, 'MM/DD/YYYY') as upload_date from air_doc_upload where (lower(bol) = '" . strtolower($m_bol) . "' or lower(bol) = '" . strtolower($h_bol) . "') and lower(format_serailno) " . common::getInNotInSql($type) . "and upper(coalesce((string_to_array((string_to_array(file_name,'.'))[1], '_'))[2],'')) not in ".$filefilter." order by id desc";
|
|
|
|
|
+ if (!empty($sql)) {
|
|
|
|
|
+ $rss = common::excuteListSql($sql);
|
|
|
|
|
+ foreach ($rss as $rs) {
|
|
|
|
|
+ $file[] = array("url"=>"main_new_version.php?action=ocean_order&operate=download&url=". (common::deCode($rs['file_path'] . DS . $rs['file_name'], 'E')),
|
|
|
|
|
+ "file_name" => $rs['file_name'],
|
|
|
|
|
+ "format_name" => $rs['format_name'],
|
|
|
|
|
+ "detail"=>$rs['upload_date'],
|
|
|
|
|
+ "can_delete"=>_getLoginName() == $rs['upload_by'],
|
|
|
|
|
+ "from_system" =>'');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return $file;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/*
|
|
/*
|
|
|
* download file
|
|
* download file
|
|
|
*/
|
|
*/
|
|
@@ -1511,7 +1647,8 @@ class ocean_order {
|
|
|
aa.*,dd.*,fd.*,air.*
|
|
aa.*,dd.*,fd.*,air.*
|
|
|
from o
|
|
from o
|
|
|
LEFT JOIN LATERAL ( SELECT departure_airport_name as fport_of_loading_exp,
|
|
LEFT JOIN LATERAL ( SELECT departure_airport_name as fport_of_loading_exp,
|
|
|
- destination_airport_name as mport_of_discharge_exp
|
|
|
|
|
|
|
+ destination_airport_name as mport_of_discharge_exp,
|
|
|
|
|
+ mawb as _mawb, mawb_name as _mawb_name, hawb as _hawb
|
|
|
FROM $order_from.air a WHERE a.serial_no = o.serial_no) air ON true
|
|
FROM $order_from.air a WHERE a.serial_no = o.serial_no) air ON true
|
|
|
LEFT JOIN LATERAL ( SELECT company as cn_company,
|
|
LEFT JOIN LATERAL ( SELECT company as cn_company,
|
|
|
address_1 as cn_address_1,
|
|
address_1 as cn_address_1,
|