Browse Source

1.大日程新增 area_no 判斷分區

2.安裝大日程 index 工勘人員改抓 warehouseid
3.大日程 submit 接收 post 的程式碼更新
gary
IA2301\IA_2301 1 year ago
parent
commit
4ac711958c
  1. 1
      .gitignore
  2. 4
      .vscode/launch.json
  3. 2
      wms/gary.php
  4. 238
      wms/ship_run_chart-model.php
  5. 45
      wms/ship_run_chart.php
  6. 8
      wms/wipwhole-index-export-excel.php
  7. 27
      wms/wipwhole-index-function.php
  8. 6
      wms/wipwhole-rec-invoice-edit-fileupload.php
  9. 273
      wms/wipwhole-rec-invoice-edit-submit.php
  10. 4
      wms/wipwhole-rec-invoice-edit.php
  11. 8
      wms/wipwhole-renovate-index-export-excel.php
  12. 27
      wms/wipwhole-renovate-index-function.php
  13. 253
      wms/wipwhole-renovate-rec-invoice-edit-submit.php
  14. 8
      wms/wipwhole-renovate-rec-invoice-edit.php
  15. 13
      wms/wipwholeinstall-index-export-excel.php
  16. 41
      wms/wipwholeinstall-index-function.php
  17. 4
      wms/wipwholeinstall-index-table-html.php
  18. 12
      wms/wipwholeinstall-renovate-index-export-excel.php
  19. 39
      wms/wipwholeinstall-renovate-index-function.php
  20. 4
      wms/wipwholeinstall-renovate-index-table-html.php

1
.gitignore

@ -27,3 +27,4 @@ wms/test.php
app/account_log/ app/account_log/
wms/gary2.php wms/gary2.php
wms/chinese.php wms/chinese.php
phpinfo.php

4
.vscode/launch.json

@ -8,7 +8,7 @@
"name": "Listen for Xdebug", "name": "Listen for Xdebug",
"type": "php", "type": "php",
"request": "launch", "request": "launch",
"port": 9003 "port": 9004
}, },
{ {
"name": "Launch currently open script", "name": "Launch currently open script",
@ -37,7 +37,7 @@
], ],
"program": "", "program": "",
"cwd": "${workspaceRoot}", "cwd": "${workspaceRoot}",
"port": 9003, "port": 9004,
"serverReadyAction": { "serverReadyAction": {
"pattern": "Development Server \\(http://localhost:([0-9]+)\\) started", "pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",
"uriFormat": "http://localhost:%s", "uriFormat": "http://localhost:%s",

2
wms/gary.php

@ -16,7 +16,7 @@ function getUserIP() {
// 获取用户的 IP 地址 // 获取用户的 IP 地址
$user_ip = getUserIP(); $user_ip = getUserIP();
echo $test = "123";
// 输出用户的 IP 地址 // 输出用户的 IP 地址
echo "用户的 IP 地址是:$user_ip"; echo "用户的 IP 地址是:$user_ip";
exit; exit;

238
wms/ship_run_chart-model.php

@ -1,33 +1,68 @@
<?php <?php
require_once dirname(__FILE__) . "/../mkt/database.php"; require_once dirname(__FILE__) . "/../mkt/database.php";
include "fun_global.php"; include "fun_global.php";
require dirname(__DIR__) . '/common/composer/vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use PhpOffice\PhpSpreadsheet\Style\Fill;
// AJAX 顯示合約明細 // AJAX 顯示合約明細
if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") {
$form_name = $_POST['form_name']; $form_name = $_POST['form_name'];
$type = $_POST['type']; $type = $_POST['type'];
$mtype = $_POST['mtype']; $mtype = $_POST['mtype'];
$year = $_POST['year']; $year = $_POST['year'];
$month = $_POST['month']; $month = $_POST['month'];
if (in_array($type, ['M1', 'MA'])) if (in_array($type, ['M1', 'MA']))
$type = null; $type = null;
if ($form_name == 'getShipping') { if ($form_name == 'getShipping')
echo getShipping($type, $mtype, $year, $month); echo getShipping($type, $mtype, $year, $month);
} if ($form_name == 'getInstalling')
if ($form_name == 'getInstalling') {
echo getInstalling($type, $mtype, $year, $month); echo getInstalling($type, $mtype, $year, $month);
} if ($form_name == 'getInstalling2')
if ($form_name == 'getInstalling2') {
echo getInstalling2($type, $mtype, $year, $month); echo getInstalling2($type, $mtype, $year, $month);
} if ($form_name == 'getQCing')
if ($form_name == 'getQCing') {
echo getQCing($type, $mtype, $year, $month); echo getQCing($type, $mtype, $year, $month);
} if ($form_name == 'getDeliverying')
if ($form_name == 'getDeliverying') {
echo getDeliverying($type, $mtype, $year, $month); echo getDeliverying($type, $mtype, $year, $month);
if ($form_name == 'getShipping_makeExcel') {
$data = getShipping_makeExcel($type, $mtype, $year, $month);
downloadExcel($data);
}
if ($form_name == 'getInstalling_makeExcel') {
$data = getInstalling_makeExcel($type, $mtype, $year, $month);
downloadExcel($data);
}
if ($form_name == 'getInstalling2_makeExcel') {
$data = getInstalling2_makeExcel($type, $mtype, $year, $month);
downloadExcel($data);
}
if ($form_name == 'getQCing_makeExcel') {
$data = getQCing_makeExcel($type, $mtype, $year, $month);
downloadExcel($data);
}
if ($form_name == 'getDeliverying_makeExcel') {
$data = getDeliverying_makeExcel($type, $mtype, $year, $month);
downloadExcel($data);
} }
} }
function fixDataNull($data)
{
foreach ($data as $key => $row) {
foreach ($row as $field => $value) {
if ($value === null) {
$data[$key][$field] = '';
}
}
}
return $data;
}
// 出貨台數 // 出貨台數
function getShipping($type, $mtype, $year, $month) function getShipping($type, $mtype, $year, $month)
{ {
@ -51,7 +86,7 @@ function getShipping($type, $mtype, $year, $month)
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; $sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
$result = mysqli_query($link, $sql); $result = mysqli_query($link, $sql);
$data = mysqli_fetch_all($result, MYSQLI_ASSOC); $data = mysqli_fetch_all($result, MYSQLI_ASSOC);
return json_encode($data, JSON_UNESCAPED_UNICODE); return json_encode(fixDataNull($data), JSON_UNESCAPED_UNICODE);
} }
// 在裝台數 // 在裝台數
@ -77,7 +112,7 @@ function getInstalling($type, $mtype, $year, $month)
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; $sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
$result = mysqli_query($link, $sql); $result = mysqli_query($link, $sql);
$data = mysqli_fetch_all($result, MYSQLI_ASSOC); $data = mysqli_fetch_all($result, MYSQLI_ASSOC);
return json_encode($data, JSON_UNESCAPED_UNICODE); return json_encode(fixDataNull($data), JSON_UNESCAPED_UNICODE);
} }
// 完工台數 // 完工台數
@ -99,7 +134,7 @@ function getInstalling2($type, $mtype, $year, $month)
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; $sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
$result = mysqli_query($link, $sql); $result = mysqli_query($link, $sql);
$data = mysqli_fetch_all($result, MYSQLI_ASSOC); $data = mysqli_fetch_all($result, MYSQLI_ASSOC);
return json_encode($data, JSON_UNESCAPED_UNICODE); return json_encode(fixDataNull($data), JSON_UNESCAPED_UNICODE);
} }
// QC台數 // QC台數
@ -121,7 +156,7 @@ function getQCing($type, $mtype, $year, $month)
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; $sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
$result = mysqli_query($link, $sql); $result = mysqli_query($link, $sql);
$data = mysqli_fetch_all($result, MYSQLI_ASSOC); $data = mysqli_fetch_all($result, MYSQLI_ASSOC);
return json_encode($data, JSON_UNESCAPED_UNICODE); return json_encode(fixDataNull($data), JSON_UNESCAPED_UNICODE);
} }
// 移交台數 // 移交台數
@ -143,5 +178,180 @@ function getDeliverying($type, $mtype, $year, $month)
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; $sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
$result = mysqli_query($link, $sql); $result = mysqli_query($link, $sql);
$data = mysqli_fetch_all($result, MYSQLI_ASSOC); $data = mysqli_fetch_all($result, MYSQLI_ASSOC);
return json_encode($data, JSON_UNESCAPED_UNICODE); return json_encode(fixDataNull($data), JSON_UNESCAPED_UNICODE);
}
// 出貨台數 產生excel
function getShipping_makeExcel($type, $mtype, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
AND (
real_arrival_date IS NOT NULL
AND real_arrival_date != ''
)
";
if (!empty($month)) {
$sql .= " AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'";
} else {
$sql .= " AND real_arrival_date BETWEEN '$year-01-01' AND '$year-12-31'";
}
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
$result = mysqli_query($link, $sql);
return mysqli_fetch_all($result, MYSQLI_ASSOC);
}
// 在裝台數 產生excel
function getInstalling_makeExcel($type, $mtype, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
AND (
tryrun_end_date = ''
OR tryrun_end_date IS NULL
)
";
if (!empty($month)) {
$sql .= " AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'";
} else {
$sql .= " AND real_arrival_date BETWEEN '$year-01-01' AND '$year-12-31'";
}
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
$result = mysqli_query($link, $sql);
return mysqli_fetch_all($result, MYSQLI_ASSOC);
}
// 完工台數 產生excel
function getInstalling2_makeExcel($type, $mtype, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
";
if (!empty($month)) {
$sql .= " AND tryrun_end_date BETWEEN '$year-$month-01' AND '$year-$month-31'";
} else {
$sql .= " AND tryrun_end_date BETWEEN '$year-01-01' AND '$year-12-31'";
}
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
$result = mysqli_query($link, $sql);
return mysqli_fetch_all($result, MYSQLI_ASSOC);
}
// QC台數 產生excel
function getQCing_makeExcel($type, $mtype, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
";
if (!empty($month)) {
$sql .= " AND end_qc_date BETWEEN '$year-$month-01' AND '$year-$month-31'";
} else {
$sql .= " AND end_qc_date BETWEEN '$year-01-01' AND '$year-12-31'";
}
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
$result = mysqli_query($link, $sql);
return mysqli_fetch_all($result, MYSQLI_ASSOC);
}
// 移交台數 產生excel
function getDeliverying_makeExcel($type, $mtype, $year, $month)
{
global $link;
// 建立一個新的 Spreadsheet 物件
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
";
if (!empty($month)) {
$sql .= " AND delivery_date BETWEEN '$year-$month-01' AND '$year-$month-31'";
} else {
$sql .= " AND delivery_date BETWEEN '$year-01-01' AND '$year-12-31'";
}
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
$result = mysqli_query($link, $sql);
return mysqli_fetch_all($result, MYSQLI_ASSOC);
}
function downloadExcel($data)
{
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$colArr = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
];
$colTitleArr = [
'合約號',
'作番號',
'客戶名稱',
'預計出貨日',
'試車完工日',
'QC合格日',
'官檢日',
'移交日',
];
$sheet->setTitle('出貨完工推移表');
for ($i = 0; $i < count($colArr); $i++)
$sheet->setCellValue($colArr[$i] . '1', $colTitleArr[$i]);
$i = 2;
foreach ($data as $row) {
$colContentArr = [
$row['contractno'],
$row['facilityno'],
$row['custom'],
$row['real_arrival_date'],
$row['tryrun_end_date'],
$row['end_qc_date'],
$row['official_check_date'],
$row['delivery_date']
];
for ($j = 0; $j < count($colContentArr); $j++)
$sheet->setCellValue($colArr[$j] . $i, $colContentArr[$j]);
$i++;
}
// 調整欄位大小
foreach ($sheet->getColumnIterator() as $column) {
$sheet->getColumnDimension($column->getColumnIndex())->setAutoSize(true);
}
$writer = new Xlsx($spreadsheet);
$file_path = dirname(__DIR__) . '/wms/excel/' . 'gary_test.xlsx';
try {
$writer->save($file_path);
// 回傳檔案路徑給 JavaScript
echo $file_path;
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
exit();
} }

45
wms/ship_run_chart.php

@ -132,6 +132,11 @@ foreach ($contract_type as $c_val => $c_key) {
<div class="modal-content"> <div class="modal-content">
<button type="button" class="close" id="myCloseBtn">X</button> <button type="button" class="close" id="myCloseBtn">X</button>
<div class='col-12' style='text-align:center'> <div class='col-12' style='text-align:center'>
<div class='row'>
<div class='col-12' style="text-align:left !important;">
<button type="button" class="btn btn-primary" id="btn_download">下載excel</button>
</div>
</div>
<div class='row'> <div class='row'>
<div class='col-12'> <div class='col-12'>
<table id="table_detail" class="table table-bordered" style="width:100%; margin:0 auto;"> <table id="table_detail" class="table table-bordered" style="width:100%; margin:0 auto;">
@ -349,6 +354,7 @@ foreach ($contract_type as $c_val => $c_key) {
}); });
function showDetail(form_name, type, mtype, year, month) { function showDetail(form_name, type, mtype, year, month) {
$("#btn_download").attr("onclick", "generateButton('" + form_name + "', '" + type + "', '" + mtype + "', '" + year + "', '" + month + "')");
$.ajax({ $.ajax({
type: "POST", type: "POST",
dataType: "json", dataType: "json",
@ -361,7 +367,6 @@ foreach ($contract_type as $c_val => $c_key) {
month: month month: month
}, },
complete: function(data) { complete: function(data) {
console.log(data);
var data = data.responseJSON var data = data.responseJSON
var str = ""; var str = "";
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
@ -382,10 +387,46 @@ foreach ($contract_type as $c_val => $c_key) {
dttable.fnDestroy(); dttable.fnDestroy();
} }
$("#table_detail").find("tbody").html(str); $("#table_detail").find("tbody").html(str);
$('#table_detail').dataTable(); $('#table_detail').dataTable({
displayLength: 100,
});
} }
}) })
} }
// 使用 JavaScript 監聽按鈕點擊事件
function generateButton(form_name, type, mtype, year, month) {
const formData = new FormData();
formData.append("form_name", form_name + "_makeExcel");
formData.append("type", type);
formData.append("mtype", mtype);
formData.append("year", year);
formData.append("month", month);
// 使用 XMLHttpRequest 來呼叫 PHP 檔案,生成 Excel
var xhr = new XMLHttpRequest();
xhr.open('POST', window.location.origin + "/wms/ship_run_chart-model.php", true);
xhr.responseType = 'text';
xhr.onload = function() {
if (xhr.status === 200) {
// 取得 PHP 回傳的檔案路徑
var response = xhr.responseText;
console.log(xhr.responseText);
var file_path = xhr.responseText;
// 創建下載連結
var link = document.createElement('a');
link.setAttribute('href', window.location.origin + "/wms/excel/gary_test.xlsx");
// 設定下載的檔案名稱
link.setAttribute('download', '出貨完工推移表.xlsx');
link.style.display = 'none';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
};
xhr.send(formData);
}
</script> </script>
<?php <?php
} }

8
wms/wipwhole-index-export-excel.php

@ -124,7 +124,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
'台灣自理項目(發貨類別)', '台灣自理項目(發貨類別)',
'台灣自理項目(發貨類別)日期', '台灣自理項目(發貨類別)日期',
'實際到貨日(到觀音廠日)', '實際到貨日(到觀音廠日)',
'實際到貨日(到觀音廠日)日期' '實際到貨日(到觀音廠日)日期',
'安裝圖上傳狀態',
'完工驗收單上傳狀態',
'移交日附件(核准函)上傳狀態'
]; ];
$sheet->setTitle('作番大日程(新梯)'); $sheet->setTitle('作番大日程(新梯)');
for ($i = 0; $i < count($colArr); $i++) for ($i = 0; $i < count($colArr); $i++)
@ -349,6 +352,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
substr($row['taiwan_goods_type_date'], 0, 10), substr($row['taiwan_goods_type_date'], 0, 10),
$arrival_date_verify_status, $arrival_date_verify_status,
substr($row['actual_tofactory_date'], 0, 10), substr($row['actual_tofactory_date'], 0, 10),
empty($row['plan_diagram_file']) ? "無" : "已上傳",
empty($row['completion_acceptance_file']) ? "無" : "已上傳",
empty($row['delivery_date_file']) ? "無" : "已上傳"
]; ];
for ($j = 0; $j < count($colContentArr); $j++) for ($j = 0; $j < count($colContentArr); $j++)
$sheet->setCellValue($colArr[$j] . $i, $colContentArr[$j]); $sheet->setCellValue($colArr[$j] . $i, $colContentArr[$j]);

27
wms/wipwhole-index-function.php

@ -48,7 +48,8 @@ function getWipwholeSearchSql()
$area_no = empty($_REQUEST['area_no']) ? null : trim($_REQUEST['area_no']); $area_no = empty($_REQUEST['area_no']) ? null : trim($_REQUEST['area_no']);
$sql = ""; $sql = "";
$sql .= empty($area_no) ? "" : " AND SUBSTR(address,1,2) IN (" . $area[$area_no] . ") "; $sql .= empty($area_no) ? "" : " AND area_no = '$area_no' ";
// $sql .= empty($area_no) ? "" : " AND SUBSTR(address,1,2) IN (" . $area[$area_no] . ") ";
$sql .= empty($contractno) ? "" : " AND contractno LIKE '%$contractno%' "; $sql .= empty($contractno) ? "" : " AND contractno LIKE '%$contractno%' ";
$sql .= empty($facilityno) ? "" : " AND facilityno LIKE '%$facilityno%' "; $sql .= empty($facilityno) ? "" : " AND facilityno LIKE '%$facilityno%' ";
$sql .= empty($custom) ? "" : " AND custom LIKE '%$custom%' "; $sql .= empty($custom) ? "" : " AND custom LIKE '%$custom%' ";
@ -284,7 +285,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('宜蘭') AND area_no = 'Y'
-- AND SUBSTR(address,1,2) in ('宜蘭')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -297,7 +299,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹') AND area_no IN ('N','T')
-- AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -310,7 +313,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗') AND area_no = 'C'
-- AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -323,7 +327,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄') AND area_no = 'K'
-- AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -564,7 +569,8 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code)
) )
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('宜蘭') AND area_no = 'Y'
-- AND SUBSTR(address,1,2) in ('宜蘭')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -585,7 +591,8 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code)
) )
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹') AND area_no IN ('N','T')
-- AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -606,7 +613,8 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code)
) )
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗') AND area_no = 'C'
-- AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -627,7 +635,8 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code)
) )
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄') AND area_no = 'K'
-- AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;

6
wms/wipwhole-rec-invoice-edit-fileupload.php

@ -2,16 +2,16 @@
function fileIUpload($post_name) function fileIUpload($post_name)
{ {
if ($_FILES[$post_name]["error"] == 0) { if (empty($_FILES[$post_name]["error"])) {
$datetime = date("YmdHis"); $datetime = date("YmdHis");
$file_name = str_replace("#", "", $_FILES[$post_name]["name"]); $file_name = empty($_FILES[$post_name]["name"]) ? "" : str_replace("#", "", $_FILES[$post_name]["name"]);
if (!empty($file_name)) {
$temp_file_name = $_FILES[$post_name]["tmp_name"]; $temp_file_name = $_FILES[$post_name]["tmp_name"];
$target_dir = empty($file_name) ? "" : "public-wipwhole/"; $target_dir = empty($file_name) ? "" : "public-wipwhole/";
$sales_spec_verify_file = strtolower($target_dir . basename($datetime . $file_name)); $sales_spec_verify_file = strtolower($target_dir . basename($datetime . $file_name));
if (file_exists($sales_spec_verify_file)) if (file_exists($sales_spec_verify_file))
unlink($sales_spec_verify_file); unlink($sales_spec_verify_file);
move_uploaded_file($temp_file_name, $sales_spec_verify_file); move_uploaded_file($temp_file_name, $sales_spec_verify_file);
if (!empty($file_name)) {
return strtolower($target_dir . basename($datetime . $file_name)); return strtolower($target_dir . basename($datetime . $file_name));
} else { } else {
return ""; return "";

273
wms/wipwhole-rec-invoice-edit-submit.php

@ -12,141 +12,143 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
} }
$datetime = date("Y-m-d H:i:s"); $datetime = date("Y-m-d H:i:s");
$contractno = $_POST['contractno']; $create_at = date("Y-m-d H:i:s");
$facility_temp_no = $_POST['facility_temp_no']; $contractno = isset($_POST['contractno']) ? $_POST['contractno'] : $row['contractno'];
$facilityno = $_POST['facilityno']; $facility_temp_no = isset($_POST['facility_temp_no']) ? $_POST['facility_temp_no'] : $row['facility_temp_no'];
$custom = $_POST['custom']; $facilityno = isset($_POST['facilityno']) ? $_POST['facilityno'] : $row['facilityno'];
$site_manager = $_POST['site_manager']; $custom = isset($_POST['custom']) ? $_POST['custom'] : $row['custom'];
$latitude = $_POST['latitude']; $site_manager = isset($_POST['site_manager']) ? $_POST['site_manager'] : $row['site_manager'];
$longitude = $_POST['longitude']; $latitude = isset($_POST['latitude']) ? $_POST['latitude'] : $row['latitude'];
$weight = $_POST['weight']; $longitude = isset($_POST['longitude']) ? $_POST['longitude'] : $row['longitude'];
$numberofpassenger = $_POST['numberofpassenger']; $weight = isset($_POST['weight']) ? $_POST['weight'] : $row['weight'];
$numberofstop = $_POST['numberofstop']; $numberofpassenger = isset($_POST['numberofpassenger']) ? $_POST['numberofpassenger'] : $row['numberofpassenger'];
$numberoffloor = $_POST['numberoffloor']; $numberofstop = isset($_POST['numberofstop']) ? $_POST['numberofstop'] : $row['numberofstop'];
$opentype = $_POST['opentype']; $numberoffloor = isset($_POST['numberoffloor']) ? $_POST['numberoffloor'] : $row['numberoffloor'];
$speed = $_POST['speed']; $opentype = isset($_POST['opentype']) ? $_POST['opentype'] : $row['opentype'];
$facility_kind = $_POST['facility_kind']; $speed = isset($_POST['speed']) ? $_POST['speed'] : $row['speed'];
$address = $_POST['address']; $facility_kind = isset($_POST['facility_kind']) ? $_POST['facility_kind'] : $row['facility_kind'];
$real_address = $_POST['real_address']; $address = isset($_POST['address']) ? $_POST['address'] : $row['address'];
$contract_arrival_date = $_POST['contract_arrival_date']; $real_address = isset($_POST['real_address']) ? $_POST['real_address'] : $row['real_address'];
$real_contract_arrival_date = $_POST['real_contract_arrival_date']; $contract_arrival_date = isset($_POST['contract_arrival_date']) ? $_POST['contract_arrival_date'] : $row['contract_arrival_date'];
$sales_spec_verify = $_POST['sales_spec_verify']; $real_contract_arrival_date = isset($_POST['real_contract_arrival_date']) ? $_POST['real_contract_arrival_date'] : $row['real_contract_arrival_date'];
$sales_spec_verify_at = $_POST['sales_spec_verify_at'] ?: $row['sales_spec_verify_at']; $sales_spec_verify = isset($_POST['sales_spec_verify']) ? $_POST['sales_spec_verify'] : $row['sales_spec_verify'];
$sales_spec_verify_owner = $_POST['sales_spec_verify_owner'] ?: $row['sales_spec_verify_owner']; $sales_spec_verify_at = isset($_POST['sales_spec_verify_at']) ? $_POST['sales_spec_verify_at'] : $row['sales_spec_verify_at'];
$real_custom_name = $_POST['real_custom_name'] ?: $row['real_custom_name']; $sales_spec_verify_owner = isset($_POST['sales_spec_verify_owner']) ? $_POST['sales_spec_verify_owner'] : $row['sales_spec_verify_owner'];
$customer_planning_verify = $_POST['customer_planning_verify']; $real_custom_name = isset($_POST['real_custom_name']) ? $_POST['real_custom_name'] : $row['real_custom_name'];
$customer_planning_verify_at = $_POST['customer_planning_verify_at'] ?: $row['customer_planning_verify_at']; $customer_planning_verify = isset($_POST['customer_planning_verify']) ? $_POST['customer_planning_verify'] : $row['customer_planning_verify'];
$customer_planning_verify_owner = $_POST['customer_planning_verify_owner'] ?: $row['customer_planning_verify_owner']; $customer_planning_verify_at = isset($_POST['customer_planning_verify_at']) ? $_POST['customer_planning_verify_at'] : $row['customer_planning_verify_at'];
$customer_color_verify = $_POST['customer_color_verify']; $customer_planning_verify_owner = isset($_POST['customer_planning_verify_owner']) ? $_POST['customer_planning_verify_owner'] : $row['customer_planning_verify_owner'];
$customer_color_verify_at = $_POST['customer_color_verify_at'] ?: $row['customer_color_verify_at']; $customer_color_verify = isset($_POST['customer_color_verify']) ? $_POST['customer_color_verify'] : $row['customer_color_verify'];
$customer_color_verify_owner = $_POST['customer_color_verify_owner'] ?: $row['customer_color_verify_owner']; $customer_color_verify_at = isset($_POST['customer_color_verify_at']) ? $_POST['customer_color_verify_at'] : $row['customer_color_verify_at'];
$customer_style_verify = $_POST['customer_style_verify']; $customer_color_verify_owner = isset($_POST['customer_color_verify_owner']) ? $_POST['customer_color_verify_owner'] : $row['customer_color_verify_owner'];
$customer_style_verify_at = $_POST['customer_style_verify_at'] ?: $row['customer_style_verify_at']; $customer_style_verify = isset($_POST['customer_style_verify']) ? $_POST['customer_style_verify'] : $row['customer_style_verify'];
$customer_style_verify_owner = $_POST['customer_style_verify_owner'] ?: $row['customer_style_verify_owner']; $customer_style_verify_at = isset($_POST['customer_style_verify_at']) ? $_POST['customer_style_verify_at'] : $row['customer_style_verify_at'];
$site_survey_contact_form_verify = $_POST['site_survey_contact_form_verify']; $customer_style_verify_owner = isset($_POST['customer_style_verify_owner']) ? $_POST['customer_style_verify_owner'] : $row['customer_style_verify_owner'];
$site_survey_contact_form_verify_at = $_POST['site_survey_contact_form_verify_at'] ?: $row['site_survey_contact_form_verify_at']; $site_survey_contact_form_verify = isset($_POST['site_survey_contact_form_verify']) ? $_POST['site_survey_contact_form_verify'] : $row['site_survey_contact_form_verify'];
$site_survey_contact_form_verify_owner = $_POST['site_survey_contact_form_verify_owner'] ?: $row['site_survey_contact_form_verify_owner']; $site_survey_contact_form_verify_at = isset($_POST['site_survey_contact_form_verify_at']) ? $_POST['site_survey_contact_form_verify_at'] : $row['site_survey_contact_form_verify_at'];
$desin_spec_verify = $_POST['desin_spec_verify']; $site_survey_contact_form_verify_owner = isset($_POST['site_survey_contact_form_verify_owner']) ? $_POST['site_survey_contact_form_verify_owner'] : $row['site_survey_contact_form_verify_owner'];
$desin_spec_verify_at = $_POST['desin_spec_verify_at'] ?: $row['desin_spec_verify_at']; $desin_spec_verify = isset($_POST['desin_spec_verify']) ? $_POST['desin_spec_verify'] : $row['desin_spec_verify'];
$desin_spec_verify_owner = $_POST['desin_spec_verify_owner'] ?: $row['desin_spec_verify_owner']; $desin_spec_verify_at = isset($_POST['desin_spec_verify_at']) ? $_POST['desin_spec_verify_at'] : $row['desin_spec_verify_at'];
$desin_planning_verify = $_POST['desin_planning_verify']; $desin_spec_verify_owner = isset($_POST['desin_spec_verify_owner']) ? $_POST['desin_spec_verify_owner'] : $row['desin_spec_verify_owner'];
$desin_planning_verify_at = $_POST['desin_planning_verify_at'] ?: $row['desin_planning_verify_at']; $desin_planning_verify = isset($_POST['desin_planning_verify']) ? $_POST['desin_planning_verify'] : $row['desin_planning_verify'];
$desin_planning_verify_owner = $_POST['desin_planning_verify_owner'] ?: $row['desin_planning_verify_owner']; $desin_planning_verify_at = isset($_POST['desin_planning_verify_at']) ? $_POST['desin_planning_verify_at'] : $row['desin_planning_verify_at'];
$desin_color_verify = $_POST['desin_color_verify']; $desin_planning_verify_owner = isset($_POST['desin_planning_verify_owner']) ? $_POST['desin_planning_verify_owner'] : $row['desin_planning_verify_owner'];
$desin_color_verify_at = $_POST['desin_color_verify_at'] ?: $row['desin_color_verify_at']; $desin_color_verify = isset($_POST['desin_color_verify']) ? $_POST['desin_color_verify'] : $row['desin_color_verify'];
$desin_color_verify_owner = $_POST['desin_color_verify_owner'] ?: $row['desin_color_verify_owner']; $desin_color_verify_at = isset($_POST['desin_color_verify_at']) ? $_POST['desin_color_verify_at'] : $row['desin_color_verify_at'];
$desin_style_verify = $_POST['desin_style_verify']; $desin_color_verify_owner = isset($_POST['desin_color_verify_owner']) ? $_POST['desin_color_verify_owner'] : $row['desin_color_verify_owner'];
$desin_style_verify_at = $_POST['desin_style_verify_at'] ?: $row['desin_style_verify_at']; $desin_style_verify = isset($_POST['desin_style_verify']) ? $_POST['desin_style_verify'] : $row['desin_style_verify'];
$desin_style_verify_owner = $_POST['desin_style_verify_owner'] ?: $row['desin_style_verify_owner']; $desin_style_verify_at = isset($_POST['desin_style_verify_at']) ? $_POST['desin_style_verify_at'] : $row['desin_style_verify_at'];
$desin_leader_verify = $_POST['desin_leader_verify']; $desin_style_verify_owner = isset($_POST['desin_style_verify_owner']) ? $_POST['desin_style_verify_owner'] : $row['desin_style_verify_owner'];
$desin_leader_verify_at = $_POST['desin_leader_verify_at'] ?: $row['desin_leader_verify_at']; $desin_leader_verify = isset($_POST['desin_leader_verify']) ? $_POST['desin_leader_verify'] : $row['desin_leader_verify'];
$desin_leader_verify_owner = $_POST['desin_leader_verify_owner'] ?: $row['desin_leader_verify_owner']; $desin_leader_verify_at = isset($_POST['desin_leader_verify_at']) ? $_POST['desin_leader_verify_at'] : $row['desin_leader_verify_at'];
$building_heigh_verify = $_POST['building_heigh_verify']; $desin_leader_verify_owner = isset($_POST['desin_leader_verify_owner']) ? $_POST['desin_leader_verify_owner'] : $row['desin_leader_verify_owner'];
$building_heigh_verify_at = $_POST['building_heigh_verify_at'] ?: $row['building_heigh_verify_at']; $building_heigh_verify = isset($_POST['building_heigh_verify']) ? $_POST['building_heigh_verify'] : $row['building_heigh_verify'];
$building_heigh_verify_owner = $_POST['building_heigh_verify_owner'] ?: $row['building_heigh_verify_owner']; $building_heigh_verify_at = isset($_POST['building_heigh_verify_at']) ? $_POST['building_heigh_verify_at'] : $row['building_heigh_verify_at'];
$site_survey_contact_verify = $_POST['site_survey_contact_verify']; $building_heigh_verify_owner = isset($_POST['building_heigh_verify_owner']) ? $_POST['building_heigh_verify_owner'] : $row['building_heigh_verify_owner'];
$site_survey_contact_verify_at = $_POST['site_survey_contact_verify_at'] ?: $row['site_survey_contact_verify_at']; $site_survey_contact_verify = isset($_POST['site_survey_contact_verify']) ? $_POST['site_survey_contact_verify'] : $row['site_survey_contact_verify'];
$site_survey_contact_verify_owner = $_POST['site_survey_contact_verify_owner'] ?: $row['site_survey_contact_verify_owner']; $site_survey_contact_verify_at = isset($_POST['site_survey_contact_verify_at']) ? $_POST['site_survey_contact_verify_at'] : $row['site_survey_contact_verify_at'];
$old_site_survey_contact_verify = $_POST['old_site_survey_contact_verify']; $site_survey_contact_verify_owner = isset($_POST['site_survey_contact_verify_owner']) ? $_POST['site_survey_contact_verify_owner'] : $row['site_survey_contact_verify_owner'];
$shengguanok_status = $_POST['shengguanok_status']; $old_site_survey_contact_verify = isset($_POST['old_site_survey_contact_verify']) ? $_POST['old_site_survey_contact_verify'] : $row['site_survey_contact_verify'];
$shengguanok_status_at = $_POST['shengguanok_status_at']; $shengguanok_status = isset($_POST['shengguanok_status']) ? $_POST['shengguanok_status'] : $row['shengguanok_status'];
$shengguanok_status_owner = $_POST['shengguanok_status_owner'] ?: $row['shengguanok_status_owner']; $shengguanok_status_at = isset($_POST['shengguanok_status_at']) ? $_POST['shengguanok_status_at'] : $row['shengguanok_status_at'];
$prattford_order_date_verify = $_POST['prattford_order_date_verify']; $shengguanok_status_owner = isset($_POST['shengguanok_status_owner']) ? $_POST['shengguanok_status_owner'] : $row['shengguanok_status_owner'];
$prattford_order_date = $_POST['prattford_order_date']; $prattford_order_date_verify = isset($_POST['prattford_order_date_verify']) ? $_POST['prattford_order_date_verify'] : $row['prattford_order_date_verify'];
$prattford_order_date_owner = $_POST['prattford_order_date_owner'] ?: $row['prattford_order_date_owner']; $prattford_order_date = isset($_POST['prattford_order_date']) ? $_POST['prattford_order_date'] : $row['prattford_order_date'];
$estimated_shipping_date_verify = $_POST['estimated_shipping_date_verify']; $prattford_order_date_owner = isset($_POST['prattford_order_date_owner']) ? $_POST['prattford_order_date_owner'] : $row['prattford_order_date_owner'];
$estimated_shipping_date = $_POST['estimated_shipping_date']; $estimated_shipping_date_verify = isset($_POST['estimated_shipping_date_verify']) ? $_POST['estimated_shipping_date_verify'] : $row['estimated_shipping_date_verify'];
$estimated_shipping_date_owner = $_POST['estimated_shipping_date_owner'] ?: $row['estimated_shipping_date_owner']; $estimated_shipping_date = isset($_POST['estimated_shipping_date']) ? $_POST['estimated_shipping_date'] : $row['estimated_shipping_date'];
$estimated_shipping_schedule_date_verify = $_POST['estimated_shipping_schedule_date_verify']; $estimated_shipping_date_owner = isset($_POST['estimated_shipping_date_owner']) ? $_POST['estimated_shipping_date_owner'] : $row['estimated_shipping_date_owner'];
$estimated_shipping_schedule_date = $_POST['estimated_shipping_schedule_date']; $estimated_shipping_schedule_date_verify = isset($_POST['estimated_shipping_schedule_date_verify']) ? $_POST['estimated_shipping_schedule_date_verify'] : $row['estimated_shipping_schedule_date_verify'];
$estimated_shipping_schedule_date_owner = $_POST['estimated_shipping_schedule_date_owner'] ?: $row['estimated_shipping_schedule_date_owner']; $estimated_shipping_schedule_date = isset($_POST['estimated_shipping_schedule_date']) ? $_POST['estimated_shipping_schedule_date'] : $row['estimated_shipping_schedule_date'];
$goods_type = $_POST['goods_type'] ?: $row['goods_type']; $estimated_shipping_schedule_date_owner = isset($_POST['estimated_shipping_schedule_date_owner']) ? $_POST['estimated_shipping_schedule_date_owner'] : $row['estimated_shipping_schedule_date_owner'];
$goods_type_date = $_POST['goods_type_date'] ?: $row['goods_type_date']; $goods_type = isset($_POST['goods_type']) ? $_POST['goods_type'] : $row['goods_type'];
$goods_type_owner = $_POST['goods_type_owner'] ?: $row['goods_type_owner']; $goods_type_date = isset($_POST['goods_type_date']) ? $_POST['goods_type_date'] : $row['goods_type_date'];
$taiwan_goods_type = $_POST['taiwan_goods_type'] ?: $row['taiwan_goods_type']; $goods_type_owner = isset($_POST['goods_type_owner']) ? $_POST['goods_type_owner'] : $row['goods_type_owner'];
$taiwan_goods_type_date = $_POST['taiwan_goods_type_date']; $taiwan_goods_type = isset($_POST['taiwan_goods_type']) ? $_POST['taiwan_goods_type'] : $row['taiwan_goods_type'];
$taiwan_goods_type_owner = $_POST['taiwan_goods_type_owner'] ?: $row['taiwan_goods_type_owner']; $taiwan_goods_type_date = isset($_POST['taiwan_goods_type_date']) ? $_POST['taiwan_goods_type_date'] : $row['taiwan_goods_type_date'];
$arrival_date_verify = $_POST['arrival_date_verify'] ?: $row['arrival_date_verify']; $taiwan_goods_type_owner = isset($_POST['taiwan_goods_type_owner']) ? $_POST['taiwan_goods_type_owner'] : $row['taiwan_goods_type_owner'];
$actual_tofactory_date = $_POST['actual_tofactory_date']; $arrival_date_verify = isset($_POST['arrival_date_verify']) ? $_POST['arrival_date_verify'] : $row['arrival_date_verify'];
$arrival_date_owner = $_POST['arrival_date_owner'] ?: $row['arrival_da $actual_tofactory_date = isset($_POST['actual_tofactory_date']) ? $_POST['actual_tofactory_date'] : $row['actual_tofactory_date'];
te_owner']; $arrival_date_owner = isset($_POST['arrival_date_owner']) ? $_POST['arrival_date_owner'] : $row['arrival_date_owner'];
$marketing_remark = $_POST['marketing_remark'] ?: $row['marketing_remark']; $marketing_remark = isset($_POST['marketing_remark']) ? $_POST['marketing_remark'] : $row['marketing_remark'];
$desin_remark = $_POST['desin_remark'] ?: $row['desin_remark']; $desin_remark = isset($_POST['desin_remark']) ? $_POST['desin_remark'] : $row['desin_remark'];
$desin_leader_remark = $_POST['desin_leader_remark'] ?: $row['desin_leader_remark']; $desin_leader_remark = isset($_POST['desin_leader_remark']) ? $_POST['desin_leader_remark'] : $row['desin_leader_remark'];
$warehouse_remark = $_POST['warehouse_remark'] ?: $row['warehouse_remark']; $warehouse_remark = isset($_POST['warehouse_remark']) ? $_POST['warehouse_remark'] : $row['warehouse_remark'];
$yewu_remark = $_POST['yewu_remark'] ?: $row['yewu_remark']; $yewu_remark = isset($_POST['yewu_remark']) ? $_POST['yewu_remark'] : $row['yewu_remark'];
$shengguan_remark = $_POST['shengguan_remark'] ?: $row['shengguan_remark']; $shengguan_remark = isset($_POST['shengguan_remark']) ? $_POST['shengguan_remark'] : $row['shengguan_remark'];
$desin_taiwan_items_no = json_encode($_POST['desin_taiwan_items_no'], JSON_UNESCAPED_UNICODE); $qc_date = isset($_POST['qc_date']) ? $_POST['qc_date'] : $row['qc_date'];
$desin_taiwan_items_name = json_encode($_POST['desin_taiwan_items_name'], JSON_UNESCAPED_UNICODE); $qc_date_owner = isset($_POST['qc_date_owner']) ? $_POST['qc_date_owner'] : $row['qc_date_owner'];
$end_qc_date = isset($_POST['end_qc_date']) ? $_POST['end_qc_date'] : $row['end_qc_date'];
$end_qc_date_owner = isset($_POST['end_qc_date_owner']) ? $_POST['end_qc_date_owner'] : $row['end_qc_date_owner'];
$official_check_date = isset($_POST['official_check_date']) ? $_POST['official_check_date'] : $row['official_check_date'];
$old_official_check_date = isset($_POST['old_official_check_date']) ? $_POST['old_official_check_date'] : $row['official_check_date'];
$official_check_date_owner = isset($_POST['official_check_date_owner']) ? $_POST['official_check_date_owner'] : $row['official_check_date_owner'];
$delivery_date = isset($_POST['delivery_date']) ? $_POST['delivery_date'] : $row['delivery_date'];
$old_delivery_date = isset($_POST['old_delivery_date']) ? $_POST['old_delivery_date'] : $row['delivery_date'];
$delivery_date_owner = isset($_POST['delivery_date_owner']) ? $_POST['delivery_date_owner'] : $row['delivery_date_owner'];
$qc_official_type = isset($_POST['qc_official_type']) ? $_POST['qc_official_type'] : $row['qc_official_type'];
$outsourcer_type = isset($_POST['outsourcer_type']) ? $_POST['outsourcer_type'] : $row['outsourcer_type'];
$install_outsourcer = isset($_POST['install_outsourcer']) ? $_POST['install_outsourcer'] : $row['install_outsourcer'];
$install_outsourcer_owner = isset($_POST['install_outsourcer_owner']) ? $_POST['install_outsourcer_owner'] : $row['install_outsourcer_owner'];
$install_outsourcer_date = isset($_POST['install_outsourcer_date']) ? $_POST['install_outsourcer_date'] : $row['install_outsourcer_date'];
$install_outsourcer_date_owner = isset($_POST['install_outsourcer_date_owner']) ? $_POST['install_outsourcer_date_owner'] : $row['install_outsourcer_date_owner'];
$estimate_install_start_date = isset($_POST['estimate_install_start_date']) ? $_POST['estimate_install_start_date'] : $row['estimate_install_start_date'];
$estimate_install_start_date_owner = isset($_POST['estimate_install_start_date_owner']) ? $_POST['estimate_install_start_date_owner'] : $row['estimate_install_start_date_owner'];
$estimate_install_end_date = isset($_POST['estimate_install_end_date']) ? $_POST['estimate_install_end_date'] : $row['estimate_install_end_date'];
$estimate_install_end_date_owner = isset($_POST['estimate_install_end_date_owner']) ? $_POST['estimate_install_end_date_owner'] : $row['estimate_install_end_date_owner'];
$tryrun_outsourcer = isset($_POST['tryrun_outsourcer']) ? $_POST['tryrun_outsourcer'] : $row['tryrun_outsourcer'];
$tryrun_outsourcer_owner = isset($_POST['tryrun_outsourcer_owner']) ? $_POST['tryrun_outsourcer_owner'] : $row['tryrun_outsourcer_owner'];
$tryrun_outsourcer_date = isset($_POST['tryrun_outsourcer_date']) ? $_POST['tryrun_outsourcer_date'] : $row['tryrun_outsourcer_date'];
$tryrun_outsourcer_date_owner = isset($_POST['tryrun_outsourcer_date_owner']) ? $_POST['tryrun_outsourcer_date_owner'] : $row['tryrun_outsourcer_date_owner'];
$estimate_tryrun_start_date = isset($_POST['estimate_tryrun_start_date']) ? $_POST['estimate_tryrun_start_date'] : $row['estimate_tryrun_start_date'];
$estimate_tryrun_start_date_owner = isset($_POST['estimate_tryrun_start_date_owner']) ? $_POST['estimate_tryrun_start_date_owner'] : $row['estimate_tryrun_start_date_owner'];
$estimate_tryrun_end_date = isset($_POST['estimate_tryrun_end_date']) ? $_POST['estimate_tryrun_end_date'] : $row['estimate_tryrun_end_date'];
$estimate_tryrun_end_date_owner = isset($_POST['estimate_tryrun_end_date_owner']) ? $_POST['estimate_tryrun_end_date_owner'] : $row['estimate_tryrun_end_date_owner'];
$warehouse_assistant_remark = isset($_POST['warehouse_assistant_remark']) ? $_POST['warehouse_assistant_remark'] : $row['warehouse_assistant_remark'];
$warehouseid = isset($_POST['warehouseid']) ? $_POST['warehouseid'] : $row['warehouseid'];
$old_warehouseid = isset($_POST['old_warehouseid']) ? $_POST['old_warehouseid'] : $row['warehouseid'];
$salesid = isset($_POST['salesid']) ? $_POST['salesid'] : $row['salesid'];
$install_start_date = isset($_POST['install_start_date']) ? $_POST['install_start_date'] : $row['install_start_date'];
$install_start_date_owner = isset($_POST['install_start_date_owner']) ? $_POST['install_start_date_owner'] : $row['install_start_date_owner'];
$install_end_date = isset($_POST['install_end_date']) ? $_POST['install_end_date'] : $row['install_end_date'];
$install_end_date_owner = isset($_POST['install_end_date_owner']) ? $_POST['install_end_date_owner'] : $row['install_end_date_owner'];
$tryrun_start_date = isset($_POST['tryrun_start_date']) ? $_POST['tryrun_start_date'] : $row['tryrun_start_date'];
$tryrun_start_date_owner = isset($_POST['tryrun_start_date_owner']) ? $_POST['tryrun_start_date_owner'] : $row['tryrun_start_date_owner'];
$tryrun_end_date = isset($_POST['tryrun_end_date']) ? $_POST['tryrun_end_date'] : $row['tryrun_end_date'];
$old_tryrun_end_date = isset($_POST['old_tryrun_end_date']) ? $_POST['old_tryrun_end_date'] : $row['tryrun_end_date'];
$tryrun_end_date_owner = isset($_POST['tryrun_end_date_owner']) ? $_POST['tryrun_end_date_owner'] : $row['tryrun_end_date_owner'];
$association_check_type = isset($_POST['association_check_type']) ? $_POST['association_check_type'] : $row['association_check_type'];
$old_delivery_date_file = isset($_POST['old_delivery_date_file']) ? $_POST['old_delivery_date_file'] : $row['delivery_date_file'];
$desin_taiwan_items_no = isset($_POST['desin_taiwan_items_no']) ? $_POST['desin_taiwan_items_no'] : "";
$desin_taiwan_items_name = isset($_POST['desin_taiwan_items_name']) ? $_POST['desin_taiwan_items_name'] : "";
$desin_taiwan_items_no = json_encode($desin_taiwan_items_no, JSON_UNESCAPED_UNICODE);
$desin_taiwan_items_name = json_encode($desin_taiwan_items_name, JSON_UNESCAPED_UNICODE);
$desin_taiwan_items_no = $desin_taiwan_items_no == 'null' ? null : $desin_taiwan_items_no; $desin_taiwan_items_no = $desin_taiwan_items_no == 'null' ? null : $desin_taiwan_items_no;
$desin_taiwan_items_name = $desin_taiwan_items_name == 'null' ? null : $desin_taiwan_items_name; $desin_taiwan_items_name = $desin_taiwan_items_name == 'null' ? null : $desin_taiwan_items_name;
$qc_date = $_POST['qc_date'] ?: $row['qc_date'];
$qc_date_owner = $_POST['qc_date_owner'] ?: $row['qc_date_owner'];
$end_qc_date = $_POST['end_qc_date'] ?: $row['end_qc_date'];
$end_qc_date_owner = $_POST['end_qc_date_owner'] ?: $row['end_qc_date_owner'];
$official_check_date = $_POST['official_check_date'] ?: $row['official_check_date'];
$old_official_check_date = $_POST['old_official_check_date'] ?: $row['old_official_check_date'];
$official_check_date_owner = $_POST['official_check_date_owner'] ?: $row['official_check_date_owner'];
$delivery_date = $_POST['delivery_date'] ?: $row['delivery_date'];
$old_delivery_date = $_POST['old_delivery_date'] ?: $row['old_delivery_date'];
$delivery_date_owner = $_POST['delivery_date_owner'] ?: $row['delivery_date_owner'];
$qc_official_type = $_POST['qc_official_type'] ?: $row['qc_official_type'];
$outsourcer_type = $_POST['outsourcer_type'];
$install_outsourcer = $_POST['install_outsourcer'];
$install_outsourcer_owner = $_POST['install_outsourcer_owner'];
$install_outsourcer_date = $_POST['install_outsourcer_date'];
$install_outsourcer_date_owner = $_POST['install_outsourcer_date_owner'];
$estimate_install_start_date = $_POST['estimate_install_start_date'];
$estimate_install_start_date_owner = $_POST['estimate_install_start_date_owner'];
$estimate_install_end_date = $_POST['estimate_install_end_date'];
$estimate_install_end_date_owner = $_POST['estimate_install_end_date_owner'];
$tryrun_outsourcer = $_POST['tryrun_outsourcer'];
$tryrun_outsourcer_owner = $_POST['tryrun_outsourcer_owner'];
$tryrun_outsourcer_date = $_POST['tryrun_outsourcer_date'];
$tryrun_outsourcer_date_owner = $_POST['tryrun_outsourcer_date_owner'];
$estimate_tryrun_start_date = $_POST['estimate_tryrun_start_date'];
$estimate_tryrun_start_date_owner = $_POST['estimate_tryrun_start_date_owner'];
$estimate_tryrun_end_date = $_POST['estimate_tryrun_end_date'];
$estimate_tryrun_end_date_owner = $_POST['estimate_tryrun_end_date_owner'];
$warehouse_assistant_remark = $_POST['warehouse_assistant_remark'];
$warehouseid = $_POST['warehouseid'] ?: $row['warehouseid'];
$old_warehouseid = $_POST['old_warehouseid'] ?: $row['warehouseid'];
$salesid = $_POST['salesid'] ?: $row['salesid'];
$install_start_date = $_POST['install_start_date'];
$install_start_date_owner = $_POST['install_start_date_owner'];
$install_end_date = $_POST['install_end_date'];
$install_end_date_owner = $_POST['install_end_date_owner'];
$tryrun_start_date = $_POST['tryrun_start_date'];
$tryrun_start_date_owner = $_POST['tryrun_start_date_owner'];
$tryrun_end_date = $_POST['tryrun_end_date'];
$old_tryrun_end_date = $_POST['old_tryrun_end_date'];
$tryrun_end_date_owner = $_POST['tryrun_end_date_owner'];
$association_check_type = $_POST['association_check_type'];
$old_delivery_date_file = $_POST['old_delivery_date_file'];
$salesname = accountid2name($salesid)[$salesid]; $salesname = accountid2name($salesid)[$salesid];
$salesmail = accountid2email([$salesid])[$salesid]; $salesmail = accountid2email([$salesid])[$salesid];
// $creater = $_POST['creater'];
$creater = $user_id; $creater = $user_id;
$create_at = date("Y-m-d H:i:s"); $create_at = date("Y-m-d H:i:s");
@ -355,7 +357,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$end_qc_date = isset($_POST['end_qc_date2']) ? $_POST['end_qc_date2'] : $end_qc_date; $end_qc_date = isset($_POST['end_qc_date2']) ? $_POST['end_qc_date2'] : $end_qc_date;
$end_qc_date_owner = isset($_POST['end_qc_date2_owner']) ? $_POST['end_qc_date2_owner'] : $end_qc_date_owner; $end_qc_date_owner = isset($_POST['end_qc_date2_owner']) ? $_POST['end_qc_date2_owner'] : $end_qc_date_owner;
$official_check_date = isset($_POST['official_check_date2']) ? $_POST['official_check_date2'] : $official_check_date; $official_check_date = isset($_POST['official_check_date2']) ? $_POST['official_check_date2'] : $official_check_date;
$old_official_check_date = isset($_POST['old_official_check_date2']) ? $_POST['old_official_check_date2'] : $old_official_check_date; $old_official_check_date = isset($_POST['old_official_check_date2']) ? $_POST['official_check_date'] : $old_official_check_date;
$official_check_date_owner = isset($_POST['official_check_date2_owner']) ? $_POST['official_check_date2_owner'] : $official_check_date_owner; $official_check_date_owner = isset($_POST['official_check_date2_owner']) ? $_POST['official_check_date2_owner'] : $official_check_date_owner;
$delivery_date = isset($_POST['delivery_date2']) ? $_POST['delivery_date2'] : $delivery_date; $delivery_date = isset($_POST['delivery_date2']) ? $_POST['delivery_date2'] : $delivery_date;
@ -697,9 +699,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
} }
// 當試車完工日更改時 發出通知 // 當試車完工日更改時 發出通知
if (!empty($tryrun_end_date) || !empty($tryrun_end_date2)) { if (!empty($tryrun_end_date)) {
if ($tryrun_end_date !== $old_tryrun_end_date || $tryrun_end_date2 !== $old_tryrun_end_date) { if ($tryrun_end_date !== $old_tryrun_end_date) {
$tryrun_end_date_tmp = $tryrun_end_date !== $old_tryrun_end_date ? $tryrun_end_date : $tryrun_end_date2;
$mail_title = "作番大日程(新梯)合約號:" . $contractno . "作番號:" . $facilityno . "客戶名稱:" . $custom . "-試車已完成通知"; $mail_title = "作番大日程(新梯)合約號:" . $contractno . "作番號:" . $facilityno . "客戶名稱:" . $custom . "-試車已完成通知";
$mail_content = "作番大日程(新梯) $mail_content = "作番大日程(新梯)
合約號:" . $contractno . " 合約號:" . $contractno . "
@ -717,7 +718,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
[ [
accountid2name(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)], accountid2name(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)],
accountid2email(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)] accountid2email(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)]
] ],
['張崇傑', 'jaychang@masada.com.tw'],
['賴定國', 'guo@masada.com.tw']
// ['gary', 'gary_chen@masada.com.tw'] // ['gary', 'gary_chen@masada.com.tw']
], ],
"永佳捷科技" "永佳捷科技"

4
wms/wipwhole-rec-invoice-edit.php

@ -567,6 +567,10 @@ include "wipwhole-rec-invoice-edit-submit.php";
<button onclick="savedata()" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;" <?= $marketing2; ?>>存檔</button> <button onclick="savedata()" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;" <?= $marketing2; ?>>存檔</button>
<span class="text-danger pull-right">若無工勘資料請勿移交至設計階段!</span> <span class="text-danger pull-right">若無工勘資料請勿移交至設計階段!</span>
<?php <?php
} else {
?>
<button onclick="savedata()" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;" <?= $marketing2; ?>>存檔</button>
<?php
} }
?> ?>
</td> </td>

8
wms/wipwhole-renovate-index-export-excel.php

@ -123,7 +123,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
'台灣自理項目(發貨類別)', '台灣自理項目(發貨類別)',
'台灣自理項目(發貨類別)日期', '台灣自理項目(發貨類別)日期',
'實際到貨日(到觀音廠日)', '實際到貨日(到觀音廠日)',
'實際到貨日(到觀音廠日)日期' '實際到貨日(到觀音廠日)日期',
'安裝圖上傳狀態',
'完工驗收單上傳狀態',
'移交日附件(核准函)上傳狀態'
]; ];
$sheet->setTitle('作番大日程(汰改)'); $sheet->setTitle('作番大日程(汰改)');
for ($i = 0; $i < count($colArr); $i++) { for ($i = 0; $i < count($colArr); $i++) {
@ -348,6 +351,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
substr($row['taiwan_goods_type_date'], 0, 10), substr($row['taiwan_goods_type_date'], 0, 10),
$arrival_date_verify_status, $arrival_date_verify_status,
substr($row['actual_tofactory_date'], 0, 10), substr($row['actual_tofactory_date'], 0, 10),
empty($row['plan_diagram_file']) ? "無" : "已上傳",
empty($row['completion_acceptance_file']) ? "無" : "已上傳",
empty($row['delivery_date_file']) ? "無" : "已上傳"
]; ];
for ($j = 0; $j < count($colContentArr); $j++) for ($j = 0; $j < count($colContentArr); $j++)
$sheet->setCellValue($colArr[$j] . $i, $colContentArr[$j]); $sheet->setCellValue($colArr[$j] . $i, $colContentArr[$j]);

27
wms/wipwhole-renovate-index-function.php

@ -298,7 +298,8 @@ function getWipwholeSearchSql()
$area_no = empty($_REQUEST['area_no']) ? null : trim($_REQUEST['area_no']); $area_no = empty($_REQUEST['area_no']) ? null : trim($_REQUEST['area_no']);
$sql = ""; $sql = "";
$sql .= empty($area_no) ? "" : " AND SUBSTR(address,1,2) IN (" . $area[$area_no] . ") "; $sql .= empty($area_no) ? "" : " AND area_no = '$area_no' ";
// $sql .= empty($area_no) ? "" : " AND SUBSTR(address,1,2) IN (" . $area[$area_no] . ") ";
$sql .= empty($contractno) ? "" : " AND contractno LIKE '%$contractno%' "; $sql .= empty($contractno) ? "" : " AND contractno LIKE '%$contractno%' ";
$sql .= empty($facilityno) ? "" : " AND facilityno LIKE '%$facilityno%' "; $sql .= empty($facilityno) ? "" : " AND facilityno LIKE '%$facilityno%' ";
$sql .= empty($custom) ? "" : " AND custom LIKE '%$custom%' "; $sql .= empty($custom) ? "" : " AND custom LIKE '%$custom%' ";
@ -544,7 +545,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('宜蘭') AND area_no = 'Y'
-- AND SUBSTR(address,1,2) in ('宜蘭')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -557,7 +559,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹') AND area_no IN ('N','T')
-- AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -570,7 +573,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗') AND area_no = 'C'
-- AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -583,7 +587,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄') AND area_no = 'K'
-- AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -822,7 +827,8 @@ function getDataSqlByflowCode($department_id, $role_id, $user_id, $flow_code)
AND flow_code IN ('$flow_code') AND flow_code IN ('$flow_code')
) )
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('宜蘭') AND area_no = 'Y'
-- AND SUBSTR(address,1,2) in ('宜蘭')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -843,7 +849,8 @@ function getDataSqlByflowCode($department_id, $role_id, $user_id, $flow_code)
AND flow_code IN ('$flow_code') AND flow_code IN ('$flow_code')
) )
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹') AND area_no IN ('N','T')
-- AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -864,7 +871,8 @@ function getDataSqlByflowCode($department_id, $role_id, $user_id, $flow_code)
AND flow_code IN ('$flow_code') AND flow_code IN ('$flow_code')
) )
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗') AND area_no = 'C'
-- AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -885,7 +893,8 @@ function getDataSqlByflowCode($department_id, $role_id, $user_id, $flow_code)
AND flow_code IN ('$flow_code') AND flow_code IN ('$flow_code')
) )
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄') AND area_no = 'K'
-- AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;

253
wms/wipwhole-renovate-rec-invoice-edit-submit.php

@ -13,135 +13,136 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$datetime = date("Y-m-d H:i:s"); $datetime = date("Y-m-d H:i:s");
$create_at = date("Y-m-d H:i:s"); $create_at = date("Y-m-d H:i:s");
$contractno = $_POST['contractno']; $contractno = isset($_POST['contractno']) ? $_POST['contractno'] : $row['contractno'];
$facility_temp_no = $_POST['facility_temp_no']; $facility_temp_no = isset($_POST['facility_temp_no']) ? $_POST['facility_temp_no'] : $row['facility_temp_no'];
$facilityno = isset($_POST['facilityno']) ? $_POST['facilityno'] : $row['facilityno'];
$custom = isset($_POST['custom']) ? $_POST['custom'] : $row['custom'];
$site_manager = isset($_POST['site_manager']) ? $_POST['site_manager'] : $row['site_manager'];
$latitude = isset($_POST['latitude']) ? $_POST['latitude'] : $row['latitude'];
$longitude = isset($_POST['longitude']) ? $_POST['longitude'] : $row['longitude'];
$weight = isset($_POST['weight']) ? $_POST['weight'] : $row['weight'];
$numberofpassenger = isset($_POST['numberofpassenger']) ? $_POST['numberofpassenger'] : $row['numberofpassenger'];
$numberofstop = isset($_POST['numberofstop']) ? $_POST['numberofstop'] : $row['numberofstop'];
$numberoffloor = isset($_POST['numberoffloor']) ? $_POST['numberoffloor'] : $row['numberoffloor'];
$opentype = isset($_POST['opentype']) ? $_POST['opentype'] : $row['opentype'];
$speed = isset($_POST['speed']) ? $_POST['speed'] : $row['speed'];
$facility_kind = isset($_POST['facility_kind']) ? $_POST['facility_kind'] : $row['facility_kind'];
$address = isset($_POST['address']) ? $_POST['address'] : $row['address'];
$real_address = isset($_POST['real_address']) ? $_POST['real_address'] : $row['real_address'];
$contract_arrival_date = isset($_POST['contract_arrival_date']) ? $_POST['contract_arrival_date'] : $row['contract_arrival_date'];;
$real_contract_arrival_date = isset($_POST['real_contract_arrival_date']) ? $_POST['real_contract_arrival_date'] : $row['real_contract_arrival_date'];
$sales_spec_verify = isset($_POST['sales_spec_verify']) ? $_POST['sales_spec_verify'] : $row['sales_spec_verify'];
$sales_spec_verify_at = isset($_POST['sales_spec_verify_at']) ? $_POST['sales_spec_verify_at'] : $row['sales_spec_verify_at'];
$sales_spec_verify_owner = isset($_POST['sales_spec_verify_owner']) ? $_POST['sales_spec_verify_owner'] : $row['sales_spec_verify_owner'];
$customer_color_verify = isset($_POST['customer_color_verify']) ? $_POST['customer_color_verify'] : $row['customer_color_verify'];
$customer_color_verify_at = isset($_POST['customer_color_verify_at']) ? $_POST['customer_color_verify_at'] : $row['customer_color_verify_at'];
$customer_color_verify_owner = isset($_POST['customer_color_verify_owner']) ? $_POST['customer_color_verify_owner'] : $row['customer_color_verify_owner'];
$customer_style_verify = isset($_POST['customer_style_verify']) ? $_POST['customer_style_verify'] : $row['customer_style_verify'];
$customer_style_verify_at = isset($_POST['customer_style_verify_at']) ? $_POST['customer_style_verify_at'] : $row['customer_style_verify_at'];
$customer_style_verify_owner = isset($_POST['customer_style_verify_owner']) ? $_POST['customer_style_verify_owner'] : $row['customer_style_verify_owner'];
$site_survey_contact_form_verify = isset($_POST['site_survey_contact_form_verify']) ? $_POST['site_survey_contact_form_verify'] : $row['site_survey_contact_form_verify'];
$site_survey_contact_form_verify_at = isset($_POST['site_survey_contact_form_verify_at']) ? $_POST['site_survey_contact_form_verify_at'] : $row['site_survey_contact_form_verify_at'];
$site_survey_contact_form_verify_owner = isset($_POST['site_survey_contact_form_verify_owner']) ? $_POST['site_survey_contact_form_verify_owner'] : $row['site_survey_contact_form_verify_owner'];
$desin_spec_verify = isset($_POST['desin_spec_verify']) ? $_POST['desin_spec_verify'] : $row['desin_spec_verify'];
$desin_spec_verify_at = isset($_POST['desin_spec_verify_at']) ? $_POST['desin_spec_verify_at'] : $row['desin_spec_verify_at'];
$desin_spec_verify_owner = isset($_POST['desin_spec_verify_owner']) ? $_POST['desin_spec_verify_owner'] : $row['desin_spec_verify_owner'];
$desin_planning_verify = isset($_POST['desin_planning_verify']) ? $_POST['desin_planning_verify'] : $row['desin_planning_verify'];
$desin_planning_verify_at = isset($_POST['desin_planning_verify_at']) ? $_POST['desin_planning_verify_at'] : $row['desin_planning_verify_at'];
$desin_planning_verify_owner = isset($_POST['desin_planning_verify_owner']) ? $_POST['desin_planning_verify_owner'] : $row['desin_planning_verify_owner'];
$desin_color_verify = isset($_POST['desin_color_verify']) ? $_POST['desin_color_verify'] : $row['desin_color_verify'];
$desin_color_verify_at = isset($_POST['desin_color_verify_at']) ? $_POST['desin_color_verify_at'] : $row['desin_color_verify_at'];
$desin_color_verify_owner = isset($_POST['desin_color_verify_owner']) ? $_POST['desin_color_verify_owner'] : $row['desin_color_verify_owner'];
$desin_style_verify = isset($_POST['desin_style_verify']) ? $_POST['desin_style_verify'] : $row['desin_style_verify'];
$desin_style_verify_at = isset($_POST['desin_style_verify_at']) ? $_POST['desin_style_verify_at'] : $row['desin_style_verify_at'];
$desin_style_verify_owner = isset($_POST['desin_style_verify_owner']) ? $_POST['desin_style_verify_owner'] : $row['desin_style_verify_owner'];
$desin_leader_verify = isset($_POST['desin_leader_verify']) ? $_POST['desin_leader_verify'] : $row['desin_leader_verify'];
$desin_leader_verify_at = isset($_POST['desin_leader_verify_at']) ? $_POST['desin_leader_verify_at'] : $row['desin_leader_verify_at'];
$desin_leader_verify_owner = isset($_POST['desin_leader_verify_owner']) ? $_POST['desin_leader_verify_owner'] : $row['desin_leader_verify_owner'];
$building_heigh_verify = isset($_POST['building_heigh_verify']) ? $_POST['building_heigh_verify'] : $row['building_heigh_verify'];
$building_heigh_verify_at = isset($_POST['building_heigh_verify_at']) ? $_POST['building_heigh_verify_at'] : $row['building_heigh_verify_at'];
$building_heigh_verify_owner = isset($_POST['building_heigh_verify_owner']) ? $_POST['building_heigh_verify_owner'] : $row['building_heigh_verify_owner'];
$customer_planning_verify = isset($_POST['customer_planning_verify']) ? $_POST['customer_planning_verify'] : $row['customer_planning_verify'];
$customer_planning_verify_at = isset($_POST['customer_planning_verify_at']) ? $_POST['customer_planning_verify_at'] : $row['customer_planning_verify_at'];
$customer_planning_verify_owner = isset($_POST['customer_planning_verify_owner']) ? $_POST['customer_planning_verify_owner'] : $row['customer_planning_verify_owner'];
$site_survey_contact_verify = isset($_POST['site_survey_contact_verify']) ? $_POST['site_survey_contact_verify'] : $row['site_survey_contact_verify'];
$site_survey_contact_verify_at = isset($_POST['site_survey_contact_verify_at']) ? $_POST['site_survey_contact_verify_at'] : $row['site_survey_contact_verify_at'];
$site_survey_contact_verify_owner = isset($_POST['site_survey_contact_verify_owner']) ? $_POST['site_survey_contact_verify_owner'] : $row['site_survey_contact_verify_owner'];
$old_site_survey_contact_verify = isset($_POST['old_site_survey_contact_verify']) ? $_POST['old_site_survey_contact_verify'] : $row['site_survey_contact_verify_owner'];
$outsourcer_type = isset($_POST['outsourcer_type']) ? $_POST['outsourcer_type'] : $row['outsourcer_type'];
$install_outsourcer = isset($_POST['install_outsourcer']) ? $_POST['install_outsourcer'] : $row['install_outsourcer'];
$install_outsourcer_owner = isset($_POST['install_outsourcer_owner']) ? $_POST['install_outsourcer_owner'] : $row['install_outsourcer_owner'];
$install_outsourcer_date = isset($_POST['install_outsourcer_date']) ? $_POST['install_outsourcer_date'] : $row['install_outsourcer_date'];
$install_outsourcer_date_owner = isset($_POST['install_outsourcer_date_owner']) ? $_POST['install_outsourcer_date_owner'] : $row['install_outsourcer_date_owner'];
$estimate_install_start_date = isset($_POST['estimate_install_start_date']) ? $_POST['estimate_install_start_date'] : $row['estimate_install_start_date'];
$estimate_install_start_date_owner = isset($_POST['estimate_install_start_date_owner']) ? $_POST['estimate_install_start_date_owner'] : $row['estimate_install_start_date_owner'];
$estimate_install_end_date = isset($_POST['estimate_install_end_date']) ? $_POST['estimate_install_end_date'] : $row['estimate_install_end_date'];
$estimate_install_end_date_owner = isset($_POST['estimate_install_end_date_owner']) ? $_POST['estimate_install_end_date_owner'] : $row['estimate_install_end_date_owner'];
$tryrun_outsourcer = isset($_POST['tryrun_outsourcer']) ? $_POST['tryrun_outsourcer'] : $row['tryrun_outsourcer'];
$tryrun_outsourcer_owner = isset($_POST['tryrun_outsourcer_owner']) ? $_POST['tryrun_outsourcer_owner'] : $row['tryrun_outsourcer_owner'];
$tryrun_outsourcer_date = isset($_POST['tryrun_outsourcer_date']) ? $_POST['tryrun_outsourcer_date'] : $row['tryrun_outsourcer_date'];
$tryrun_outsourcer_date_owner = isset($_POST['tryrun_outsourcer_date_owner']) ? $_POST['tryrun_outsourcer_date_owner'] : $row['tryrun_outsourcer_date_owner'];
$estimate_tryrun_start_date = isset($_POST['estimate_tryrun_start_date']) ? $_POST['estimate_tryrun_start_date'] : $row['estimate_tryrun_start_date'];
$estimate_tryrun_start_date_owner = isset($_POST['estimate_tryrun_start_date_owner']) ? $_POST['estimate_tryrun_start_date_owner'] : $row['estimate_tryrun_start_date_owner'];
$estimate_tryrun_end_date = isset($_POST['estimate_tryrun_end_date']) ? $_POST['estimate_tryrun_end_date'] : $row['estimate_tryrun_end_date'];
$estimate_tryrun_end_date_owner = isset($_POST['estimate_tryrun_end_date_owner']) ? $_POST['estimate_tryrun_end_date_owner'] : $row['estimate_tryrun_end_date_owner'];
$warehouse_assistant_remark = isset($_POST['warehouse_assistant_remark']) ? $_POST['warehouse_assistant_remark'] : $row['warehouse_assistant_remark'];
$shengguanok_status = isset($_POST['shengguanok_status']) ? $_POST['shengguanok_status'] : $row['shengguanok_status'];
$shengguanok_status_at = isset($_POST['shengguanok_status_at']) ? $_POST['shengguanok_status_at'] : $row['shengguanok_status_at'];
$shengguanok_status_owner = isset($_POST['shengguanok_status_owner']) ? $_POST['shengguanok_status_owner'] : $row['shengguanok_status_owner'];
$prattford_order_date_verify = isset($_POST['prattford_order_date_verify']) ? $_POST['prattford_order_date_verify'] : $row['prattford_order_date_verify'];
$prattford_order_date = isset($_POST['prattford_order_date']) ? $_POST['prattford_order_date'] : $row['prattford_order_date'];
$prattford_order_date_owner = isset($_POST['prattford_order_date_owner']) ? $_POST['prattford_order_date_owner'] : $row['prattford_order_date_owner'];
$estimated_shipping_date_verify = isset($_POST['estimated_shipping_date_verify']) ? $_POST['estimated_shipping_date_verify'] : $row['estimated_shipping_date_verify'];
$estimated_shipping_date = isset($_POST['estimated_shipping_date']) ? $_POST['estimated_shipping_date'] : $row['estimated_shipping_date'];
$estimated_shipping_date_owner = isset($_POST['estimated_shipping_date_owner']) ? $_POST['estimated_shipping_date_owner'] : $row['estimated_shipping_date_owner'];
$estimated_shipping_schedule_date_verify = isset($_POST['estimated_shipping_schedule_date_verify']) ? $_POST['estimated_shipping_schedule_date_verify'] : $row['estimated_shipping_schedule_date_verify'];
$estimated_shipping_schedule_date = isset($_POST['estimated_shipping_schedule_date']) ? $_POST['estimated_shipping_schedule_date'] : $row['estimated_shipping_schedule_date'];
$estimated_shipping_schedule_date_owner = isset($_POST['estimated_shipping_schedule_date_owner']) ? $_POST['estimated_shipping_schedule_date_owner'] : $row['estimated_shipping_schedule_date_owner'];
$goods_type = isset($_POST['goods_type']) ? $_POST['goods_type'] : $row['goods_type'];
$goods_type_date = isset($_POST['goods_type_date']) ? $_POST['goods_type_date'] : $row['goods_type_date'];
$goods_type_owner = isset($_POST['goods_type_owner']) ? $_POST['goods_type_owner'] : $row['goods_type_owner'];
$taiwan_goods_type = isset($_POST['taiwan_goods_type']) ? $_POST['taiwan_goods_type'] : $row['taiwan_goods_type'];
$taiwan_goods_type_date = isset($_POST['taiwan_goods_type_date']) ? $_POST['taiwan_goods_type_date'] : $row['taiwan_goods_type_date'];
$taiwan_goods_type_owner = isset($_POST['taiwan_goods_type_owner']) ? $_POST['taiwan_goods_type_owner'] : $row['taiwan_goods_type_owner'];
$arrival_date_verify = isset($_POST['arrival_date_verify']) ? $_POST['arrival_date_verify'] : $row['arrival_date_verify'];
$actual_tofactory_date = isset($_POST['actual_tofactory_date']) ? $_POST['actual_tofactory_date'] : $row['actual_tofactory_date'];
$arrival_date_owner = isset($_POST['arrival_date_owner']) ? $_POST['arrival_date_owner'] : $row['arrival_date_owner'];
$marketing_remark = isset($_POST['marketing_remark']) ? $_POST['marketing_remark'] : $row['marketing_remark'];
$desin_remark = isset($_POST['desin_remark']) ? $_POST['desin_remark'] : $row['desin_remark'];
$desin_leader_remark = isset($_POST['desin_leader_remark']) ? $_POST['desin_leader_remark'] : $row['desin_leader_remark'];
$warehouse_remark = isset($_POST['warehouse_remark']) ? $_POST['warehouse_remark'] : $row['warehouse_remark'];
$yewu_remark = isset($_POST['yewu_remark']) ? $_POST['yewu_remark'] : $row['yewu_remark'];
$shengguan_remark = isset($_POST['shengguan_remark']) ? $_POST['shengguan_remark'] : $row['shengguan_remark'];
$qc_date = isset($_POST['qc_date']) ? $_POST['qc_date'] : $row['qc_date'];
$qc_date_owner = isset($_POST['qc_date_owner']) ? $_POST['qc_date_owner'] : $row['qc_date_owner'];
$end_qc_date = isset($_POST['end_qc_date']) ? $_POST['end_qc_date'] : $row['end_qc_date'];
$end_qc_date_owner = isset($_POST['end_qc_date_owner']) ? $_POST['end_qc_date_owner'] : $row['end_qc_date_owner'];
$official_check_date = isset($_POST['official_check_date']) ? $_POST['official_check_date'] : $row['official_check_date'];
$old_official_check_date = isset($_POST['old_official_check_date']) ? $_POST['old_official_check_date'] : $row['official_check_date'];
$official_check_date_owner = isset($_POST['official_check_date_owner']) ? $_POST['official_check_date_owner'] : $row['official_check_date_owner'];
$delivery_date = isset($_POST['delivery_date']) ? $_POST['delivery_date'] : $row['delivery_date'];
$old_delivery_date = isset($_POST['old_delivery_date']) ? $_POST['old_delivery_date'] : $row['delivery_date'];
$delivery_date_owner = isset($_POST['delivery_date_owner']) ? $_POST['delivery_date_owner'] : $row['delivery_date_owner'];
$salesid = isset($_POST['salesid']) ? $_POST['salesid'] : $row['salesid'];
$warehouseid = isset($_POST['warehouseid']) ? $_POST['warehouseid'] : $row['warehouseid'];
$old_warehouseid = isset($_POST['old_warehouseid']) ? $_POST['old_warehouseid'] : $row['warehouseid'];
$association_check_type = isset($_POST['association_check_type']) ? $_POST['association_check_type'] : $row['association_check_type'];
$install_start_date = isset($_POST['install_start_date']) ? $_POST['install_start_date'] : $row['install_start_date'];
$install_start_date_owner = isset($_POST['install_start_date_owner']) ? $_POST['install_start_date_owner'] : $row['install_start_date_owner'];
$install_end_date = isset($_POST['install_end_date']) ? $_POST['install_end_date'] : $row['install_end_date'];
$install_end_date_owner = isset($_POST['install_end_date_owner']) ? $_POST['install_end_date_owner'] : $row['install_end_date_owner'];
$tryrun_start_date = isset($_POST['tryrun_start_date']) ? $_POST['tryrun_start_date'] : $row['tryrun_start_date'];
$tryrun_start_date_owner = isset($_POST['tryrun_start_date_owner']) ? $_POST['tryrun_start_date_owner'] : $row['tryrun_start_date_owner'];
$tryrun_end_date = isset($_POST['tryrun_end_date']) ? $_POST['tryrun_end_date'] : $row['tryrun_end_date'];
$old_tryrun_end_date = isset($_POST['old_tryrun_end_date']) ? $_POST['old_tryrun_end_date'] : $row['tryrun_end_date'];
$tryrun_end_date_owner = isset($_POST['tryrun_end_date_owner']) ? $_POST['tryrun_end_date_owner'] : $row['tryrun_end_date_owner'];
$old_delivery_date_file = isset($_POST['old_delivery_date_file']) ? $_POST['old_delivery_date_file'] : $row['delivery_date_file'];
$renovate_type = json_encode($_POST['renovate_type'], JSON_UNESCAPED_UNICODE); $renovate_type = json_encode($_POST['renovate_type'], JSON_UNESCAPED_UNICODE);
$facilityno = $_POST['facilityno'];
$custom = $_POST['custom'];
$site_manager = $_POST['site_manager'];
$latitude = $_POST['latitude'];
$longitude = $_POST['longitude'];
$weight = $_POST['weight'];
$numberofpassenger = $_POST['numberofpassenger'];
$numberofstop = $_POST['numberofstop'];
$numberoffloor = $_POST['numberoffloor'];
$opentype = $_POST['opentype'];
$speed = $_POST['speed'];
$facility_kind = $_POST['facility_kind'];
$address = $_POST['address'];
$real_address = $_POST['real_address'];
$contract_arrival_date = $_POST['contract_arrival_date'];
$real_contract_arrival_date = $_POST['real_contract_arrival_date'];
$sales_spec_verify = $_POST['sales_spec_verify'];
$sales_spec_verify_at = $_POST['sales_spec_verify_at'] ?: $row['sales_spec_verify_at'];
$sales_spec_verify_owner = $_POST['sales_spec_verify_owner'] ?: $row['sales_spec_verify_owner'];
$customer_color_verify = $_POST['customer_color_verify'];
$customer_color_verify_at = $_POST['customer_color_verify_at'] ?: $row['customer_color_verify_at'];
$customer_color_verify_owner = $_POST['customer_color_verify_owner'] ?: $row['customer_color_verify_owner'];
$customer_style_verify = $_POST['customer_style_verify'];
$customer_style_verify_at = $_POST['customer_style_verify_at'] ?: $row['customer_style_verify_at'];
$customer_style_verify_owner = $_POST['customer_style_verify_owner'] ?: $row['customer_style_verify_owner'];
$site_survey_contact_form_verify = $_POST['site_survey_contact_form_verify'];
$site_survey_contact_form_verify_at = $_POST['site_survey_contact_form_verify_at'] ?: $row['site_survey_contact_form_verify_at'];
$site_survey_contact_form_verify_owner = $_POST['site_survey_contact_form_verify_owner'] ?: $row['site_survey_contact_form_verify_owner'];
$desin_spec_verify = $_POST['desin_spec_verify'];
$desin_spec_verify_at = $_POST['desin_spec_verify_at'] ?: $row['desin_spec_verify_at'];
$desin_spec_verify_owner = $_POST['desin_spec_verify_owner'] ?: $row['desin_spec_verify_owner'];
$desin_planning_verify = $_POST['desin_planning_verify'];
$desin_planning_verify_at = $_POST['desin_planning_verify_at'] ?: $row['desin_planning_verify_at'];
$desin_planning_verify_owner = $_POST['desin_planning_verify_owner'] ?: $row['desin_planning_verify_owner'];
$desin_color_verify = $_POST['desin_color_verify'];
$desin_color_verify_at = $_POST['desin_color_verify_at'] ?: $row['desin_color_verify_at'];
$desin_color_verify_owner = $_POST['desin_color_verify_owner'] ?: $row['desin_color_verify_owner'];
$desin_style_verify = $_POST['desin_style_verify'];
$desin_style_verify_at = $_POST['desin_style_verify_at'] ?: $row['desin_style_verify_at'];
$desin_style_verify_owner = $_POST['desin_style_verify_owner'] ?: $row['desin_style_verify_owner'];
$desin_leader_verify = $_POST['desin_leader_verify'];
$desin_leader_verify_at = $_POST['desin_leader_verify_at'] ?: $row['desin_leader_verify_at'];
$desin_leader_verify_owner = $_POST['desin_leader_verify_owner'] ?: $row['desin_leader_verify_owner'];
$building_heigh_verify = $_POST['building_heigh_verify'];
$building_heigh_verify_at = $_POST['building_heigh_verify_at'] ?: $row['building_heigh_verify_at'];
$building_heigh_verify_owner = $_POST['building_heigh_verify_owner'] ?: $row['building_heigh_verify_owner'];
$customer_planning_verify = $_POST['customer_planning_verify'];
$customer_planning_verify_at = $_POST['customer_planning_verify_at'] ?: $row['customer_planning_verify_at'];
$customer_planning_verify_owner = $_POST['customer_planning_verify_owner'] ?: $row['customer_planning_verify_owner'];
$site_survey_contact_verify = $_POST['site_survey_contact_verify'];
$site_survey_contact_verify_at = $_POST['site_survey_contact_verify_at'] ?: $row['site_survey_contact_verify_at'];
$site_survey_contact_verify_owner = $_POST['site_survey_contact_verify_owner'] ?: $row['site_survey_contact_verify_owner'];
$old_site_survey_contact_verify = $_POST['old_site_survey_contact_verify'];
$outsourcer_type = $_POST['outsourcer_type'];
$install_outsourcer = $_POST['install_outsourcer'];
$install_outsourcer_owner = $_POST['install_outsourcer_owner'];
$install_outsourcer_date = $_POST['install_outsourcer_date'];
$install_outsourcer_date_owner = $_POST['install_outsourcer_date_owner'];
$estimate_install_start_date = $_POST['estimate_install_start_date'];
$estimate_install_start_date_owner = $_POST['estimate_install_start_date_owner'];
$estimate_install_end_date = $_POST['estimate_install_end_date'];
$estimate_install_end_date_owner = $_POST['estimate_install_end_date_owner'];
$tryrun_outsourcer = $_POST['tryrun_outsourcer'];
$tryrun_outsourcer_owner = $_POST['tryrun_outsourcer_owner'];
$tryrun_outsourcer_date = $_POST['tryrun_outsourcer_date'];
$tryrun_outsourcer_date_owner = $_POST['tryrun_outsourcer_date_owner'];
$estimate_tryrun_start_date = $_POST['estimate_tryrun_start_date'];
$estimate_tryrun_start_date_owner = $_POST['estimate_tryrun_start_date_owner'];
$estimate_tryrun_end_date = $_POST['estimate_tryrun_end_date'];
$estimate_tryrun_end_date_owner = $_POST['estimate_tryrun_end_date_owner'];
$warehouse_assistant_remark = $_POST['warehouse_assistant_remark'];
$shengguanok_status = $_POST['shengguanok_status'];
$shengguanok_status_at = $_POST['shengguanok_status_at'];
$shengguanok_status_owner = $_POST['shengguanok_status_owner'] ?: $row['shengguanok_status_owner'];
$prattford_order_date_verify = $_POST['prattford_order_date_verify'];
$prattford_order_date = $_POST['prattford_order_date'];
$prattford_order_date_owner = $_POST['prattford_order_date_owner'] ?: $row['prattford_order_date_owner'];
$estimated_shipping_date_verify = $_POST['estimated_shipping_date_verify'];
$estimated_shipping_date = $_POST['estimated_shipping_date'];
$estimated_shipping_date_owner = $_POST['estimated_shipping_date_owner'] ?: $row['estimated_shipping_date_owner'];
$estimated_shipping_schedule_date_verify = $_POST['estimated_shipping_schedule_date_verify'];
$estimated_shipping_schedule_date = $_POST['estimated_shipping_schedule_date'];
$estimated_shipping_schedule_date_owner = $_POST['estimated_shipping_schedule_date_owner'] ?: $row['estimated_shipping_schedule_date_owner'];
$goods_type = $_POST['goods_type'] ?: $row['goods_type'];
$goods_type_date = $_POST['goods_type_date'];
$goods_type_owner = $_POST['goods_type_owner'] ?: $row['goods_type_owner'];
$taiwan_goods_type = $_POST['taiwan_goods_type'] ?: $row['taiwan_goods_type'];
$taiwan_goods_type_date = $_POST['taiwan_goods_type_date'];
$taiwan_goods_type_owner = $_POST['taiwan_goods_type_owner'] ?: $row['taiwan_goods_type_owner'];
$arrival_date_verify = $_POST['arrival_date_verify'] ?: $row['arrival_date_verify'];
$actual_tofactory_date = $_POST['actual_tofactory_date'];
$arrival_date_owner = $_POST['arrival_date_owner'] ?: $row['arrival_date_owner'];
$marketing_remark = $_POST['marketing_remark'] ?: $row['marketing_remark'];
$desin_remark = $_POST['desin_remark'] ?: $row['desin_remark'];
$desin_leader_remark = $_POST['desin_leader_remark'] ?: $row['desin_leader_remark'];
$warehouse_remark = $_POST['warehouse_remark'] ?: $row['warehouse_remark'];
$yewu_remark = $_POST['yewu_remark'] ?: $row['yewu_remark'];
$shengguan_remark = $_POST['shengguan_remark'] ?: $row['shengguan_remark'];
$desin_taiwan_items_no = json_encode($_POST['desin_taiwan_items_no'], JSON_UNESCAPED_UNICODE); $desin_taiwan_items_no = json_encode($_POST['desin_taiwan_items_no'], JSON_UNESCAPED_UNICODE);
$desin_taiwan_items_name = json_encode($_POST['desin_taiwan_items_name'], JSON_UNESCAPED_UNICODE); $desin_taiwan_items_name = json_encode($_POST['desin_taiwan_items_name'], JSON_UNESCAPED_UNICODE);
$desin_taiwan_items_no = $desin_taiwan_items_no == 'null' ? null : $desin_taiwan_items_no; $desin_taiwan_items_no = $desin_taiwan_items_no == 'null' ? null : $desin_taiwan_items_no;
$desin_taiwan_items_name = $desin_taiwan_items_name == 'null' ? null : $desin_taiwan_items_name; $desin_taiwan_items_name = $desin_taiwan_items_name == 'null' ? null : $desin_taiwan_items_name;
$qc_date = $_POST['qc_date'] ?: $row['qc_date'];
$qc_date_owner = $_POST['qc_date_owner'] ?: $row['qc_date_owner'];
$end_qc_date = $_POST['end_qc_date'] ?: $row['end_qc_date'];
$end_qc_date_owner = $_POST['end_qc_date_owner'] ?: $row['end_qc_date_owner'];
$official_check_date = $_POST['official_check_date'] ?: $row['official_check_date'];
$old_official_check_date = $_POST['old_official_check_date'] ?: $row['old_official_check_date'];
$official_check_date_owner = $_POST['official_check_date_owner'] ?: $row['official_check_date_owner'];
$delivery_date = $_POST['delivery_date'] ?: $row['delivery_date'];
$old_delivery_date = $_POST['old_delivery_date'] ?: $row['old_delivery_date'];
$delivery_date_owner = $_POST['delivery_date_owner'] ?: $row['delivery_date_owner'];
$salesid = $_POST['salesid'] ?: $row['salesid'];
$warehouseid = $_POST['warehouseid'] ?: $row['warehouseid'];
$old_warehouseid = $_POST['old_warehouseid'] ?: $row['warehouseid'];
$association_check_type = $_POST['association_check_type'] ?: $row['association_check_type'];
$install_start_date = $_POST['install_start_date'];
$install_start_date_owner = $_POST['install_start_date_owner'];
$install_end_date = $_POST['install_end_date'];
$install_end_date_owner = $_POST['install_end_date_owner'];
$tryrun_start_date = $_POST['tryrun_start_date'];
$tryrun_start_date_owner = $_POST['tryrun_start_date_owner'];
$tryrun_end_date = $_POST['tryrun_end_date'];
$old_tryrun_end_date = $_POST['old_tryrun_end_date'];
$tryrun_end_date_owner = $_POST['tryrun_end_date_owner'];
$old_delivery_date_file = $_POST['old_delivery_date_file'];
$salesname = accountid2name($salesid)[$salesid]; $salesname = accountid2name($salesid)[$salesid];
$salesmail = accountid2email([$salesid])[$salesid]; $salesmail = accountid2email([$salesid])[$salesid];
@ -747,7 +748,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
[ [
accountid2name(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)], accountid2name(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)],
accountid2email(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)] accountid2email(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)]
] ],
['張崇傑', 'jaychang@masada.com.tw'],
['賴定國', 'guo@masada.com.tw']
// ['gary', 'gary_chen@masada.com.tw'] // ['gary', 'gary_chen@masada.com.tw']
], ],
"永佳捷科技" "永佳捷科技"

8
wms/wipwhole-renovate-rec-invoice-edit.php

@ -885,6 +885,10 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<button onclick="savedata()" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;" <?= $marketing2; ?>>存檔</button> <button onclick="savedata()" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;" <?= $marketing2; ?>>存檔</button>
<span class="text-danger pull-right">若無工勘資料請勿移交至設計階段!</span> <span class="text-danger pull-right">若無工勘資料請勿移交至設計階段!</span>
<?php <?php
} else {
?>
<button onclick="savedata()" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;" <?= $marketing2; ?>>存檔</button>
<?php
} }
?> ?>
</td> </td>
@ -2213,6 +2217,8 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
return 3; return 3;
if ($("#site_survey_contact_form_verify").val() == '0' && !$('#site_survey_contact_form_verify_file_a').length) if ($("#site_survey_contact_form_verify").val() == '0' && !$('#site_survey_contact_form_verify_file_a').length)
return 3; return 3;
if ($("#customer_planning_verify").val() == '0' && !$('#customer_planning_verify_file_a').length)
return 3;
return 1; return 1;
} }
@ -2276,8 +2282,6 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
return 3; return 3;
if ($("#site_survey_contact_verify").val() == '0' && !$('#site_survey_contact_verify_file_a').length) if ($("#site_survey_contact_verify").val() == '0' && !$('#site_survey_contact_verify_file_a').length)
return 3; return 3;
if ($("#customer_planning_verify").val() == '0' && !$('#customer_planning_verify_file_a').length)
return 3;
return true; return true;
} }

13
wms/wipwholeinstall-index-export-excel.php

@ -63,8 +63,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
// 取得當前使用者所屬職位 // 取得當前使用者所屬職位
$role_id = getRoleId($link, $user_id); $role_id = getRoleId($link, $user_id);
$sql = getDataSql($department_id, $user_id, "A"); $sql = getDataSql($department_id, $role_id, $user_id);
$result = mysqli_query($link, $sql); $result = mysqli_query($link, $sql);
if ($result) { if ($result) {
$data = array(); $data = array();
@ -110,7 +109,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
'QC合格日', 'QC合格日',
'官檢日', '官檢日',
'移交日', '移交日',
'營業人員' '營業人員',
'安裝圖上傳狀態',
'完工驗收單上傳狀態',
'移交日附件(核准函)上傳狀態'
]; ];
$sheet->setTitle('新梯出貨預定表'); $sheet->setTitle('新梯出貨預定表');
for ($i = 0; $i < count($colTitleArr); $i++) for ($i = 0; $i < count($colTitleArr); $i++)
@ -177,7 +179,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
substr($row['end_qc_date'], 0, 10), substr($row['end_qc_date'], 0, 10),
$row['association_check_type'] == '1' ? "-" : substr($row['official_check_date'], 0, 10), $row['association_check_type'] == '1' ? "-" : substr($row['official_check_date'], 0, 10),
substr($row['delivery_date'], 0, 10), substr($row['delivery_date'], 0, 10),
accountidToName($row['salesid']) accountidToName($row['salesid']),
empty($row['plan_diagram_file']) ? "無" : "已上傳",
empty($row['completion_acceptance_file']) ? "無" : "已上傳",
empty($row['delivery_date_file']) ? "無" : "已上傳"
]; ];
// $colContentArr2 = [ // $colContentArr2 = [
// !empty($row['tryrun_outsourcer']) ? "試車:" . $row['tryrun_outsourcer'] : "", // !empty($row['tryrun_outsourcer']) ? "試車:" . $row['tryrun_outsourcer'] : "",

41
wms/wipwholeinstall-index-function.php

@ -31,7 +31,8 @@ function getWipwholeSearchSql()
$area_no = empty($_REQUEST['area_no']) ? null : trim($_REQUEST['area_no']); $area_no = empty($_REQUEST['area_no']) ? null : trim($_REQUEST['area_no']);
$sql = ""; $sql = "";
$sql .= empty($area_no) ? "" : " AND SUBSTR(address,1,2) IN (" . $area[$area_no] . ") "; $sql .= empty($area_no) ? "" : " AND area_no = '$area_no' ";
// $sql .= empty($area_no) ? "" : " AND SUBSTR(address,1,2) IN (" . $area[$area_no] . ") ";
$sql .= empty($contractno) ? "" : " AND contractno LIKE '%$contractno%' "; $sql .= empty($contractno) ? "" : " AND contractno LIKE '%$contractno%' ";
$sql .= empty($facilityno) ? "" : " AND facilityno LIKE '%$facilityno%' "; $sql .= empty($facilityno) ? "" : " AND facilityno LIKE '%$facilityno%' ";
$sql .= empty($custom) ? "" : " AND custom LIKE '%$custom%' "; $sql .= empty($custom) ? "" : " AND custom LIKE '%$custom%' ";
@ -191,7 +192,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹') AND area_no IN ('N','T')
-- AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -204,7 +206,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗') AND area_no = 'C'
-- AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -217,20 +220,22 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄') AND area_no = 'K'
-- AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
} }
// 宜花東營銷部 工務助理 // 宜花東營銷部 工務助理
if ($department_id == '314' && $role_id == '4') { if ($department_id == '315' && $role_id == '4') {
$sql = " $sql = "
SELECT * FROM wipwholestatus SELECT * FROM wipwholestatus
WHERE 1=1 WHERE 1=1
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('台東','宜蘭','花蓮') AND area_no = 'Y'
-- AND SUBSTR(address,1,2) in ('台東','宜蘭','花蓮')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -255,7 +260,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('宜蘭','花蓮','台東') AND area_no = 'Y'
-- AND SUBSTR(address,1,2) in ('宜蘭','花蓮','台東')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -362,7 +368,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('宜蘭') AND area_no = 'Y'
-- AND SUBSTR(address,1,2) in ('宜蘭')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -375,7 +382,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹') AND area_no IN ('N','T')
-- AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -388,7 +396,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗') AND area_no = 'C'
-- AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -401,7 +410,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄') AND area_no = 'K'
-- AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -522,7 +532,8 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code)
) )
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹') AND area_no IN ('N','T')
-- AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -543,7 +554,8 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code)
) )
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗') AND area_no = 'C'
-- AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -564,7 +576,8 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code)
) )
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄') AND area_no = 'K'
-- AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;

4
wms/wipwholeinstall-index-table-html.php

@ -199,13 +199,13 @@
<p> <p>
<a target='_blank' href="wipwhole-rec-invoice-edit.php?function_name=wipwholestatus&<?php echo $token_link; ?>&id=<?php echo $data['id']; ?>" class="btn btn-primary btn-sm"> <a target='_blank' href="wipwhole-rec-invoice-edit.php?function_name=wipwholestatus&<?php echo $token_link; ?>&id=<?php echo $data['id']; ?>" class="btn btn-primary btn-sm">
<?php <?php
echo getGunwuName($data['address']); echo accountidToName($data['warehouseid']);
?> ?>
</a> </a>
</p> </p>
<?php <?php
} else { } else {
echo getGunwuName($data['address']); echo accountidToName($data['warehouseid']);
} }
?> ?>
</td> </td>

12
wms/wipwholeinstall-renovate-index-export-excel.php

@ -63,7 +63,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
// 取得當前使用者所屬職位 // 取得當前使用者所屬職位
$role_id = getRoleId($link, $user_id); $role_id = getRoleId($link, $user_id);
$sql = getDataSql($department_id, $user_id, "A"); $sql = getDataSql($department_id, $role_id, $user_id);
$result = mysqli_query($link, $sql); $result = mysqli_query($link, $sql);
if ($result) { if ($result) {
@ -110,7 +110,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
'QC合格日', 'QC合格日',
'官檢日', '官檢日',
'移交日', '移交日',
'營業人員' '營業人員',
'安裝圖上傳狀態',
'完工驗收單上傳狀態',
'移交日附件(核准函)上傳狀態'
]; ];
$sheet->setTitle('汰改出貨預定表'); $sheet->setTitle('汰改出貨預定表');
@ -179,7 +182,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
substr($row['end_qc_date'], 0, 10), substr($row['end_qc_date'], 0, 10),
$row['association_check_type'] == '1' ? "-" : substr($row['official_check_date'], 0, 10), $row['association_check_type'] == '1' ? "-" : substr($row['official_check_date'], 0, 10),
substr($row['delivery_date'], 0, 10), substr($row['delivery_date'], 0, 10),
accountidToName($row['salesid']) accountidToName($row['salesid']),
empty($row['plan_diagram_file']) ? "無" : "已上傳",
empty($row['completion_acceptance_file']) ? "無" : "已上傳",
empty($row['delivery_date_file']) ? "無" : "已上傳"
]; ];
for ($j = 0; $j < count($colContentArr); $j++) { for ($j = 0; $j < count($colContentArr); $j++) {
$sheet->setCellValue(num2alpha($j) . $i, $colContentArr[$j]); $sheet->setCellValue(num2alpha($j) . $i, $colContentArr[$j]);

39
wms/wipwholeinstall-renovate-index-function.php

@ -31,7 +31,8 @@ function getWipwholeSearchSql()
$area_no = empty($_REQUEST['area_no']) ? null : trim($_REQUEST['area_no']); $area_no = empty($_REQUEST['area_no']) ? null : trim($_REQUEST['area_no']);
$sql = ""; $sql = "";
$sql .= empty($area_no) ? "" : " AND SUBSTR(address,1,2) IN (" . $area[$area_no] . ") "; $sql .= empty($area_no) ? "" : " AND area_no = '$area_no' ";
// $sql .= empty($area_no) ? "" : " AND SUBSTR(address,1,2) IN (" . $area[$area_no] . ") ";
$sql .= empty($contractno) ? "" : " AND contractno LIKE '%$contractno%' "; $sql .= empty($contractno) ? "" : " AND contractno LIKE '%$contractno%' ";
$sql .= empty($facilityno) ? "" : " AND facilityno LIKE '%$facilityno%' "; $sql .= empty($facilityno) ? "" : " AND facilityno LIKE '%$facilityno%' ";
$sql .= empty($custom) ? "" : " AND custom LIKE '%$custom%' "; $sql .= empty($custom) ? "" : " AND custom LIKE '%$custom%' ";
@ -191,7 +192,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹') AND area_no IN ('N','T')
-- AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -204,7 +206,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗') AND area_no = 'C'
-- AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -217,7 +220,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄') AND area_no = 'K'
-- AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -230,7 +234,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('宜蘭','花蓮','台東','臺東') AND area_no = 'Y'
-- AND SUBSTR(address,1,2) in ('宜蘭','花蓮','台東','臺東')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -255,7 +260,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('宜蘭','花蓮','台東') AND area_no = 'Y'
-- AND SUBSTR(address,1,2) in ('宜蘭','花蓮','台東')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -362,7 +368,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('宜蘭') AND area_no = 'Y'
-- AND SUBSTR(address,1,2) in ('宜蘭')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -375,7 +382,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹') AND area_no IN ('N','T')
-- AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -388,7 +396,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗') AND area_no = 'C'
-- AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -401,7 +410,8 @@ function getDataSql($department_id, $role_id, $user_id)
AND status = '1' AND status = '1'
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄') AND area_no = 'K'
-- AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -517,7 +527,8 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code)
) )
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹') AND area_no IN ('N','T')
-- AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -538,7 +549,8 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code)
) )
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗') AND area_no = 'C'
-- AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;
@ -559,7 +571,8 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code)
) )
AND contract_type = '$contract_type' AND contract_type = '$contract_type'
" . getWipwholeSearchSql() . " " . getWipwholeSearchSql() . "
AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄') AND area_no = 'K'
-- AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄')
ORDER BY real_contract_arrival_date DESC ORDER BY real_contract_arrival_date DESC
"; ";
return $sql; return $sql;

4
wms/wipwholeinstall-renovate-index-table-html.php

@ -182,13 +182,13 @@
<p> <p>
<a target='_blank' href="wipwhole-renovate-rec-invoice-edit.php?function_name=wipwholestatus&<?php echo $token_link; ?>&id=<?php echo $data['id']; ?>" class="btn btn-primary btn-sm"> <a target='_blank' href="wipwhole-renovate-rec-invoice-edit.php?function_name=wipwholestatus&<?php echo $token_link; ?>&id=<?php echo $data['id']; ?>" class="btn btn-primary btn-sm">
<?php <?php
echo getGunwuName($data['address']); echo accountidToName($data['warehouseid']);
?> ?>
</a> </a>
</p> </p>
<?php <?php
} else { } else {
echo getGunwuName($data['address']); echo accountidToName($data['warehouseid']);
} }
?> ?>
</td> </td>

Loading…
Cancel
Save