Browse Source

1.新增出貨完工推移表

2.T8 API金鑰更新
3.大日程開放陳志文官檢日權限
4.大日程新增生管變更地址功能
5.大日程新增 移交日便更 及上傳移交日文件 的寄信功能
6.
gary
IA2301\IA_2301 1 year ago
parent
commit
f6eb34e541
  1. 42
      wms/T8_Authorization_curl_ver.php
  2. 32
      wms/contract_b-index.php
  3. BIN
      wms/img/mail001.jpg
  4. 30
      wms/ship_run_chart-model.php
  5. 157
      wms/ship_run_chart-model_BK.php
  6. 111
      wms/ship_run_chart.php
  7. 391
      wms/ship_run_chart_BK.php
  8. 2
      wms/wipwhole-change-contractdate-function.php
  9. 46
      wms/wipwhole-change-contractdate-submit.php
  10. 13
      wms/wipwhole-change-contractdate.php
  11. 1
      wms/wipwhole-rec-invoice-edit-fileupload.php
  12. 473
      wms/wipwhole-rec-invoice-edit-submit.php
  13. 60
      wms/wipwhole-rec-invoice-edit.php
  14. 487
      wms/wipwhole-renovate-rec-invoice-edit-submit.php
  15. 55
      wms/wipwhole-renovate-rec-invoice-edit.php

42
wms/T8_Authorization_curl_ver.php

@ -1,21 +1,50 @@
<?php
// 202711
// $user_id = "M0000";
// $user_password = "M012290493119";
// 測試空間
$user_id = "M0117";
$user_password = "90493119";
$validation = get_Auth($user_id, $user_password);
$api_key = "A21181F1EE4966D3";
$GroupId = "TEST";
$apiurl = 'http://60.244.87.101:880//twWebAPI/GetAuth';
// 正式空間
// $user_id = "M0117";
// $user_password = "90493119";
// $api_key = "A21181F1EE4966D3";
// $GroupId = "MASADA";
// $apiurl = 'http://60.244.87.101:880//twWebAPI/GetAuth';
$data = array(
'user_id' => $user_id,
'user_password' => $user_password,
'api_key' => $api_key,
'GroupId' => $GroupId,
'apiurl' => $apiurl
);
echo $validation = get_Auth($data);
function get_Auth($user_id = "M0000", $user_password = "M012290493119")
function get_Auth($data)
{
$user_id = $data['user_id'];
$user_password = $data['user_password'];
$api_key = $data['api_key'];
$GroupId = $data['GroupId'];
$apiurl = $data['apiurl'];
// 伺服器時間扣兩分鐘會比較穩定
// $now = gmdate("YmdHis");
$now = gmdate("YmdHis", strtotime("-2 minutes"));
$data = "$user_id." . $now;
$sign = hash_hmac('SHA256', $data, 'B2D6395D2883E26C', false);
$data = "$user_id." . $now;
$sign = hash_hmac('SHA256', $data, $api_key, false);
// 各種API連線網址
// $apiurl = 'https://erp.masada.com.tw:780/twWebAPI/GetAuth';
$apiurl = 'http://60.244.87.101:880//twWebAPI/GetAuth';
// $apiurl = 'http://10.10.145.2:880//twWebAPI/GetAuth';
@ -25,7 +54,8 @@ function get_Auth($user_id = "M0000", $user_password = "M012290493119")
"UserId: $user_id",
"Pwd: $user_password",
"TimestampUTC: $now",
"Sign: $sign"
"Sign: $sign",
"GroupId: $GroupId"
];
$ch = curl_init();
@ -42,6 +72,8 @@ function get_Auth($user_id = "M0000", $user_password = "M012290493119")
return $result['Data']['CHI_Authorization'];
if ($result['Status'] == 'Error')
return $result['ErrorMsg'];
print_r($result);
}
curl_close($ch);

32
wms/contract_b-index.php

@ -25,8 +25,8 @@ $sql = "
cp.PersonId, -- 業務人員
cgp.PersonName, -- 業務人員名稱
cd.DeptName, -- 業務人員部門
siam.UnTransAmount -- 合約金額
-- siad_tmp2.Max_CU_EstPayDate -- 最後收款日期
siam.UnTransAmount, -- 合約金額
siad_tmp2.Max_CU_EstPayDate -- 最後收款日期
FROM salIncomeApplyMaster AS siam
LEFT JOIN (
SELECT
@ -61,7 +61,7 @@ $sql = "
FROM salIncomeApplyDetail AS siad
GROUP BY siad.BillNo
)AS siad_tmp2 -- 合約明細2
ON siam.BillNo = siad_tmp.BillNo
ON siam.BillNo = siad_tmp2.BillNo
$sql_cmd
AND siam.CurrentState = '2'
";
@ -185,7 +185,8 @@ if ($data) :
<th style='text-align:center;vertical-align: middle;width:120px;'>單據號</th>
<th style='text-align:center;vertical-align: middle;width:120px;'>客戶名稱</th>
<th style='text-align:center;vertical-align: middle;width:80px;'>單據日期</th>
<!-- <th style='text-align:center;vertical-align: middle;width:80px;'>最後收款日</th> -->
<th style='text-align:center;vertical-align: middle;width:80px;'>最後收款日</th>
<th style='text-align:center;vertical-align: middle;width:120px;'>追蹤狀態</th>
<th style='text-align:center;vertical-align: middle;width:120px;'>金額</th>
<th style='text-align:center;vertical-align: middle;width:60px;'>明細</th>
</tr>
@ -215,9 +216,26 @@ if ($data) :
<td>
<?php echo date('Y/m/d', strtotime($row['BillDate'])); ?>
</td>
<!-- <td>
<?php echo date('Y/m/d', strtotime($row['Max_CU_EstPayDate'])); ?>
</td> -->
<td>
<?php echo empty($row['Max_CU_EstPayDate']) ? '' : date('Y/m/d', strtotime($row['Max_CU_EstPayDate'])); ?>
</td>
<td>
<?php
$date1 = new DateTime(date('Y-m-d', strtotime($row['Max_CU_EstPayDate'])));
$date2 = new DateTime(date('Y-m-d'));
$interval = $date1->diff($date2);
$months = $interval->m;
$months += $interval->y * 12;
if ($date1 <= $date2) {
echo "<span class=''>合約已過期</span>";
} else if ($months <= 2) {
echo "<span class='text-danger'>合約快到期</span>";
} else {
echo "<span class='text-success'>合約未到期</span>";
}
?>
</td>
<td>
<?php echo number_format(intval($row['UnTransAmount']), 0, '', ','); ?>
</td>

BIN
wms/img/mail001.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 KiB

30
wms/ship_run_chart-model.php

@ -9,6 +9,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$mtype = $_POST['mtype'];
$year = $_POST['year'];
$month = $_POST['month'];
if (in_array($type, ['M1', 'MA']))
$type = null;
if ($form_name == 'getShipping') {
echo getShipping($type, $mtype, $year, $month);
}
@ -62,12 +64,8 @@ function getInstalling($type, $mtype, $year, $month)
FROM wipwholestatus
WHERE status = '1'
AND (
install_start_date IS NOT NULL
OR install_start_date != ''
)
AND (
install_end_date IS NULL
OR install_end_date = ''
tryrun_end_date = ''
OR tryrun_end_date IS NULL
)
";
if (!empty($month)) {
@ -91,15 +89,11 @@ function getInstalling2($type, $mtype, $year, $month)
*
FROM wipwholestatus
WHERE status = '1'
AND install_start_date IS NOT NULL
AND install_start_date != ''
AND install_end_date IS NOT NULL
AND install_end_date != ''
";
if (!empty($month)) {
$sql .= " AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'";
$sql .= " AND tryrun_end_date BETWEEN '$year-$month-01' AND '$year-$month-31'";
} else {
$sql .= " AND real_arrival_date BETWEEN '$year-01-01' AND '$year-12-31'";
$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%'" : "";
@ -117,13 +111,11 @@ function getQCing($type, $mtype, $year, $month)
*
FROM wipwholestatus
WHERE status = '1'
AND end_qc_date IS NOT NULL
AND end_qc_date != ''
";
if (!empty($month)) {
$sql .= " AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'";
$sql .= " AND end_qc_date BETWEEN '$year-$month-01' AND '$year-$month-31'";
} else {
$sql .= " AND real_arrival_date BETWEEN '$year-01-01' AND '$year-12-31'";
$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%'" : "";
@ -141,13 +133,11 @@ function getDeliverying($type, $mtype, $year, $month)
*
FROM wipwholestatus
WHERE status = '1'
AND delivery_date IS NOT NULL
AND delivery_date != ''
";
if (!empty($month)) {
$sql .= " AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'";
$sql .= " AND delivery_date BETWEEN '$year-$month-01' AND '$year-$month-31'";
} else {
$sql .= " AND real_arrival_date BETWEEN '$year-01-01' AND '$year-12-31'";
$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%'" : "";

157
wms/ship_run_chart-model_BK.php

@ -0,0 +1,157 @@
<?php
require_once dirname(__FILE__) . "/../mkt/database.php";
include "fun_global.php";
// AJAX 顯示合約明細
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$form_name = $_POST['form_name'];
$type = $_POST['type'];
$mtype = $_POST['mtype'];
$year = $_POST['year'];
$month = $_POST['month'];
if ($form_name == 'getShipping') {
echo getShipping($type, $mtype, $year, $month);
}
if ($form_name == 'getInstalling') {
echo getInstalling($type, $mtype, $year, $month);
}
if ($form_name == 'getInstalling2') {
echo getInstalling2($type, $mtype, $year, $month);
}
if ($form_name == 'getQCing') {
echo getQCing($type, $mtype, $year, $month);
}
if ($form_name == 'getDeliverying') {
echo getDeliverying($type, $mtype, $year, $month);
}
}
// 出貨台數
function getShipping($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);
$data = mysqli_fetch_all($result, MYSQLI_ASSOC);
return json_encode($data, JSON_UNESCAPED_UNICODE);
}
// 在裝台數
function getInstalling($type, $mtype, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
AND (
install_start_date IS NOT NULL
OR install_start_date != ''
)
AND (
install_end_date IS NULL
OR install_end_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);
$data = mysqli_fetch_all($result, MYSQLI_ASSOC);
return json_encode($data, JSON_UNESCAPED_UNICODE);
}
// 完工台數
function getInstalling2($type, $mtype, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
AND install_start_date IS NOT NULL
AND install_start_date != ''
AND install_end_date IS NOT NULL
AND install_end_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);
$data = mysqli_fetch_all($result, MYSQLI_ASSOC);
return json_encode($data, JSON_UNESCAPED_UNICODE);
}
// QC台數
function getQCing($type, $mtype, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
AND end_qc_date IS NOT NULL
AND end_qc_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);
$data = mysqli_fetch_all($result, MYSQLI_ASSOC);
return json_encode($data, JSON_UNESCAPED_UNICODE);
}
// 移交台數
function getDeliverying($type, $mtype, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
AND delivery_date IS NOT NULL
AND delivery_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);
$data = mysqli_fetch_all($result, MYSQLI_ASSOC);
return json_encode($data, JSON_UNESCAPED_UNICODE);
}

111
wms/ship_run_chart.php

@ -8,6 +8,8 @@ include "css/view/wipwhole-index.php";
function getShipping($type, $mtype, $year, $month)
{
global $link;
if (in_array($type, ['M1', 'MA']))
$type = null;
$sql = "
SELECT
count(*) AS all_count
@ -30,6 +32,8 @@ function getShipping($type, $mtype, $year, $month)
function getInstalling($type, $mtype, $year, $month)
{
global $link;
if (in_array($type, ['M1', 'MA']))
$type = null;
$sql = "
SELECT
count(*) AS all_count
@ -37,12 +41,8 @@ function getInstalling($type, $mtype, $year, $month)
WHERE status = '1'
AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'
AND (
install_start_date IS NOT NULL
OR install_start_date != ''
)
AND (
install_end_date IS NULL
OR install_end_date = ''
tryrun_end_date = ''
OR tryrun_end_date IS NULL
)
";
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
@ -56,16 +56,14 @@ function getInstalling($type, $mtype, $year, $month)
function getInstalling2($type, $mtype, $year, $month)
{
global $link;
if (in_array($type, ['M1', 'MA']))
$type = null;
$sql = "
SELECT
count(*) AS all_count
FROM wipwholestatus
WHERE status = '1'
AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'
AND install_start_date IS NOT NULL
AND install_start_date != ''
AND install_end_date IS NOT NULL
AND install_end_date != ''
AND tryrun_end_date BETWEEN '$year-$month-01' AND '$year-$month-31'
";
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
@ -78,15 +76,14 @@ function getInstalling2($type, $mtype, $year, $month)
function getQCing($type, $mtype, $year, $month)
{
global $link;
if (in_array($type, ['M1', 'MA']))
$type = null;
$sql = "
SELECT
count(*) AS all_count
FROM wipwholestatus
WHERE status = '1'
AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'
AND end_qc_date IS NOT NULL
AND end_qc_date != ''
AND end_qc_date BETWEEN '$year-$month-01' AND '$year-$month-31'
";
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
@ -99,15 +96,14 @@ function getQCing($type, $mtype, $year, $month)
function getDeliverying($type, $mtype, $year, $month)
{
global $link;
if (in_array($type, ['M1', 'MA']))
$type = null;
$sql = "
SELECT
count(*) AS all_count
FROM wipwholestatus
WHERE status = '1'
AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'
AND delivery_date IS NOT NULL
AND delivery_date != ''
AND delivery_date BETWEEN '$year-$month-01' AND '$year-$month-31'
";
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
@ -115,13 +111,20 @@ function getDeliverying($type, $mtype, $year, $month)
$data = mysqli_fetch_array($result, MYSQLI_ASSOC);
return $data['all_count'];
}
$contract_type = [
'' => '新梯+汰改',
'A' => '新梯',
'B' => '汰改'
'B' => '汰改 M1+MA',
'M1' => '汰改 M1',
'MA' => '汰改 MA'
];
foreach ($contract_type as $c_val => $c_key) {
$mtype = null;
if ($c_val == "M1")
$mtype = "M1";
if ($c_val == "MA")
$mtype = "MA";
?>
<div id="myModal" class="modal">
@ -194,11 +197,11 @@ foreach ($contract_type as $c_val => $c_key) {
if ($val == 'A')
echo "<span style='font-size:12px;'>有出貨日</span>";
if ($val == 'B')
echo "<span style='font-size:12px;'>有安裝開工日,沒安裝完工日</span> ";
echo "<span style='font-size:12px;'>沒有實際試車完工日</span> ";
if ($val == 'C')
echo "<span style='font-size:12px;'>安裝完工日</span> ";
echo "<span style='font-size:12px;'>實際試車完工日</span> ";
if ($val == 'D')
echo "<span style='font-size:12px;'>有QC完工</span> ";
echo "<span style='font-size:12px;'>有QC合格</span> ";
if ($val == 'E')
echo "<span style='font-size:12px;'>移交日</span> ";
?>
@ -213,54 +216,54 @@ foreach ($contract_type as $c_val => $c_key) {
$e_count = 0;
for ($i = 1; $i <= 12; $i++) {
if ($val == 'A') {
$a = getShipping($c_val, null, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT));
$a = getShipping($c_val, $mtype, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT));
$a_count += $a;
$onclick = "showDetail('getShipping', '$c_val', '', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
$onclick = "showDetail('getShipping', '$c_val', '$mtype', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $a . '</a></td>';
}
if ($val == 'B') {
$b = getInstalling($c_val, null, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT));
$b = getInstalling($c_val, $mtype, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT));
$b_count += $b;
$onclick = "showDetail('getInstalling', '$c_val', '', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
$onclick = "showDetail('getInstalling', '$c_val', '$mtype', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $b . '</a></td>';
}
if ($val == 'C') {
$c = getInstalling2($c_val, null, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT));
$c = getInstalling2($c_val, $mtype, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT));
$c_count += $c;
$onclick = "showDetail('getInstalling2', '$c_val', '', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
$onclick = "showDetail('getInstalling2', '$c_val', '$mtype', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $c . '</a></td>';
}
if ($val == 'D') {
$d = getQCing($c_val, null, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT));
$d = getQCing($c_val, $mtype, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT));
$d_count += $d;
$onclick = "showDetail('getQCing', '$c_val', '', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
$onclick = "showDetail('getQCing', '$c_val', '$mtype', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $d . '</a></td>';
}
if ($val == 'E') {
$e = getDeliverying($c_val, null, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT));
$e = getDeliverying($c_val, $mtype, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT));
$e_count += $e;
$onclick = "showDetail('getDeliverying', '$c_val', '', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
$onclick = "showDetail('getDeliverying', '$c_val', '$mtype', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $e . '</a></td>';
}
}
if ($val == 'A') {
$onclick = "showDetail('getShipping', '$c_val', '', '" . (date("Y")-1) . "', '')";
$onclick = "showDetail('getShipping', '$c_val', '$mtype', '" . (date("Y") - 1) . "', '')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $a_count . '</a></td>';
}
if ($val == 'B') {
$onclick = "showDetail('getInstalling', '$c_val', '', '" . (date("Y")-1) . "', '')";
$onclick = "showDetail('getInstalling', '$c_val', '$mtype', '" . (date("Y") - 1) . "', '')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $b_count . '</a></td>';
}
if ($val == 'C') {
$onclick = "showDetail('getInstalling2', '$c_val', '', '" . (date("Y")-1) . "', '')";
$onclick = "showDetail('getInstalling2', '$c_val', '$mtype', '" . (date("Y") - 1) . "', '')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $c_count . '</a></td>';
}
if ($val == 'D') {
$onclick = "showDetail('getQCing', '$c_val', '', '" . (date("Y")-1) . "', '')";
$onclick = "showDetail('getQCing', '$c_val', '$mtype', '" . (date("Y") - 1) . "', '')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $d_count . '</a></td>';
}
if ($val == 'E') {
$onclick = "showDetail('getDeliverying', '$c_val', '', '" . (date("Y")-1) . "', '')";
$onclick = "showDetail('getDeliverying', '$c_val', '$mtype', '" . (date("Y") - 1) . "', '')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $e_count . '</a></td>';
}
?>
@ -275,54 +278,54 @@ foreach ($contract_type as $c_val => $c_key) {
$e_count = 0;
for ($i = 1; $i <= 12; $i++) {
if ($val == 'A') {
$a = getShipping($c_val, null, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT));
$a = getShipping($c_val, $mtype, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT));
$a_count += $a;
$onclick = "showDetail('getShipping', '$c_val', '', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
$onclick = "showDetail('getShipping', '$c_val', '$mtype', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $a . '</a></td>';
}
if ($val == 'B') {
$b = getInstalling($c_val, null, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT));
$b = getInstalling($c_val, $mtype, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT));
$b_count += $b;
$onclick = "showDetail('getInstalling', '$c_val', '', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
$onclick = "showDetail('getInstalling', '$c_val', '$mtype', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $b . '</a></td>';
}
if ($val == 'C') {
$c = getInstalling2($c_val, null, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT));
$c = getInstalling2($c_val, $mtype, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT));
$c_count += $c;
$onclick = "showDetail('getInstalling2', '$c_val', '', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
$onclick = "showDetail('getInstalling2', '$c_val', '$mtype', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $c . '</a></td>';
}
if ($val == 'D') {
$d = getQCing($c_val, null, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT));
$d = getQCing($c_val, $mtype, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT));
$d_count += $d;
$onclick = "showDetail('getQCing', '$c_val', '', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
$onclick = "showDetail('getQCing', '$c_val', '$mtype', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $d . '</a></td>';
}
if ($val == 'E') {
$e = getDeliverying($c_val, null, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT));
$e = getDeliverying($c_val, $mtype, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT));
$e_count += $e;
$onclick = "showDetail('getDeliverying', '$c_val', '', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
$onclick = "showDetail('getDeliverying', '$c_val', '$mtype', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $e . '</a></td>';
}
}
if ($val == 'A') {
$onclick = "showDetail('getShipping', '$c_val', '', '" . (date("Y")) . "', '')";
$onclick = "showDetail('getShipping', '$c_val', '$mtype', '" . (date("Y")) . "', '')";
echo '<td style="text-align:center;"> <a class="myBtn" href="#" onclick="' . $onclick . '">' . $a_count . ' </a></td>';
}
if ($val == 'B') {
$onclick = "showDetail('getInstalling', '$c_val', '', '" . (date("Y")) . "', '')";
$onclick = "showDetail('getInstalling', '$c_val', '$mtype', '" . (date("Y")) . "', '')";
echo '<td style="text-align:center;"> <a class="myBtn" href="#" onclick="' . $onclick . '">' . $b_count . ' </a></td>';
}
if ($val == 'C') {
$onclick = "showDetail('getInstalling2', '$c_val', '', '" . (date("Y")) . "', '')";
$onclick = "showDetail('getInstalling2', '$c_val', '$mtype', '" . (date("Y")) . "', '')";
echo '<td style="text-align:center;"> <a class="myBtn" href="#" onclick="' . $onclick . '">' . $c_count . ' </a></td>';
}
if ($val == 'D') {
$onclick = "showDetail('getQCing', '$c_val', '', '" . (date("Y")) . "', '')";
$onclick = "showDetail('getQCing', '$c_val', '$mtype', '" . (date("Y")) . "', '')";
echo '<td style="text-align:center;"> <a class="myBtn" href="#" onclick="' . $onclick . '">' . $d_count . ' </a></td>';
}
if ($val == 'E') {
$onclick = "showDetail('getDeliverying', '$c_val', '', '" . (date("Y")) . "', '')";
$onclick = "showDetail('getDeliverying', '$c_val', '$mtype', '" . (date("Y")) . "', '')";
echo '<td style="text-align:center;"> <a class="myBtn" href="#" onclick="' . $onclick . '">' . $e_count . ' </a></td>';
}
?>

391
wms/ship_run_chart_BK.php

@ -0,0 +1,391 @@
<?php
// ini_set('display_errors', 'on');
include "header.php";
include "css/view/wipwhole-index.php";
// 出貨台數
function getShipping($type, $mtype, $year, $month)
{
global $link;
$sql = "
SELECT
count(*) AS all_count
FROM wipwholestatus
WHERE status = '1'
AND (
real_arrival_date IS NOT NULL
AND real_arrival_date != ''
)
AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'
";
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
$result = mysqli_query($link, $sql);
$data = mysqli_fetch_array($result, MYSQLI_ASSOC);
return $data['all_count'];
}
// 在裝台數
function getInstalling($type, $mtype, $year, $month)
{
global $link;
$sql = "
SELECT
count(*) AS all_count
FROM wipwholestatus
WHERE status = '1'
AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'
AND (
install_start_date IS NOT NULL
OR install_start_date != ''
)
AND (
install_end_date IS NULL
OR install_end_date = ''
)
";
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
$result = mysqli_query($link, $sql);
$data = mysqli_fetch_array($result, MYSQLI_ASSOC);
return $data['all_count'];
}
// 完工台數
function getInstalling2($type, $mtype, $year, $month)
{
global $link;
$sql = "
SELECT
count(*) AS all_count
FROM wipwholestatus
WHERE status = '1'
AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'
AND install_start_date IS NOT NULL
AND install_start_date != ''
AND install_end_date IS NOT NULL
AND install_end_date != ''
";
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
$result = mysqli_query($link, $sql);
$data = mysqli_fetch_array($result, MYSQLI_ASSOC);
return $data['all_count'];
}
// QC台數
function getQCing($type, $mtype, $year, $month)
{
global $link;
$sql = "
SELECT
count(*) AS all_count
FROM wipwholestatus
WHERE status = '1'
AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'
AND end_qc_date IS NOT NULL
AND end_qc_date != ''
";
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
$result = mysqli_query($link, $sql);
$data = mysqli_fetch_array($result, MYSQLI_ASSOC);
return $data['all_count'];
}
// 移交台數
function getDeliverying($type, $mtype, $year, $month)
{
global $link;
$sql = "
SELECT
count(*) AS all_count
FROM wipwholestatus
WHERE status = '1'
AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'
AND delivery_date IS NOT NULL
AND delivery_date != ''
";
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
$result = mysqli_query($link, $sql);
$data = mysqli_fetch_array($result, MYSQLI_ASSOC);
return $data['all_count'];
}
$contract_type = [
'' => '新梯+汰改',
'A' => '新梯',
'B' => '汰改'
];
foreach ($contract_type as $c_val => $c_key) {
?>
<div id="myModal" class="modal">
<div class="back"></div>
<div class="modal-content">
<button type="button" class="close" id="myCloseBtn">X</button>
<div class='col-12' style='text-align:center'>
<div class='row'>
<div class='col-12'>
<table id="table_detail" class="table table-bordered" style="width:100%; margin:0 auto;">
<thead>
<tr>
<th>合約號</th>
<th>作番號</th>
<th>客戶名稱</th>
<th>預計出貨日</th>
<th>試車完工日</th>
<th>QC合格日</th>
<th>官檢日</th>
<th>移交日</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<table class="table table-striped table-bordered" style="width:98.5%;overflow-x:auto">
<thead>
<tr>
<th style='text-align:center;vertical-align:middle;' colspan='15'>
<h4>出貨完工推移表(<?php echo $c_key; ?>)</h4>
</th>
</tr>
<tr>
<th style='text-align:center;width:150px;vertical-align:middle;' rowspan='2'>階段台數</th>
<th style='text-align:center;width:150px;vertical-align:middle;' rowspan='2'>年度</th>
<th style='text-align:center;vertical-align:middle;' colspan='12'>月份</th>
<th style='text-align:center;vertical-align:middle;' rowspan='2'>合計</th>
</tr>
<tr>
<?php
for ($i = 1; $i <= 12; $i++) {
echo "<td style='text-align:center;'>" . $i . "月</td>";
}
?>
</tr>
</thead>
<tbody>
<?php
$type_arr = [
'A' => '出貨台數',
'B' => '在裝台數',
'C' => '完工台數',
'D' => 'QC台數',
'E' => '移交台數'
];
foreach ($type_arr as $val => $key) {
?>
<tr>
<td style='text-align:center;vertical-align:middle;' rowspan='2'>
<?php
echo $key;
echo "<br/>";
if ($val == 'A')
echo "<span style='font-size:12px;'>有出貨日</span>";
if ($val == 'B')
echo "<span style='font-size:12px;'>有安裝開工日,沒安裝完工日</span> ";
if ($val == 'C')
echo "<span style='font-size:12px;'>有安裝完工日</span> ";
if ($val == 'D')
echo "<span style='font-size:12px;'>有QC完工日</span> ";
if ($val == 'E')
echo "<span style='font-size:12px;'>移交日</span> ";
?>
</td>
<td>前一年度(<?php echo (date("Y") - 1); ?>)</td>
<?php
$a_count = 0;
$b_count = 0;
$c_count = 0;
$d_count = 0;
$e_count = 0;
for ($i = 1; $i <= 12; $i++) {
if ($val == 'A') {
$a = getShipping($c_val, null, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT));
$a_count += $a;
$onclick = "showDetail('getShipping', '$c_val', '', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $a . '</a></td>';
}
if ($val == 'B') {
$b = getInstalling($c_val, null, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT));
$b_count += $b;
$onclick = "showDetail('getInstalling', '$c_val', '', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $b . '</a></td>';
}
if ($val == 'C') {
$c = getInstalling2($c_val, null, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT));
$c_count += $c;
$onclick = "showDetail('getInstalling2', '$c_val', '', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $c . '</a></td>';
}
if ($val == 'D') {
$d = getQCing($c_val, null, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT));
$d_count += $d;
$onclick = "showDetail('getQCing', '$c_val', '', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $d . '</a></td>';
}
if ($val == 'E') {
$e = getDeliverying($c_val, null, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT));
$e_count += $e;
$onclick = "showDetail('getDeliverying', '$c_val', '', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $e . '</a></td>';
}
}
if ($val == 'A') {
$onclick = "showDetail('getShipping', '$c_val', '', '" . (date("Y")-1) . "', '')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $a_count . '</a></td>';
}
if ($val == 'B') {
$onclick = "showDetail('getInstalling', '$c_val', '', '" . (date("Y")-1) . "', '')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $b_count . '</a></td>';
}
if ($val == 'C') {
$onclick = "showDetail('getInstalling2', '$c_val', '', '" . (date("Y")-1) . "', '')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $c_count . '</a></td>';
}
if ($val == 'D') {
$onclick = "showDetail('getQCing', '$c_val', '', '" . (date("Y")-1) . "', '')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $d_count . '</a></td>';
}
if ($val == 'E') {
$onclick = "showDetail('getDeliverying', '$c_val', '', '" . (date("Y")-1) . "', '')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $e_count . '</a></td>';
}
?>
</tr>
<tr>
<td>本年度(<?php echo date("Y"); ?>)</td>
<?php
$a_count = 0;
$b_count = 0;
$c_count = 0;
$d_count = 0;
$e_count = 0;
for ($i = 1; $i <= 12; $i++) {
if ($val == 'A') {
$a = getShipping($c_val, null, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT));
$a_count += $a;
$onclick = "showDetail('getShipping', '$c_val', '', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $a . '</a></td>';
}
if ($val == 'B') {
$b = getInstalling($c_val, null, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT));
$b_count += $b;
$onclick = "showDetail('getInstalling', '$c_val', '', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $b . '</a></td>';
}
if ($val == 'C') {
$c = getInstalling2($c_val, null, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT));
$c_count += $c;
$onclick = "showDetail('getInstalling2', '$c_val', '', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $c . '</a></td>';
}
if ($val == 'D') {
$d = getQCing($c_val, null, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT));
$d_count += $d;
$onclick = "showDetail('getQCing', '$c_val', '', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $d . '</a></td>';
}
if ($val == 'E') {
$e = getDeliverying($c_val, null, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT));
$e_count += $e;
$onclick = "showDetail('getDeliverying', '$c_val', '', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')";
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $e . '</a></td>';
}
}
if ($val == 'A') {
$onclick = "showDetail('getShipping', '$c_val', '', '" . (date("Y")) . "', '')";
echo '<td style="text-align:center;"> <a class="myBtn" href="#" onclick="' . $onclick . '">' . $a_count . ' </a></td>';
}
if ($val == 'B') {
$onclick = "showDetail('getInstalling', '$c_val', '', '" . (date("Y")) . "', '')";
echo '<td style="text-align:center;"> <a class="myBtn" href="#" onclick="' . $onclick . '">' . $b_count . ' </a></td>';
}
if ($val == 'C') {
$onclick = "showDetail('getInstalling2', '$c_val', '', '" . (date("Y")) . "', '')";
echo '<td style="text-align:center;"> <a class="myBtn" href="#" onclick="' . $onclick . '">' . $c_count . ' </a></td>';
}
if ($val == 'D') {
$onclick = "showDetail('getQCing', '$c_val', '', '" . (date("Y")) . "', '')";
echo '<td style="text-align:center;"> <a class="myBtn" href="#" onclick="' . $onclick . '">' . $d_count . ' </a></td>';
}
if ($val == 'E') {
$onclick = "showDetail('getDeliverying', '$c_val', '', '" . (date("Y")) . "', '')";
echo '<td style="text-align:center;"> <a class="myBtn" href="#" onclick="' . $onclick . '">' . $e_count . ' </a></td>';
}
?>
</tr>
<?php
}
?>
</tbody>
</table>
<script>
var modal = document.getElementById("myModal");
$(".myBtn").click(function() {
$("#myModal").show();
});
$("#myCloseBtn").click(function(e) {
$("#myModal").hide();
});
$(".back").click(function(e) {
$("#myModal").hide();
});
function showDetail(form_name, type, mtype, year, month) {
$.ajax({
type: "POST",
dataType: "json",
url: "ship_run_chart-model.php",
data: {
form_name: form_name,
type: type,
mtype: mtype,
year: year,
month: month
},
complete: function(data) {
console.log(data);
var data = data.responseJSON
var str = "";
for (var i = 0; i < data.length; i++) {
str += "<tr>";
str += "<td>" + data[i]['contractno'] + "</td>";
str += "<td>" + data[i]['facilityno'] + "</td>";
str += "<td>" + data[i]['custom'] + "</td>";
str += "<td>" + data[i]['real_arrival_date'] + "</td>";
str += "<td>" + data[i]['tryrun_end_date'] + "</td>";
str += "<td>" + data[i]['end_qc_date'] + "</td>";
str += "<td>" + data[i]['official_check_date'] + "</td>";
str += "<td>" + data[i]['delivery_date'] + "</td>";
str += "</tr>";
}
if ($('#table_detail').hasClass('dataTable')) {
dttable = $('#table_detail').dataTable();
dttable.fnClearTable();
dttable.fnDestroy();
}
$("#table_detail").find("tbody").html(str);
$('#table_detail').dataTable();
}
})
}
</script>
<?php
}
include("footer.php");
?>

2
wms/wipwhole-change-contractdate-function.php

@ -596,6 +596,8 @@ function getAssignStatusSelect($link, $user_id, $nowFormStatus)
if (empty($nowFormStatus)) {
if (in_array(getDepartmentId($link, $user_id), ['521', '531', '541', '542', '543', '544', '545'])) {
$options_str .= "<option value='A'>提出申請</option>";
} else if (in_array(getDepartmentId($link, $user_id), ['250'])) {
$options_str .= "<option value='Z'>提出申請</option>";
} else {
$options_str .= "<option value='B'>提出申請</option>";
}

46
wms/wipwhole-change-contractdate-submit.php

@ -212,11 +212,55 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$contract_arrival_date_tmp = empty($contract_arrival_date) ? $real_contract_arrival_date : $contract_arrival_date;
$real_address_tmp = empty($real_address) ? $old_real_address : $real_address;
$shengguanok_insert_status = empty($_POST['shengguanok_insert_status']) ? null : $_POST['shengguanok_insert_status'];
if (accountidToDepartId($user_id) == "250" && in_array(accountidToRoleId($user_id), ["1", "4"])) {
$tds = date("Y-m-d H:i:s");
$next_users = $_POST['next_users'];
$seq = $_POST['seq'] + 1;
$seq = 1;
$id = isset($_GET['id']) ? $_GET['id'] : getId($link, $cid);
if (!empty($shengguanok_insert_status)) {
echo $form_key = getFomkeySeq($link);
$all_contractno_change = empty($_POST['all_contractno_change']) ? null : $_POST['all_contractno_change'];
$real_contract_arrival_date = $_POST['real_contract_arrival_date'];
$contract_arrival_date = $_POST['contract_arrival_date'];
$city = $_POST['city'];
if (!empty($_POST['real_address'])) {
$real_address = $city . $_POST['real_address'];
} else {
$real_address = $_POST['real_address'];
}
$old_real_address = $_POST['old_real_address'];
$estimated_shipping_schedule_date = $_POST['estimated_shipping_schedule_date'];
$contractno = $_POST['contractno'];
$next_users = $_POST['next_users'];
$tds = date("Y-m-d H:i:s");
$data_arr = array(
'id' => $id,
'all_contractno_change' => $all_contractno_change,
'real_contract_arrival_date' => $real_contract_arrival_date,
'contract_arrival_date' => $contract_arrival_date,
'real_address' => $real_address,
'old_real_address' => $old_real_address,
'contractno' => $contractno,
'tds' => $tds,
'form_key' => $form_key,
'user_id' => $user_id,
'change_status' => $_POST['assign_status']
);
addWipwholeChangeContractdateDetails($link, $data_arr);
// 寫入待簽
$data_arr['last_id'] = $link->insert_id;
addFlow($link, $data_arr);
$data_arr['seq'] = '0';
$data_arr['current_assigner'] = $user_id;
addSubflow($link, $data_arr);
$data_arr['seq'] = '1';
$data_arr['current_assigner'] = $next_users;
addSubflow($link, $data_arr);
$seq = '2';
$next_users = '00000';
}
$sql = "
UPDATE wipwhole_change_contractdate_details
SET change_status = 'Z'

13
wms/wipwhole-change-contractdate.php

@ -323,6 +323,11 @@ if (!empty(checkNowFormStatus($link)))
<th class="td_title"> 下位簽核者</th>
<td colspan="2">
<?php
if (empty(checkNowFormStatus($link))) {
if (in_array(getDepartmentId($link, $user_id), ['250'])) {
echo "<input type='hidden' name='shengguanok_insert_status' value='1' />";
}
}
if (empty(checkNowFormStatus($link))) {
if (in_array(getDepartmentId($link, $user_id), ['521', '531', '541', '542', '543', '544', '545'])) {
echo "<select name='next_users' id='next_users'>";
@ -332,6 +337,14 @@ if (!empty(checkNowFormStatus($link)))
";
endforeach;
echo "</select>";
} else if (in_array(getDepartmentId($link, $user_id), ['250'])) {
echo "<select name='next_users' id='next_users'>";
foreach ($shengguanok_options as $shengguanok_option) :
echo "
<option value='" . $shengguanok_option['val'] . "'>" . $shengguanok_option['val'] . $shengguanok_option['label'] . "</option>
";
endforeach;
echo "</select>";
} else {
echo "
<select name='next_users' id='next_users'>

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

@ -69,5 +69,6 @@ $delivery_date_file = fileIUpload("delivery_date_file");
$shengguanok_status_file = fileIUpload("shengguanok_status_file");
// 工務助理
$outsourcer_contract_file = fileIUploads("outsourcer_contract_file");
$delivery_date_file2 = fileIUpload("delivery_date_file2");
// 品證
$official_check_file = fileIUpload("official_check_file");

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

@ -139,8 +139,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$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];
$salesmail = accountid2email([$salesid])[$salesid];
@ -151,207 +153,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
// 上傳附件
include "wipwhole-rec-invoice-edit-fileupload.php";
// 指派工勘人員
if ($warehouseid !== $old_warehouseid) {
if (checkNowFormGStatus($link) == 'G') {
$sql = "SELECT form_key FROM flow
WHERE form_id = '$id'
AND flow_id = 'wws01'
AND flow_code = 'G'
";
$result = mysqli_query($link, $sql);
$form_key = $result->fetch_row()[0];
if (!empty($form_key)) {
$sql = "UPDATE wipwholestatus
SET warehouseid = '$warehouseid'
WHERE id = '$id';
";
mysqli_query($link, $sql);
$sql = "UPDATE subflow
SET current_assigner = '$warehouseid'
WHERE 1 = 1
AND seq = '1'
AND form_key = '$form_key';
";
mysqli_query($link, $sql);
}
}
}
if (!empty($official_check_date)) {
if ($official_check_date !== $old_official_check_date) {
$sql = "
SELECT accountid
FROM account
WHERE department_id = '250'
AND role_id IN ('1','2','3','4');
";
$result = mysqli_query($link, $sql);
foreach ($result as $row) {
$permission = $row["accountid"];
$title = "客戶:$custom 作番:$facilityno 官檢日變更";
$content = "客戶:$custom
作番:$facilityno
官檢日 $old_official_check_date => $official_check_date";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
}
// 工勘變更通知繪圖人員
if ($site_survey_contact_verify !== $old_site_survey_contact_verify) {
$site_survey_status = array(
"1" => "請選擇",
"0" => "已確認",
"2" => "無工勘需求",
"A" => "未動工",
"B" => "地下室施工",
"C" => "打樁",
"D" => "地基",
"E" => "挖土",
"G" => "機房",
"H" => "機械式淨高",
"M" => "樓中樓",
"OH" => "最高層(頂樓高度)",
"P" => "PIT(機坑深度)",
"R" => "R 樓",
"S" => "停工",
"T" => "TOP",
"TC" => "頂部間隙",
"TS" => "行程",
"TH" => "全高",
"Y" => "已搭、已出",
"YB" => "退購結案",
"YF" => "既有建物",
"YN" => "已搭、未出"
);
$sql = "
SELECT accountid
FROM account
WHERE department_id = '321'
AND role_id IN ('2','3','5');
";
$result = mysqli_query($link, $sql);
foreach ($result as $row) {
$permission = $row["accountid"];
$title = "客戶:$custom 作番:$facilityno 工勘狀態更改";
$content = "客戶:$custom
作番:$facilityno
工勘狀態 $site_survey_status[$old_site_survey_contact_verify] => $site_survey_status[$site_survey_contact_verify]";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
if (!empty($desin_documents_verify_file)) {
$title = "合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件";
$content = "合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件
<a href='wipwhole-rec-invoice-edit.php?function_name=wipwholestatus&{token_link}&id=$id' target='_blank'>前往下載</a>
";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => "M0168",
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
// 官檢日及移交日通知生管人員
if (!empty($official_check_date)) {
if ($official_check_date !== $old_official_check_date) {
$permission = "M0168";
$title = "官檢日變更 客戶:$custom 作番:$facilityno";
$content = "客戶:$custom
作番:$facilityno
官檢日 $old_official_check_date => $official_check_date";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
if (!empty($delivery_date)) {
if ($delivery_date !== $old_delivery_date) {
$permission_arr = ['M0168', 'M0012'];
foreach ($permission_arr as $permission) {
$title = "移交日變更 客戶:$custom 作番:$facilityno";
$content = "客戶:$custom
作番:$facilityno
移交日 $old_delivery_date => $delivery_date";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
}
if (!empty($delivery_date)) {
if ($old_delivery_date !== $delivery_date) {
if (empty($change_all_contractno)) {
$mail_title = "作番大日程(新梯)合約號:" . $contractno . "-移交日變更通知";
$mail_content = "作番大日程(新梯)
合約號:" . $contractno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
} else {
$mail_title = "作番大日程(新梯)合約號:" . $contractno . "作番號:" . $facilityno . "-移交日變更通知";
$mail_content = "作番大日程(新梯)
合約號:" . $contractno
. "
作番號:" . $facilityno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
}
$cmail->sendx(
$mail_title,
$mail_content,
[
[$salesname, $salesmail]
// ['gary', 'gary_chen@masada.com.tw']
],
"永佳捷科技"
);
}
}
$updatesql = "
UPDATE wipwholestatus
SET
@ -397,6 +198,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$updatesql .= "customer_style_verify_file = '$customer_style_verify_file', ";
if (!empty($site_survey_contact_form_verify_file))
$updatesql .= "site_survey_contact_form_verify_file = '$site_survey_contact_form_verify_file', ";
if (!empty($official_check_file))
$updatesql .= "official_check_file = '$official_check_file', ";
if (!empty($delivery_date_file))
$updatesql .= "delivery_date_file = '$delivery_date_file', ";
} else if ($user_department_id == 911) {
// 設計主管
if ($role_id == 1) {
@ -547,7 +352,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$qc_official_type = isset($_POST['qc_official_type2']) ? $_POST['qc_official_type2'] : $qc_official_type;
$qc_date = isset($_POST['qc_date2']) ? $_POST['qc_date2'] : $qc_date;
$qc_date_owner = isset($_POST['qc_date2_owner']) ? $_POST['qc_date2_owner'] : $qc_date_owner;
$end_qc_date = isset($_POST['end_qc_date2']) ? $_POST['end_qc_date2'] : $row['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;
$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;
@ -643,8 +448,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$updatesql .= "building_heigh_verify_file = '$building_heigh_verify_file', ";
if (!empty($site_survey_contact_verify_file))
$updatesql .= "site_survey_contact_verify_file = '$site_survey_contact_verify_file', ";
if (!empty($delivery_date_file))
$updatesql .= "delivery_date_file = '$delivery_date_file', ";
if (!empty($delivery_date_file2))
$updatesql .= "delivery_date_file = '$delivery_date_file2', ";
}
// 許協更新業務確認項目權限
@ -689,6 +494,266 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
// echo $updatesql;
// exit;
mysqli_query($link, $updatesql);
// 指派工勘人員
if ($warehouseid !== $old_warehouseid) {
if (checkNowFormGStatus($link) == 'G') {
$sql = "SELECT form_key FROM flow
WHERE form_id = '$id'
AND flow_id = 'wws01'
AND flow_code = 'G'
";
$result = mysqli_query($link, $sql);
$form_key = $result->fetch_row()[0];
if (!empty($form_key)) {
$sql = "UPDATE wipwholestatus
SET warehouseid = '$warehouseid'
WHERE id = '$id';
";
mysqli_query($link, $sql);
$sql = "UPDATE subflow
SET current_assigner = '$warehouseid'
WHERE 1 = 1
AND seq = '1'
AND form_key = '$form_key';
";
mysqli_query($link, $sql);
}
}
}
if (!empty($official_check_date)) {
if ($official_check_date !== $old_official_check_date) {
$sql = "
SELECT accountid
FROM account
WHERE department_id = '250'
AND role_id IN ('1','2','3','4');
";
$result = mysqli_query($link, $sql);
foreach ($result as $row) {
$permission = $row["accountid"];
$title = "客戶:$custom 作番:$facilityno 官檢日變更";
$content = "客戶:$custom
作番:$facilityno
官檢日 $old_official_check_date => $official_check_date";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
}
// 工勘變更通知繪圖人員
if ($site_survey_contact_verify !== $old_site_survey_contact_verify) {
$site_survey_status = array(
"1" => "請選擇",
"0" => "已確認",
"2" => "無工勘需求",
"A" => "未動工",
"B" => "地下室施工",
"C" => "打樁",
"D" => "地基",
"E" => "挖土",
"G" => "機房",
"H" => "機械式淨高",
"M" => "樓中樓",
"OH" => "最高層(頂樓高度)",
"P" => "PIT(機坑深度)",
"R" => "R 樓",
"S" => "停工",
"T" => "TOP",
"TC" => "頂部間隙",
"TS" => "行程",
"TH" => "全高",
"Y" => "已搭、已出",
"YB" => "退購結案",
"YF" => "既有建物",
"YN" => "已搭、未出"
);
$sql = "
SELECT accountid
FROM account
WHERE department_id = '321'
AND role_id IN ('2','3','5');
";
$result = mysqli_query($link, $sql);
foreach ($result as $row) {
$permission = $row["accountid"];
$title = "客戶:$custom 作番:$facilityno 工勘狀態更改";
$content = "客戶:$custom
作番:$facilityno
工勘狀態 $site_survey_status[$old_site_survey_contact_verify] => $site_survey_status[$site_survey_contact_verify]";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
if (!empty($desin_documents_verify_file)) {
$title = "合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件";
$content = "合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件
<a href='wipwhole-rec-invoice-edit.php?function_name=wipwholestatus&{token_link}&id=$id' target='_blank'>前往下載</a>
";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => "M0168",
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
// 官檢日及移交日通知生管人員
if (!empty($official_check_date)) {
if ($official_check_date !== $old_official_check_date) {
$permission = "M0168";
$title = "官檢日變更 客戶:$custom 作番:$facilityno";
$content = "客戶:$custom
作番:$facilityno
官檢日 $old_official_check_date => $official_check_date";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
if (!empty($delivery_date)) {
if ($delivery_date !== $old_delivery_date) {
$permission_arr = ['M0168', 'M0012'];
foreach ($permission_arr as $permission) {
$title = "移交日變更 客戶:$custom 作番:$facilityno";
$content = "客戶:$custom
作番:$facilityno
移交日 $old_delivery_date => $delivery_date";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
}
if (!empty($delivery_date)) {
if ($old_delivery_date !== $delivery_date) {
if (empty($change_all_contractno)) {
$mail_title = "作番大日程(新梯)合約號:" . $contractno . "-移交日變更通知";
$mail_content = "作番大日程(新梯)
合約號:" . $contractno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
} else {
$mail_title = "作番大日程(新梯)合約號:" . $contractno . "作番號:" . $facilityno . "-移交日變更通知";
$mail_content = "作番大日程(新梯)
合約號:" . $contractno
. "
作番號:" . $facilityno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
}
$cmail->sendx(
$mail_title,
$mail_content,
[
[$salesname, $salesmail]
// ['gary', 'gary_chen@masada.com.tw']
],
"永佳捷科技"
);
}
}
// 當試車完工日更改時 發出通知
if (!empty($tryrun_end_date) || !empty($tryrun_end_date2)) {
if ($tryrun_end_date !== $old_tryrun_end_date || $tryrun_end_date2 !== $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_content = "作番大日程(新梯)
合約號:" . $contractno . "
作番號:" . $facilityno . "
客戶名稱:" . $custom . "
已完成試車, 請注意後續交車時間, 如需要官檢, 請提供如下資料
<img style='width: 500px' src='https://masada.com.tw/wms/img/mail001.jpg' />
";
$cmail->sendx(
$mail_title,
$mail_content,
[
[$salesname, $salesmail],
[
accountid2name(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)],
accountid2email(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)]
]
// ['gary', 'gary_chen@masada.com.tw']
],
"永佳捷科技"
);
}
}
// 當移交日附件更改時 發出通知
if (!empty($delivery_date_file) || !empty($delivery_date_file2)) {
if ($delivery_date_file !== $old_delivery_date_file || $delivery_date_file2 !== $old_delivery_date_file) {
$delivery_date_file_tmp = $delivery_date_file !== $old_delivery_date_file ? $delivery_date_file : $delivery_date_file2;
$mail_title = "作番大日程(新梯)合約號:" . $contractno . "-交車完成通知";
$mail_content = "作番大日程(新梯)
合約號:" . $contractno . "
作番號:" . $facilityno . "
客戶名稱:" . $custom . "
已完成交車並已上傳交車單或竣工單, 請至OA系統中填寫移交日, 並準備後續請款事宜!
";
$cmail->sendx(
$mail_title,
$mail_content,
[
[$salesname, $salesmail],
[
accountid2name(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)],
accountid2email(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)]
],
['葉俊麟', 'darren@masada.com.tw'],
['蘇淑娥 ', 'supe1218@masada.com.tw']
// ['gary', 'gary_chen@masada.com.tw']
],
"永佳捷科技"
);
}
}
echo "
<script type ='text/JavaScript'>
alert('資料更新成功');

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

@ -316,9 +316,9 @@ include "wipwhole-rec-invoice-edit-submit.php";
<tr>
<td style="vertical-align: middle">官檢類型</td>
<td colspan="3">
<input type='radio' id="association_check_type_1" name='association_check_type' value='1' <?= $marketing2; ?> <?php echo $row['association_check_type'] == '1' ? "checked disabled" : ""; ?> />
<input type='radio' class="disabled_select" id="association_check_type_1" name='association_check_type' value='1' <?= $marketing2; ?> <?php echo $row['association_check_type'] == '1' ? "checked disabled" : ""; ?> />
<label for='association_check_type_1'>需要</label>
<input type='radio' id="association_check_type_2" name='association_check_type' value='2' <?= $marketing2; ?> <?php echo $row['association_check_type'] == '2' ? "checked disabled" : ""; ?> />
<input type='radio' class="disabled_select" id="association_check_type_2" name='association_check_type' value='2' <?= $marketing2; ?> <?php echo $row['association_check_type'] == '2' ? "checked disabled" : ""; ?> />
<label for='association_check_type_2'>不需要</label>
</td>
</tr>
@ -507,15 +507,16 @@ include "wipwhole-rec-invoice-edit-submit.php";
<textarea class="form-control disabled_select" name="marketing_remark" <?= $marketing; ?>><?php echo $row['marketing_remark']; ?></textarea>
</td>
</tr>
<!-- <tr>
<tr>
<td style="vertical-align: middle">移交日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control disabled_select" type="date" id="delivery_date" name="delivery_date" value="<?= $row['delivery_date']; ?>" <?= $marketing2; ?>>
<input class="form-control disabled_select" type="date" min="<?php echo date("Y-m-01"); ?>" max="<?php echo date("Y-m-t"); ?>" id="delivery_date" name="delivery_date" value="<?= $row['delivery_date']; ?>" <?= $marketing2; ?>>
<input type="hidden" id="old_delivery_date" name="old_delivery_date" value="<?= $row['delivery_date']; ?>">
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#delivery_date").val("");' <?= $marketing2; ?>>清除</button>
</span>
<input type="hidden" id="old_delivery_date" name="old_delivery_date" value="<?= $row['delivery_date']; ?>">
<input type="hidden" id="old_delivery_date_tmp" value="<?= $row['delivery_date']; ?>">
</div>
</td>
<td style="vertical-align: middle">確認人</td>
@ -526,7 +527,18 @@ include "wipwhole-rec-invoice-edit-submit.php";
</select>
</td>
<td colspan='4'>
<span class="text-danger">有官檢日或QC合格日後才可填寫</span>
<p class="text-danger">1.有官檢日或QC合格日後才可填寫。</p>
<p class="text-danger">2.注意填寫後不可更改!</p>
<p class="text-danger">3.只能維護當前月份。</p>
</td>
</tr>
<!-- <tr>
<td style="vertical-align: middle;">移交日附件(核准函)</td>
<td colspan='3' style="vertical-align: middle;">
<input style="width:70%;display:inline;" type="file" id="delivery_date_file" name="delivery_date_file" <?= $marketing2; ?>>
<?php
echo !empty($row['delivery_date_file']) ? "<a id='delivery_date_a' style='color:#00F;' href='" . $row['delivery_date_file'] . "' target='_blank'>下載附件</a>" : "";
?>
</td>
</tr> -->
<tr>
@ -1053,6 +1065,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">實際試車完工日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input type="hidden" name="old_tryrun_end_date" value="<?= $row['tryrun_end_date']; ?>">
<input class="form-control" type="date" id="tryrun_end_date" name="tryrun_end_date" value="<?= $row['tryrun_end_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#tryrun_end_date").val("");' <?= $warehouse2; ?>>清除</button>
@ -1067,7 +1080,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
</select>
</td>
</tr>
<tr>
<!-- <tr>
<td style="vertical-align: middle">移交日</td>
<td style="vertical-align: middle">
<div class="input-group">
@ -1102,21 +1115,16 @@ include "wipwhole-rec-invoice-edit-submit.php";
<p class="text-danger">2.注意填寫後不可更改!</p>
<p class="text-danger">3.只能維護當前月份。</p>
</td>
</tr>
</tr> -->
<tr>
<td colspan="4">
<?php
if (saveInstallData($user_department_id, $role_id)) {
echo "<button type='button' onclick='savedata()' class='btn btn-primary btn-lg pull-right' style='margin-left:3px;'>提交</button>";
// echo "<button onclick='saveInstallData()' type='button' class='btn btn-primary btn-lg pull-right' style='margin-left:3px;'>存檔</button>";
// echo "<label class='pull-right' for='change_all_contractno_tmp'> 變更此合約全部日期</label>";
// echo "<input class='pull-right' type='checkbox' id='change_all_contractno_tmp' value='1' />";
}
?>
</td>
</tr>
</tbody>
</table>
</div>
@ -1477,7 +1485,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">QC合格日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="end_qc_date" name="end_qc_date" value="<?= $row['end_qc_date']; ?>" <?= $pinzheng; ?> >
<input class="form-control disabled_select" type="date" id="end_qc_date" name="end_qc_date" value="<?= $row['end_qc_date']; ?>" <?= $pinzheng; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#end_qc_date").val("");' <?= $pinzheng; ?>>清除</button>
</span>
@ -1495,10 +1503,10 @@ include "wipwhole-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">官檢日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="official_check_date" name="official_check_date" value="<?= $row['official_check_date']; ?>" <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "disabled" : ""; ?>>
<input type="hidden" id="old_official_check_date" name="old_official_check_date" value="<?= $row['official_check_date']; ?>" <?php echo $row['association_check_type'] == '2' ? "disabled" : ""; ?>>
<input class="form-control disabled_select" type="date" id="official_check_date" name="official_check_date" value="<?= $row['official_check_date']; ?>" <?php in_array($user_id, ['M0054']) ? "" : $pinzheng; ?> <?php echo in_array($row['association_check_type'], ['2', '0']) ? "disabled" : ""; ?>>
<input type="hidden" id="old_official_check_date" name="old_official_check_date" value="<?= $row['official_check_date']; ?>" <?php echo in_array($row['association_check_type'], ['2', '0']) ? "disabled" : ""; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#official_check_date").val("");' <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "disabled" : ""; ?>>清除</button>
<button class="btn btn-default" type='button' onclick='$("#official_check_date").val("");' <?php in_array($user_id, ['M0054']) ? "" : $pinzheng; ?><?php echo in_array($row['association_check_type'], ['2', '0']) ? "disabled" : ""; ?>>清除</button>
</span>
</div>
</td>
@ -1513,7 +1521,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<tr>
<td style='width:180px;'>官檢附件</td>
<td>
<input style="width:70%;display:inline;" type="file" id="official_check_file" name="official_check_file" <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "disabled" : ""; ?>>
<input style="width:70%;display:inline;" class="disabled_select" type="file" id="official_check_file" name="official_check_file" <?php in_array($user_id, ['M0054']) ? "" : $pinzheng; ?> <?php echo in_array($row['association_check_type'], ['2', '0']) ? "disabled" : ""; ?>>
<?php
echo !empty($row['official_check_file']) ? "<a id='official_check_file' style='color:#00F;' href='" . $row['official_check_file'] . "' target='_blank'>下載附件</a>" : "";
?>
@ -1523,7 +1531,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<tr>
<td colspan="8">
<?php
if (in_array($user_department_id, [220, 912]) || $user_id == 'M0164') {
if (in_array($user_department_id, [220, 912]) || in_array($user_id, ['M0054', 'M0164'])) {
echo "<button onclick='savedata()' type='button' class='btn btn-primary btn-lg pull-right' style='margin-left:3px;'>存檔</button>";
}
?>
@ -1577,7 +1585,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">QC合格日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="end_qc_date2" name="end_qc_date2" value="<?= $row['end_qc_date']; ?>" <?= $warehouse2; ?>>
<input class="form-control disabled_select" type="date" id="end_qc_date2" name="end_qc_date2" value="<?= $row['end_qc_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#end_qc_date2").val("");' <?= $warehouse2; ?>>清除</button>
</span>
@ -1595,7 +1603,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">官檢日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="official_check_date2" name="official_check_date2" value="<?= $row['official_check_date']; ?>" <?= $warehouse2; ?>>
<input class="form-control disabled_select" type="date" id="official_check_date2" name="official_check_date2" value="<?= $row['official_check_date']; ?>" <?= $warehouse2; ?>>
<input type="hidden" id="old_official_check_date2" name="old_official_check_date2" value="<?= $row['official_check_date']; ?>">
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#official_check_date2").val("");' <?= $warehouse2; ?>>清除</button>
@ -1906,6 +1914,16 @@ include "wipwhole-rec-invoice-edit-submit.php";
?>
</td>
</tr>
<tr>
<td style="vertical-align: middle;">移交日附件(核准函)</td>
<td colspan='3' style="vertical-align: middle;">
<input type="hidden" name="old_delivery_date_file" value="<?php echo $row['delivery_date_file']; ?>">
<input style="width:70%;display:inline;" type="file" id="delivery_date_file2" name="delivery_date_file2" <?= $warehouse2; ?>>
<?php
echo !empty($row['delivery_date_file']) ? "<a id='delivery_date_a' style='color:#00F;' href='" . $row['delivery_date_file'] . "' target='_blank'>下載附件</a>" : "";
?>
</td>
</tr>
<tr>
<td colspan="4">
<?php

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

@ -132,6 +132,16 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$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];
$salesmail = accountid2email([$salesid])[$salesid];
@ -141,209 +151,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
// 上傳附件
include "wipwhole-rec-invoice-edit-fileupload.php";
// 指派工勘人員
if ($warehouseid !== $old_warehouseid) {
if (checkNowFormStatus($link) == 'A') {
$sql = "SELECT form_key FROM flow
WHERE form_id = '$id'
AND flow_id = 'wws02'
AND flow_code = 'A'
";
$result = mysqli_query($link, $sql);
$form_key = $result->fetch_row()[0];
if (!empty($form_key)) {
$sql = "UPDATE wipwholestatus
SET warehouseid = '$warehouseid'
WHERE id = '$id';
";
mysqli_query($link, $sql);
$sql = "UPDATE subflow
SET current_assigner = '$warehouseid'
WHERE 1 = 1
AND seq = '1'
AND form_key = '$form_key';
";
mysqli_query($link, $sql);
}
}
}
if (!empty($official_check_date)) {
if ($official_check_date !== $old_official_check_date) {
$sql = "
SELECT accountid
FROM account
WHERE department_id = '250'
AND role_id IN ('1','2','3','4');
";
$result = mysqli_query($link, $sql);
foreach ($result as $row) {
$permission = $row["accountid"];
$title = "客戶:$custom 作番:$facilityno 官檢日變更";
$content = "客戶:$custom
作番:$facilityno
官檢日 $old_official_check_date => $official_check_date";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
}
// 工勘變更通知繪圖人員
if ($site_survey_contact_verify !== $old_site_survey_contact_verify) {
$site_survey_status = array(
"1" => "請選擇",
"0" => "已確認",
"2" => "無工勘需求",
"A" => "未動工",
"B" => "地下室施工",
"C" => "打樁",
"D" => "地基",
"E" => "挖土",
"G" => "機房",
"H" => "機械式淨高",
"M" => "樓中樓",
"OH" => "最高層(頂樓高度)",
"P" => "PIT(機坑深度)",
"R" => "R 樓",
"S" => "停工",
"T" => "TOP",
"TC" => "頂部間隙",
"TS" => "行程",
"TH" => "全高",
"Y" => "已搭、已出",
"YB" => "退購結案",
"YF" => "既有建物",
"YN" => "已搭、未出"
);
$sql = "
SELECT accountid
FROM account
WHERE department_id = '321'
AND role_id IN ('2','3','5');
";
$result = mysqli_query($link, $sql);
foreach ($result as $row) {
$permission = $row["accountid"];
$title = "客戶:$custom 作番:$facilityno 工勘狀態更改";
$content = "客戶:$custom
作番:$facilityno
工勘狀態 $site_survey_status[$old_site_survey_contact_verify] => $site_survey_status[$site_survey_contact_verify]";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
if (!empty($desin_documents_verify_file)) {
$title = "合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件";
$content = "合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件
<a href='wipwhole-rec-invoice-edit.php?function_name=wipwholestatus&{token_link}&id=$id' target='_blank'>前往下載</a>
";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => "M0168",
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
// 官檢日及移交日通知生管人員
if (!empty($official_check_date)) {
if ($official_check_date !== $old_official_check_date) {
$permission = "M0168";
$title = "官檢日變更 客戶:$custom 作番:$facilityno";
$content = "客戶:$custom
作番:$facilityno
官檢日 $old_official_check_date => $official_check_date";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
if (!empty($delivery_date)) {
if ($delivery_date !== $old_delivery_date) {
$permission_arr = ['M0168', 'M0012'];
foreach ($permission_arr as $permission) {
// $permission = "M0168";
$title = "移交日變更 客戶:$custom 作番:$facilityno";
$content = "客戶:$custom
作番:$facilityno
移交日 $old_delivery_date => $delivery_date";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
}
if (!empty($delivery_date)) {
if ($old_delivery_date !== $delivery_date) {
if (empty($change_all_contractno)) {
$mail_title = "作番大日程(汰改)合約號:" . $contractno . "-移交日變更通知";
$mail_content = "作番大日程(汰改)
合約號:" . $contractno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
} else {
$mail_title = "作番大日程(汰改)合約號:" . $contractno . "作番號:" . $facilityno . "-移交日變更通知";
$mail_content = "作番大日程(汰改)
合約號:" . $contractno
. "
作番號:" . $facilityno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
}
$cmail->sendx(
$mail_title,
$mail_content,
[
[$salesname, $salesmail],
// ['gary', 'gary_chen@masada.com.tw']
],
"永佳捷科技"
);
}
}
$updatesql = "update wipwholestatus set ";
@ -400,6 +207,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$updatesql .= empty($customer_color_verify_file) ? "" : "customer_color_verify_file = '$customer_color_verify_file',";
$updatesql .= empty($customer_style_verify_file) ? "" : "customer_style_verify_file = '$customer_style_verify_file',";
$updatesql .= empty($site_survey_contact_form_verify_file) ? "" : "site_survey_contact_form_verify_file = '$site_survey_contact_form_verify_file',";
if (!empty($official_check_file))
$updatesql .= "official_check_file = '$official_check_file', ";
if (!empty($delivery_date_file))
$updatesql .= "delivery_date_file = '$delivery_date_file', ";
} else if ($user_department_id == 911) {
// 設計主管
if ($role_id == 1) {
@ -567,7 +378,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$qc_official_type = isset($_POST['qc_official_type2']) ? $_POST['qc_official_type2'] : $qc_official_type;
$qc_date = isset($_POST['qc_date2']) ? $_POST['qc_date2'] : $qc_date;
$qc_date_owner = isset($_POST['qc_date2_owner']) ? $_POST['qc_date2_owner'] : $qc_date_owner;
$end_qc_date = isset($_POST['end_qc_date2']) ? $_POST['end_qc_date2'] : $row['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;
$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;
@ -662,8 +473,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$updatesql .= "building_heigh_verify_file = '$building_heigh_verify_file', ";
if (!empty($site_survey_contact_verify_file))
$updatesql .= "site_survey_contact_verify_file = '$site_survey_contact_verify_file', ";
if (!empty($delivery_date_file))
$updatesql .= "delivery_date_file = '$delivery_date_file', ";
if (!empty($delivery_date_file2))
$updatesql .= "delivery_date_file = '$delivery_date_file2', ";
}
// 許協更新業務確認項目權限
@ -709,6 +520,270 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
// echo $updatesql;
// exit;
mysqli_query($link, $updatesql);
// 指派工勘人員
if ($warehouseid !== $old_warehouseid) {
if (checkNowFormStatus($link) == 'A') {
$sql = "SELECT form_key FROM flow
WHERE form_id = '$id'
AND flow_id = 'wws02'
AND flow_code = 'A'
";
$result = mysqli_query($link, $sql);
$form_key = $result->fetch_row()[0];
if (!empty($form_key)) {
$sql = "UPDATE wipwholestatus
SET warehouseid = '$warehouseid'
WHERE id = '$id';
";
mysqli_query($link, $sql);
$sql = "UPDATE subflow
SET current_assigner = '$warehouseid'
WHERE 1 = 1
AND seq = '1'
AND form_key = '$form_key';
";
mysqli_query($link, $sql);
}
}
}
if (!empty($official_check_date)) {
if ($official_check_date !== $old_official_check_date) {
$sql = "
SELECT accountid
FROM account
WHERE department_id = '250'
AND role_id IN ('1','2','3','4');
";
$result = mysqli_query($link, $sql);
foreach ($result as $row) {
$permission = $row["accountid"];
$title = "客戶:$custom 作番:$facilityno 官檢日變更";
$content = "客戶:$custom
作番:$facilityno
官檢日 $old_official_check_date => $official_check_date";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
}
// 工勘變更通知繪圖人員
if ($site_survey_contact_verify !== $old_site_survey_contact_verify) {
$site_survey_status = array(
"1" => "請選擇",
"0" => "已確認",
"2" => "無工勘需求",
"A" => "未動工",
"B" => "地下室施工",
"C" => "打樁",
"D" => "地基",
"E" => "挖土",
"G" => "機房",
"H" => "機械式淨高",
"M" => "樓中樓",
"OH" => "最高層(頂樓高度)",
"P" => "PIT(機坑深度)",
"R" => "R 樓",
"S" => "停工",
"T" => "TOP",
"TC" => "頂部間隙",
"TS" => "行程",
"TH" => "全高",
"Y" => "已搭、已出",
"YB" => "退購結案",
"YF" => "既有建物",
"YN" => "已搭、未出"
);
$sql = "
SELECT accountid
FROM account
WHERE department_id = '321'
AND role_id IN ('2','3','5');
";
$result = mysqli_query($link, $sql);
foreach ($result as $row) {
$permission = $row["accountid"];
$title = "客戶:$custom 作番:$facilityno 工勘狀態更改";
$content = "客戶:$custom
作番:$facilityno
工勘狀態 $site_survey_status[$old_site_survey_contact_verify] => $site_survey_status[$site_survey_contact_verify]";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
if (!empty($desin_documents_verify_file)) {
$title = "合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件";
$content = "合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件
<a href='wipwhole-rec-invoice-edit.php?function_name=wipwholestatus&{token_link}&id=$id' target='_blank'>前往下載</a>
";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => "M0168",
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
// 官檢日及移交日通知生管人員
if (!empty($official_check_date)) {
if ($official_check_date !== $old_official_check_date) {
$permission = "M0168";
$title = "官檢日變更 客戶:$custom 作番:$facilityno";
$content = "客戶:$custom
作番:$facilityno
官檢日 $old_official_check_date => $official_check_date";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
if (!empty($delivery_date)) {
if ($delivery_date !== $old_delivery_date) {
$permission_arr = ['M0168', 'M0012'];
foreach ($permission_arr as $permission) {
// $permission = "M0168";
$title = "移交日變更 客戶:$custom 作番:$facilityno";
$content = "客戶:$custom
作番:$facilityno
移交日 $old_delivery_date => $delivery_date";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
}
if (!empty($delivery_date)) {
if ($old_delivery_date !== $delivery_date) {
if (empty($change_all_contractno)) {
$mail_title = "作番大日程(汰改)合約號:" . $contractno . "-移交日變更通知";
$mail_content = "作番大日程(汰改)
合約號:" . $contractno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
} else {
$mail_title = "作番大日程(汰改)合約號:" . $contractno . "作番號:" . $facilityno . "-移交日變更通知";
$mail_content = "作番大日程(汰改)
合約號:" . $contractno
. "
作番號:" . $facilityno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
}
$cmail->sendx(
$mail_title,
$mail_content,
[
[$salesname, $salesmail],
// ['gary', 'gary_chen@masada.com.tw']
],
"永佳捷科技"
);
}
}
// 當試車完工日更改時 發出通知
if (!empty($tryrun_end_date) || !empty($tryrun_end_date2)) {
if ($tryrun_end_date !== $old_tryrun_end_date || $tryrun_end_date2 !== $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_content = "作番大日程(汰改)
合約號:" . $contractno . "
作番號:" . $facilityno . "
客戶名稱:" . $custom . "
已完成試車, 請注意後續交車時間, 如需要官檢, 請提供如下資料
<img style='width: 500px' src='https://masada.com.tw/wms/img/mail001.jpg' />
";
$cmail->sendx(
$mail_title,
$mail_content,
[
[$salesname, $salesmail],
[
accountid2name(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)],
accountid2email(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)]
]
// ['gary', 'gary_chen@masada.com.tw']
],
"永佳捷科技"
);
}
}
// 當移交日附件更改時 發出通知
if (!empty($delivery_date_file) || !empty($delivery_date_file2)) {
if ($delivery_date_file !== $old_delivery_date_file || $delivery_date_file2 !== $old_delivery_date_file) {
$delivery_date_file_tmp = $delivery_date_file !== $old_delivery_date_file ? $delivery_date_file : $delivery_date_file2;
$mail_title = "作番大日程(汰改)合約號:" . $contractno . "-交車完成通知";
$mail_content = "作番大日程(汰改)
合約號:" . $contractno . "
作番號:" . $facilityno . "
客戶名稱:" . $custom . "
已完成交車並已上傳交車單或竣工單, 請至OA系統中填寫移交日, 並準備後續請款事宜!
";
$cmail->sendx(
$mail_title,
$mail_content,
[
[$salesname, $salesmail],
[
accountid2name(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)],
accountid2email(manage_class_gary_ver($salesid))[manage_class_gary_ver($salesid)]
],
['葉俊麟', 'darren@masada.com.tw'],
['蘇淑娥 ', 'supe1218@masada.com.tw']
// ['gary', 'gary_chen@masada.com.tw']
],
"永佳捷科技"
);
}
}
echo "
<script type ='text/JavaScript'>
alert('資料更新成功');

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

@ -537,6 +537,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">實際試車完工日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input type="hidden" name="old_tryrun_end_date" value="<?= $row['tryrun_end_date']; ?>" >
<input class="form-control" type="date" id="tryrun_end_date" name="tryrun_end_date" value="<?= $row['tryrun_end_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#tryrun_end_date").val("");' <?= $warehouse2; ?>>清除</button>
@ -551,7 +552,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
</select>
</td>
</tr>
<tr>
<!-- <tr>
<td style="vertical-align: middle">移交日</td>
<td style="vertical-align: middle">
<div class="input-group">
@ -586,7 +587,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<p class="text-danger">2.注意填寫後不可更改!</p>
<p class="text-danger">3.只能維護當前月份。</p>
</td>
</tr>
</tr> -->
<tr>
<td colspan="4">
<?php
@ -623,9 +624,9 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<tr>
<td style="vertical-align: middle">官檢類型</td>
<td colspan="3">
<input type='radio' id="association_check_type_1" name='association_check_type' value='1' <?= $marketing2; ?> <?php echo $row['association_check_type'] == '1' ? "checked disabled" : ""; ?> />
<input type='radio' class='disabled_select' id="association_check_type_1" name='association_check_type' value='1' <?= $marketing2; ?> <?php echo $row['association_check_type'] == '1' ? "checked disabled" : ""; ?> />
<label for='association_check_type_1'>需要</label>
<input type='radio' id="association_check_type_2" name='association_check_type' value='2' <?= $marketing2; ?> <?php echo $row['association_check_type'] == '2' ? "checked disabled" : ""; ?> />
<input type='radio' class='disabled_select' id="association_check_type_2" name='association_check_type' value='2' <?= $marketing2; ?> <?php echo $row['association_check_type'] == '2' ? "checked disabled" : ""; ?> />
<label for='association_check_type_2'>不需要</label>
</td>
</tr>
@ -825,15 +826,16 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td colspan="7">
<textarea class="form-control " name="marketing_remark" <?= $marketing; ?>><?php echo $row['marketing_remark']; ?></textarea>
</tr>
<!-- <tr>
<tr>
<td style="vertical-align: middle">移交日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control disabled_select" type="date" id="delivery_date" name="delivery_date" value="<?= $row['delivery_date']; ?>" <?= $marketing2; ?>>
<input class="form-control disabled_select" type="date" min="<?php echo date("Y-m-01"); ?>" max="<?php echo date("Y-m-t"); ?>" id="delivery_date" name="delivery_date" value="<?= $row['delivery_date']; ?>" <?= $marketing2; ?>>
<input type="hidden" id="old_delivery_date" name="old_delivery_date" value="<?= $row['delivery_date']; ?>">
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#delivery_date").val("");' <?= $marketing2; ?>>清除</button>
</span>
<input type="hidden" id="old_delivery_date" name="old_delivery_date" value="<?= $row['delivery_date']; ?>">
<input type="hidden" id="old_delivery_date_tmp" value="<?= $row['delivery_date']; ?>">
</div>
</td>
<td style="vertical-align: middle">確認人</td>
@ -844,7 +846,18 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
</select>
</td>
<td colspan='4'>
<span class="text-danger">有官檢日或QC合格日後才可填寫</span>
<p class="text-danger">1.有官檢日或QC合格日後才可填寫。</p>
<p class="text-danger">2.注意填寫後不可更改!</p>
<p class="text-danger">3.只能維護當前月份。</p>
</td>
</tr>
<!-- <tr>
<td style="vertical-align: middle;">移交日附件(核准函)</td>
<td colspan='3' style="vertical-align: middle;">
<input style="width:70%;display:inline;" type="file" id="delivery_date_file" name="delivery_date_file" <?= $marketing2; ?>>
<?php
echo !empty($row['delivery_date_file']) ? "<a id='delivery_date_a' style='color:#00F;' href='" . $row['delivery_date_file'] . "' target='_blank'>下載附件</a>" : "";
?>
</td>
</tr> -->
<tr>
@ -1471,7 +1484,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">QC合格日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="end_qc_date" name="end_qc_date" value="<?= $row['end_qc_date']; ?>" <?= $pinzheng; ?>>
<input class="form-control disabled_select" type="date" id="end_qc_date" name="end_qc_date" value="<?= $row['end_qc_date']; ?>" <?= $pinzheng; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#end_qc_date").val("");' <?= $pinzheng; ?>>清除</button>
</span>
@ -1489,10 +1502,10 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">官檢日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="official_check_date" name="official_check_date" value="<?= $row['official_check_date']; ?>" <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "disabled" : ""; ?>>
<input type="hidden" id="old_official_check_date" name="old_official_check_date" value="<?= $row['official_check_date']; ?>" <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "disabled" : ""; ?>>
<input class="form-control disabled_select" type="date" id="official_check_date" name="official_check_date" value="<?= $row['official_check_date']; ?>" <?php in_array($user_id, ["M0054"]) ? "" : $pinzheng; ?> <?php echo in_array($row['association_check_type'], ['0', '2']) ? "disabled" : ""; ?>>
<input type="hidden" id="old_official_check_date" name="old_official_check_date" value="<?= $row['official_check_date']; ?>" <?php in_array($user_id, ["M0054"]) ? "" : $pinzheng; ?> <?php echo in_array($row['association_check_type'], ['0', '2']) ? "disabled" : ""; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#official_check_date").val("");' <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "disabled" : ""; ?>>清除</button>
<button class="btn btn-default" type='button' onclick='$("#official_check_date").val("");' <?php in_array($user_id, ["M0054"]) ? "" : $pinzheng; ?> <?php echo in_array($row['association_check_type'], ['0', '2']) ? "disabled" : ""; ?>>清除</button>
</span>
</div>
</td>
@ -1507,7 +1520,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<tr>
<td style='width:180px;'>官檢附件</td>
<td>
<input style="width:70%;display:inline;" type="file" id="official_check_file" name="official_check_file" <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "disabled" : ""; ?>>
<input style="width:70%;display:inline;" type="file" id="official_check_file" name="official_check_file" <?php in_array($user_id, ["M0054"]) ? "" : $pinzheng; ?> <?php echo in_array($row['association_check_type'], ['0', '2']) ? "disabled" : ""; ?>>
<?php
echo !empty($row['official_check_file']) ? "<a id='official_check_file' style='color:#00F;' href='" . $row['official_check_file'] . "' target='_blank'>下載附件</a>" : "";
?>
@ -1517,7 +1530,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<tr>
<td colspan="8">
<?php
if (in_array($user_department_id, [220, 912]) || in_array($user_id, ['M0164', 'M0165', 'M0127'])) {
if (in_array($user_department_id, [220, 912]) || in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0054'])) {
?>
<button onclick="savedata()" type="button" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;">存檔</button>
<?php
@ -1573,7 +1586,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">QC合格日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="end_qc_date2" name="end_qc_date2" value="<?= $row['end_qc_date']; ?>" <?= $warehouse2; ?>>
<input class="form-control disabled_select" type="date" id="end_qc_date2" name="end_qc_date2" value="<?= $row['end_qc_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#end_qc_date2").val("");' <?= $warehouse2; ?>>清除</button>
</span>
@ -1591,7 +1604,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">官檢日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="official_check_date2" name="official_check_date2" value="<?= $row['official_check_date']; ?>" <?= $warehouse2; ?>>
<input class="form-control disabled_select" type="date" id="official_check_date2" name="official_check_date2" value="<?= $row['official_check_date']; ?>" <?= $warehouse2; ?>>
<input type="hidden" id="old_official_check_date2" name="old_official_check_date2" value="<?= $row['official_check_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#official_check_date2").val("");' <?= $warehouse2; ?>>清除</button>
@ -1902,6 +1915,16 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
?>
</td>
</tr>
<tr>
<td style="vertical-align: middle;">移交日附件(核准函)</td>
<td colspan='3' style="vertical-align: middle;">
<input type="hidden" name="old_delivery_date_file" value="<?php echo $row['delivery_date_file']; ?>">
<input style="width:70%;display:inline;" type="file" id="delivery_date_file2" name="delivery_date_file2" <?= $warehouse2; ?>>
<?php
echo !empty($row['delivery_date_file']) ? "<a id='delivery_date_a' style='color:#00F;' href='" . $row['delivery_date_file'] . "' target='_blank'>下載附件</a>" : "";
?>
</td>
</tr>
<tr>
<td colspan="4">
<?php

Loading…
Cancel
Save