Cheng 1 year ago
parent
commit
2840d81dd2
  1. 1
      .gitignore
  2. 2
      wms/T8_APItest_from_bpm.php
  3. 37
      wms/api/bpm/addConstructOutsource.ini
  4. 102
      wms/api/bpm/addConstructOutsource.php
  5. 31
      wms/api/bpm/addConstructOutsource.txt
  6. 24
      wms/board-record-submit.php
  7. 121
      wms/css/view/wipwhole-index.php
  8. 7
      wms/frame/api_getdata.php
  9. 1
      wms/frame/notice.php
  10. 2
      wms/fun_global.php
  11. 8
      wms/mkt/pricereview-index.php
  12. 2
      wms/ngfeedback-index.php
  13. 13
      wms/notice-delete-all.php
  14. 37
      wms/notice-edit.php
  15. 109
      wms/notice-index.php
  16. 137
      wms/schedule-index.php
  17. 138
      wms/sign/list.php
  18. 3
      wms/wipwhole-index-export-excel.php
  19. 16
      wms/wipwhole-index-function.php
  20. 8
      wms/wipwhole-index-table-html.php
  21. 16
      wms/wipwhole-index.php
  22. 187
      wms/wipwhole-rec-invoice-edit-submit.php
  23. 151
      wms/wipwhole-rec-invoice-edit.php
  24. 251
      wms/wipwhole-rec-invoice.php
  25. 21
      wms/wipwhole-renovate-index-export-excel.php
  26. 49
      wms/wipwhole-renovate-index-function.php
  27. 18
      wms/wipwhole-renovate-index-table-html.php
  28. 14
      wms/wipwhole-renovate-index.php
  29. 411
      wms/wipwhole-renovate-rec-invoice-edit-submit.php
  30. 533
      wms/wipwhole-renovate-rec-invoice-edit.php
  31. 270
      wms/wipwhole-renovate-rec-invoice.php
  32. 123
      wms/wipwhole-wipinstallstatus-index-modal.php
  33. 299
      wms/wipwhole-wipinstallstatus-index.php
  34. 9
      wms/wipwholeinstall-index-function.php
  35. 9
      wms/wipwholeinstall-renovate-index-function.php

1
.gitignore

@ -26,3 +26,4 @@ wms/contract/images/contracts
wms/test.php wms/test.php
app/account_log/ app/account_log/
wms/gary2.php wms/gary2.php
wms/chinese.php

2
wms/T8_APItest_from_bpm.php

@ -23,7 +23,7 @@ if ($hashReferer == $referrer) {
function send_data_to_API($validation) function send_data_to_API($validation)
{ {
// $apiurl = 'http://60.244.87.101:880//twWebAPI/V1/STKASSY/PostERPData'; // $apiurl = 'http://60.244.87.101:880//twWebAPI/V1/STKASSY/PostERPData';
$apiurl = 'http://10.10.145.2:880//twWebAPI/V1/STKASSY/PostERPData'; $apiurl = 'http://10.10.145.2:880/twWebAPI/V1/STKASSY/PostERPData';
// $apiurl = 'https://erp.masada.com.tw:780/twWebAPI/V1/STKASSY/PostERPData'; // $apiurl = 'https://erp.masada.com.tw:780/twWebAPI/V1/STKASSY/PostERPData';
$headerParam = [ $headerParam = [

37
wms/api/bpm/addConstructOutsource.ini

@ -0,0 +1,37 @@
[1704265677]
test = "test"
[1704265897]
fdSignEnable = ""
fdNumber = "D022"
fd_3c7c8fe420374a = "test"
fd_3c7d1b1c73adc0 = "12345678"
docSubject = "工程A"
fd_3c7d1c085a7922 = "100"
fd_3c7d23c16f9606 = "100"
fdIsFiling = ""
fd_3c7d217e9aee76 = "100"
fd_3c7d1b36e1bf06 = "328桃園市觀音區崙坪村8鄰140號"
fdCanCircularize = ""
fd_3c7c8f83024a64 = "工程A"
docStatus = "20"
docCreateTime = "2024-01-03 15:11:00.0"
fd_3c7c8e9cdb7b84 = "abc1234"
fd_3c7d1be15a905a = "0987980607"
fdId = "18cce2968e5df283fcfe62c4b8487aac"
fd_3c7d1b06bde1d4 = "負責人A"
fd_3c7c8f95d36a78 = "328桃園市觀音區崙坪村8鄰140號"
fd_3c7d1ad092a344 = "永佳捷科技股份有限公司"
[1704267391]
fd_3c7d23c16f9606 = "100"
[1704267579]
fd_3c7d23c16f9606 = "100"
[1704267778]
fd_3c7d23c16f9606 = "100"
[1704268463]
fdId = "18cce504901cfe97c572b7548da9349e"

102
wms/api/bpm/addConstructOutsource.php

@ -0,0 +1,102 @@
<?php
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
show405Error();
exit;
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$request_data_json = file_get_contents('php://input');
$request_data = json_decode(file_get_contents('php://input'), true);
if (empty($request_data)) {
show400Error();
exit;
}
writePostIni($request_data);
writePostIniJson($request_data);
$fd_id = $request_data[$fd_id];
// $dsn = 'mysql:host=localhost;dbname=appwms_test';
// $username = 'masadaroot';
// $password = 'x6h5E5p#u8y';
// try {
// $pdo = new PDO($dsn, $username, $password);
// $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// $pdo->exec('SET CHARACTER SET utf8mb4');
// $pdo->beginTransaction();
// $sth = $pdo->prepare("INSERT INTO account (accounttype , accountid) VALUES (?, ?)");
// $sth->bindValue(1, 'mf_vol_no');
// $sth->execute();
// $pdo->commit();
// showSuccessMessage();
// } catch (PDOException $e) {
// $pdo->rollBack();
// echo "Transaction failed: " . $e->getMessage();
// }
}
function showSuccessMessage()
{
$response = array('status' => 'success', 'message' => 'Data received and stored successfully');
header('Content-Type: application/json');
echo json_encode($response);
}
function showErrorMessage()
{
$response = array('status' => 'error', 'message' => 'Data received and stored error');
header('Content-Type: application/json');
echo json_encode($response);
}
function show400Error()
{
http_response_code(400);
echo 'Invalid request data';
}
function show405Error()
{
http_response_code(405);
echo 'Method Not Allowed';
}
function writePostIni($request_data)
{
// 讀取現有 ini 檔案的資料
$ini_file = 'addConstructOutsource.ini';
$existing_data = parse_ini_file($ini_file, true);
// 將接收到的資料加入現有資料
$timestamp = time();
$existing_data[$timestamp] = $request_data;
// 將資料寫入 ini 檔
$ini_content = '';
foreach ($existing_data as $key => $value) {
$ini_content .= "[$key]\n";
foreach ($value as $k => $v) {
$ini_content .= "$k = \"$v\"\n";
}
$ini_content .= "\n";
}
file_put_contents($ini_file, $ini_content);
}
function writePostIniJson($request_data)
{
$txt_file = 'addConstructOutsource.txt';
$txt = "";
$file = fopen($txt_file, 'a');
foreach($request_data as $k => $v){
$txt .= "$k = \"$v\"\n";
}
fwrite($file, $txt . PHP_EOL);
fclose($file);
}

31
wms/api/bpm/addConstructOutsource.txt

@ -0,0 +1,31 @@
test = "test"
fdSignEnable = ""
fdNumber = "D022"
fd_3c7c8fe420374a = "test"
fd_3c7d1b1c73adc0 = "12345678"
docSubject = "工程A"
fd_3c7d1c085a7922 = "100"
fd_3c7d23c16f9606 = "100"
fdIsFiling = ""
fd_3c7d217e9aee76 = "100"
fd_3c7d1b36e1bf06 = "328桃園市觀音區崙坪村8鄰140號"
fdCanCircularize = ""
fd_3c7c8f83024a64 = "工程A"
docStatus = "20"
docCreateTime = "2024-01-03 15:11:00.0"
fd_3c7c8e9cdb7b84 = "abc1234"
fd_3c7d1be15a905a = "0987980607"
fdId = "18cce2968e5df283fcfe62c4b8487aac"
fd_3c7d1b06bde1d4 = "負責人A"
fd_3c7c8f95d36a78 = "328桃園市觀音區崙坪村8鄰140號"
fd_3c7d1ad092a344 = "永佳捷科技股份有限公司"
fd_3c7d23c16f9606 = "100"
fd_3c7d23c16f9606 = "100"
fd_3c7d23c16f9606 = "100"
fdId = "18cce504901cfe97c572b7548da9349e"

24
wms/board-record-submit.php

@ -36,6 +36,30 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$db_query .= "'$title', '$content', '$target_file1', '1', '" . $user_id . "', NOW())"; $db_query .= "'$title', '$content', '$target_file1', '1', '" . $user_id . "', NOW())";
$result = mysqli_query($link, $db_query); $result = mysqli_query($link, $db_query);
if (mysqli_affected_rows($link) > 0) { if (mysqli_affected_rows($link) > 0) {
include "class/Cnotice.php";
$cn = new Cnotice();
$sql = "
SELECT accountid
FROM account
WHERE accounttype IN ('B','C','D','E','M','W')
";
$result = mysqli_query($link, $sql);
foreach ($result as $row) {
$permission = $row["accountid"];
$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);
}
echo "<script type ='text/JavaScript'>"; echo "<script type ='text/JavaScript'>";
echo "alert('新增成功');"; echo "alert('新增成功');";
echo "location.href='board-index.php?function_name=board&token=" . $token . "';"; echo "location.href='board-index.php?function_name=board&token=" . $token . "';";

121
wms/css/view/wipwhole-index.php

@ -71,6 +71,127 @@
text-align: center; text-align: center;
} }
#loadingOverlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.7);
/* 透明度的背景颜色 */
z-index: 9999;
/* 确保在最上层显示 */
/* 添加加载动画的样式 */
}
.hidden {
display: none;
}
#loadingOverlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.7);
/* 半透明的背景 */
z-index: 9999;
/* 确保显示在最上层 */
display: flex;
justify-content: center;
align-items: center;
}
.loading-text {
text-align: center;
margin-top: 10px;
/* 调整文字与图标之间的间距 */
font-size: 16px;
color: #333;
/* 文字颜色 */
}
.loading-icon {
/* 这里是你加载图标的样式,可以是一个动画、GIF图或者SVG等 */
/* 例如一个简单的加载圆圈动画 */
border: 10px solid #f3f3f3;
/* 灰色边框 */
border-top: 10px solid #3498db;
/* 蓝色顶部边框 */
border-radius: 50%;
width: 80px;
height: 80px;
animation: spin 2s linear infinite;
/* 旋转动画 */
}
/* The Modal (background) */
.modal {
display: none;
/* Hidden by default */
position: fixed;
/* Stay in place */
z-index: 1;
/* Sit on top */
padding-top: 100px;
/* Location of the box */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
}
.modal .back {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.4);
/* Black w/ opacity */
}
/* Modal Content */
.modal-content {
z-index: 9;
background-color: #fefefe;
margin: auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
}
/* The Close Button */
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {

7
wms/frame/api_getdata.php

@ -81,7 +81,12 @@ function get_notice($token)
$i = 1; $i = 1;
$data = []; $data = [];
$sql = "select id, kind, related_id, title from notice "; $sql = "select id, kind, related_id, title from notice ";
$sql .= "where (permission like '%" . $user_id . "%' or permission = 'ALL' or creater = '$user_id') "; $sql .= "where (
permission like '%" . $user_id . "%'
or permission = 'ALL'
-- or creater = '$user_id'
)
";
$sql .= "and (haveread != '1' or haveread is null) "; $sql .= "and (haveread != '1' or haveread is null) ";
$sql .= "order by id desc limit 0, 6"; $sql .= "order by id desc limit 0, 6";
$res = mysqli_query($link, $sql); $res = mysqli_query($link, $sql);

1
wms/frame/notice.php

@ -61,6 +61,7 @@ h5 a {
<div class="card-header"> <div class="card-header">
<h5 class="card-title m-0"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-bell" viewBox="0 0 16 16"><path d="M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zM8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z"/></svg> <h5 class="card-title m-0"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-bell" viewBox="0 0 16 16"><path d="M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zM8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z"/></svg>
<a href="/wms/notice-index.php?token=<?php echo $token; ?>" target="_parent">系統通知</a></h5> <a href="/wms/notice-index.php?token=<?php echo $token; ?>" target="_parent">系統通知</a></h5>
<a style="float:right;" href="/wms/notice-delete-all.php?token=<?php echo $token; ?>" target="_parent">全部已讀</a>
</div> </div>
<div class="card-body p-0"> <div class="card-body p-0">
Loading... Loading...

2
wms/fun_global.php

@ -176,6 +176,8 @@ function check_user_permission($user_id, $token)
'/wms/index.php', '/wms/index.php',
'/wms/notice-index.php', '/wms/notice-index.php',
'/wms/notice-edit.php', '/wms/notice-edit.php',
'/wms/notice-delete.php',
'/wms/notice-delete-all.php',
'/wms/change-password.php', '/wms/change-password.php',
'/wms/wipwhole-change-contractdate.php', '/wms/wipwhole-change-contractdate.php',
'/wms/wipwhole-change-planning-customer-name.php', '/wms/wipwhole-change-planning-customer-name.php',

8
wms/mkt/pricereview-index.php

@ -11,8 +11,8 @@ $data = array();
// sql語法存在變數中 // sql語法存在變數中
$sql_cmd = sql_myself($user_id, "pricereview_main .creater"); $sql_cmd = sql_myself($user_id, "pricereview_main .creater");
$sql = "select pricereview_main.*, contract_new_apply.status as applystatus, contract_new_apply.progress as applyprogress from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where pricereview_main.creater = '$user_id' and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id"; $sql = "select pricereview_main.*, contract_new_apply.status as applystatus, contract_new_apply.progress as applyprogress from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where pricereview_main.creater = '$user_id' and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id";
// M0024許伃廷,M0107許紓晴權限全開 // M0024許伃廷,M0107許紓晴,,M0175陳君敏,M0189權限全開
if ($user_id == "M0024" || $user_id == 'M0026' || $user_id == "M0107" || $user_id == "M0174" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") { if ($user_id == "M0024" || $user_id == 'M0026' || $user_id == "M0107" || $user_id == "M0174" || $user_id == "M0175" ||$user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") {
$sql_cmd = "where create_at >= '2023-01-01 00:00:00'"; $sql_cmd = "where create_at >= '2023-01-01 00:00:00'";
$sql = "select pricereview_main.*, contract_new_apply.status as applystatus, contract_new_apply.progress as applyprogress from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where create_at >= '2023-01-01 00:00:00' and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id"; $sql = "select pricereview_main.*, contract_new_apply.status as applystatus, contract_new_apply.progress as applyprogress from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where create_at >= '2023-01-01 00:00:00' and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id";
} }
@ -472,7 +472,7 @@ if ($data) :
} }
</style> </style>
<td> <td>
<?php if (($data['status'] == 'YY' && $oneself) || ($data['status'] == 'YY' && ($user_id == "M0174" || $user_id == 'M0225' || $user_id === "M0107" || $user_id === "M0060"))) : ?> <?php if (($data['status'] == 'YY' && $oneself) || ($data['status'] == 'YY' && ($user_id == "M0174" || $user_id == 'M0225' || $user_id === "M0107" || $user_id === "M0060" || $user_id === "M0175"))) : ?>
<?php if (($user_id === "M0107" || $user_id === "M0060") && $data['applystatus'] < 3) : ?> <?php if (($user_id === "M0107" || $user_id === "M0060") && $data['applystatus'] < 3) : ?>
<span style="font-size:13px;font-weight:600">待申請</span> <span style="font-size:13px;font-weight:600">待申請</span>
<?php elseif ($data['applystatus'] < 3) : ?> <?php elseif ($data['applystatus'] < 3) : ?>
@ -495,7 +495,7 @@ if ($data) :
<span style="font-size:13px;font-weight:600">--</span> <span style="font-size:13px;font-weight:600">--</span>
<?php endif; ?> <?php endif; ?>
<!-- 工號M0107、M0174有所有權限 --> <!-- 工號M0107、M0174有所有權限 -->
<?php if (($data['status'] === 'YY' && $data['applystatus'] == 3 && ($user_id == "M0107" || $user_id == "M0060")) || $user_id == "M0174" || $user_id == 'M0225') : ?> <?php if (($data['status'] === 'YY' && $data['applystatus'] == 3 && ($user_id == "M0107" || $user_id == "M0060" || $user_id == "M0175")) || $user_id == "M0174" || $user_id == 'M0225') : ?>
<a class="applybtn" href="../contract/contract-download.php?id=<?php echo $data['id'] . '&' . $para ?>">下載</a> <a class="applybtn" href="../contract/contract-download.php?id=<?php echo $data['id'] . '&' . $para ?>">下載</a>
<?php endif; ?> <?php endif; ?>
</td> </td>

2
wms/ngfeedback-index.php

@ -191,7 +191,7 @@ $sql = "
f_return_department_name(responsibledepartment) as responsibledepartment_name f_return_department_name(responsibledepartment) as responsibledepartment_name
from ngfeedback from ngfeedback
"; ";
if(accountidToDepartId($user_id !== '912')){ if(accountidToDepartId($user_id) !== '912'){
$sql .= sql_myself($user_id); $sql .= sql_myself($user_id);
} }

13
wms/notice-delete-all.php

@ -0,0 +1,13 @@
<?php
ob_start();
include "header.php";
$db_query = "
update notice set haveread = 1
where permission like '%" . $user_id . "%'
";
$res = mysqli_query($link, $db_query);
header("Refresh:0; url=index.php?".$token_link);
ob_end_flush();
?>

37
wms/notice-edit.php

@ -6,22 +6,30 @@ $id = isset($_GET['id']) ? $_GET['id'] : die('ERROR: Record ID not found.');
$db_query = "select * from notice where id = '$id'"; $db_query = "select * from notice where id = '$id'";
$data = mysqli_query($link, $db_query); $data = mysqli_query($link, $db_query);
foreach($data as $data) : // 進入等於已讀
$sql = "
UPDATE notice SET
haveread = 1
WHERE id = '$id'
";
mysqli_query($link, $sql);
foreach ($data as $data) :
?> ?>
<style> <style>
.nextline { .nextline {
width: 100%; width: 100%;
height: 0; height: 0;
} }
</style> </style>
<script> <script>
$(function(){ $(function() {
$('#btn').click(function(){ $('#btn').click(function() {
history.go(-1); history.go(-1);
}); });
}); });
</script> </script>
<div class="container"> <div class="container">
<form class="form-inline" method="post" action="#"> <form class="form-inline" method="post" action="#">
<div> <div>
<label for="title">標題</label> <label for="title">標題</label>
@ -30,7 +38,10 @@ $(function(){
<div class="nextline"></div> <div class="nextline"></div>
<div> <div>
<label for="content">內容</label><br> <label for="content">內容</label><br>
<textarea class="form-control2" name="content" id="content" rows="8" cols="100" required><?php echo $data['content']; ?></textarea> <div>
<?php echo nl2br(str_replace("{token_link}", $token_link, $data['content'])); ?>
</div>
<!-- <textarea class="form-control2" name="content" id="content" rows="8" cols="100" required><?php echo $data['content']; ?></textarea> -->
</div> </div>
<div class="nextline"></div> <div class="nextline"></div>
<div> <div>
@ -39,7 +50,7 @@ $(function(){
</div> </div>
<input type="hidden" name="id" value="<?php echo $id; ?>"> <input type="hidden" name="id" value="<?php echo $id; ?>">
</form> </form>
</div> </div>
<?php <?php
endforeach; endforeach;

109
wms/notice-index.php

@ -1,4 +1,5 @@
<?php <?php
ini_set('display_errors', 'on');
include "header.php"; include "header.php";
// 設置一個空陣列來放資料 // 設置一個空陣列來放資料
@ -6,11 +7,18 @@ $data = array();
// sql語法存在變數中 // sql語法存在變數中
$sql = "select * from notice "; $sql = "select * from notice ";
$sql .= "where (permission like '%".$user_id."%' or permission = 'ALL' or creater = '$user_id') "; $sql .= "
where (
permission like '%" . $user_id . "%'
or permission = 'ALL'
-- or creater = '$user_id'
)
";
$sql .= "order by id"; $sql .= "order by id";
// 用mysqli_query方法執行(sql語法)將結果存在變數中 // 用mysqli_query方法執行(sql語法)將結果存在變數中
$data = mysqli_query($link,$sql); $data = mysqli_query($link, $sql);
?> ?>
<!-- <!--
@ -21,44 +29,47 @@ $data = mysqli_query($link,$sql);
</p> </p>
--> -->
<?php <?php
if($data): if ($data) :
?> ?>
<style> <style>
table { table {
table-layout:fixed; table-layout: fixed;
width: 100%;
}
td {
word-wrap: break-word;
}
img {
width: 125px;
}
.width_style_1 {
width: 125px;
}
table {
width: 100%; width: 100%;
} }
td { #table_index_filter {
word-wrap:break-word; float: right;
} }
img { #table_index_paginate {
width:125px; float: right;
} }
.width_style_1 { label {
width:125px;
}
table{
width:100%;
}
#table_index_filter{
float:right;
}
#table_index_paginate{
float:right;
}
label {
display: inline-flex; display: inline-flex;
margin-bottom: .5rem; margin-bottom: .5rem;
margin-top: .5rem; margin-top: .5rem;
} }
</style> </style>
<div style="overflow-x:auto;"> <div style="overflow-x:auto;">
<table id="table_index" class="table table-striped table-bordered" style="width:100%"> <table id="table_index" class="table table-striped table-bordered" style="width:100%">
<thead> <thead>
<tr> <tr>
@ -67,34 +78,48 @@ label {
<th>標題</th> <th>標題</th>
<th>內容</th> <th>內容</th>
<th>確認</th> <th>確認</th>
<th>已讀</th>
<th>建檔人</th> <th>建檔人</th>
<th>建檔時間</th> <th>建檔時間</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach($data as $data) : if (is_null($data['haveread'])):?> <?php foreach ($data as $data) : ?>
<tr> <tr>
<td><?php echo $data['id']; ?></td> <td><?php echo $data['id']; ?></td>
<td><?php if ($data['kind']=='1') echo "系統"; else echo "會議"; ?></td> <td><?php if ($data['kind'] == '1') echo "系統";
else echo "會議"; ?></td>
<td><?php echo $data['title']; ?></td> <td><?php echo $data['title']; ?></td>
<td><?php echo $data['content']; ?></td> <td><?php echo $data['content']; ?></td>
<!-- <td><?php if ($data['haveread']=='1') echo "已確認"; else echo "新通知"; ?></td> --> <td>
<!-- <td><button onclick="checked(event, <?php echo $data['id'];?>)" >不再通知</button></td> --> <?php
if ($data['haveread'] == '1')
echo "已確認";
else
echo "新通知"; ?>
</td>
<!-- <td><button onclick="checked(event, <?php echo $data['id']; ?>)" >不再通知</button></td> -->
<td><a href="notice-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-info btn-sm" onClick="return confirm('確認關閉通知嗎?')"> <td><a href="notice-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-info btn-sm" onClick="return confirm('確認關閉通知嗎?')">
<span class="glyphicon glyphicon-ok"></span> <span class="glyphicon glyphicon-ok"></span>
</a></td> </a></td>
<td><?php echo $data['creater']; ?></td> <td><?php echo !empty(accountidToName($data['creater'])) ? accountidToName($data['creater']) : $data['creater']; ?></td>
<td><?php echo $data['create_at']; ?></td> <td><?php echo $data['create_at']; ?></td>
</tr> </tr>
<?php endif;?>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>
</div> </div>
<script>
$('#table_index').DataTable({
"order": [
[4, "desc"],
[0, "desc"]
]
});
</script>
<?php <?php
else: else :
echo "<h2>There is no record!</h2>"; echo "<h2>There is no record!</h2>";
endif; endif;

137
wms/schedule-index.php

@ -1,7 +1,7 @@
<?php <?php
include "header.php"; include "header.php";
$tourl = $_SERVER["SCRIPT_NAME"]."?function_name=schedule&token=".$token; $tourl = $_SERVER["SCRIPT_NAME"] . "?function_name=schedule&token=" . $token;
// 工務總處可瀏覽全部資料 // 工務總處可瀏覽全部資料
$sql = "select department_id, role_id from account where accountid = '$user_id'"; $sql = "select department_id, role_id from account where accountid = '$user_id'";
@ -17,22 +17,22 @@ $dr_arr = ['3114', '3133', '3144', '3152'];
if (!isset($_GET["p"]) || $_GET["p"] <= 0) $p = 1; if (!isset($_GET["p"]) || $_GET["p"] <= 0) $p = 1;
else $p = $_GET["p"]; else $p = $_GET["p"];
$page_each = 50; $page_each = 50;
$page_from = ($p-1)*$page_each; $page_from = ($p - 1) * $page_each;
// 設置一個空陣列來放資料 // 設置一個空陣列來放資料
$data = array(); $data = array();
// sql語法存在變數中 // sql語法存在變數中
$page_close = 0; $page_close = 0;
$sql_cmd2 = ""; $sql_cmd2 = "";
$sql_cmd = sql_myself($user_id, "repairerid"); $sql_cmd = sql_myself($user_id, "repairedid");
if ($user_department_id == "501" || $user_department_id == "322" || $user_id == "M0012" || $user_id == "M0105") $sql_cmd = ""; if ($user_department_id == "501" || $user_department_id == "322" || $user_id == "M0012" || $user_id == "M0105") $sql_cmd = "";
if (in_array($user_department_id.$user_role_id, $dr_arr)) $sql_cmd = ""; if (in_array($user_department_id . $user_role_id, $dr_arr)) $sql_cmd = "";
//if (empty($sql_cmd)) $sql_cmd = "where "; //if (empty($sql_cmd)) $sql_cmd = "where ";
if (!empty($_GET["contractno"])) $sql_cmd2 .= "and contractno = '".$_GET["contractno"]."' "; if (!empty($_GET["contractno"])) $sql_cmd2 .= "and contractno = '" . $_GET["contractno"] . "' ";
if (!empty($_GET["facilityno"])) $sql_cmd2 .= "and facilityno = '".$_GET["facilityno"]."' "; if (!empty($_GET["facilityno"])) $sql_cmd2 .= "and facilityno = '" . $_GET["facilityno"] . "' ";
//if (!empty($_GET["repairername"])) $sql_cmd2 .= "and repairername = '".$_GET["repairername"]."' "; //if (!empty($_GET["repairername"])) $sql_cmd2 .= "and repairername = '".$_GET["repairername"]."' ";
if (!empty($sql_cmd2)) { if (!empty($sql_cmd2)) {
if ($sql_cmd == "") $sql_cmd = "where ".ltrim($sql_cmd2, "and"); if ($sql_cmd == "") $sql_cmd = "where " . ltrim($sql_cmd2, "and");
else $sql_cmd .= $sql_cmd2; else $sql_cmd .= $sql_cmd2;
$page_close = 1; // 不分頁 $page_close = 1; // 不分頁
} }
@ -43,27 +43,27 @@ if (!$page_close) $sql .= " limit $page_from, $page_each";
//echo $sql; //echo $sql;
// 用mysqli_query方法執行(sql語法)將結果存在變數中 // 用mysqli_query方法執行(sql語法)將結果存在變數中
$data = mysqli_query($link,$sql); $data = mysqli_query($link, $sql);
$total_nums = mysqli_affected_rows($link); $total_nums = mysqli_affected_rows($link);
?> ?>
<!-- <a href="create.php"><h2>新增</h2></a> --> <!-- <a href="create.php"><h2>新增</h2></a> -->
<?php if ($user_auth&2) { ?> <?php if ($user_auth & 2) { ?>
<p> <p>
<a href="schedule-create.php?function_name=schedule&<?php echo $token_link; ?>" class="btn btn-info btn-sm"> <a href="schedule-create.php?function_name=schedule&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-plus"></span> <span class="glyphicon glyphicon-plus"></span>
</a> </a>
</p> </p>
<?php <?php
} }
if($data): if ($data) :
if($_SERVER["REQUEST_METHOD"] == "POST"){ if ($_SERVER["REQUEST_METHOD"] == "POST") {
if(empty($_POST["name"]) && empty($_POST["email"]) && empty($_POST["website"])){ if (empty($_POST["name"]) && empty($_POST["email"]) && empty($_POST["website"])) {
echo "<p class='error'>Please fill up the required field!</p>"; echo "<p class='error'>Please fill up the required field!</p>";
} else { } else {
header("Location:schedule-index.php"); header("Location:schedule-index.php");
@ -72,41 +72,45 @@ if($data):
?> ?>
<style> <style>
table { table {
table-layout:fixed; table-layout: fixed;
width: 100%; width: 100%;
} }
td { td {
word-wrap:break-word; word-wrap: break-word;
} }
img { img {
width:125px; width: 125px;
} }
.width_style_1 { .width_style_1 {
width:125px; width: 125px;
} }
table{ table {
width:100%; width: 100%;
} }
#table_index2_filter{
float:right; #table_index2_filter {
} float: right;
#table_index2_paginate{ }
float:right;
} #table_index2_paginate {
label { float: right;
}
label {
display: inline-flex; display: inline-flex;
margin-bottom: .5rem; margin-bottom: .5rem;
margin-top: .5rem; margin-top: .5rem;
} }
#preloader {/* 這是整個會蓋住畫面的底色色塊 */ #preloader {
/* 這是整個會蓋住畫面的底色色塊 */
position: fixed; position: fixed;
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -114,8 +118,10 @@ label {
top: 10%; top: 10%;
background-color: #fff; background-color: #fff;
z-index: 9999; z-index: 9999;
} }
#status {/* 這是中間loading的gif坐標css,我們盡量讓他畫面置中 */
#status {
/* 這是中間loading的gif坐標css,我們盡量讓他畫面置中 */
position: fixed; position: fixed;
width: 218px; width: 218px;
height: 419px; height: 419px;
@ -123,11 +129,10 @@ label {
margin-top: -160px; margin-top: -160px;
left: 50%; left: 50%;
top: 50%; top: 50%;
} }
</style>
</style> <script>
<script> $(function() {
$(function(){
$('#table_index2').DataTable({ $('#table_index2').DataTable({
"pageLength": 50, "pageLength": 50,
"searching": false, "searching": false,
@ -138,11 +143,11 @@ $(function(){
<?php if (!$page_close) { ?> <?php if (!$page_close) { ?>
$('.dataTables_info').hide(); $('.dataTables_info').hide();
<?php } ?> <?php } ?>
}); });
</script> </script>
<div style="overflow-x:auto;"> <div style="overflow-x:auto;">
<form method='get' action='<?php echo $tourl;?>'> <form method='get' action='<?php echo $tourl; ?>'>
<table class='table table-striped table-bordered' style='width:70%;text-align:center;margin:0 auto'> <table class='table table-striped table-bordered' style='width:70%;text-align:center;margin:0 auto'>
<tbody> <tbody>
<tr> <tr>
@ -184,7 +189,7 @@ $(function(){
<th>簽名檔</th> <th>簽名檔</th>
<th>建檔人</th> <th>建檔人</th>
<th>建檔時間</th> <th>建檔時間</th>
<?php if ($user_auth&2) { ?> <?php if ($user_auth & 2) { ?>
<th>修改</th> <th>修改</th>
<th>刪除</th> <th>刪除</th>
<?php } ?> <?php } ?>
@ -192,7 +197,7 @@ $(function(){
</thead> </thead>
<tbody> <tbody>
<?php foreach($data as $data) : ?> <?php foreach ($data as $data) : ?>
<tr> <tr>
<td><?php echo $data['id']; ?></td> <td><?php echo $data['id']; ?></td>
<td style="width:100pd;word-break: break-all;"><?php echo $data['contractno']; ?></td> <td style="width:100pd;word-break: break-all;"><?php echo $data['contractno']; ?></td>
@ -205,7 +210,9 @@ $(function(){
<td style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis;"><?php echo $data['item']; ?></td> <td style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis;"><?php echo $data['item']; ?></td>
<td style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis;"><?php echo $data['item_detail']; ?></td> <td style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis;"><?php echo $data['item_detail']; ?></td>
<td style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis;"><?php echo $data['result']; ?></td> <td style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis;"><?php echo $data['result']; ?></td>
<td><?php if ($data['evidences']) { echo "<a href=\"/app/".$data['evidences']."\">瀏覽</a>"; } ?></td> <td><?php if ($data['evidences']) {
echo "<a href=\"/app/" . $data['evidences'] . "\">瀏覽</a>";
} ?></td>
<td><?php echo $data['descriptons']; ?></td> <td><?php echo $data['descriptons']; ?></td>
<td><?php echo $data['customer_login_id']; ?></td> <td><?php echo $data['customer_login_id']; ?></td>
<td><?php echo $data['customer_login_name']; ?></td> <td><?php echo $data['customer_login_name']; ?></td>
@ -225,7 +232,7 @@ $(function(){
<td style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis;"><?php echo $data['customer_signature']; ?></td> <td style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis;"><?php echo $data['customer_signature']; ?></td>
<td><?php echo $data['creater']; ?></td> <td><?php echo $data['creater']; ?></td>
<td><?php echo $data['create_at']; ?></td> <td><?php echo $data['create_at']; ?></td>
<?php if ($user_auth&2) { ?> <?php if ($user_auth & 2) { ?>
<td> <td>
<p> <p>
<a href="schedule-edit.php?id=<?php echo $data['id']; ?>&function_name=schedule&<?php echo $token_link; ?>" class="btn btn-info btn-sm"> <a href="schedule-edit.php?id=<?php echo $data['id']; ?>&function_name=schedule&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
@ -249,20 +256,20 @@ $(function(){
<?php <?php
if (!$page_close) { if (!$page_close) {
if (isset($_GET["contractno"])) $tourl .= "&contractno=".$_GET["contractno"]; if (isset($_GET["contractno"])) $tourl .= "&contractno=" . $_GET["contractno"];
if (isset($_GET["facilityno"])) $tourl .= "&facilityno=".$_GET["facilityno"]; if (isset($_GET["facilityno"])) $tourl .= "&facilityno=" . $_GET["facilityno"];
?> ?>
<nav aria-label="Page navigation example"> <nav aria-label="Page navigation example">
<ul class="pagination"> <ul class="pagination">
<li class="page-item"><a class="page-link" href="<?php echo $tourl; ?>&p=<?php echo $p-1; ?>">Previous</a></li> <li class="page-item"><a class="page-link" href="<?php echo $tourl; ?>&p=<?php echo $p - 1; ?>">Previous</a></li>
<?php if ($p > 2) { ?> <?php if ($p > 2) { ?>
<li class="page-item<?php if ($_GET["p"]==($p-2)) echo " active"; ?>"><a class="page-link" href="<?php echo $tourl; ?>&p=<?php echo $p-2; ?>"><?php echo $p-2; ?></a></li> <li class="page-item<?php if ($_GET["p"] == ($p - 2)) echo " active"; ?>"><a class="page-link" href="<?php echo $tourl; ?>&p=<?php echo $p - 2; ?>"><?php echo $p - 2; ?></a></li>
<li class="page-item<?php if ($_GET["p"]==($p-1)) echo " active"; ?>"><a class="page-link" href="<?php echo $tourl; ?>&p=<?php echo $p-1; ?>"><?php echo $p-1; ?></a></li> <li class="page-item<?php if ($_GET["p"] == ($p - 1)) echo " active"; ?>"><a class="page-link" href="<?php echo $tourl; ?>&p=<?php echo $p - 1; ?>"><?php echo $p - 1; ?></a></li>
<?php } ?> <?php } ?>
<li class="page-item<?php if (empty($_GET["p"]) || $_GET["p"]==$p) echo " active"; ?>"><a class="page-link" href="<?php echo $tourl; ?>&p=<?php echo $p; ?>"><?php echo $p; ?></a></li> <li class="page-item<?php if (empty($_GET["p"]) || $_GET["p"] == $p) echo " active"; ?>"><a class="page-link" href="<?php echo $tourl; ?>&p=<?php echo $p; ?>"><?php echo $p; ?></a></li>
<li class="page-item<?php if ($_GET["p"]==($p+1)) echo " active"; ?>"><a class="page-link" href="<?php echo $tourl; ?>&p=<?php echo $p+1; ?>"><?php echo $p+1; ?></a></li> <li class="page-item<?php if ($_GET["p"] == ($p + 1)) echo " active"; ?>"><a class="page-link" href="<?php echo $tourl; ?>&p=<?php echo $p + 1; ?>"><?php echo $p + 1; ?></a></li>
<li class="page-item<?php if ($_GET["p"]==($p+2)) echo " active"; ?>"><a class="page-link" href="<?php echo $tourl; ?>&p=<?php echo $p+2; ?>"><?php echo $p+2; ?></a></li> <li class="page-item<?php if ($_GET["p"] == ($p + 2)) echo " active"; ?>"><a class="page-link" href="<?php echo $tourl; ?>&p=<?php echo $p + 2; ?>"><?php echo $p + 2; ?></a></li>
<li class="page-item"><a class="page-link" href="<?php echo $tourl; ?>&p=<?php echo $p+1; ?>">Next</a></li> <li class="page-item"><a class="page-link" href="<?php echo $tourl; ?>&p=<?php echo $p + 1; ?>">Next</a></li>
</ul> </ul>
</nav> </nav>
<?php <?php
@ -270,7 +277,7 @@ $(function(){
?> ?>
<?php <?php
else: else :
echo "<h2>There is no record!</h2>"; echo "<h2>There is no record!</h2>";
endif; endif;

138
wms/sign/list.php

@ -1,8 +1,6 @@
<?php <?php
// phpinfo(); // error_reporting(E_ALL);
// exit(); // ini_set("display_errors", "on");
error_reporting(E_ALL);
ini_set("display_errors", "on");
/** /**
* 显示所有的待签 员工所有待签 * 显示所有的待签 员工所有待签
*/ */
@ -13,6 +11,61 @@ require_once "../database.php";
require_once "../header.php"; require_once "../header.php";
function getWipwholestatusDataByFormkey($link, $form_key, $flow_id)
{
$sql = "
SELECT
form_id
FROM flow
WHERE form_key = '$form_key'
AND system_id = 'wws'
AND flow_id = '$flow_id'
";
$result = mysqli_query($link, $sql);
$row = mysqli_fetch_assoc($result);
$sql = "
SELECT
*
FROM wipwholestatus
WHERE id = '" . $row['form_id'] . "'
ANd status = '1'
";
$result = mysqli_query($link, $sql);
$row = mysqli_fetch_assoc($result);
return $row;
}
function getwipwholeChangeContractdateDetailsDataByFormkey($link, $form_key, $flow_id)
{
$sql = "
SELECT
form_id
FROM flow
WHERE form_key = '$form_key'
AND system_id = 'wws'
AND flow_id = '$flow_id'
";
$result = mysqli_query($link, $sql);
$row = mysqli_fetch_assoc($result);
$sql = "
SELECT
wipwholestatus_id
FROM wipwhole_change_contractdate_details
WHERE id = '" . $row['form_id'] . "'
";
$result = mysqli_query($link, $sql);
$row = mysqli_fetch_assoc($result);
$sql = "
SELECT
*
FROM wipwholestatus
WHERE id = '" . $row['wipwholestatus_id'] . "'
ANd status = '1'
";
$result = mysqli_query($link, $sql);
$row = mysqli_fetch_assoc($result);
return $row;
}
$system_id = $_SERVER['REQUEST_METHOD'] == 'GET' ? @$_GET['system_id'] : @$_POST['system_id']; $system_id = $_SERVER['REQUEST_METHOD'] == 'GET' ? @$_GET['system_id'] : @$_POST['system_id'];
$where_system_id = " and a.system_id like '" . $system_id . "%'"; $where_system_id = " and a.system_id like '" . $system_id . "%'";
@ -20,28 +73,33 @@ $where_system_id = " and a.system_id like '" . $system_id . "%'";
$flow_id = $_SERVER['REQUEST_METHOD'] == 'GET' ? @$_GET['flow_id'] : @$_POST['flow_id']; $flow_id = $_SERVER['REQUEST_METHOD'] == 'GET' ? @$_GET['flow_id'] : @$_POST['flow_id'];
$where_flow_id = " and b.flow_id like '" . $flow_id . "%'"; $where_flow_id = " and b.flow_id like '" . $flow_id . "%'";
$sql_get = "SELECT c.form_key, a.system_id,b.flow_id ,a.system_name,c.current_assigner, $sql_get = "
concat(c.current_assigner ,'-',f_return_name(c.current_assigner)) current_assigner_name , select
flow_name,c.update_date ,c.create_date,b.path,d.flow_code FROM system_main a,flow_main b ,subflow c.form_key,
c,flow d a.system_id,
WHERE a.system_id=b.system_id b.flow_id ,
AND b.flow_id=d.flow_id a.system_name,
AND c.current_assigner='$user_id' c.current_assigner,
AND d.flow_id=b.flow_id concat(
AND c.form_key=d.form_key c.current_assigner ,
'-',f_return_name(c.current_assigner)
) current_assigner_name ,
flow_name,
c.update_date ,
c.create_date,
b.path,
d.flow_code
from system_main a,flow_main b ,subflow c,flow d
where a.system_id=b.system_id
and b.flow_id=d.flow_id
and c.current_assigner='$user_id'
and d.flow_id=b.flow_id
and c.form_key=d.form_key
$where_system_id $where_system_id
$where_flow_id $where_flow_id
"; ";
//echo $sql_get;
$result = mysqli_query($link, $sql_get);
if ($result == false) {
die(mysqli_error($link));
}
$res_get = mysqli_fetch_all(mysqli_query($link, $sql_get), MYSQLI_ASSOC); $res_get = mysqli_fetch_all(mysqli_query($link, $sql_get), MYSQLI_ASSOC);
// echo '<pre>';
// print_r($sql_get);
// echo '</pre>';
// exit;
$system_name_opt = array_map(function ($item) { $system_name_opt = array_map(function ($item) {
return array('system_id' => $item['system_id'], 'system_name' => $item['system_name']); return array('system_id' => $item['system_id'], 'system_name' => $item['system_name']);
@ -142,7 +200,7 @@ $flow_name_opt = (array_unique($flow_name_opt, SORT_REGULAR));
<table id="table_index" style='width:100%;margin:0 auto' class="table table-striped table-bordered display compact"> <table id="table_index" style='width:100%;margin:0 auto' class="table table-striped table-bordered display compact">
<thead> <thead>
<tr> <tr>
<th>序號</th> <th style="width:400px;">序號</th>
<th>系統名稱</th> <th>系統名稱</th>
<th>流程名稱</th> <th>流程名稱</th>
<th>接收日期</th> <th>接收日期</th>
@ -154,18 +212,46 @@ $flow_name_opt = (array_unique($flow_name_opt, SORT_REGULAR));
<?php <?php
$rowspan = 1; $rowspan = 1;
$path = "localhost:3000/wms/sign/list.php";
foreach ($res_get as $key => $data) : foreach ($res_get as $key => $data) :
//嘗試將已結案隱藏起來 : 測試使用者體驗 //嘗試將已結案隱藏起來 : 測試使用者體驗
if ($data['flow_code'] !== 'Z') { if ($data['flow_code'] !== 'Z') {
?> ?>
<tr> <tr>
<td><a target="_blank" href="<?= $path . "?form_key=" . $data['form_key'] . "&token=$token" ?>"><?= $data['form_key']; ?></a></td> <td>
<?php
if (in_array($data['flow_name'], ['作番大日程(新梯)流程', '作番大日程(汰改)流程'])) {
$w_data = getWipwholestatusDataByFormkey($link, $data['form_key'], $data['flow_id']);
$facilityno = $w_data['facilityno'];
$contractno = $w_data['contractno'];
?>
<a target="_blank" href="<?= $data['path'] . "?fromsign=1&form_key=" . $data['form_key'] . "&token=$token" ?>">
作番大日程-合約號:<?= $contractno ?> 作番號:<?= $facilityno ?>
</a>
<?php
} else if (in_array($data['flow_name'], ['預計出貨日調整申請流程'])) {
$w_data = getwipwholeChangeContractdateDetailsDataByFormkey($link, $data['form_key'], $data['flow_id']);
$facilityno = $w_data['facilityno'];
$contractno = $w_data['contractno'];
?>
<a target="_blank" href="<?= $data['path'] . "?fromsign=1&form_key=" . $data['form_key'] . "&token=$token" ?>">
作番大日程-合約號:<?= $contractno ?> 作番號:<?= $facilityno ?>
</a>
<?php
} else {
?>
<a target="_blank" href="<?= $data['path'] . "?fromsign=1&form_key=" . $data['form_key'] . "&token=$token" ?>">
<?= $data['form_key']; ?>
</a>
<?php
}
?>
</td>
<td><?php echo $data['system_name']; ?></td> <td><?php echo $data['system_name']; ?></td>
<td><?php echo $data['flow_name']; ?></td> <td><?php echo $data['flow_name']; ?></td>
<td><?php echo $data['update_date']; ?></td> <td><?php echo $data['update_date']; ?></td>
<td><?php echo $data['current_assigner_name']; ?></td> <td><?php echo $data['current_assigner_name']; ?></td>
<td><?php echo $data['flow_code'] == 'Z' ? "結案" : "未結案"; ?></td> <td><?php echo $data['flow_code'] == 'Z' ? "結案" : ""; ?></td>
</tr> </tr>

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

@ -328,7 +328,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
substr($row['desin_style_verify_at'], 0, 10), substr($row['desin_style_verify_at'], 0, 10),
$desin_leader_verify_status, $desin_leader_verify_status,
substr($row['desin_leader_verify_at'], 0, 10), substr($row['desin_leader_verify_at'], 0, 10),
getGunwuName($row['address']) . $gongwuok . "/2", // getGunwuName($row['address']) . $gongwuok . "/2",
accountidToName($row['warehouseid']) . $gongwuok . "/2",
$dbuilding_heigh_verify_status, $dbuilding_heigh_verify_status,
substr($row['building_heigh_verify_at'], 0, 10), substr($row['building_heigh_verify_at'], 0, 10),
$site_survey_contact_verify_status, $site_survey_contact_verify_status,

16
wms/wipwhole-index-function.php

@ -143,7 +143,7 @@ function getDataSql($department_id, $role_id, $user_id)
// 營業員主管或營業員 // 營業員主管或營業員
$department_arr = [ $department_arr = [
'310', '311', '312', '313', '314', '315', '310', '311', '312', '313', '314', '315',
'511', '512', '513', '514' '511', '512', '513', '514', '515'
]; ];
// 補丁 黃孟澤 & 葉博澄 權限 = 李烘銘 // 補丁 黃孟澤 & 葉博澄 權限 = 李烘銘
@ -967,14 +967,14 @@ function getMarketingStatus($link, $user_department_id, $role_id, $status)
{ {
if ($user_department_id == 220) if ($user_department_id == 220)
return ""; return "";
if ($user_department_id == 311 || $user_department_id == 312 || $user_department_id == 313 || $user_department_id == 314 || $user_department_id == 315) { if (in_array($user_department_id, [311, 312, 313, 314, 315])) {
if ($status == 1) { if ($status == 1) {
return checkNowFormStatus($link) == 'A' ? "" : "disabled"; return checkNowFormStatus($link) == 'A' ? "" : "disabled";
} else { } else {
return ""; return "";
} }
} }
if ($user_department_id == 501 || $user_department_id == 511 || $user_department_id == 512 || $user_department_id == 513 || $user_department_id == 514) { if (in_array($user_department_id, [501, 511, 512, 513, 514, 515])) {
if ($status == 1) { if ($status == 1) {
return checkNowFormStatus($link) == 'A' ? "" : "disabled"; return checkNowFormStatus($link) == 'A' ? "" : "disabled";
} else { } else {
@ -1091,10 +1091,10 @@ function getTabNo($user_department_id)
// 由地址取得工務負責人 // 由地址取得工務負責人
function getGunwuName($address) function getGunwuName($address)
{ {
$north_arr = array('台北', '基隆', '新北', '桃園', '新竹', '台東', '花蓮'); $north_arr = array('台北', '基隆', '新北', '桃園', '新竹', '花蓮');
$north_arr2 = array('宜蘭'); $north_arr2 = array('宜蘭');
$center_arr = array('南投', '彰化', '雲林', '台中', '苗栗'); $center_arr = array('南投', '彰化', '雲林', '台中', '苗栗');
$south_arr = array('台南', '嘉義', '屏東', '高雄'); $south_arr = array('台南', '嘉義', '屏東', '高雄', '台東');
foreach ($north_arr as $key => $value) foreach ($north_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false) if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "張潘榮"; return "張潘榮";
@ -1103,7 +1103,7 @@ function getGunwuName($address)
return "高培軒"; return "高培軒";
foreach ($center_arr as $key => $value) foreach ($center_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false) if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "林瑋隆"; return "劉子睿";
foreach ($south_arr as $key => $value) foreach ($south_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false) if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "鄭存邑"; return "鄭存邑";
@ -1258,7 +1258,7 @@ function getSaveEstimateInstallData($user_department_id, $role_id)
return true; return true;
if ($user_department_id == '542' && in_array($role_id, ['1', '5', '6', '8'])) if ($user_department_id == '542' && in_array($role_id, ['1', '5', '6', '8']))
return true; return true;
if ($user_department_id == '544' && in_array($role_id, ['3', '6'])) if ($user_department_id == '544' && in_array($role_id, ['3', '6', '9']))
return true; return true;
if ($user_department_id == '543' && $role_id == '2') if ($user_department_id == '543' && $role_id == '2')
return true; return true;
@ -1277,7 +1277,7 @@ function saveInstallData($user_department_id, $role_id)
return true; return true;
if ($user_department_id == '543' && $role_id == '2') if ($user_department_id == '543' && $role_id == '2')
return true; return true;
if ($user_department_id == '544' && in_array($role_id, ['3', '4', '6'])) if ($user_department_id == '544' && in_array($role_id, ['3', '4', '6', '9']))
return true; return true;
if ($user_department_id == '545' && in_array($role_id, ['3', '6'])) if ($user_department_id == '545' && in_array($role_id, ['3', '6']))
return true; return true;

8
wms/wipwhole-index-table-html.php

@ -12,6 +12,7 @@ if (in_array($user_id, ['M0175', 'M0079'])) {
<?php <?php
echo $update_delete_status ? "<th style='text-align:center;width:80px;'>刪除</th>" : ""; echo $update_delete_status ? "<th style='text-align:center;width:80px;'>刪除</th>" : "";
?> ?>
<th style="text-align:center;width:80px;">序號</th>
<th style="text-align:center;width:120px;">合約號</th> <th style="text-align:center;width:120px;">合約號</th>
<th style="text-align:center;width:120px;">電梯編號</th> <th style="text-align:center;width:120px;">電梯編號</th>
<th style="text-align:center;width:150px;">客戶姓名</th> <th style="text-align:center;width:150px;">客戶姓名</th>
@ -104,6 +105,7 @@ if (in_array($user_id, ['M0175', 'M0079'])) {
?> ?>
<tr> <tr>
<?php echo $update_delete_status ? "<td><button type='button' class='btn btn-danger' onclick='delete_wipwholestatus(" . $data['id'] . ")'>刪除</button></td>" : ""; ?> <?php echo $update_delete_status ? "<td><button type='button' class='btn btn-danger' onclick='delete_wipwholestatus(" . $data['id'] . ")'>刪除</button></td>" : ""; ?>
<td><?php echo $data['id']; ?></td>
<td> <td>
<?php <?php
if (in_array($department_id, [311, 312, 313, 314, 315, 501, 511, 512, 513, 513, 220, 911])) { if (in_array($department_id, [311, 312, 313, 314, 315, 501, 511, 512, 513, 513, 220, 911])) {
@ -229,14 +231,16 @@ if (in_array($user_id, ['M0175', 'M0079'])) {
?> ?>
<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']);
// echo getGunwuName($data['address']);
?> ?>
</a> </a>
</p> </p>
<?php <?php
} else { } else {
echo $str; echo $str;
echo getGunwuName($data['address']); // echo getGunwuName($data['address']);
echo accountidToName($data['warehouseid']);
} }
?> ?>
</td> </td>

16
wms/wipwhole-index.php

@ -37,6 +37,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($form_name == 'del_form') { if ($form_name == 'del_form') {
$sql = "UPDATE wipwholestatus SET status = '0' WHERE id = '$del_seq' "; $sql = "UPDATE wipwholestatus SET status = '0' WHERE id = '$del_seq' ";
mysqli_query($link, $sql); mysqli_query($link, $sql);
$sql = "UPDATE flow set flow_code = 'Z' where form_id = '$del_seq' and flow_id = 'wws01' ";
mysqli_query($link, $sql);
} }
} }
@ -461,6 +463,9 @@ mysqli_close($link);
} }
$('#table_index2').DataTable({ $('#table_index2').DataTable({
fixedColumns: {
leftColumns: 4
},
scrollX: true, scrollX: true,
fixedHeader: true, fixedHeader: true,
scrollY: 500, scrollY: 500,
@ -491,9 +496,7 @@ mysqli_close($link);
[4, "desc"], [4, "desc"],
[8, "asc"] [8, "asc"]
] ]
} });
);
document.querySelector("#table_index2_filter > label > input").placeholder = "快速搜尋"; document.querySelector("#table_index2_filter > label > input").placeholder = "快速搜尋";
// datatable 畫面重整後保留資料 // datatable 畫面重整後保留資料
@ -583,3 +586,10 @@ mysqli_close($link);
<input type='hidden' id='del_seq' name='del_seq' value='' /> <input type='hidden' id='del_seq' name='del_seq' value='' />
<input type='hidden' id='form_name' name='form_name' value='del_form' /> <input type='hidden' id='form_name' name='form_name' value='del_form' />
</form> </form>
<style>
/* 设置固定列的背景色 */
.dtfc-fixed-left {
background-color: #f9f9f9;
border: 1px !important;
}
</style>

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

@ -107,6 +107,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$old_official_check_date = $_POST['old_official_check_date'] ?: $row['old_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']; $official_check_date_owner = $_POST['official_check_date_owner'] ?: $row['official_check_date_owner'];
$delivery_date = $_POST['delivery_date'] ?: $row['delivery_date']; $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']; $delivery_date_owner = $_POST['delivery_date_owner'] ?: $row['delivery_date_owner'];
$qc_official_type = $_POST['qc_official_type'] ?: $row['qc_official_type']; $qc_official_type = $_POST['qc_official_type'] ?: $row['qc_official_type'];
$outsourcer_type = $_POST['outsourcer_type']; $outsourcer_type = $_POST['outsourcer_type'];
@ -128,6 +129,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$estimate_tryrun_end_date_owner = $_POST['estimate_tryrun_end_date_owner']; $estimate_tryrun_end_date_owner = $_POST['estimate_tryrun_end_date_owner'];
$warehouse_assistant_remark = $_POST['warehouse_assistant_remark']; $warehouse_assistant_remark = $_POST['warehouse_assistant_remark'];
$warehouseid = $_POST['warehouseid'] ?: $row['warehouseid'];
$old_warehouseid = $_POST['old_warehouseid'] ?: $row['warehouseid'];
// $creater = $_POST['creater']; // $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");
@ -135,7 +139,33 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
// 上傳附件 // 上傳附件
include "wipwhole-rec-invoice-edit-fileupload.php"; 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 (!empty($official_check_date)) {
if ($official_check_date !== $old_official_check_date) { if ($official_check_date !== $old_official_check_date) {
$sql = " $sql = "
@ -221,7 +251,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!empty($desin_documents_verify_file)) { if (!empty($desin_documents_verify_file)) {
$title = "合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件"; $title = "合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件";
$content = "合約號:$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( $data = array(
'kind' => 1, 'kind' => 1,
'related_id' => $id, 'related_id' => $id,
@ -234,6 +266,48 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$cn->sendx($data); $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 = "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);
}
}
$updatesql = " $updatesql = "
UPDATE wipwholestatus UPDATE wipwholestatus
SET SET
@ -262,7 +336,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$updatesql .= "building_heigh_verify_file = '$building_heigh_verify_file', "; $updatesql .= "building_heigh_verify_file = '$building_heigh_verify_file', ";
if (!empty($site_survey_contact_verify_file)) if (!empty($site_survey_contact_verify_file))
$updatesql .= "site_survey_contact_verify_file = '$site_survey_contact_verify_file', "; $updatesql .= "site_survey_contact_verify_file = '$site_survey_contact_verify_file', ";
} else if (in_array($user_department_id, [311, 312, 313, 314, 315])) { }
if (in_array($user_department_id, [311, 312, 313, 314, 315])) {
// 營業更新; // 營業更新;
$updatesql .= " $updatesql .= "
sales_spec_verify = '$sales_spec_verify', sales_spec_verify = '$sales_spec_verify',
@ -447,25 +523,46 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|| in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545]) || in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545])
) { ) {
$qc_official_type = $_POST['qc_official_type2'] ?: $row['qc_official_type']; // $outsourcer_type = $_POST['outsourcer_type'];
$outsourcer_type = $_POST['outsourcer_type']; // $qc_official_type = $_POST['qc_official_type2'] ?: $row['qc_official_type'];
$qc_date = $_POST['qc_date2'] ?: $row['qc_date']; // $qc_date = $_POST['qc_date2'] ?: $row['qc_date'];
$qc_date_owner = $_POST['qc_date2_owner'] ?: $row['qc_date_owner']; // $qc_date_owner = $_POST['qc_date2_owner'] ?: $row['qc_date_owner'];
$end_qc_date = $_POST['end_qc_date2'] ?: $row['end_qc_date']; // $end_qc_date = $_POST['end_qc_date2'] ?: $row['end_qc_date'];
$end_qc_date_owner = $_POST['end_qc_date2_owner'] ?: $row['end_qc_date_owner']; // $end_qc_date_owner = $_POST['end_qc_date2_owner'] ?: $row['end_qc_date_owner'];
$official_check_date = $_POST['official_check_date2'] ?: $row['official_check_date']; // $official_check_date = $_POST['official_check_date2'] ?: $row['official_check_date'];
$old_official_check_date = $_POST['old_official_check_date2'] ?: $row['old_official_check_date']; // $old_official_check_date = $_POST['old_official_check_date2'] ?: $row['old_official_check_date'];
$official_check_date_owner = $_POST['official_check_date2_owner'] ?: $row['official_check_date_owner']; // $official_check_date_owner = $_POST['official_check_date2_owner'] ?: $row['official_check_date_owner'];
$delivery_date = $_POST['delivery_date2'] ?: $row['delivery_date']; // $delivery_date = $_POST['delivery_date2'] ?: $row['delivery_date'];
$delivery_date_owner = $_POST['delivery_date2_owner'] ?: $row['delivery_date_owner']; // $delivery_date_owner = $_POST['delivery_date2_owner'] ?: $row['delivery_date_owner'];
$install_start_date = $_POST['install_start_date2'] ?: $row['install_start_date']; // $install_start_date = $_POST['install_start_date2'] ?: $row['install_start_date'];
$install_start_date_owner = $_POST['install_start_date2_owner'] ?: $row['install_start_date_owner']; // $install_start_date_owner = $_POST['install_start_date2_owner'] ?: $row['install_start_date_owner'];
$install_end_date = $_POST['install_end_date2'] ?: $row['install_end_date']; // $install_end_date = $_POST['install_end_date2'] ?: $row['install_end_date'];
$install_end_date_owner = $_POST['install_end_date2_owner'] ?: $row['install_end_date_owner']; // $install_end_date_owner = $_POST['install_end_date2_owner'] ?: $row['install_end_date_owner'];
$tryrun_start_date = $_POST['tryrun_start_date2'] ?: $row['tryrun_start_date']; // $tryrun_start_date = $_POST['tryrun_start_date2'] ?: $row['tryrun_start_date'];
$tryrun_start_date_owner = $_POST['tryrun_start_date2_owner'] ?: $row['tryrun_start_date_owner']; // $tryrun_start_date_owner = $_POST['tryrun_start_date2_owner'] ?: $row['tryrun_start_date_owner'];
$tryrun_end_date = $_POST['tryrun_end_date2'] ?: $row['tryrun_end_date']; // $tryrun_end_date = $_POST['tryrun_end_date2'] ?: $row['tryrun_end_date'];
$tryrun_end_date_owner = $_POST['tryrun_end_date2_owner'] ?: $row['tryrun_end_date_owner']; // $tryrun_end_date_owner = $_POST['tryrun_end_date2_owner'] ?: $row['tryrun_end_date_owner'];
$outsourcer_type = isset($_POST['outsourcer_type']) ? $_POST['outsourcer_type'] : $row['outsourcer_type'];
$qc_official_type = isset($_POST['qc_official_type2']) ? $_POST['qc_official_type2'] : $row['qc_official_type'];
$qc_date = isset($_POST['qc_date2']) ? $_POST['qc_date2'] : $row['qc_date'];
$qc_date_owner = isset($_POST['qc_date2_owner']) ? $_POST['qc_date2_owner'] : $row['qc_date_owner'];
$end_qc_date = isset($_POST['end_qc_date2']) ? $_POST['end_qc_date2'] : $row['end_qc_date'];
$end_qc_date_owner = isset($_POST['end_qc_date2_owner']) ? $_POST['end_qc_date2_owner'] : $row['end_qc_date_owner'];
$official_check_date = isset($_POST['official_check_date2']) ? $_POST['official_check_date2'] : $row['official_check_date'];
$old_official_check_date = isset($_POST['old_official_check_date2']) ? $_POST['old_official_check_date2'] : $row['old_official_check_date'];
$official_check_date_owner = isset($_POST['official_check_date2_owner']) ? $_POST['official_check_date2_owner'] : $row['official_check_date_owner'];
$delivery_date = isset($_POST['delivery_date2']) ? $_POST['delivery_date2'] : $row['delivery_date'];
$delivery_date_owner = isset($_POST['delivery_date2_owner']) ? $_POST['delivery_date2_owner'] : $row['delivery_date_owner'];
$install_start_date = isset($_POST['install_start_date2']) ? $_POST['install_start_date2'] : $row['install_start_date'];
$install_start_date_owner = isset($_POST['install_start_date2_owner']) ? $_POST['install_start_date2_owner'] : $row['install_start_date_owner'];
$install_end_date = isset($_POST['install_end_date2']) ? $_POST['install_end_date2'] : $row['install_end_date'];
$install_end_date_owner = isset($_POST['install_end_date2_owner']) ? $_POST['install_end_date2_owner'] : $row['install_end_date_owner'];
$tryrun_start_date = isset($_POST['tryrun_start_date2']) ? $_POST['tryrun_start_date2'] : $row['tryrun_start_date'];
$tryrun_start_date_owner = isset($_POST['tryrun_start_date2_owner']) ? $_POST['tryrun_start_date2_owner'] : $row['tryrun_start_date_owner'];
$tryrun_end_date = isset($_POST['tryrun_end_date2']) ? $_POST['tryrun_end_date2'] : $row['tryrun_end_date'];
$tryrun_end_date_owner = isset($_POST['tryrun_end_date2_owner']) ? $_POST['tryrun_end_date2_owner'] : $row['tryrun_end_date_owner'];
$updatesql .= " $updatesql .= "
qc_official_type = '$qc_official_type', qc_official_type = '$qc_official_type',
@ -776,11 +873,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($_POST['form_name'] == 'update_install_date_form') { if ($_POST['form_name'] == 'update_install_date_form') {
include "./class/Cmail.php";
$cmail = new Cmail();
foreach ($_POST as $k => $v) foreach ($_POST as $k => $v)
$$k = htmlspecialchars(stripslashes(trim($v))); $$k = htmlspecialchars(stripslashes(trim($v)));
$change_all_contractno = $_POST['change_all_contractno']; $change_all_contractno = $_POST['change_all_contractno'];
$contractno = $_POST['contractno2']; $contractno2 = $_POST['contractno2'];
$install_start_date = $_POST['install_start_date']; $install_start_date = $_POST['install_start_date'];
$install_start_date_owner = $_POST['install_start_date_owner']; $install_start_date_owner = $_POST['install_start_date_owner'];
$install_end_date = $_POST['install_end_date']; $install_end_date = $_POST['install_end_date'];
@ -789,6 +888,42 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$tryrun_start_date_owner = $_POST['tryrun_start_date_owner']; $tryrun_start_date_owner = $_POST['tryrun_start_date_owner'];
$tryrun_end_date = $_POST['tryrun_end_date']; $tryrun_end_date = $_POST['tryrun_end_date'];
$tryrun_end_date_owner = $_POST['tryrun_end_date_owner']; $tryrun_end_date_owner = $_POST['tryrun_end_date_owner'];
$old_delivery_date = $_POST['old_delivery_date'];
$delivery_date = $_POST['delivery_date'];
$delivery_date_owner = $_POST['delivery_date_owner'];
$contractno = $_POST['contractno'];
$facilityno = $_POST['facilityno'];
$salesid = $_POST['salesid'];
$salesname = accountid2name($salesid)[$salesid];
$salesmail = accountid2email([$salesid])[$salesid];
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]
],
"永佳捷科技"
);
}
$updatesql = " $updatesql = "
UPDATE wipwholestatus UPDATE wipwholestatus
@ -800,12 +935,14 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
tryrun_start_date = '$tryrun_start_date', tryrun_start_date = '$tryrun_start_date',
tryrun_start_date_owner = '$tryrun_start_date_owner', tryrun_start_date_owner = '$tryrun_start_date_owner',
tryrun_end_date = '$tryrun_end_date', tryrun_end_date = '$tryrun_end_date',
tryrun_end_date_owner = '$tryrun_end_date_owner' tryrun_end_date_owner = '$tryrun_end_date_owner',
delivery_date = '$delivery_date',
delivery_date_owner = '$delivery_date_owner'
"; ";
if (empty($change_all_contractno)) { if (empty($change_all_contractno)) {
$updatesql .= "WHERE id = '$id' "; $updatesql .= "WHERE id = '$id' ";
} else { } else {
$updatesql .= "WHERE contractno = '$contractno' "; $updatesql .= "WHERE contractno = '$contractno2' ";
} }
// echo $updatesql; // echo $updatesql;
// exit; // exit;

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

@ -497,7 +497,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<textarea class="form-control disabled_select" name="marketing_remark" <?= $marketing; ?>><?php echo $row['marketing_remark']; ?></textarea> <textarea class="form-control disabled_select" name="marketing_remark" <?= $marketing; ?>><?php echo $row['marketing_remark']; ?></textarea>
</td> </td>
</tr> </tr>
<tr> <!-- <tr>
<td style="vertical-align: middle">移交日</td> <td style="vertical-align: middle">移交日</td>
<td style="vertical-align: middle"> <td style="vertical-align: middle">
<div class="input-group"> <div class="input-group">
@ -505,6 +505,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#delivery_date").val("");' <?= $marketing2; ?>>清除</button> <button class="btn btn-default" type='button' onclick='$("#delivery_date").val("");' <?= $marketing2; ?>>清除</button>
</span> </span>
<input type="hidden" id="old_delivery_date" name="old_delivery_date" value="<?= $row['delivery_date']; ?>">
</div> </div>
</td> </td>
<td style="vertical-align: middle">確認人</td> <td style="vertical-align: middle">確認人</td>
@ -514,7 +515,10 @@ include "wipwhole-rec-invoice-edit-submit.php";
<?php echo getSelectOptionHtml($all_users_options, $row['delivery_date_owner']); ?> <?php echo getSelectOptionHtml($all_users_options, $row['delivery_date_owner']); ?>
</select> </select>
</td> </td>
</tr> <td colspan='4'>
<span class="text-danger">有官檢日或QC合格日後才可填寫</span>
</td>
</tr> -->
<tr> <tr>
<td colspan="8"> <td colspan="8">
<input class="form-control " type="hidden" name="creater" value="<?= $user_id; ?>"> <input class="form-control " type="hidden" name="creater" value="<?= $user_id; ?>">
@ -793,6 +797,78 @@ include "wipwhole-rec-invoice-edit-submit.php";
<div id="tabs-3"> <div id="tabs-3">
<table class="table table-bordered" style="width:100%"> <table class="table table-bordered" style="width:100%">
<tbody style="font-weight: bolder;margin-bottom: 20px"> <tbody style="font-weight: bolder;margin-bottom: 20px">
<tr>
<td style="vertical-align: middle">工勘人員</td>
<td>
<input type="hidden" name="old_warehouseid" id="old_warehouseid" value="<?= $row["warehouseid"]; ?>">
<?php
// 北區
if (in_array($row['warehouseid'], ['M0041', 'M0150'])) {
?>
<select name="warehouseid" id="warehouseid" <?= $warehouse; ?>>
<option value="">請選擇</option>
<option value="M0041" <?php if ($row["warehouseid"] == "M0041") echo " selected"; ?>>張潘榮</option>
<option value="M0150" <?php if ($row["warehouseid"] == "M0150") echo " selected"; ?>>羅盛騰</option>
</select>
<?php
}
?>
<?php
// 中區
if (in_array($row['warehouseid'], ['M0198', 'M0158'])) {
?>
<select name="warehouseid" id="warehouseid" <?= $warehouse; ?>>
<option value="">請選擇</option>
<option value="M0198" <?php if ($row["warehouseid"] == "M0198") echo " selected"; ?>>廖堉勝</option>
<option value="M0158" <?php if ($row["warehouseid"] == "M0158") echo " selected"; ?>>劉子睿</option>
</select>
<?php
}
?>
<?php
// 南區
if (in_array($row['warehouseid'], ['M0078', 'M0102', 'M0187'])) {
?>
<select name="warehouseid" id="warehouseid" <?= $warehouse; ?>>
<option value="">請選擇</option>
<option value="M0078" <?php if ($row["warehouseid"] == "M0078") echo " selected"; ?>>許益連</option>
<option value="M0102" <?php if ($row["warehouseid"] == "M0102") echo " selected"; ?>>鄭存邑</option>
<option value="M0187" <?php if ($row["warehouseid"] == "M0187") echo " selected"; ?>>田祖豪</option>
</select>
<?php
}
?>
<?php
// 宜蘭
if (in_array($row['warehouseid'], ['M0087'])) {
?>
<select name="warehouseid" id="warehouseid" <?= $warehouse; ?>>
<option value="">請選擇</option>
<option value="M0087" <?php if ($row["warehouseid"] == "M0087") echo " selected"; ?>>高培軒</option>
</select>
<?php
}
?>
<?php
// 南區
if (!in_array($row['warehouseid'], ['M0041', 'M0150', 'M0078', 'M0102', 'M0187', 'M0198', 'M0087', 'M0158'])) {
?>
<select name="warehouseid" id="warehouseid" <?= $warehouse; ?>>
<option value="">請選擇</option>
<option value="M0041" <?php if ($row["warehouseid"] == "M0041") echo " selected"; ?>>張潘榮</option>
<option value="M0150" <?php if ($row["warehouseid"] == "M0150") echo " selected"; ?>>羅盛騰</option>
<option value="M0078" <?php if ($row["warehouseid"] == "M0078") echo " selected"; ?>>許益連</option>
<option value="M0102" <?php if ($row["warehouseid"] == "M0102") echo " selected"; ?>>鄭存邑</option>
<option value="M0198" <?php if ($row["warehouseid"] == "M0198") echo " selected"; ?>>廖堉勝</option>
<option value="M0187" <?php if ($row["warehouseid"] == "M0187") echo " selected"; ?>>田祖豪</option>
<option value="M0087" <?php if ($row["warehouseid"] == "M0087") echo " selected"; ?>>高培軒</option>
<option value="M0158" <?php if ($row["warehouseid"] == "M0158") echo " selected"; ?>>劉子睿</option>
</select>
<?php
}
?>
</td>
</tr>
<tr> <tr>
<td style="vertical-align: middle">樓高通報</td> <td style="vertical-align: middle">樓高通報</td>
<td> <td>
@ -982,6 +1058,28 @@ include "wipwhole-rec-invoice-edit-submit.php";
</select> </select>
</td> </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_tmp" value="<?= $row['delivery_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#delivery_date_tmp").val("");' <?= $warehouse2; ?>>清除</button>
</span>
<input type="hidden" id="old_delivery_date_tmp" value="<?= $row['delivery_date']; ?>">
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="delivery_date_owner_tmp" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['delivery_date_owner']); ?>
</select>
</td>
<td colspan='4'>
<span class="text-danger">有官檢日或QC合格日後才可填寫</span>
</td>
</tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<?php <?php
@ -1280,6 +1378,36 @@ include "wipwhole-rec-invoice-edit-submit.php";
<button onclick="updateRealArrivalDate()" type="button" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;" <?php echo $shengguan2; ?>>出貨日調整</button> <button onclick="updateRealArrivalDate()" type="button" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;" <?php echo $shengguan2; ?>>出貨日調整</button>
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align: middle">官檢日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" value="<?= $row['official_check_date']; ?>" disabled>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['official_check_date_owner']); ?>
</select>
</td>
</tr>
<tr>
<td style="vertical-align: middle">移交日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control " type="date" value="<?= $row['delivery_date']; ?>" disabled>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['delivery_date_owner']); ?>
</select>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -1806,6 +1934,12 @@ include "wipwhole-rec-invoice-edit-submit.php";
<input type="hidden" id="tryrun_start_date_owner" name='tryrun_start_date_owner' value="<?php echo $row['tryrun_start_date_owner']; ?>" /> <input type="hidden" id="tryrun_start_date_owner" name='tryrun_start_date_owner' value="<?php echo $row['tryrun_start_date_owner']; ?>" />
<input type="hidden" id="tryrun_end_date" name='tryrun_end_date' value="<?php echo $row['tryrun_end_date']; ?>" /> <input type="hidden" id="tryrun_end_date" name='tryrun_end_date' value="<?php echo $row['tryrun_end_date']; ?>" />
<input type="hidden" id="tryrun_end_date_owner" name='tryrun_end_date_owner' value="<?php echo $row['tryrun_end_date_owner']; ?>" /> <input type="hidden" id="tryrun_end_date_owner" name='tryrun_end_date_owner' value="<?php echo $row['tryrun_end_date_owner']; ?>" />
<input type="hidden" id="delivery_date" name='delivery_date' value="<?php echo $row['delivery_date']; ?>" />
<input type="hidden" id="old_delivery_date" name='old_delivery_date' value="<?php echo $row['delivery_date']; ?>" />
<input type="hidden" id="delivery_date_owner" name='delivery_date_owner' value="<?php echo $row['delivery_date_owner']; ?>" />
<input type="hidden" id="facilityno" name='facilityno' value="<?php echo $row['facilityno']; ?>" />
<input type="hidden" id="contractno" name='contractno' value="<?php echo $row['contractno']; ?>" />
<input type="hidden" name='salesid' value="<?php echo $row['salesid']; ?>" />
<input type="hidden" name='form_name' value="update_install_date_form" /> <input type="hidden" name='form_name' value="update_install_date_form" />
</form> </form>
<form method="post" id="update_shengguan_form" enctype="multipart/form-data"> <form method="post" id="update_shengguan_form" enctype="multipart/form-data">
@ -1854,12 +1988,12 @@ include "wipwhole-rec-invoice-edit-submit.php";
} }
function checkDeliveryDateKeyinStatus() { function checkDeliveryDateKeyinStatus() {
$("#delivery_date").prop("disabled", true); $("#delivery_date,#delivery_date_tmp").prop("disabled", true);
if ($("#end_qc_date").val() !== "") { if ($("#end_qc_date").val() !== "") {
$("#delivery_date").prop("disabled", false); $("#delivery_date,#delivery_date_tmp").prop("disabled", false);
} }
if ($("#official_check_date").val() !== "") { if ($("#official_check_date").val() !== "") {
$("#delivery_date").prop("disabled", false); $("#delivery_date,#delivery_date_tmp").prop("disabled", false);
} }
} }
$(function() { $(function() {
@ -1889,7 +2023,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
'qc_date2', 'qc_date2',
'end_qc_date2', 'end_qc_date2',
'official_check_date2', 'official_check_date2',
'delivery_date', // 'delivery_date',
'delivery_date2', 'delivery_date2',
'install_start_date2', 'install_start_date2',
'install_end_date2', 'install_end_date2',
@ -1924,6 +2058,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
'install_end_date', 'install_end_date',
'tryrun_start_date', 'tryrun_start_date',
'tryrun_end_date', 'tryrun_end_date',
'delivery_date'
] ]
for (var i = 0; i < oursourcer_input_arr.length; i++) { for (var i = 0; i < oursourcer_input_arr.length; i++) {
inputChangeOutsourcer(oursourcer_input_arr[i]); inputChangeOutsourcer(oursourcer_input_arr[i]);
@ -2198,6 +2333,8 @@ include "wipwhole-rec-invoice-edit-submit.php";
$("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val()); $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val());
$("#tryrun_end_date").val($("#tryrun_end_date_tmp").val()); $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val());
$("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val()); $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val());
$("#delivery_date").val($("#delivery_date_tmp").val());
$("#delivery_date_owner").val($("#delivery_date_owner_tmp").val());
$('#update_install_date_form').submit(); $('#update_install_date_form').submit();
} }
} else { } else {
@ -2209,6 +2346,8 @@ include "wipwhole-rec-invoice-edit-submit.php";
$("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val()); $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val());
$("#tryrun_end_date").val($("#tryrun_end_date_tmp").val()); $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val());
$("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val()); $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val());
$("#delivery_date").val($("#delivery_date_tmp").val());
$("#delivery_date_owner").val($("#delivery_date_owner_tmp").val());
$('#update_install_date_form').submit(); $('#update_install_date_form').submit();
} }
} }

251
wms/wipwhole-rec-invoice.php

@ -1,4 +1,5 @@
<?php <?php
ini_set('display_errors', 'on');
/** /**
* 流程規則:(新梯) * 流程規則:(新梯)
@ -48,194 +49,91 @@ if ($department_id == "321" || $department_id == "220") {
// 預設新梯代碼 A // 預設新梯代碼 A
$contract_type = ''; $contract_type = '';
// 合約號
$contractno = ''; $contractno = '';
// 營業員ID
$salesid = ''; $salesid = '';
// 工務人員ID
$warehouseid = ''; $warehouseid = '';
// 客戶姓名
$custom = ''; $custom = '';
// 工地負責人
$site_manager = ''; $site_manager = '';
// 客戶id
$accountid = ''; $accountid = '';
// 作番號
$facilityno = ''; $facilityno = '';
// 號機
$facility_temp_no = ''; $facility_temp_no = '';
// 緯度
$latitude = ''; $latitude = '';
// 經度
$longitude = ''; $longitude = '';
// 載重
$weight = ''; $weight = '';
// 人乘
$numberofpassenger = ''; $numberofpassenger = '';
// 樓停
$numberofstop = ''; $numberofstop = '';
// 樓層
$numberoffloor = ''; $numberoffloor = '';
// 開門方式
$opentype = ''; $opentype = '';
// 速度
$speed = ''; $speed = '';
// 機型
$facility_kind = ''; $facility_kind = '';
// 地址
$address = ''; $address = '';
// 合約到貨日
$contract_arrival_date = ''; $contract_arrival_date = '';
// 實際到貨日
$real_contract_arrival_date = ''; $real_contract_arrival_date = '';
// 營業規格確認
$sales_spec_verify = ''; $sales_spec_verify = '';
// 營業規格附件
$sales_spec_verify_file = ''; $sales_spec_verify_file = '';
// 營業規格確認時間
$sales_spec_verify_at = ''; $sales_spec_verify_at = '';
// 營業規格確認人
$sales_spec_verify_owner = ''; $sales_spec_verify_owner = '';
// 客戶計劃圖確認
$customer_planning_verify = ''; $customer_planning_verify = '';
// 客戶計劃圖附件
$customer_planning_verify_file = ''; $customer_planning_verify_file = '';
// 客戶計劃圖確認時間
$customer_planning_verify_at = ''; $customer_planning_verify_at = '';
// 客戶計劃圖確認人
$customer_planning_verify_owner = ''; $customer_planning_verify_owner = '';
// 客戶顏色確認
$customer_color_verify = ''; $customer_color_verify = '';
// 客戶顏色附件
$customer_color_verify_file = ''; $customer_color_verify_file = '';
// 客戶顏色確認時間
$customer_color_verify_at = ''; $customer_color_verify_at = '';
// 客戶顏色確認人
$customer_color_verify_owner = ''; $customer_color_verify_owner = '';
// 工勘聯絡表
$site_survey_contact_form_verify = ''; $site_survey_contact_form_verify = '';
// 工勘聯絡表附件
$site_survey_contact_form_verify_file = ''; $site_survey_contact_form_verify_file = '';
// 工勘聯絡表確認時間
$site_survey_contact_form_verify_at = ''; $site_survey_contact_form_verify_at = '';
// 工勘聯絡表確認人
$site_survey_contact_form_verify_owner = ''; $site_survey_contact_form_verify_owner = '';
// 設計規格確認
$desin_spec_verify = ''; $desin_spec_verify = '';
// 設計規格確認附件
$desin_spec_verify_file = ''; $desin_spec_verify_file = '';
// 設計規格確認時間
$desin_spec_verify_at = ''; $desin_spec_verify_at = '';
// 設計規格確認確認人
$desin_spec_verify_owner = ''; $desin_spec_verify_owner = '';
// 設計計劃圖確認
$desin_planning_verify = ''; $desin_planning_verify = '';
// 設計計劃圖確認附件
$desin_planning_verify_file = ''; $desin_planning_verify_file = '';
// 設計計劃圖確認時間
$desin_planning_verify_at = ''; $desin_planning_verify_at = '';
// 設計計劃圖確認人
$desin_planning_verify_owner = ''; $desin_planning_verify_owner = '';
// 設計顏色確認
$desin_color_verify = ''; $desin_color_verify = '';
// 設計顏色確認附件
$desin_color_verify_file = ''; $desin_color_verify_file = '';
// 設計顏色確認時間
$desin_color_verify_at = ''; $desin_color_verify_at = '';
// 設計顏色確認人
$desin_color_verify_owner = ''; $desin_color_verify_owner = '';
// 設計仕樣確認
$desin_style_verify = ''; $desin_style_verify = '';
// 設計仕樣確認附件
$desin_style_verify_file = ''; $desin_style_verify_file = '';
// 設計仕樣確認時間
$desin_style_verify_at = ''; $desin_style_verify_at = '';
// 設計仕樣確認人
$desin_style_verify_owner = ''; $desin_style_verify_owner = '';
// 設計主管確認
$desin_leader_verify = ''; $desin_leader_verify = '';
// 設計主管確認附件
$desin_leader_verify_file = ''; $desin_leader_verify_file = '';
// 設計主管確認時間
$desin_leader_verify_at = ''; $desin_leader_verify_at = '';
// 設計主管確認人
$desin_leader_verify_owner = ''; $desin_leader_verify_owner = '';
// 樓高通報
$building_heigh_verify = ''; $building_heigh_verify = '';
// 樓高通報附件
$building_heigh_verify_file = ''; $building_heigh_verify_file = '';
// 樓高通報時間
$building_heigh_verify_at = ''; $building_heigh_verify_at = '';
// 樓高通報確認人
$building_heigh_verify_owner = ''; $building_heigh_verify_owner = '';
// 電氣發貨明細
$electrical_design_publish = ''; $electrical_design_publish = '';
// 電氣資料發行時間
$electrical_design_publish_at = ''; $electrical_design_publish_at = '';
// 電氣資料發行人
$electrical_design_publish_owner = ''; $electrical_design_publish_owner = '';
// 機械資料發行
$mechanical_design_publish = ''; $mechanical_design_publish = '';
// 機械資料發行時間
$mechanical_design_publish_at = ''; $mechanical_design_publish_at = '';
// 機械資料發行人
$mechanical_design_publish_owner = ''; $mechanical_design_publish_owner = '';
// 電氣發貨明細
$electrical_shipping_date_publish = ''; $electrical_shipping_date_publish = '';
// 電氣發貨明細時間
$electrical_shipping_date_publish_at = ''; $electrical_shipping_date_publish_at = '';
// 電氣發貨明細發行人
$electrical_shipping_date_publish_owner = ''; $electrical_shipping_date_publish_owner = '';
// 機械發貨明細
$mechanical_shipping_date_publish = ''; $mechanical_shipping_date_publish = '';
// 機械發貨明細時間
$mechanical_shipping_date_publish_at = ''; $mechanical_shipping_date_publish_at = '';
// 機械發貨明細發行人
$mechanical_shipping_date_publish_owner = ''; $mechanical_shipping_date_publish_owner = '';
// 下單日(普來特富)
$prattford_order_date = ''; $prattford_order_date = '';
// 預計發貨日(到港日)
$estimated_shipping_date = ''; $estimated_shipping_date = '';
// 發貨類別(A.全級發貨、G.欠件發貨)
$goods_type = ''; $goods_type = '';
// 實際到貨日(到觀音廠日)
$actual_tofactory_date = ''; $actual_tofactory_date = '';
// 發貨確認人
$shipping_date_owner = ''; $shipping_date_owner = '';
// 預計船期
$estimated_shipping_schedule_date = ''; $estimated_shipping_schedule_date = '';
// 實際到貨日(到港日)
$actual_arrival_date = ''; $actual_arrival_date = '';
// 到貨確認人
$arrival_date_owner = ''; $arrival_date_owner = '';
// 是否齊備
$shengguanok_status = ''; $shengguanok_status = '';
// 生管確認附件
$shengguanok_status_file = ''; $shengguanok_status_file = '';
// 已備齊時間
$shengguanok_status_at = ''; $shengguanok_status_at = '';
// 已備齊檢查人
$shengguanok_status_owner = ''; $shengguanok_status_owner = '';
// 建立人
$creater = ''; $creater = '';
// 建立時間
$create_at = ''; $create_at = '';
@ -243,197 +141,92 @@ if ($department_id == "321" || $department_id == "220") {
// 預設新梯代碼 A // 預設新梯代碼 A
$contract_type = postCheck('contract_type', 'A'); $contract_type = postCheck('contract_type', 'A');
// 合約號
$contractno = postCheck('contractno'); $contractno = postCheck('contractno');
// 營業員ID
$salesid = postCheck('salesid'); $salesid = postCheck('salesid');
// 工務人員ID
$warehouseid = postCheck('warehouseid'); $warehouseid = postCheck('warehouseid');
// 客戶姓名
$custom = postCheck('custom'); $custom = postCheck('custom');
// 工地負責人
$site_manager = postCheck('site_manager'); $site_manager = postCheck('site_manager');
// 客戶id
$accountid = postCheck('accountid'); $accountid = postCheck('accountid');
// 作番號
$facilityno = postCheck('facilityno'); $facilityno = postCheck('facilityno');
// 作番號
$facility_temp_no = postCheck('facility_temp_no'); $facility_temp_no = postCheck('facility_temp_no');
// 緯度
$latitude = postCheck('latitude'); $latitude = postCheck('latitude');
// 經度
$longitude = postCheck('longitude'); $longitude = postCheck('longitude');
// 載重
$weight = postCheck('weight'); $weight = postCheck('weight');
// 人乘
$numberofpassenger = postCheck('numberofpassenger'); $numberofpassenger = postCheck('numberofpassenger');
// 樓停
$numberofstop = postCheck('numberofstop'); $numberofstop = postCheck('numberofstop');
// 樓層
$numberoffloor = postCheck('numberoffloor'); $numberoffloor = postCheck('numberoffloor');
// 開門方式
$opentype = postCheck('opentype'); $opentype = postCheck('opentype');
// 速度
$speed = postCheck('speed'); $speed = postCheck('speed');
// 機型
$facility_kind = postCheck('facility_kind'); $facility_kind = postCheck('facility_kind');
// 地址
$address = postCheck('address'); $address = postCheck('address');
// 合約到貨日
$contract_arrival_date = postCheck('contract_arrival_date'); $contract_arrival_date = postCheck('contract_arrival_date');
// 實際到貨日
$real_contract_arrival_date = postCheck('real_contract_arrival_date'); $real_contract_arrival_date = postCheck('real_contract_arrival_date');
// 營業規格確認
$sales_spec_verify = postCheck('sales_spec_verify'); $sales_spec_verify = postCheck('sales_spec_verify');
// 營業規格附件
$sales_spec_verify_file = postCheck('sales_spec_verify_file'); $sales_spec_verify_file = postCheck('sales_spec_verify_file');
// 營業規格確認時間
$sales_spec_verify_at = postCheck('sales_spec_verify_at'); $sales_spec_verify_at = postCheck('sales_spec_verify_at');
// 營業規格確認人
$sales_spec_verify_owner = postCheck('sales_spec_verify_owner'); $sales_spec_verify_owner = postCheck('sales_spec_verify_owner');
// 客戶計劃圖確認
$customer_planning_verify = postCheck('customer_planning_verify'); $customer_planning_verify = postCheck('customer_planning_verify');
// 客戶計劃圖附件
$customer_planning_verify_file = postCheck('customer_planning_verify_file'); $customer_planning_verify_file = postCheck('customer_planning_verify_file');
// 客戶計劃圖確認時間
$customer_planning_verify_at = postCheck('customer_planning_verify_at'); $customer_planning_verify_at = postCheck('customer_planning_verify_at');
// 客戶計劃圖確認人
$customer_planning_verify_owner = postCheck('customer_planning_verify_owner'); $customer_planning_verify_owner = postCheck('customer_planning_verify_owner');
// 客戶顏色確認
$customer_color_verify = postCheck('customer_color_verify'); $customer_color_verify = postCheck('customer_color_verify');
// 客戶顏色附件
$customer_color_verify_file = postCheck('customer_color_verify_file'); $customer_color_verify_file = postCheck('customer_color_verify_file');
// 客戶顏色確認時間
$customer_color_verify_at = postCheck('customer_color_verify_at'); $customer_color_verify_at = postCheck('customer_color_verify_at');
// 客戶顏色確認人
$customer_color_verify_owner = postCheck('customer_color_verify_owner'); $customer_color_verify_owner = postCheck('customer_color_verify_owner');
// 工勘聯絡表
$site_survey_contact_form_verify = postCheck('site_survey_contact_form_verify'); $site_survey_contact_form_verify = postCheck('site_survey_contact_form_verify');
// 工勘聯絡表附件
$site_survey_contact_form_verify_file = postCheck('site_survey_contact_form_verify_file'); $site_survey_contact_form_verify_file = postCheck('site_survey_contact_form_verify_file');
// 工勘聯絡表確認時間
$site_survey_contact_form_verify_at = postCheck('site_survey_contact_form_verify_at'); $site_survey_contact_form_verify_at = postCheck('site_survey_contact_form_verify_at');
// 工勘聯絡表確認人
$site_survey_contact_form_verify_owner = postCheck('site_survey_contact_form_verify_owner'); $site_survey_contact_form_verify_owner = postCheck('site_survey_contact_form_verify_owner');
// 設計規格確認
$desin_spec_verify = postCheck('desin_spec_verify'); $desin_spec_verify = postCheck('desin_spec_verify');
// 設計規格確認附件
$desin_spec_verify_file = postCheck('desin_spec_verify_file'); $desin_spec_verify_file = postCheck('desin_spec_verify_file');
// 設計規格確認時間
$desin_spec_verify_at = postCheck('desin_spec_verify_at'); $desin_spec_verify_at = postCheck('desin_spec_verify_at');
// 設計規格確認確認人
$desin_spec_verify_owner = postCheck('desin_spec_verify_owner'); $desin_spec_verify_owner = postCheck('desin_spec_verify_owner');
// 設計計劃圖確認
$desin_planning_verify = postCheck('desin_planning_verify'); $desin_planning_verify = postCheck('desin_planning_verify');
// 設計計劃圖確認附件
$desin_planning_verify_file = postCheck('desin_planning_verify_file'); $desin_planning_verify_file = postCheck('desin_planning_verify_file');
// 設計計劃圖確認時間
$desin_planning_verify_at = postCheck('desin_planning_verify_at'); $desin_planning_verify_at = postCheck('desin_planning_verify_at');
// 設計計劃圖確認人
$desin_planning_verify_owner = postCheck('desin_planning_verify_owner'); $desin_planning_verify_owner = postCheck('desin_planning_verify_owner');
// 設計顏色確認
$desin_color_verify = postCheck('desin_color_verify'); $desin_color_verify = postCheck('desin_color_verify');
// 設計顏色確認附件
$desin_color_verify_file = postCheck('desin_color_verify_file'); $desin_color_verify_file = postCheck('desin_color_verify_file');
// 設計顏色確認時間
$desin_color_verify_at = postCheck('desin_color_verify_at'); $desin_color_verify_at = postCheck('desin_color_verify_at');
// 設計顏色確認人
$desin_color_verify_owner = postCheck('desin_color_verify_owner'); $desin_color_verify_owner = postCheck('desin_color_verify_owner');
// 設計仕樣確認
$desin_style_verify = postCheck('desin_style_verify'); $desin_style_verify = postCheck('desin_style_verify');
// 設計仕樣確認附件
$desin_style_verify_file = postCheck('desin_style_verify_file'); $desin_style_verify_file = postCheck('desin_style_verify_file');
// 設計仕樣確認時間
$desin_style_verify_at = postCheck('desin_style_verify_at'); $desin_style_verify_at = postCheck('desin_style_verify_at');
// 設計仕樣確認人
$desin_style_verify_owner = postCheck('desin_style_verify_owner'); $desin_style_verify_owner = postCheck('desin_style_verify_owner');
// 設計主管確認
$desin_leader_verify = postCheck('desin_leader_verify'); $desin_leader_verify = postCheck('desin_leader_verify');
// 設計主管確認附件
$desin_leader_verify_file = postCheck('desin_leader_verify_file'); $desin_leader_verify_file = postCheck('desin_leader_verify_file');
// 設計主管確認時間
$desin_leader_verify_at = postCheck('desin_leader_verify_at'); $desin_leader_verify_at = postCheck('desin_leader_verify_at');
// 設計主管確認人
$desin_leader_verify_owner = postCheck('desin_leader_verify_owner'); $desin_leader_verify_owner = postCheck('desin_leader_verify_owner');
// 樓高通報
$building_heigh_verify = postCheck('building_heigh_verify'); $building_heigh_verify = postCheck('building_heigh_verify');
// 樓高通報附件
$building_heigh_verify_file = postCheck('building_heigh_verify_file'); $building_heigh_verify_file = postCheck('building_heigh_verify_file');
// 樓高通報時間
$building_heigh_verify_at = postCheck('building_heigh_verify_at'); $building_heigh_verify_at = postCheck('building_heigh_verify_at');
// 樓高通報確認人
$building_heigh_verify_owner = postCheck('building_heigh_verify_owner'); $building_heigh_verify_owner = postCheck('building_heigh_verify_owner');
// 電氣發貨明細
$electrical_design_publish = postCheck('electrical_design_publish'); $electrical_design_publish = postCheck('electrical_design_publish');
// 電氣資料發行時間
$electrical_design_publish_at = postCheck('electrical_design_publish_at'); $electrical_design_publish_at = postCheck('electrical_design_publish_at');
// 電氣資料發行人
$electrical_design_publish_owner = postCheck('electrical_design_publish_owner'); $electrical_design_publish_owner = postCheck('electrical_design_publish_owner');
// 機械資料發行
$mechanical_design_publish = postCheck('mechanical_design_publish'); $mechanical_design_publish = postCheck('mechanical_design_publish');
// 機械資料發行時間
$mechanical_design_publish_at = postCheck('mechanical_design_publish_at'); $mechanical_design_publish_at = postCheck('mechanical_design_publish_at');
// 機械資料發行人
$mechanical_design_publish_owner = postCheck('mechanical_design_publish_owner'); $mechanical_design_publish_owner = postCheck('mechanical_design_publish_owner');
// 電氣發貨明細
$electrical_shipping_date_publish = postCheck('electrical_shipping_date_publish'); $electrical_shipping_date_publish = postCheck('electrical_shipping_date_publish');
// 電氣發貨明細時間
$electrical_shipping_date_publish_at = postCheck('electrical_shipping_date_publish_at'); $electrical_shipping_date_publish_at = postCheck('electrical_shipping_date_publish_at');
// 電氣發貨明細發行人
$electrical_shipping_date_publish_owner = postCheck('electrical_shipping_date_publish_owner'); $electrical_shipping_date_publish_owner = postCheck('electrical_shipping_date_publish_owner');
// 機械發貨明細
$mechanical_shipping_date_publish = postCheck('mechanical_shipping_date_publish'); $mechanical_shipping_date_publish = postCheck('mechanical_shipping_date_publish');
// 機械發貨明細時間
$mechanical_shipping_date_publish_at = postCheck('mechanical_shipping_date_publish_at'); $mechanical_shipping_date_publish_at = postCheck('mechanical_shipping_date_publish_at');
// 機械發貨明細發行人
$mechanical_shipping_date_publish_owner = postCheck('mechanical_shipping_date_publish_owner'); $mechanical_shipping_date_publish_owner = postCheck('mechanical_shipping_date_publish_owner');
// 普來特富(下單日)
$prattford_order_date = postCheck('prattford_order_date'); $prattford_order_date = postCheck('prattford_order_date');
// 預計發貨日(到港日)
$estimated_shipping_date = postCheck('estimated_shipping_date'); $estimated_shipping_date = postCheck('estimated_shipping_date');
// 發貨類別(A.全級發貨、G.欠件發貨)
$goods_type = postCheck('goods_type'); $goods_type = postCheck('goods_type');
// 實際到貨日(到觀音廠日)
$actual_tofactory_date = postCheck('actual_tofactory_date'); $actual_tofactory_date = postCheck('actual_tofactory_date');
// 發貨確認人
$shipping_date_owner = postCheck('shipping_date_owner'); $shipping_date_owner = postCheck('shipping_date_owner');
// 預計船期
$estimated_shipping_schedule_date = postCheck('estimated_shipping_schedule_date'); $estimated_shipping_schedule_date = postCheck('estimated_shipping_schedule_date');
// 實際到貨日(到港日)
$actual_arrival_date = postCheck('actual_arrival_date'); $actual_arrival_date = postCheck('actual_arrival_date');
// 到貨確認人
$arrival_date_owner = postCheck('arrival_date_owner'); $arrival_date_owner = postCheck('arrival_date_owner');
// 是否齊備
$shengguanok_status = postCheck('shengguanok_status'); $shengguanok_status = postCheck('shengguanok_status');
// 生管確認附件
$shengguanok_status_file = postCheck('shengguanok_status_file'); $shengguanok_status_file = postCheck('shengguanok_status_file');
// 已備齊時間
$shengguanok_status_at = postCheck('shengguanok_status_at'); $shengguanok_status_at = postCheck('shengguanok_status_at');
// 已備齊檢查人
$shengguanok_status_owner = postCheck('shengguanok_status_owner'); $shengguanok_status_owner = postCheck('shengguanok_status_owner');
// QC與官檢種類
$qc_official_type = postCheck('qc_official_type'); $qc_official_type = postCheck('qc_official_type');
// 建立人
$creater = postCheck('creater'); $creater = postCheck('creater');
// 建立時間
$create_at = date('Y-m-d H:i:s'); $create_at = date('Y-m-d H:i:s');
@ -443,6 +236,7 @@ if ($department_id == "321" || $department_id == "220") {
contract_type, contract_type,
contractno, contractno,
salesid, salesid,
warehouseid,
custom, custom,
site_manager, site_manager,
accountid, accountid,
@ -531,6 +325,7 @@ if ($department_id == "321" || $department_id == "220") {
'$contract_type', '$contract_type',
'$contractno', '$contractno',
'$salesid', '$salesid',
'$warehouseid',
'$custom', '$custom',
'$site_manager', '$site_manager',
'$accountid', '$accountid',
@ -668,7 +463,9 @@ if ($department_id == "321" || $department_id == "220") {
accountid AS val , accountid AS val ,
name AS label name AS label
FROM account FROM account
WHERE department_id IN ('521','531','541','542','543','544','545') WHERE 1=1
-- AND department_id IN ('521','531','541','542','543','544','545')
AND accountid IN ('M0041','M0150','M0198','M0078','M0087','M0161')
ORDER BY label ASC ORDER BY label ASC
"; ";
$warehouse_options = mysqli_query($link, $sql); $warehouse_options = mysqli_query($link, $sql);
@ -815,14 +612,36 @@ if ($department_id == "321" || $department_id == "220") {
<td style="vertical-align: middle"> <td style="vertical-align: middle">
<select class="form-control " id="warehouseid" name="warehouseid"> <select class="form-control " id="warehouseid" name="warehouseid">
<option value="">未選擇</option> <option value="">未選擇</option>
<optgroup label="北區">
<option value="M0041">張潘榮(桃竹以北)</option>
<option value="M0150">羅盛騰(桃竹)</option>
<option value="M0040">吳宗紘</option>
</optgroup>
<optgroup label="中區">
<option value="M0198">廖堉勝</option>
<option value="M0158">劉子睿(新梯)</option>
<option value="M0161">鄭永典(汰改)</option>
<option value="M0159">孫仲凱</option>
<option value="M0202">徐錦潤</option>
<option value="M0113">林瑋隆</option>
</optgroup>
<optgroup label="南區">
<option value="M0078">許益連</option>
<option value="M0102">鄭存邑(高屏、台東)</option>
<option value="M0187">田祖豪(台南、嘉義)</option>
<option value="M0077">鍾玉龍</option>
</optgroup>
<optgroup label="宜蘭">
<option value="M0087">高培軒</option>
</optgroup>
<?php <?php
foreach ($warehouse_options as $warehouse_option) : // foreach ($warehouse_options as $warehouse_option) :
if ($warehouse_option['val'] == $warehouseid) { // if ($warehouse_option['val'] == $warehouseid) {
echo "<option selected value='" . $warehouse_option['val'] . "'>" . $warehouse_option['val'] . $warehouse_option['label'] . "</option>"; // echo "<option selected value='" . $warehouse_option['val'] . "'>" . $warehouse_option['val'] . $warehouse_option['label'] . "</option>";
} else { // } else {
echo "<option value='" . $warehouse_option['val'] . "'>" . $warehouse_option['val'] . $warehouse_option['label'] . "</option>"; // echo "<option value='" . $warehouse_option['val'] . "'>" . $warehouse_option['val'] . $warehouse_option['label'] . "</option>";
} // }
endforeach // endforeach
?> ?>
</select> </select>
</td> </td>

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

@ -87,11 +87,11 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
'樓高通報日期', '樓高通報日期',
'工勘確認', '工勘確認',
'工勘確認日期', '工勘確認日期',
'客戶計劃圖(意匠圖)',
'客戶計劃圖(意匠圖)日期',
'營業/契約確認', '營業/契約確認',
'營業/契約規格', '營業/契約規格',
'營業/契約規格日期', '營業/契約規格日期',
'客戶計劃圖(意匠圖)',
'客戶計劃圖(意匠圖)日期',
'客戶顏色', '客戶顏色',
'客戶顏色日期', '客戶顏色日期',
'客戶樣式', '客戶樣式',
@ -158,8 +158,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$gongwuok += 1; $gongwuok += 1;
if (!in_array($row['site_survey_contact_verify'], ['1', 'A'])) if (!in_array($row['site_survey_contact_verify'], ['1', 'A']))
$gongwuok += 1; $gongwuok += 1;
if ($row['customer_planning_verify'] == 0)
$gongwuok += 1;
// 營業統計已確認 // 營業統計已確認
if ($row['sales_spec_verify'] == 0) if ($row['sales_spec_verify'] == 0)
@ -170,6 +168,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$yingyeok += 1; $yingyeok += 1;
if ($row['site_survey_contact_form_verify'] == 0) if ($row['site_survey_contact_form_verify'] == 0)
$yingyeok += 1; $yingyeok += 1;
if ($row['customer_planning_verify'] == 0)
$yingyeok += 1;
// 設計統計已確認 // 設計統計已確認
if ($row['desin_spec_verify'] == 0) if ($row['desin_spec_verify'] == 0)
@ -305,16 +305,17 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
substr($row['estimated_shipping_schedule_date'], 0, 10), substr($row['estimated_shipping_schedule_date'], 0, 10),
substr($row['actual_tofactory_date'], 0, 10), substr($row['actual_tofactory_date'], 0, 10),
substr($row['real_contract_arrival_date'], 0, 10), substr($row['real_contract_arrival_date'], 0, 10),
getGunwuName($row['address']) . $gongwuok . "/3", // getGunwuName($row['address']) . $gongwuok . "/2",
accountidToName($row['warehouseid']) . $gongwuok . "/2",
$dbuilding_heigh_verify_status, $dbuilding_heigh_verify_status,
substr($row['building_heigh_verify_at'], 0, 10), substr($row['building_heigh_verify_at'], 0, 10),
$site_survey_contact_verify_status, $site_survey_contact_verify_status,
substr($row['site_survey_contact_verify_at'], 0, 10), substr($row['site_survey_contact_verify_at'], 0, 10),
$customer_planning_verify_status, accountidToName($row['salesid']) . " " . $yingyeok . "/5",
substr($row['customer_planning_verify_at'], 0, 10),
accountidToName($row['salesid']) . " " . $yingyeok . "/4",
$sales_spec_verify_status, $sales_spec_verify_status,
substr($row['sales_spec_verify_at'], 0, 10), substr($row['sales_spec_verify_at'], 0, 10),
$customer_planning_verify_status,
substr($row['customer_planning_verify_at'], 0, 10),
$customer_color_verify_status, $customer_color_verify_status,
substr($row['customer_color_verify_at'], 0, 10), substr($row['customer_color_verify_at'], 0, 10),
$customer_style_verify_status, $customer_style_verify_status,
@ -364,13 +365,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
->getStartColor()->setRGB('8EA9DB'); ->getStartColor()->setRGB('8EA9DB');
// 背景顏色為橘色 // 背景顏色為橘色
$styleA1toC1 = $sheet->getStyle('O1:U1'); $styleA1toC1 = $sheet->getStyle('O1:S1');
$fillA1toC1 = $styleA1toC1->getFill(); $fillA1toC1 = $styleA1toC1->getFill();
$fillA1toC1->setFillType(Fill::FILL_SOLID) $fillA1toC1->setFillType(Fill::FILL_SOLID)
->getStartColor()->setRGB('FFBB66'); ->getStartColor()->setRGB('FFBB66');
// 背景顏色為綠色 // 背景顏色為綠色
$styleA1toC1 = $sheet->getStyle('V1:AD1'); $styleA1toC1 = $sheet->getStyle('T1:AD1');
$fillA1toC1 = $styleA1toC1->getFill(); $fillA1toC1 = $styleA1toC1->getFill();
$fillA1toC1->setFillType(Fill::FILL_SOLID) $fillA1toC1->setFillType(Fill::FILL_SOLID)
->getStartColor()->setRGB('DDFF77'); ->getStartColor()->setRGB('DDFF77');

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

@ -85,7 +85,8 @@ function checkYingYeok($link, $id)
CAST(IF(sales_spec_verify != '2',sales_spec_verify,'0') AS SIGNED) + CAST(IF(sales_spec_verify != '2',sales_spec_verify,'0') AS SIGNED) +
CAST(IF(customer_color_verify != '2',customer_color_verify,'0') AS SIGNED) + CAST(IF(customer_color_verify != '2',customer_color_verify,'0') AS SIGNED) +
CAST(IF(customer_style_verify != '2',customer_style_verify,'0') AS SIGNED) + CAST(IF(customer_style_verify != '2',customer_style_verify,'0') AS SIGNED) +
CAST(IF(site_survey_contact_form_verify != '2',site_survey_contact_form_verify,'0') AS SIGNED) CAST(IF(site_survey_contact_form_verify != '2',site_survey_contact_form_verify,'0') AS SIGNED) +
CAST(IF(customer_planning_verify != '2',customer_planning_verify,'0') AS SIGNED)
) AS sum_num ) AS sum_num
FROM wipwholestatus FROM wipwholestatus
WHERE 1=1 WHERE 1=1
@ -139,8 +140,7 @@ function checkGongWuok($link, $id)
$sql = " $sql = "
SELECT SELECT
SUM( SUM(
CAST(IF(building_heigh_verify != '2',building_heigh_verify,'0') AS SIGNED) + CAST(IF(building_heigh_verify != '2',building_heigh_verify,'0') AS SIGNED)
CAST(IF(customer_planning_verify != '2',customer_planning_verify,'0') AS SIGNED)
) AS sum_num ) AS sum_num
FROM wipwholestatus FROM wipwholestatus
WHERE 1=1 WHERE 1=1
@ -414,7 +414,7 @@ function getDataSql($department_id, $role_id, $user_id)
// 營業員主管或營業員 // 營業員主管或營業員
$department_arr = [ $department_arr = [
'310', '311', '312', '313', '314', '315', '310', '311', '312', '313', '314', '315',
'511', '512', '513', '514' '511', '512', '513', '514', '515'
]; ];
$sql_cmd = sql_myself($user_id, "salesid"); $sql_cmd = sql_myself($user_id, "salesid");
@ -631,7 +631,7 @@ function getDataSqlByflowCode($department_id, $role_id, $user_id, $flow_code)
$contract_type = 'B'; $contract_type = 'B';
// 營業員主管或營業員 // 營業員主管或營業員
$department_arr = ['501', '511', '512', '513', '514']; $department_arr = ['501', '511', '512', '513', '514', '515'];
$sql_cmd = sql_myself($user_id, "salesid"); $sql_cmd = sql_myself($user_id, "salesid");
$sql = " $sql = "
@ -915,10 +915,10 @@ function getDataSqlByflowCode($department_id, $role_id, $user_id, $flow_code)
function getGunwuName($address) function getGunwuName($address)
{ {
$north_arr = array('台北', '基隆', '新北', '桃園', '新竹', '台東'); $north_arr = array('台北', '基隆', '新北', '桃園', '新竹');
$north_arr2 = array('宜蘭'); $north_arr2 = array('宜蘭');
$center_arr = array('南投', '彰化', '雲林', '台中', '苗栗'); $center_arr = array('南投', '彰化', '雲林', '台中', '苗栗');
$south_arr = array('台南', '嘉義', '屏東', '高雄'); $south_arr = array('台南', '嘉義', '屏東', '高雄', '台東');
foreach ($north_arr as $key => $value) foreach ($north_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false) if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "吳宗紘"; return "吳宗紘";
@ -927,7 +927,7 @@ function getGunwuName($address)
return "高培軒"; return "高培軒";
foreach ($center_arr as $key => $value) foreach ($center_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false) if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "林瑋隆"; return "劉子睿";
foreach ($south_arr as $key => $value) foreach ($south_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false) if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "鄭存邑"; return "鄭存邑";
@ -967,14 +967,14 @@ function getMarketingStatus($link, $user_department_id, $role_id, $status)
{ {
if ($user_department_id == 220) if ($user_department_id == 220)
return ""; return "";
if ($user_department_id == 311 || $user_department_id == 312 || $user_department_id == 313 || $user_department_id == 314 || $user_department_id == 315) { if (in_array($user_department_id, [311, 312, 313, 314, 315])) {
if ($status == 1) { if ($status == 1) {
return checkNowFormStatus($link) == 'B' ? "" : "disabled"; return checkNowFormStatus($link) == 'B' ? "" : "disabled";
} else { } else {
return ""; return "";
} }
} }
if ($user_department_id == 501 || $user_department_id == 511 || $user_department_id == 512 || $user_department_id == 513 || $user_department_id == 514) { if (in_array($user_department_id, [501, 511, 512, 513, 514, 515])) {
if ($status == 1) { if ($status == 1) {
return checkNowFormStatus($link) == 'B' ? "" : "disabled"; return checkNowFormStatus($link) == 'B' ? "" : "disabled";
} else { } else {
@ -1060,7 +1060,7 @@ function getYingyeokOptions($link)
accountid AS val , accountid AS val ,
name AS label name AS label
FROM `account` FROM `account`
WHERE `department_id` IN ('311','312','313','314','315','511','512','513','514') WHERE `department_id` IN ('311','312','313','314','315','511','512','513','514','515')
ORDER BY accountid ASC ORDER BY accountid ASC
"; ";
return mysqli_query($link, $sql); return mysqli_query($link, $sql);
@ -1172,7 +1172,7 @@ function getWipwholeChangeButtonStatus($user_department_id)
{ {
if (in_array($user_department_id, [311, 312, 313, 314, 315])) if (in_array($user_department_id, [311, 312, 313, 314, 315]))
return true; return true;
if (in_array($user_department_id, [501, 511, 512, 513, 514])) if (in_array($user_department_id, [501, 511, 512, 513, 514, 515]))
return true; return true;
if (in_array($user_department_id, [521, 531, 220, 250])) if (in_array($user_department_id, [521, 531, 220, 250]))
return true; return true;
@ -1202,7 +1202,7 @@ function getSaveEstimateInstallData($user_department_id, $role_id)
return true; return true;
if ($user_department_id == '542' && in_array($role_id, ['1', '5', '6', '8'])) if ($user_department_id == '542' && in_array($role_id, ['1', '5', '6', '8']))
return true; return true;
if ($user_department_id == '544' && in_array($role_id, ['3', '6'])) if ($user_department_id == '544' && in_array($role_id, ['3', '6', '9']))
return true; return true;
if ($user_department_id == '543' && $role_id == '2') if ($user_department_id == '543' && $role_id == '2')
return true; return true;
@ -1221,7 +1221,7 @@ function getSaveInstallDataButtonStatus($user_department_id, $role_id)
return true; return true;
if ($user_department_id == '543' && $role_id == '2') if ($user_department_id == '543' && $role_id == '2')
return true; return true;
if ($user_department_id == '544' && in_array($role_id, ['3', '4', '6'])) if ($user_department_id == '544' && in_array($role_id, ['3', '4', '6', '9']))
return true; return true;
if ($user_department_id == '545' && in_array($role_id, ['3', '6'])) if ($user_department_id == '545' && in_array($role_id, ['3', '6']))
return true; return true;
@ -1269,3 +1269,24 @@ function getAllCustomerPlanningVerify($link, $id)
"; ";
return mysqli_query($link, $sql); return mysqli_query($link, $sql);
} }
// 各區營銷(契約)經理判斷程式
function checkUseridIsManager($user_id)
{
// 北區 劉永德
if (in_array($user_id, ['M0137']))
return true;
// 中區 李烘銘
if (in_array($user_id, ['M0086']))
return true;
// 桃竹 張莉凱
if (in_array($user_id, ['M0026']))
return true;
// 宜花東 陳志文
if (in_array($user_id, ['M0054']))
return true;
// 南區 吳育宗
if (in_array($user_id, ['M0033']))
return true;
return false;
}

18
wms/wipwhole-renovate-index-table-html.php

@ -6,12 +6,13 @@ if (in_array($user_id, ['M0175', 'M0079'])) {
} }
?> ?>
<table id="table_index2" class="table table-striped table-bordered dt-responsive nowrap" style="width:98.5%"> <table id="table_index2" class="table table-striped table-bordered " style="width:100%;table-layout:fixed;">
<thead> <thead>
<tr> <tr>
<?php <?php
echo $update_delete_status ? "<th style='text-align:center;width:80px;'>刪除</th>" : ""; echo $update_delete_status ? "<th style='text-align:center;width:80px;'>刪除</th>" : "";
?> ?>
<th style="text-align:center;width:120px;">序號</th>
<th style="text-align:center;width:120px;">合約號</th> <th style="text-align:center;width:120px;">合約號</th>
<th style="text-align:center;width:100px;">汰改種類</th> <th style="text-align:center;width:100px;">汰改種類</th>
<th style="text-align:center;width:120px;">電梯編號</th> <th style="text-align:center;width:120px;">電梯編號</th>
@ -61,8 +62,6 @@ if (in_array($user_id, ['M0175', 'M0079'])) {
$data['gongwuok'] += 1; $data['gongwuok'] += 1;
if (!in_array($data['site_survey_contact_verify'], ['1', 'A'])) if (!in_array($data['site_survey_contact_verify'], ['1', 'A']))
$data['gongwuok'] += 1; $data['gongwuok'] += 1;
if ($data['customer_planning_verify'] == 0 || $data['customer_planning_verify'] == 2)
$data['gongwuok'] += 1;
// 營業統計已確認 // 營業統計已確認
if ($data['sales_spec_verify'] == 0 || $data['sales_spec_verify'] == 2) if ($data['sales_spec_verify'] == 0 || $data['sales_spec_verify'] == 2)
@ -73,6 +72,8 @@ if (in_array($user_id, ['M0175', 'M0079'])) {
$data['yingyeok'] += 1; $data['yingyeok'] += 1;
if ($data['site_survey_contact_form_verify'] == 0 || $data['site_survey_contact_form_verify'] == 2) if ($data['site_survey_contact_form_verify'] == 0 || $data['site_survey_contact_form_verify'] == 2)
$data['yingyeok'] += 1; $data['yingyeok'] += 1;
if ($data['customer_planning_verify'] == 0 || $data['customer_planning_verify'] == 2)
$data['yingyeok'] += 1;
// 設計統計已確認 // 設計統計已確認
if ($data['desin_spec_verify'] == 0 || $data['desin_spec_verify'] == 2) if ($data['desin_spec_verify'] == 0 || $data['desin_spec_verify'] == 2)
@ -105,6 +106,7 @@ if (in_array($user_id, ['M0175', 'M0079'])) {
?> ?>
<tr> <tr>
<?php echo $update_delete_status ? "<td><button type='button' class='btn btn-danger' onclick='delete_wipwholestatus(" . $data['id'] . ")'>刪除</button></td>" : ""; ?> <?php echo $update_delete_status ? "<td><button type='button' class='btn btn-danger' onclick='delete_wipwholestatus(" . $data['id'] . ")'>刪除</button></td>" : ""; ?>
<td><?php echo $data['id']; ?></td>
<td> <td>
<?php <?php
if (in_array($department_id, [311, 312, 313, 314, 315, 501, 511, 512, 513, 514, 220, 911])) { if (in_array($department_id, [311, 312, 313, 314, 315, 501, 511, 512, 513, 514, 220, 911])) {
@ -197,27 +199,29 @@ if (in_array($user_id, ['M0175', 'M0079'])) {
</td> </td>
<td> <td>
<?php <?php
$str = $data['gongwuok'] . "/3"; $str = $data['gongwuok'] . "/2";
if ($edit_flag & 4 && ($user_auth & 2)) { if ($edit_flag & 4 && ($user_auth & 2)) {
?> ?>
<p> <p>
<?php echo $str; ?> <?php echo $str; ?>
<a target='_blank' href="wipwhole-renovate-rec-invoice-edit.php?function_name=wipwholerenstatus&<?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=wipwholerenstatus&<?php echo $token_link; ?>&id=<?php echo $data['id']; ?>" class="btn btn-primary btn-sm">
<?php <?php
echo getGunwuName($data['address']); // echo getGunwuName($data['address']);
echo accountidToName($data['warehouseid']);
?> ?>
</a> </a>
</p> </p>
<?php <?php
} else { } else {
echo $str; echo $str;
echo getGunwuName($data['address']); // echo getGunwuName($data['address']);
echo accountidToName($data['warehouseid']);
} }
?> ?>
</td> </td>
<td> <td>
<?php <?php
$str = $data['yingyeok'] . "/4"; $str = $data['yingyeok'] . "/5";
if ($edit_flag & 1 && ($user_auth & 2)) { if ($edit_flag & 1 && ($user_auth & 2)) {
?> ?>
<p> <p>

14
wms/wipwhole-renovate-index.php

@ -33,6 +33,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($form_name == 'del_form') { if ($form_name == 'del_form') {
$sql = "UPDATE wipwholestatus SET status = '0' WHERE id = '$del_seq' "; $sql = "UPDATE wipwholestatus SET status = '0' WHERE id = '$del_seq' ";
mysqli_query($link, $sql); mysqli_query($link, $sql);
$sql = "UPDATE flow set flow_code = 'Z' where form_id = '$del_seq' and flow_id = 'wws02' ";
mysqli_query($link, $sql);
} }
} }
@ -404,7 +406,10 @@ mysqli_close($link);
window.location.href = '<?php echo "/wms/estimated_shipping_date_report.php?$token_link" ?>'; window.location.href = '<?php echo "/wms/estimated_shipping_date_report.php?$token_link" ?>';
} }
$('#table_index2,#table_index3,#table_index4,#table_index5,#table_index6,#table_index7').DataTable({ $('#table_index2').DataTable({
fixedColumns: {
leftColumns: 4
},
scrollX: true, scrollX: true,
fixedHeader: true, fixedHeader: true,
scrollY: 500, scrollY: 500,
@ -586,3 +591,10 @@ mysqli_close($link);
<input type='hidden' id='del_seq' name='del_seq' value='' /> <input type='hidden' id='del_seq' name='del_seq' value='' />
<input type='hidden' id='form_name' name='form_name' value='del_form' /> <input type='hidden' id='form_name' name='form_name' value='del_form' />
</form> </form>
<style>
/* 设置固定列的背景色 */
.dtfc-fixed-left {
background-color: #f9f9f9;
border: 1px !important;
}
</style>

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

@ -1,6 +1,8 @@
<?php <?php
// ini_set('display_errors', 'on'); // ini_set('display_errors', 'on');
if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") {
include("class/Cnotice.php");
$cn = new Cnotice();
if ($_POST['form_name'] == 'main_form') { if ($_POST['form_name'] == 'main_form') {
foreach ($_POST as $k => $v) { foreach ($_POST as $k => $v) {
@ -8,28 +10,17 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$$k = htmlspecialchars(stripslashes(trim($v))); $$k = htmlspecialchars(stripslashes(trim($v)));
} }
// 時間戳記
$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 = $_POST['contractno'];
// 號機
$facility_temp_no = $_POST['facility_temp_no']; $facility_temp_no = $_POST['facility_temp_no'];
// 汰改方案 B
$renovate_type = json_encode($_POST['renovate_type'], JSON_UNESCAPED_UNICODE); $renovate_type = json_encode($_POST['renovate_type'], JSON_UNESCAPED_UNICODE);
// 作番號
$facilityno = $_POST['facilityno']; $facilityno = $_POST['facilityno'];
// 客戶名稱
$custom = $_POST['custom']; $custom = $_POST['custom'];
// 工地負責人
$site_manager = $_POST['site_manager']; $site_manager = $_POST['site_manager'];
// 緯度
$latitude = $_POST['latitude']; $latitude = $_POST['latitude'];
// 經度
$longitude = $_POST['longitude']; $longitude = $_POST['longitude'];
$weight = $_POST['weight']; $weight = $_POST['weight'];
$numberofpassenger = $_POST['numberofpassenger']; $numberofpassenger = $_POST['numberofpassenger'];
$numberofstop = $_POST['numberofstop']; $numberofstop = $_POST['numberofstop'];
$numberoffloor = $_POST['numberoffloor']; $numberoffloor = $_POST['numberoffloor'];
@ -38,64 +29,45 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$facility_kind = $_POST['facility_kind']; $facility_kind = $_POST['facility_kind'];
$address = $_POST['address']; $address = $_POST['address'];
$real_address = $_POST['real_address']; $real_address = $_POST['real_address'];
//合約到貨日
$contract_arrival_date = $_POST['contract_arrival_date']; $contract_arrival_date = $_POST['contract_arrival_date'];
//合約到貨日
$real_contract_arrival_date = $_POST['real_contract_arrival_date']; $real_contract_arrival_date = $_POST['real_contract_arrival_date'];
//营业规格确认
$sales_spec_verify = $_POST['sales_spec_verify']; $sales_spec_verify = $_POST['sales_spec_verify'];
$sales_spec_verify_at = $_POST['sales_spec_verify_at'] ?: $row['sales_spec_verify_at']; $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']; $sales_spec_verify_owner = $_POST['sales_spec_verify_owner'] ?: $row['sales_spec_verify_owner'];
//客户颜色确认
$customer_color_verify = $_POST['customer_color_verify']; $customer_color_verify = $_POST['customer_color_verify'];
$customer_color_verify_at = $_POST['customer_color_verify_at'] ?: $row['customer_color_verify_at']; $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_color_verify_owner = $_POST['customer_color_verify_owner'] ?: $row['customer_color_verify_owner'];
//客户颜色确认
$customer_style_verify = $_POST['customer_style_verify']; $customer_style_verify = $_POST['customer_style_verify'];
$customer_style_verify_at = $_POST['customer_style_verify_at'] ?: $row['customer_style_verify_at']; $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']; $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 = $_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_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']; $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 = $_POST['desin_spec_verify'];
$desin_spec_verify_at = $_POST['desin_spec_verify_at'] ?: $row['desin_spec_verify_at']; $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_spec_verify_owner = $_POST['desin_spec_verify_owner'] ?: $row['desin_spec_verify_owner'];
//设计计划图确认
$desin_planning_verify = $_POST['desin_planning_verify']; $desin_planning_verify = $_POST['desin_planning_verify'];
$desin_planning_verify_at = $_POST['desin_planning_verify_at'] ?: $row['desin_planning_verify_at']; $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_planning_verify_owner = $_POST['desin_planning_verify_owner'] ?: $row['desin_planning_verify_owner'];
//设计颜色确认
$desin_color_verify = $_POST['desin_color_verify']; $desin_color_verify = $_POST['desin_color_verify'];
$desin_color_verify_at = $_POST['desin_color_verify_at'] ?: $row['desin_color_verify_at']; $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_color_verify_owner = $_POST['desin_color_verify_owner'] ?: $row['desin_color_verify_owner'];
//设计仕样确认
$desin_style_verify = $_POST['desin_style_verify']; $desin_style_verify = $_POST['desin_style_verify'];
$desin_style_verify_at = $_POST['desin_style_verify_at'] ?: $row['desin_style_verify_at']; $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_style_verify_owner = $_POST['desin_style_verify_owner'] ?: $row['desin_style_verify_owner'];
//设计主管確認
$desin_leader_verify = $_POST['desin_leader_verify']; $desin_leader_verify = $_POST['desin_leader_verify'];
$desin_leader_verify_at = $_POST['desin_leader_verify_at'] ?: $row['desin_leader_verify_at']; $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']; $desin_leader_verify_owner = $_POST['desin_leader_verify_owner'] ?: $row['desin_leader_verify_owner'];
//楼高通报
$building_heigh_verify = $_POST['building_heigh_verify']; $building_heigh_verify = $_POST['building_heigh_verify'];
$building_heigh_verify_at = $_POST['building_heigh_verify_at'] ?: $row['building_heigh_verify_at']; $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']; $building_heigh_verify_owner = $_POST['building_heigh_verify_owner'] ?: $row['building_heigh_verify_owner'];
//客户计划图确认
$customer_planning_verify = $_POST['customer_planning_verify']; $customer_planning_verify = $_POST['customer_planning_verify'];
$customer_planning_verify_at = $_POST['customer_planning_verify_at'] ?: $row['customer_planning_verify_at']; $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']; $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 = $_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_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']; $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']; $old_site_survey_contact_verify = $_POST['old_site_survey_contact_verify'];
// 工務助理
$outsourcer_type = $_POST['outsourcer_type']; $outsourcer_type = $_POST['outsourcer_type'];
$install_outsourcer = $_POST['install_outsourcer']; $install_outsourcer = $_POST['install_outsourcer'];
$install_outsourcer_owner = $_POST['install_outsourcer_owner']; $install_outsourcer_owner = $_POST['install_outsourcer_owner'];
@ -114,117 +86,37 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$estimate_tryrun_end_date = $_POST['estimate_tryrun_end_date']; $estimate_tryrun_end_date = $_POST['estimate_tryrun_end_date'];
$estimate_tryrun_end_date_owner = $_POST['estimate_tryrun_end_date_owner']; $estimate_tryrun_end_date_owner = $_POST['estimate_tryrun_end_date_owner'];
$warehouse_assistant_remark = $_POST['warehouse_assistant_remark']; $warehouse_assistant_remark = $_POST['warehouse_assistant_remark'];
// 工勘變更通知繪圖人員
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]";
$sql = "
INSERT INTO notice(
kind,
related_id,
title,
content,
haveread,
permission,
creater,
create_at
)VALUES(
'1',
'$id',
'$title',
'$content',
null,
'$permission',
'$creater',
'$create_at'
);
";
mysqli_query($link, $sql);
}
}
//是否齊備
$shengguanok_status = $_POST['shengguanok_status']; $shengguanok_status = $_POST['shengguanok_status'];
$shengguanok_status_at = $_POST['shengguanok_status_at']; $shengguanok_status_at = $_POST['shengguanok_status_at'];
$shengguanok_status_owner = $_POST['shengguanok_status_owner'] ?: $row['shengguanok_status_owner']; $shengguanok_status_owner = $_POST['shengguanok_status_owner'] ?: $row['shengguanok_status_owner'];
//下單日(普萊特富)
$prattford_order_date_verify = $_POST['prattford_order_date_verify']; $prattford_order_date_verify = $_POST['prattford_order_date_verify'];
$prattford_order_date = $_POST['prattford_order_date']; $prattford_order_date = $_POST['prattford_order_date'];
$prattford_order_date_owner = $_POST['prattford_order_date_owner'] ?: $row['prattford_order_date_owner']; $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_verify = $_POST['estimated_shipping_date_verify'];
$estimated_shipping_date = $_POST['estimated_shipping_date']; $estimated_shipping_date = $_POST['estimated_shipping_date'];
$estimated_shipping_date_owner = $_POST['estimated_shipping_date_owner'] ?: $row['estimated_shipping_date_owner']; $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_verify = $_POST['estimated_shipping_schedule_date_verify'];
$estimated_shipping_schedule_date = $_POST['estimated_shipping_schedule_date']; $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']; $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 = $_POST['goods_type'] ?: $row['goods_type'];
$goods_type_date = $_POST['goods_type_date']; $goods_type_date = $_POST['goods_type_date'];
$goods_type_owner = $_POST['goods_type_owner'] ?: $row['goods_type_owner']; $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 = $_POST['taiwan_goods_type'] ?: $row['taiwan_goods_type'];
$taiwan_goods_type_date = $_POST['taiwan_goods_type_date']; $taiwan_goods_type_date = $_POST['taiwan_goods_type_date'];
$taiwan_goods_type_owner = $_POST['taiwan_goods_type_owner'] ?: $row['taiwan_goods_type_owner']; $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']; $arrival_date_verify = $_POST['arrival_date_verify'] ?: $row['arrival_date_verify'];
$actual_tofactory_date = $_POST['actual_tofactory_date']; $actual_tofactory_date = $_POST['actual_tofactory_date'];
$arrival_date_owner = $_POST['arrival_date_owner'] ?: $row['arrival_date_owner']; $arrival_date_owner = $_POST['arrival_date_owner'] ?: $row['arrival_date_owner'];
// 各部門備註
$marketing_remark = $_POST['marketing_remark'] ?: $row['marketing_remark']; $marketing_remark = $_POST['marketing_remark'] ?: $row['marketing_remark'];
$desin_remark = $_POST['desin_remark'] ?: $row['desin_remark']; $desin_remark = $_POST['desin_remark'] ?: $row['desin_remark'];
$desin_leader_remark = $_POST['desin_leader_remark'] ?: $row['desin_leader_remark']; $desin_leader_remark = $_POST['desin_leader_remark'] ?: $row['desin_leader_remark'];
$warehouse_remark = $_POST['warehouse_remark'] ?: $row['warehouse_remark']; $warehouse_remark = $_POST['warehouse_remark'] ?: $row['warehouse_remark'];
$yewu_remark = $_POST['yewu_remark'] ?: $row['yewu_remark']; $yewu_remark = $_POST['yewu_remark'] ?: $row['yewu_remark'];
$shengguan_remark = $_POST['shengguan_remark'] ?: $row['shengguan_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 = $_POST['qc_date'] ?: $row['qc_date'];
$qc_date_owner = $_POST['qc_date_owner'] ?: $row['qc_date_owner']; $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 = $_POST['end_qc_date'] ?: $row['end_qc_date'];
@ -233,15 +125,46 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$old_official_check_date = $_POST['old_official_check_date'] ?: $row['old_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']; $official_check_date_owner = $_POST['official_check_date_owner'] ?: $row['official_check_date_owner'];
$delivery_date = $_POST['delivery_date'] ?: $row['delivery_date']; $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']; $delivery_date_owner = $_POST['delivery_date_owner'] ?: $row['delivery_date_owner'];
$warehouseid = $_POST['warehouseid'] ?: $row['warehouseid'];
$old_warehouseid = $_POST['old_warehouseid'] ?: $row['warehouseid'];
$creater = $_POST['creater']; $creater = $_POST['creater'];
$create_at = date("Y-m-d H:i:s"); $create_at = date("Y-m-d H:i:s");
// 上傳附件 // 上傳附件
include "wipwhole-rec-invoice-edit-fileupload.php"; 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) { if ($official_check_date !== $old_official_check_date) {
$sql = " $sql = "
SELECT accountid SELECT accountid
@ -254,31 +177,131 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$permission = $row["accountid"]; $permission = $row["accountid"];
$title = "客戶:$custom 作番:$facilityno 官檢日變更"; $title = "客戶:$custom 作番:$facilityno 官檢日變更";
$content = "客戶:$custom $content = "客戶:$custom
作番:$facilityno 作番:$facilityno
官檢日 $old_official_check_date => $official_check_date"; 官檢日 $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);
}
}
}
$sql = " // 工勘變更通知繪圖人員
INSERT INTO notice( if ($site_survey_contact_verify !== $old_site_survey_contact_verify) {
kind, $site_survey_status = array(
related_id, "1" => "請選擇",
title, "0" => "已確認",
content, "2" => "無工勘需求",
haveread, "A" => "未動工",
permission, "B" => "地下室施工",
creater, "C" => "打樁",
create_at "D" => "地基",
)VALUES( "E" => "挖土",
'1', "G" => "機房",
'$id', "H" => "機械式淨高",
'$title', "M" => "樓中樓",
'$content', "OH" => "最高層(頂樓高度)",
null, "P" => "PIT(機坑深度)",
'$permission', "R" => "R 樓",
'$creater', "S" => "停工",
'" . date("Y-m-d H:i: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');
"; ";
mysqli_query($link, $sql); $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 = "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);
} }
} }
@ -293,9 +316,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
site_survey_contact_verify = '$site_survey_contact_verify', site_survey_contact_verify = '$site_survey_contact_verify',
site_survey_contact_verify_at = '$site_survey_contact_verify_at', site_survey_contact_verify_at = '$site_survey_contact_verify_at',
site_survey_contact_verify_owner = '$site_survey_contact_verify_owner', site_survey_contact_verify_owner = '$site_survey_contact_verify_owner',
customer_planning_verify = '$customer_planning_verify',
customer_planning_verify_at = '$customer_planning_verify_at',
customer_planning_verify_owner = '$customer_planning_verify_owner',
"; ";
$updatesql .= "warehouse_remark = '', "; $updatesql .= "warehouse_remark = '', ";
if (!empty(trim($warehouse_remark))) { if (!empty(trim($warehouse_remark))) {
@ -305,8 +325,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
} }
$updatesql .= empty($building_heigh_verify_file) ? "" : "building_heigh_verify_file = '$building_heigh_verify_file',"; $updatesql .= empty($building_heigh_verify_file) ? "" : "building_heigh_verify_file = '$building_heigh_verify_file',";
$updatesql .= empty($site_survey_contact_verify_file) ? "" : "site_survey_contact_verify_file = '$site_survey_contact_verify_file',"; $updatesql .= empty($site_survey_contact_verify_file) ? "" : "site_survey_contact_verify_file = '$site_survey_contact_verify_file',";
$updatesql .= empty($customer_planning_verify_file) ? "" : "customer_planning_verify_file = '$customer_planning_verify_file',"; }
} else if (in_array($user_department_id, [311, 312, 313, 314, 315, 511, 512, 513, 514])) {
if (in_array($user_department_id, [311, 312, 313, 314, 315, 511, 512, 513, 514, 515])) {
// 契約更新; // 契約更新;
$updatesql .= " $updatesql .= "
sales_spec_verify = '$sales_spec_verify', sales_spec_verify = '$sales_spec_verify',
@ -323,6 +344,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
site_survey_contact_form_verify_owner = '$site_survey_contact_form_verify_owner', site_survey_contact_form_verify_owner = '$site_survey_contact_form_verify_owner',
delivery_date = '$delivery_date', delivery_date = '$delivery_date',
delivery_date_owner = '$delivery_date_owner', delivery_date_owner = '$delivery_date_owner',
customer_planning_verify = '$customer_planning_verify',
customer_planning_verify_at = '$customer_planning_verify_at',
customer_planning_verify_owner = '$customer_planning_verify_owner',
marketing_remark = '', marketing_remark = '',
"; ";
if (!empty(trim($marketing_remark))) { if (!empty(trim($marketing_remark))) {
@ -330,6 +354,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "<br/>" . $marketing_remark . "<br/><br/>',IF(all_remark IS NULL,'',all_remark)), all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "<br/>" . $marketing_remark . "<br/><br/>',IF(all_remark IS NULL,'',all_remark)),
"; ";
} }
$updatesql .= empty($customer_planning_verify_file) ? "" : "customer_planning_verify_file = '$customer_planning_verify_file',";
$updatesql .= empty($sales_spec_verify_file) ? "" : "sales_spec_verify_file = '$sales_spec_verify_file',"; $updatesql .= empty($sales_spec_verify_file) ? "" : "sales_spec_verify_file = '$sales_spec_verify_file',";
$updatesql .= empty($customer_color_verify_file) ? "" : "customer_color_verify_file = '$customer_color_verify_file',"; $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($customer_style_verify_file) ? "" : "customer_style_verify_file = '$customer_style_verify_file',";
@ -492,8 +517,69 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
} }
// 工務助理 // 工務助理
if (in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188', 'M0117'])) { if (
in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188', 'M0117', 'M0054'])
|| in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545])
) {
// $outsourcer_type = $_POST['outsourcer_type'];
// $qc_official_type = $_POST['qc_official_type2'] ?: $row['qc_official_type'];
// $qc_date = $_POST['qc_date2'] ?: $row['qc_date'];
// $qc_date_owner = $_POST['qc_date2_owner'] ?: $row['qc_date_owner'];
// $end_qc_date = $_POST['end_qc_date2'] ?: $row['end_qc_date'];
// $end_qc_date_owner = $_POST['end_qc_date2_owner'] ?: $row['end_qc_date_owner'];
// $official_check_date = $_POST['official_check_date2'] ?: $row['official_check_date'];
// $old_official_check_date = $_POST['old_official_check_date2'] ?: $row['old_official_check_date'];
// $official_check_date_owner = $_POST['official_check_date2_owner'] ?: $row['official_check_date_owner'];
// $delivery_date = $_POST['delivery_date2'] ?: $row['delivery_date'];
// $delivery_date_owner = $_POST['delivery_date2_owner'] ?: $row['delivery_date_owner'];
// $install_start_date = $_POST['install_start_date2'] ?: $row['install_start_date'];
// $install_start_date_owner = $_POST['install_start_date2_owner'] ?: $row['install_start_date_owner'];
// $install_end_date = $_POST['install_end_date2'] ?: $row['install_end_date'];
// $install_end_date_owner = $_POST['install_end_date2_owner'] ?: $row['install_end_date_owner'];
// $tryrun_start_date = $_POST['tryrun_start_date2'] ?: $row['tryrun_start_date'];
// $tryrun_start_date_owner = $_POST['tryrun_start_date2_owner'] ?: $row['tryrun_start_date_owner'];
// $tryrun_end_date = $_POST['tryrun_end_date2'] ?: $row['tryrun_end_date'];
// $tryrun_end_date_owner = $_POST['tryrun_end_date2_owner'] ?: $row['tryrun_end_date_owner'];
$outsourcer_type = isset($_POST['outsourcer_type']) ? $_POST['outsourcer_type'] : $row['outsourcer_type'];
$qc_official_type = isset($_POST['qc_official_type2']) ? $_POST['qc_official_type2'] : $row['qc_official_type'];
$qc_date = isset($_POST['qc_date2']) ? $_POST['qc_date2'] : $row['qc_date'];
$qc_date_owner = isset($_POST['qc_date2_owner']) ? $_POST['qc_date2_owner'] : $row['qc_date_owner'];
$end_qc_date = isset($_POST['end_qc_date2']) ? $_POST['end_qc_date2'] : $row['end_qc_date'];
$end_qc_date_owner = isset($_POST['end_qc_date2_owner']) ? $_POST['end_qc_date2_owner'] : $row['end_qc_date_owner'];
$official_check_date = isset($_POST['official_check_date2']) ? $_POST['official_check_date2'] : $row['official_check_date'];
$old_official_check_date = isset($_POST['old_official_check_date2']) ? $_POST['old_official_check_date2'] : $row['old_official_check_date'];
$official_check_date_owner = isset($_POST['official_check_date2_owner']) ? $_POST['official_check_date2_owner'] : $row['official_check_date_owner'];
$delivery_date = isset($_POST['delivery_date2']) ? $_POST['delivery_date2'] : $row['delivery_date'];
$delivery_date_owner = isset($_POST['delivery_date2_owner']) ? $_POST['delivery_date2_owner'] : $row['delivery_date_owner'];
$install_start_date = isset($_POST['install_start_date2']) ? $_POST['install_start_date2'] : $row['install_start_date'];
$install_start_date_owner = isset($_POST['install_start_date2_owner']) ? $_POST['install_start_date2_owner'] : $row['install_start_date_owner'];
$install_end_date = isset($_POST['install_end_date2']) ? $_POST['install_end_date2'] : $row['install_end_date'];
$install_end_date_owner = isset($_POST['install_end_date2_owner']) ? $_POST['install_end_date2_owner'] : $row['install_end_date_owner'];
$tryrun_start_date = isset($_POST['tryrun_start_date2']) ? $_POST['tryrun_start_date2'] : $row['tryrun_start_date'];
$tryrun_start_date_owner = isset($_POST['tryrun_start_date2_owner']) ? $_POST['tryrun_start_date2_owner'] : $row['tryrun_start_date_owner'];
$tryrun_end_date = isset($_POST['tryrun_end_date2']) ? $_POST['tryrun_end_date2'] : $row['tryrun_end_date'];
$tryrun_end_date_owner = isset($_POST['tryrun_end_date2_owner']) ? $_POST['tryrun_end_date2_owner'] : $row['tryrun_end_date_owner'];
$updatesql .= " $updatesql .= "
qc_official_type = '$qc_official_type',
install_start_date = '$install_start_date',
install_start_date_owner = '$install_start_date_owner',
install_end_date = '$install_end_date',
install_end_date_owner = '$install_end_date_owner',
tryrun_start_date = '$tryrun_start_date',
tryrun_start_date_owner = '$tryrun_start_date_owner',
tryrun_end_date = '$tryrun_end_date',
tryrun_end_date_owner = '$tryrun_end_date_owner',
delivery_date = '$delivery_date',
delivery_date_owner = '$delivery_date_owner',
qc_date = '$qc_date',
qc_date_owner = '$qc_date_owner',
end_qc_date = '$end_qc_date',
end_qc_date_owner = '$end_qc_date_owner',
official_check_date = '$official_check_date',
official_check_date_owner = '$official_check_date_owner',
outsourcer_type = '$outsourcer_type', outsourcer_type = '$outsourcer_type',
install_outsourcer = '$install_outsourcer', install_outsourcer = '$install_outsourcer',
install_outsourcer_owner = '$install_outsourcer_owner', install_outsourcer_owner = '$install_outsourcer_owner',
@ -513,6 +599,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
estimate_tryrun_end_date_owner = '$estimate_tryrun_end_date_owner', estimate_tryrun_end_date_owner = '$estimate_tryrun_end_date_owner',
warehouse_assistant_remark = '$warehouse_assistant_remark', warehouse_assistant_remark = '$warehouse_assistant_remark',
"; ";
if (!empty($plan_diagram_file)) { if (!empty($plan_diagram_file)) {
$updatesql .= "plan_diagram_file = '$plan_diagram_file', "; $updatesql .= "plan_diagram_file = '$plan_diagram_file', ";
$updatesql .= " $updatesql .= "
@ -526,7 +613,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
"; ";
} }
if (!empty($outsourcer_contract_file)) { if (!empty($outsourcer_contract_file)) {
$updatesql .= "outsourcer_contract_file = '$outsourcer_contract_file', "; echo $updatesql .= "outsourcer_contract_file = '$outsourcer_contract_file', ";
} }
} }
@ -807,6 +894,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($_POST['form_name'] == 'update_install_date_form') { if ($_POST['form_name'] == 'update_install_date_form') {
include "./class/Cmail.php";
$cmail = new Cmail();
foreach ($_POST as $k => $v) foreach ($_POST as $k => $v)
$$k = htmlspecialchars(stripslashes(trim($v))); $$k = htmlspecialchars(stripslashes(trim($v)));
@ -820,6 +909,42 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$tryrun_start_date_owner = $_POST['tryrun_start_date_owner']; $tryrun_start_date_owner = $_POST['tryrun_start_date_owner'];
$tryrun_end_date = $_POST['tryrun_end_date']; $tryrun_end_date = $_POST['tryrun_end_date'];
$tryrun_end_date_owner = $_POST['tryrun_end_date_owner']; $tryrun_end_date_owner = $_POST['tryrun_end_date_owner'];
$old_delivery_date = $_POST['old_delivery_date'];
$delivery_date = $_POST['delivery_date'];
$delivery_date_owner = $_POST['delivery_date_owner'];
$contractno = $_POST['contractno'];
$facilityno = $_POST['facilityno'];
$salesid = $_POST['salesid'];
$salesname = accountid2name($salesid)[$salesid];
$salesmail = accountid2email([$salesid])[$salesid];
if ($old_delivery_date !== $delivery_date) {
if (empty($change_all_contractno)) {
$mail_title = "作番大日程(汰改)合約號:" . $contractno . "-移交日變更通知";
$mail_content = "作番大日程(汰改)$salesname$salesmail
合約號:" . $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]
],
"永佳捷科技"
);
}
$updatesql = " $updatesql = "
UPDATE wipwholestatus UPDATE wipwholestatus
@ -831,7 +956,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
tryrun_start_date = '$tryrun_start_date', tryrun_start_date = '$tryrun_start_date',
tryrun_start_date_owner = '$tryrun_start_date_owner', tryrun_start_date_owner = '$tryrun_start_date_owner',
tryrun_end_date = '$tryrun_end_date', tryrun_end_date = '$tryrun_end_date',
tryrun_end_date_owner = '$tryrun_end_date_owner' tryrun_end_date_owner = '$tryrun_end_date_owner',
delivery_date = '$delivery_date',
delivery_date_owner = '$delivery_date_owner'
"; ";
if (empty($change_all_contractno)) { if (empty($change_all_contractno)) {
$updatesql .= "WHERE id = '$id' "; $updatesql .= "WHERE id = '$id' ";
@ -1010,7 +1137,7 @@ function checkWwsAssianStatus($link, $user_id)
], ],
"永佳捷科技" "永佳捷科技"
); );
do_wws_next_assign("M0173", $form_YD_key, 'C'); do_wws_next_assign("M0173", $form_key, 'C');
return true; return true;
} }
} }

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

@ -1,12 +1,13 @@
<?php <?php
// ini_set('display_errors', 'on'); ini_set('display_errors', 'on');
/** /**
* (汰改)流程規則: * (汰改)流程規則:
* 1. A:工務組長確認中 生管建立大日程 (或是系統洗入) * 1. A:工務組長確認中 生管建立大日程 (或是系統洗入)
* 工務:宜蘭=高培軒(M0087) 北=吳宗紘(M0040) 中=林瑋隆(M0113) 南=韋宗榮(M0039)改鄭存邑(M0102) * 工務:宜蘭=高培軒(M0087) 北=吳宗紘(M0040) 中=林瑋隆(M0113) 南=韋宗榮(M0039)改鄭存邑(M0102)
* 2. B:營業員確認中 * 2. B:營業員確認中
* 3. F:營業員主管確認中
* 3. C:設計部門確認中 (郭承瑋) * 3. C:設計部門確認中 (郭承瑋)
* 4. D:設計部門主管確認中 (N0019江京鴻) * 4. D:設計部門主管確認中 (M0019江京鴻)
* 5. E:生管確認中 (M0024伃廷) * 5. E:生管確認中 (M0024伃廷)
* 6. Z:本單結案 (00000) * 6. Z:本單結案 (00000)
*/ */
@ -234,12 +235,12 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
$assign_status = array( $assign_status = array(
'A' => '工務確認中', 'A' => '工務確認中',
'B' => '工務部門已確認<br/>營業部門確認中', 'B' => '工務部門已確認<br/>營業部門確認中',
'F' => '營業部門已確認<br/>營業主管確認中',
'C' => '營業部門已確認<br/>設計部門確認中', 'C' => '營業部門已確認<br/>設計部門確認中',
'D' => '設計部門已確認<br/>設計部門主管確認中', 'D' => '設計部門已確認<br/>設計部門主管確認中',
'E' => '營業部門主管已確認<br/>生管部門確認中', 'E' => '營業部門主管已確認<br/>生管部門確認中',
'Z' => '此作番大日程已結案', 'Z' => '此作番大日程已結案',
); );
if (checkNowFormStatus($link) == '') { if (checkNowFormStatus($link) == '') {
echo "此作番大日程已結案"; echo "此作番大日程已結案";
} else { } else {
@ -283,6 +284,78 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<div id="tabs-3"> <div id="tabs-3">
<table class="table table-bordered" style="width:100%"> <table class="table table-bordered" style="width:100%">
<tbody style="font-weight: bolder;margin-bottom: 20px"> <tbody style="font-weight: bolder;margin-bottom: 20px">
<tr>
<td style="vertical-align: middle">工勘人員</td>
<td>
<input type="hidden" name="old_warehouseid" id="old_warehouseid" value="<?= $row["warehouseid"]; ?>">
<?php
// 北區
if (in_array($row['warehouseid'], ['M0040', 'M0040', 'M0150'])) {
?>
<select name="warehouseid" id="warehouseid" <?= $warehouse; ?>>
<option value="">請選擇</option>
<option value="M0040" <?php if ($row["warehouseid"] == "M0040") echo " selected"; ?>>吳宗紘</option>
<option value="M0150" <?php if ($row["warehouseid"] == "M0150") echo " selected"; ?>>羅盛騰</option>
</select>
<?php
}
?>
<?php
// 中區
if (in_array($row['warehouseid'], ['M0198', 'M0158'])) {
?>
<select name="warehouseid" id="warehouseid" <?= $warehouse; ?>>
<option value="">請選擇</option>
<option value="M0198" <?php if ($row["warehouseid"] == "M0198") echo " selected"; ?>>廖堉勝</option>
<option value="M0158" <?php if ($row["warehouseid"] == "M0158") echo " selected"; ?>>劉子睿</option>
</select>
<?php
}
?>
<?php
// 南區
if (in_array($row['warehouseid'], ['M0078', 'M0102', 'M0187'])) {
?>
<select name="warehouseid" id="warehouseid" <?= $warehouse; ?>>
<option value="">請選擇</option>
<option value="M0078" <?php if ($row["warehouseid"] == "M0078") echo " selected"; ?>>許益連</option>
<option value="M0102" <?php if ($row["warehouseid"] == "M0102") echo " selected"; ?>>鄭存邑</option>
<option value="M0187" <?php if ($row["warehouseid"] == "M0187") echo " selected"; ?>>田祖豪</option>
</select>
<?php
}
?>
<?php
// 宜蘭
if (in_array($row['warehouseid'], ['M0087'])) {
?>
<select name="warehouseid" id="warehouseid" <?= $warehouse; ?>>
<option value="">請選擇</option>
<option value="M0087" <?php if ($row["warehouseid"] == "M0087") echo " selected"; ?>>高培軒</option>
</select>
<?php
}
?>
<?php
// 南區
if (!in_array($row['warehouseid'], ['M0040', 'M0150', 'M0078', 'M0102', 'M0187', 'M0198', 'M0087', 'M0158'])) {
?>
<select name="warehouseid" id="warehouseid" <?= $warehouse; ?>>
<option value="">請選擇</option>
<option value="M0040" <?php if ($row["warehouseid"] == "M0040") echo " selected"; ?>>張潘榮</option>
<option value="M0150" <?php if ($row["warehouseid"] == "M0150") echo " selected"; ?>>羅盛騰</option>
<option value="M0078" <?php if ($row["warehouseid"] == "M0078") echo " selected"; ?>>許益連</option>
<option value="M0102" <?php if ($row["warehouseid"] == "M0102") echo " selected"; ?>>鄭存邑</option>
<option value="M0198" <?php if ($row["warehouseid"] == "M0198") echo " selected"; ?>>廖堉勝</option>
<option value="M0187" <?php if ($row["warehouseid"] == "M0187") echo " selected"; ?>>田祖豪</option>
<option value="M0087" <?php if ($row["warehouseid"] == "M0087") echo " selected"; ?>>高培軒</option>
<option value="M0158" <?php if ($row["warehouseid"] == "M0158") echo " selected"; ?>>劉子睿</option>
</select>
<?php
}
?>
</td>
</tr>
<tr> <tr>
<td style="vertical-align: middle">樓高通報</td> <td style="vertical-align: middle">樓高通報</td>
<td> <td>
@ -373,78 +446,6 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
</select> </select>
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align: middle">
客戶計劃圖
<br />
(意匠圖)
<?php
$result2 = getWipwholeChangePlanningCustomerDetailsStatus($link, $id);
$row2 = mysqli_fetch_assoc($result2);
if (empty($row2['change_status'])) {
$show_tmp_arr = [
'311', '312', '313', '314', '315',
'501', '511', '512', '513', '514',
'220', '320'
];
if (in_array($user_department_id, $show_tmp_arr))
echo "<br/>";
echo "<a target='_blank' style='color:#00F;' href='wipwhole-change-planning-customer-name.php?function_name=wipwholerenstatus&$token_link&id=$id'>申請上傳</a>";
} else {
if (in_array($row2['change_status'], ['A', 'B', 'D'])) {
echo "<br/>";
echo "<a target='_blank' style='color:#00F;' href='wipwhole-change-planning-customer-name.php?function_name=wipwholerenstatus&$token_link&id=$id'>客戶姓名:" . $row2['custom_name'] . "<br/>狀態:審核中</a>";
}
if ($row2['change_status'] == 'C') {
echo "<br/>";
echo "<a target='_blank' style='color:#00F;' href='wipwhole-change-planning-customer-name.php?function_name=wipwholerenstatus&$token_link&id=$id'>客戶姓名:" . $row2['custom_name'] . "<br/>狀態:已取消</a>";
}
if ($row2['change_status'] == 'Z') {
echo "<br/>";
echo "<a target='_blank' style='color:#00F;' href='wipwhole-change-planning-customer-name.php?function_name=wipwholerenstatus&$token_link&id=$id'>客戶姓名:" . $row2['custom_name'] . "<br/>狀態:審核通過</a>";
}
}
?>
</td>
<td>
<select class="disabled_select" name="customer_planning_verify" id="customer_planning_verify" <?= $warehouse; ?>>
<option <?php if ($row["customer_planning_verify"] == "1") echo " selected"; ?> value="1">請選擇</option>
<option <?php if ($row["customer_planning_verify"] == "0") echo " selected"; ?> value="0">已完成</option>
<option <?php if ($row["customer_planning_verify"] == "1") echo " selected"; ?> value="1">進行中</option>
<option <?php if ($row["customer_planning_verify"] == "2") echo " selected"; ?> value="2">無需求</option>
</select>
</td>
<td style="vertical-align: middle;">附件</td>
<td style="vertical-align: middle;">
<input style="width:70%;display:inline;" type="file" id="customer_planning_verify_file" name="customer_planning_verify_file" <?php
if (isset($row2['change_status'])) {
echo $row2['change_status'] === 'Z' ? "" : "disabled";
} else {
echo "disabled";
}
?>>
<?php
// echo !empty($row['customer_planning_verify_file']) ? "<a id='customer_planning_verify_file_a' style='color:#00F;' href='" . $row['customer_planning_verify_file'] . "' target='_blank'>下載附件</a>" : "";
?>
<br />
<?php
$customer_planning_verify_files = getAllCustomerPlanningVerify($link, $id);
foreach ($customer_planning_verify_files as $row2) :
echo "<a id='customer_planning_verify_file_a' style='color:#00F;'
href='" . $row2['customer_planning_verify_file'] . "' target='_blank'>下載附件_" . $row2['custom_name'] . "_" . $row2['create_at'] . "</a></br>";
endforeach;
?>
</td>
<td style="vertical-align: middle">確認時間</td>
<td><input class="form-control disabled_select" type="datetime-local" id="customer_planning_verify_at" name="customer_planning_verify_at" value="<?= $row['customer_planning_verify_at']; ?>" readonly></td>
<td style="vertical-align: middle">確認人</td>
<td>
<select name="customer_planning_verify_owner" class="disabled_select" id="customer_planning_verify_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['customer_planning_verify_owner']); ?>
</select>
</td>
</tr>
<tr> <tr>
<td colspan="8"> <td colspan="8">
<i>如有複數檔案請放置同個壓縮檔後再上傳</i> <i>如有複數檔案請放置同個壓縮檔後再上傳</i>
@ -549,6 +550,28 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
</select> </select>
</td> </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_tmp" value="<?= $row['delivery_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#delivery_date_tmp").val("");' <?= $warehouse2; ?>>清除</button>
</span>
<input type="hidden" id="old_delivery_date_tmp" value="<?= $row['delivery_date']; ?>">
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="delivery_date_owner_tmp" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['delivery_date_owner']); ?>
</select>
</td>
<td colspan='4'>
<span class="text-danger">有官檢日或QC合格日後才可填寫</span>
</td>
</tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<?php <?php
@ -566,6 +589,20 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<div id="tabs-1"> <div id="tabs-1">
<table class="table table-bordered" style="width:100%"> <table class="table table-bordered" style="width:100%">
<tbody style="font-weight: bolder;margin-bottom: 20px"> <tbody style="font-weight: bolder;margin-bottom: 20px">
<tr>
<td>營業人員確認項</td>
<td>
<?php
echo "營業擔當:" . $row['salesid'] . accountid2name()[$row['salesid']];
?>
<br />
<?php
if (!checkUseridIsManager($row['salesid'])) {
echo "營業擔當主管:" . manage_class($row['salesid'])[0] . accountid2name(manage_class($row['salesid'])[0])[manage_class($row['salesid'])[0]];
}
?>
</td>
</tr>
<tr> <tr>
<td style="vertical-align: middle;width:auto;">營業確認規格</td> <td style="vertical-align: middle;width:auto;">營業確認規格</td>
<td style="width:150px;"> <td style="width:150px;">
@ -597,6 +634,78 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
</select> </select>
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align: middle">
客戶計劃圖
<br />
(意匠圖)
<?php
// $result2 = getWipwholeChangePlanningCustomerDetailsStatus($link, $id);
// $row2 = mysqli_fetch_assoc($result2);
// if (empty($row2['change_status'])) {
// $show_tmp_arr = [
// '311', '312', '313', '314', '315',
// '501', '511', '512', '513', '514',
// '220', '320'
// ];
// if (in_array($user_department_id, $show_tmp_arr))
// echo "<br/>";
// echo "<a target='_blank' style='color:#00F;' href='wipwhole-change-planning-customer-name.php?function_name=wipwholerenstatus&$token_link&id=$id'>申請上傳</a>";
// } else {
// if (in_array($row2['change_status'], ['A', 'B', 'D'])) {
// echo "<br/>";
// echo "<a target='_blank' style='color:#00F;' href='wipwhole-change-planning-customer-name.php?function_name=wipwholerenstatus&$token_link&id=$id'>客戶姓名:" . $row2['custom_name'] . "<br/>狀態:審核中</a>";
// }
// if ($row2['change_status'] == 'C') {
// echo "<br/>";
// echo "<a target='_blank' style='color:#00F;' href='wipwhole-change-planning-customer-name.php?function_name=wipwholerenstatus&$token_link&id=$id'>客戶姓名:" . $row2['custom_name'] . "<br/>狀態:已取消</a>";
// }
// if ($row2['change_status'] == 'Z') {
// echo "<br/>";
// echo "<a target='_blank' style='color:#00F;' href='wipwhole-change-planning-customer-name.php?function_name=wipwholerenstatus&$token_link&id=$id'>客戶姓名:" . $row2['custom_name'] . "<br/>狀態:審核通過</a>";
// }
// }
?>
</td>
<td>
<select class="disabled_select" name="customer_planning_verify" id="customer_planning_verify" <?= $marketing; ?>>
<option <?php if ($row["customer_planning_verify"] == "1") echo " selected"; ?> value="1">請選擇</option>
<option <?php if ($row["customer_planning_verify"] == "0") echo " selected"; ?> value="0">已完成</option>
<option <?php if ($row["customer_planning_verify"] == "1") echo " selected"; ?> value="1">進行中</option>
<option <?php if ($row["customer_planning_verify"] == "2") echo " selected"; ?> value="2">無需求</option>
</select>
</td>
<td style="vertical-align: middle;">附件</td>
<td style="vertical-align: middle;">
客戶姓名:<input type="text" name="real_custom_name" id="real_custom_name" style="width:70%;display:inline;" value="<?= $row["real_custom_name"]; ?>" placeholder="輸入後即可上傳附件" <?= $marketing; ?> />
<br />
<input style="width:70%;display:inline;" type="file" id="customer_planning_verify_file" name="customer_planning_verify_file" disabled>
<?php
// echo !empty($row['customer_planning_verify_file']) ? "<a id='customer_planning_verify_file_a' style='color:#00F;' href='" . $row['customer_planning_verify_file'] . "' target='_blank'>下載附件</a>" : "";
?>
<br />
<?php
$customer_planning_verify_files = getAllCustomerPlanningVerify($link, $id);
foreach ($customer_planning_verify_files as $row2) :
echo "<a id='customer_planning_verify_file_a' style='color:#00F;'
href='" . $row2['customer_planning_verify_file'] . "' target='_blank'>下載附件_" . $row2['custom_name'] . "_" . $row2['create_at'] . "</a></br>";
endforeach;
?>
</td>
<td style="vertical-align: middle">確認時間</td>
<td><input class="form-control disabled_select" type="datetime-local" id="customer_planning_verify_at" name="customer_planning_verify_at" value="<?= $row['customer_planning_verify_at']; ?>" readonly></td>
<td style="vertical-align: middle">確認人</td>
<td>
<select name="customer_planning_verify_owner" class="disabled_select" id="customer_planning_verify_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['customer_planning_verify_owner']); ?>
</select>
</td>
</tr>
<tr> <tr>
<td style="vertical-align: middle">客戶顏色</td> <td style="vertical-align: middle">客戶顏色</td>
<td> <td>
@ -690,7 +799,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td colspan="7"> <td colspan="7">
<textarea class="form-control " name="marketing_remark" <?= $marketing; ?>><?php echo $row['marketing_remark']; ?></textarea> <textarea class="form-control " name="marketing_remark" <?= $marketing; ?>><?php echo $row['marketing_remark']; ?></textarea>
</tr> </tr>
<tr> <!-- <tr>
<td style="vertical-align: middle">移交日</td> <td style="vertical-align: middle">移交日</td>
<td style="vertical-align: middle"> <td style="vertical-align: middle">
<div class="input-group"> <div class="input-group">
@ -698,6 +807,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#delivery_date").val("");' <?= $marketing2; ?>>清除</button> <button class="btn btn-default" type='button' onclick='$("#delivery_date").val("");' <?= $marketing2; ?>>清除</button>
</span> </span>
<input type="hidden" id="old_delivery_date" name="old_delivery_date" value="<?= $row['delivery_date']; ?>">
</div> </div>
</td> </td>
<td style="vertical-align: middle">確認人</td> <td style="vertical-align: middle">確認人</td>
@ -707,7 +817,10 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<?php echo getSelectOptionHtml($all_users_options, $row['delivery_date_owner']); ?> <?php echo getSelectOptionHtml($all_users_options, $row['delivery_date_owner']); ?>
</select> </select>
</td> </td>
</tr> <td colspan='4'>
<span class="text-danger">有官檢日或QC合格日後才可填寫</span>
</td>
</tr> -->
<tr> <tr>
<td colspan="8"> <td colspan="8">
<input class="form-control " type="hidden" name="creater" value="<?= $user_id; ?>"> <input class="form-control " type="hidden" name="creater" value="<?= $user_id; ?>">
@ -1258,6 +1371,36 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<button onclick="updateRealArrivalDate()" type="button" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;" <?php echo $shengguan2; ?>>出貨日調整</button> <button onclick="updateRealArrivalDate()" type="button" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;" <?php echo $shengguan2; ?>>出貨日調整</button>
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align: middle">官檢日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" value="<?= $row['official_check_date']; ?>" disabled>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['official_check_date_owner']); ?>
</select>
</td>
</tr>
<tr>
<td style="vertical-align: middle">移交日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control " type="date" value="<?= $row['delivery_date']; ?>" disabled>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['delivery_date_owner']); ?>
</select>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -1267,12 +1410,12 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<tr> <tr>
<td style="vertical-align: middle">QC及官檢類型</td> <td style="vertical-align: middle">QC及官檢類型</td>
<td> <td>
<input type='radio' disabled <?php echo $row['qc_official_type'] == 'Q' ? "checked" : ""; ?> /> <input type='radio' id="qc_official_type_Q" name='qc_official_type' value="Q" <?= $pinzheng; ?> <?php echo $row['qc_official_type'] == 'Q' ? "checked" : ""; ?> />
<label for='outsourcer_type_I'>只需QC</label> <label for='qc_official_type_Q'>只需QC</label>
<input type='radio' disabled <?php echo $row['qc_official_type'] == 'O' ? "checked" : ""; ?> /> <input type='radio' id="qc_official_type_O" name='qc_official_type' value="O" <?= $pinzheng; ?> <?php echo $row['qc_official_type'] == 'O' ? "checked" : ""; ?> />
<label for='outsourcer_type_T'>只需官檢</label> <label for='qc_official_type_O'>只需官檢</label>
<input type='radio' disabled <?php echo $row['qc_official_type'] == 'QO' ? "checked" : ""; ?> /> <input type='radio' id="qc_official_type_QO" name='qc_official_type' value="QO" <?= $pinzheng; ?> <?php echo $row['qc_official_type'] == 'QO' ? "checked" : ""; ?> />
<label for='outsourcer_type_IT'>QC+官檢</label> <label for='qc_official_type_QO'>QC+官檢</label>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -1363,6 +1506,96 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
(工務助理項目) (工務助理項目)
</td> </td>
</tr> </tr>
<?php
if ($user_id == 'M0193') {
?>
<tr>
<td style="vertical-align: middle">QC及官檢類型</td>
<td>
<input type='radio' id="qc_official_type_Q2" name='qc_official_type2' value='Q' <?= $warehouse2; ?> <?php echo $row['qc_official_type'] == 'Q' ? "checked" : ""; ?> />
<label for='qc_official_type_Q2'>只需QC</label>
<input type='radio' id="qc_official_type_O2" name='qc_official_type2' value='O' <?= $warehouse2; ?> <?php echo $row['qc_official_type'] == 'O' ? "checked" : ""; ?> />
<label for='qc_official_type_O2'>只需官檢</label>
<input type='radio' id="qc_official_type_QO2" name='qc_official_type2' value='QO' <?= $warehouse2; ?> <?php echo $row['qc_official_type'] == 'QO' ? "checked" : ""; ?> />
<label for='qc_official_type_QO2'>QC+官檢</label>
</td>
</tr>
<tr>
<td style="vertical-align: middle">內部QC日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="qc_date2" name="qc_date2" value="<?= $row['qc_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#qc_date2").val("");' <?= $warehouse2; ?>>清除</button>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="qc_date2_owner" name="qc_date2_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['qc_date_owner']); ?>
</select>
</td>
</tr>
<tr>
<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; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#end_qc_date2").val("");' <?= $warehouse2; ?>>清除</button>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="end_qc_date2_owner" name="end_qc_date2_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['end_qc_date_owner']); ?>
</select>
</td>
</tr>
<tr>
<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 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>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="official_check_date2_owner" name="official_check_date2_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['official_check_date_owner']); ?>
</select>
</td>
</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_date2" name="delivery_date2" value="<?= $row['delivery_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#delivery_date2").val("");' <?= $warehouse2; ?>>清除</button>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="delivery_date2_owner" name="delivery_date2_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['delivery_date_owner']); ?>
</select>
</td>
</tr>
<?php
}
?>
<tr> <tr>
<td style="vertical-align: middle">發包類型</td> <td style="vertical-align: middle">發包類型</td>
<td> <td>
@ -1536,6 +1769,84 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
</select> </select>
</td> </td>
</tr> </tr>
<?php
if ($user_id == 'M0193') {
?>
<tr>
<td style="vertical-align: middle">實際安裝開工日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" name="install_start_date2" id="install_start_date2" value="<?= $row['install_start_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#install_start_date2").val("");' <?= $warehouse2; ?>>清除</button>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" name="install_start_date2_owner" id="install_start_date2_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['install_start_date_owner']); ?>
</select>
</td>
</tr>
<tr>
<td style="vertical-align: middle">實際安裝完工日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" name="install_end_date2" id="install_end_date2" value="<?= $row['install_end_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#install_end_date2").val("");' <?= $warehouse2; ?>>清除</button>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" name="install_end_date2_owner" id="install_end_date2_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['install_end_date_owner']); ?>
</select>
</td>
</tr>
<tr>
<td style="vertical-align: middle">實際試車開工日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" name="tryrun_start_date2" id="tryrun_start_date2" value="<?= $row['tryrun_start_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#tryrun_start_date2").val("");' <?= $warehouse2; ?>>清除</button>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" name="tryrun_start_date2_owner" id="tryrun_start_date2_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['tryrun_start_date_owner']); ?>
</select>
</td>
</tr>
<tr>
<td style="vertical-align: middle">實際試車完工日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" name="tryrun_end_date2" id="tryrun_end_date2" value="<?= $row['tryrun_end_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#tryrun_end_date2").val("");' <?= $warehouse2; ?>>清除</button>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" name="tryrun_end_date2_owner" id="tryrun_end_date2_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['tryrun_end_date_owner']); ?>
</select>
</td>
</tr>
<?php
}
?>
<tr> <tr>
<td>備註</td> <td>備註</td>
<td colspan="3"> <td colspan="3">
@ -1574,15 +1885,19 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
</form> </form>
<form method="post" id="assign_form" enctype="multipart/form-data"> <form method="post" id="assign_form" enctype="multipart/form-data">
<input type="hidden" name='form_name' value="assign_form" /> <input type="hidden" name='form_name' value="assign_form" />
<input type="hidden" name='id' value="<?php echo $id; ?>" />
</form> </form>
<form method="post" id="back_marketing_assign_form" enctype="multipart/form-data"> <form method="post" id="back_marketing_assign_form" enctype="multipart/form-data">
<input type="hidden" name='salesid' value="<?php echo $row['salesid']; ?>" /> <input type="hidden" name='salesid' value="<?php echo $row['salesid']; ?>" />
<input type="hidden" name='id' value="<?php echo $id; ?>" />
<input type="hidden" name='form_name' value="back_marketing_assign_form" /> <input type="hidden" name='form_name' value="back_marketing_assign_form" />
</form> </form>
<form method="post" id="back_design_assign_form" enctype="multipart/form-data"> <form method="post" id="back_design_assign_form" enctype="multipart/form-data">
<input type="hidden" name='id' value="<?php echo $id; ?>" />
<input type="hidden" name='form_name' value="back_design_assign_form" /> <input type="hidden" name='form_name' value="back_design_assign_form" />
</form> </form>
<form method="post" id="warehouse_assign_form" enctype="multipart/form-data"> <form method="post" id="warehouse_assign_form" enctype="multipart/form-data">
<input type="hidden" name='id' value="<?php echo $id; ?>" />
<input type="hidden" name='form_name' value="warehouse_assign_form" /> <input type="hidden" name='form_name' value="warehouse_assign_form" />
</form> </form>
<form method="post" id="update_contract_date_form" enctype="multipart/form-data"> <form method="post" id="update_contract_date_form" enctype="multipart/form-data">
@ -1614,6 +1929,12 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<input type="hidden" id="tryrun_start_date_owner" name='tryrun_start_date_owner' value="<?php echo $row['tryrun_start_date_owner']; ?>" /> <input type="hidden" id="tryrun_start_date_owner" name='tryrun_start_date_owner' value="<?php echo $row['tryrun_start_date_owner']; ?>" />
<input type="hidden" id="tryrun_end_date" name='tryrun_end_date' value="<?php echo $row['tryrun_end_date']; ?>" /> <input type="hidden" id="tryrun_end_date" name='tryrun_end_date' value="<?php echo $row['tryrun_end_date']; ?>" />
<input type="hidden" id="tryrun_end_date_owner" name='tryrun_end_date_owner' value="<?php echo $row['tryrun_end_date_owner']; ?>" /> <input type="hidden" id="tryrun_end_date_owner" name='tryrun_end_date_owner' value="<?php echo $row['tryrun_end_date_owner']; ?>" />
<input type="hidden" id="delivery_date" name='delivery_date' value="<?php echo $row['delivery_date']; ?>" />
<input type="hidden" id="old_delivery_date" name='old_delivery_date' value="<?php echo $row['delivery_date']; ?>" />
<input type="hidden" id="delivery_date_owner" name='delivery_date_owner' value="<?php echo $row['delivery_date_owner']; ?>" />
<input type="hidden" id="facilityno" name='facilityno' value="<?php echo $row['facilityno']; ?>" />
<input type="hidden" id="contractno" name='contractno' value="<?php echo $row['contractno']; ?>" />
<input type="hidden" name='salesid' value="<?php echo $row['salesid']; ?>" />
<input type="hidden" name='form_name' value="update_install_date_form" /> <input type="hidden" name='form_name' value="update_install_date_form" />
</form> </form>
<form method="post" id="update_shengguan_form" enctype="multipart/form-data"> <form method="post" id="update_shengguan_form" enctype="multipart/form-data">
@ -1646,7 +1967,34 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
$('#renovate_type').select2(); $('#renovate_type').select2();
$("#renovate_type").val(jsonData).trigger("change"); $("#renovate_type").val(jsonData).trigger("change");
$('#site_survey_contact_verify').select2(); $('#site_survey_contact_verify').select2();
checkCustomerPlanningVerifyFileKeyinStatus();
checkDeliveryDateKeyinStatus();
});
function checkCustomerPlanningVerifyFileKeyinStatus() {
checkCustomerPlanningVerifyFileDisabled();
$("#real_custom_name").keyup(function() {
checkCustomerPlanningVerifyFileDisabled();
}); });
}
function checkCustomerPlanningVerifyFileDisabled() {
if ($("#real_custom_name").val() !== "") {
$("#customer_planning_verify_file").prop("disabled", false);
} else {
$("#customer_planning_verify_file").prop("disabled", true);
}
}
function checkDeliveryDateKeyinStatus() {
$("#delivery_date,#delivery_date_tmp").prop("disabled", true);
if ($("#end_qc_date").val() !== "") {
$("#delivery_date,#delivery_date_tmp").prop("disabled", false);
}
if ($("#official_check_date").val() !== "") {
$("#delivery_date,#delivery_date_tmp").prop("disabled", false);
}
}
$(function() { $(function() {
var tab = $('#tab').val(); var tab = $('#tab').val();
$("#tabs").tabs({ $("#tabs").tabs({
@ -1670,7 +2018,15 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
'qc_date', 'qc_date',
'end_qc_date', 'end_qc_date',
'official_check_date', 'official_check_date',
'delivery_date' // 'delivery_date',
'qc_date2',
'end_qc_date2',
'official_check_date2',
'delivery_date2',
'install_start_date2',
'install_end_date2',
'tryrun_start_date2',
'tryrun_end_date2',
] ]
for (var i = 0; i < catchTime_input_arr.length; i++) { for (var i = 0; i < catchTime_input_arr.length; i++) {
inputChangeCatchTime(catchTime_input_arr[i]); inputChangeCatchTime(catchTime_input_arr[i]);
@ -1700,6 +2056,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
'install_end_date', 'install_end_date',
'tryrun_start_date', 'tryrun_start_date',
'tryrun_end_date', 'tryrun_end_date',
'delivery_date'
] ]
for (var i = 0; i < oursourcer_input_arr.length; i++) { for (var i = 0; i < oursourcer_input_arr.length; i++) {
inputChangeOutsourcer(oursourcer_input_arr[i]); inputChangeOutsourcer(oursourcer_input_arr[i]);
@ -1772,6 +2129,8 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
} }
function getDoMarketingAssignStatus() { function getDoMarketingAssignStatus() {
if ($("#customer_planning_verify").val() == '1')
return 2;
if ($("#sales_spec_verify").val() == '1') if ($("#sales_spec_verify").val() == '1')
return 2; return 2;
if ($("#customer_style_verify").val() == '1') if ($("#customer_style_verify").val() == '1')
@ -1847,8 +2206,6 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
return 2; return 2;
if ($("#site_survey_contact_verify").val() == '1') if ($("#site_survey_contact_verify").val() == '1')
return 2; return 2;
if ($("#customer_planning_verify").val() == '1')
return 2;
if ($("#building_heigh_verify").val() == '0' && !$('#building_heigh_verify_file_a').length) if ($("#building_heigh_verify").val() == '0' && !$('#building_heigh_verify_file_a').length)
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)
@ -2001,6 +2358,8 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
$("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val()); $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val());
$("#tryrun_end_date").val($("#tryrun_end_date_tmp").val()); $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val());
$("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val()); $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val());
$("#delivery_date").val($("#delivery_date_tmp").val());
$("#delivery_date_owner").val($("#delivery_date_owner_tmp").val());
$('#update_install_date_form').submit(); $('#update_install_date_form').submit();
} }
} else { } else {
@ -2012,6 +2371,8 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
$("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val()); $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val());
$("#tryrun_end_date").val($("#tryrun_end_date_tmp").val()); $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val());
$("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val()); $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val());
$("#delivery_date").val($("#delivery_date_tmp").val());
$("#delivery_date_owner").val($("#delivery_date_owner_tmp").val());
$('#update_install_date_form').submit(); $('#update_install_date_form').submit();
} }
} }

270
wms/wipwhole-renovate-rec-invoice.php

@ -1,15 +1,5 @@
<?php <?php
// ini_set('display_errors', 'on'); // ini_set('display_errors', 'on');
/**
* 流程規則:(汰改)
* 1.A:工務主管確認中 B:營業員確認中 C:設計部門人員確認中 D:生管主管確認中 Z:生管確認完成
*
* 新梯 543 筆 (已匯入)
* 舊改 141 筆 (資料未洗入)
* 已簽回 684 筆 (共計)
*/
// error_reporting(0); // error_reporting(0);
include "header.php"; include "header.php";
@ -48,398 +38,186 @@ if ($department_id == "321" || $department_id == "220") {
return $row['0'] > 0 ? true : false; return $row['0'] > 0 ? true : false;
} }
// 預設汰改代碼 A
$contract_type = 'B'; $contract_type = 'B';
// 汰改方案
$renovate_type = ''; $renovate_type = '';
// 合約號
$contractno = ''; $contractno = '';
// 營業員ID
$salesid = ''; $salesid = '';
// 工務人員ID
$warehouseid = ''; $warehouseid = '';
// 客戶姓名
$custom = ''; $custom = '';
// 工地負責人
$site_manager = ''; $site_manager = '';
// 客戶id
$accountid = ''; $accountid = '';
// 作番號
$facilityno = ''; $facilityno = '';
// 號機
$facility_temp_no = ''; $facility_temp_no = '';
// 緯度
$latitude = ''; $latitude = '';
// 經度
$longitude = ''; $longitude = '';
// 載重
$weight = ''; $weight = '';
// 人乘
$numberofpassenger = ''; $numberofpassenger = '';
// 樓停
$numberofstop = ''; $numberofstop = '';
// 樓層
$numberoffloor = ''; $numberoffloor = '';
// 開門方式
$opentype = ''; $opentype = '';
// 速度
$speed = ''; $speed = '';
// 機型
$facility_kind = ''; $facility_kind = '';
// 地址
$address = ''; $address = '';
// 合約到貨日
$contract_arrival_date = ''; $contract_arrival_date = '';
// 實際到貨日
$real_contract_arrival_date = ''; $real_contract_arrival_date = '';
// 營業規格確認
$sales_spec_verify = ''; $sales_spec_verify = '';
// 營業規格附件
$sales_spec_verify_file = ''; $sales_spec_verify_file = '';
// 營業規格確認時間
$sales_spec_verify_at = ''; $sales_spec_verify_at = '';
// 營業規格確認人
$sales_spec_verify_owner = ''; $sales_spec_verify_owner = '';
// 客戶計劃圖確認
$customer_planning_verify = ''; $customer_planning_verify = '';
// 客戶計劃圖附件
$customer_planning_verify_file = ''; $customer_planning_verify_file = '';
// 客戶計劃圖確認時間
$customer_planning_verify_at = ''; $customer_planning_verify_at = '';
// 客戶計劃圖確認人
$customer_planning_verify_owner = ''; $customer_planning_verify_owner = '';
// 客戶顏色確認
$customer_color_verify = ''; $customer_color_verify = '';
// 客戶顏色附件
$customer_color_verify_file = ''; $customer_color_verify_file = '';
// 客戶顏色確認時間
$customer_color_verify_at = ''; $customer_color_verify_at = '';
// 客戶顏色確認人
$customer_color_verify_owner = ''; $customer_color_verify_owner = '';
// 工勘聯絡表
$site_survey_contact_form_verify = ''; $site_survey_contact_form_verify = '';
// 工勘聯絡表附件
$site_survey_contact_form_verify_file = ''; $site_survey_contact_form_verify_file = '';
// 工勘聯絡表確認時間
$site_survey_contact_form_verify_at = ''; $site_survey_contact_form_verify_at = '';
// 工勘聯絡表確認人
$site_survey_contact_form_verify_owner = ''; $site_survey_contact_form_verify_owner = '';
// 設計規格確認
$desin_spec_verify = ''; $desin_spec_verify = '';
// 設計規格確認附件
$desin_spec_verify_file = ''; $desin_spec_verify_file = '';
// 設計規格確認時間
$desin_spec_verify_at = ''; $desin_spec_verify_at = '';
// 設計規格確認確認人
$desin_spec_verify_owner = ''; $desin_spec_verify_owner = '';
// 設計計劃圖確認
$desin_planning_verify = ''; $desin_planning_verify = '';
// 設計計劃圖確認附件
$desin_planning_verify_file = ''; $desin_planning_verify_file = '';
// 設計計劃圖確認時間
$desin_planning_verify_at = ''; $desin_planning_verify_at = '';
// 設計計劃圖確認人
$desin_planning_verify_owner = ''; $desin_planning_verify_owner = '';
// 設計顏色確認
$desin_color_verify = ''; $desin_color_verify = '';
// 設計顏色確認附件
$desin_color_verify_file = ''; $desin_color_verify_file = '';
// 設計顏色確認時間
$desin_color_verify_at = ''; $desin_color_verify_at = '';
// 設計顏色確認人
$desin_color_verify_owner = ''; $desin_color_verify_owner = '';
// 設計仕樣確認
$desin_style_verify = ''; $desin_style_verify = '';
// 設計仕樣確認附件
$desin_style_verify_file = ''; $desin_style_verify_file = '';
// 設計仕樣確認時間
$desin_style_verify_at = ''; $desin_style_verify_at = '';
// 設計仕樣確認人
$desin_style_verify_owner = ''; $desin_style_verify_owner = '';
// 設計主管確認
$desin_leader_verify = ''; $desin_leader_verify = '';
// 設計主管確認附件
$desin_leader_verify_file = ''; $desin_leader_verify_file = '';
// 設計主管確認時間
$desin_leader_verify_at = ''; $desin_leader_verify_at = '';
// 設計主管確認人
$desin_leader_verify_owner = ''; $desin_leader_verify_owner = '';
// 樓高通報
$building_heigh_verify = ''; $building_heigh_verify = '';
// 樓高通報附件
$building_heigh_verify_file = ''; $building_heigh_verify_file = '';
// 樓高通報時間
$building_heigh_verify_at = ''; $building_heigh_verify_at = '';
// 樓高通報確認人
$building_heigh_verify_owner = ''; $building_heigh_verify_owner = '';
// 電氣發貨明細
$electrical_design_publish = ''; $electrical_design_publish = '';
// 電氣資料發行時間
$electrical_design_publish_at = ''; $electrical_design_publish_at = '';
// 電氣資料發行人
$electrical_design_publish_owner = ''; $electrical_design_publish_owner = '';
// 機械資料發行
$mechanical_design_publish = ''; $mechanical_design_publish = '';
// 機械資料發行時間
$mechanical_design_publish_at = ''; $mechanical_design_publish_at = '';
// 機械資料發行人
$mechanical_design_publish_owner = ''; $mechanical_design_publish_owner = '';
// 電氣發貨明細
$electrical_shipping_date_publish = ''; $electrical_shipping_date_publish = '';
// 電氣發貨明細時間
$electrical_shipping_date_publish_at = ''; $electrical_shipping_date_publish_at = '';
// 電氣發貨明細發行人
$electrical_shipping_date_publish_owner = ''; $electrical_shipping_date_publish_owner = '';
// 機械發貨明細
$mechanical_shipping_date_publish = ''; $mechanical_shipping_date_publish = '';
// 機械發貨明細時間
$mechanical_shipping_date_publish_at = ''; $mechanical_shipping_date_publish_at = '';
// 機械發貨明細發行人
$mechanical_shipping_date_publish_owner = ''; $mechanical_shipping_date_publish_owner = '';
// 下單日(普來特富)
$prattford_order_date = ''; $prattford_order_date = '';
// 預計發貨日(到港日)
$estimated_shipping_date = ''; $estimated_shipping_date = '';
// 發貨類別(A.全級發貨、G.欠件發貨)
$goods_type = ''; $goods_type = '';
// 實際到貨日(到觀音廠日)
$actual_tofactory_date = ''; $actual_tofactory_date = '';
// 發貨確認人
$shipping_date_owner = ''; $shipping_date_owner = '';
// 預計船期
$estimated_shipping_schedule_date = ''; $estimated_shipping_schedule_date = '';
// 實際到貨日(到港日)
$actual_arrival_date = ''; $actual_arrival_date = '';
// 到貨確認人
$arrival_date_owner = ''; $arrival_date_owner = '';
// 是否齊備
$shengguanok_status = ''; $shengguanok_status = '';
// 生管確認附件
$shengguanok_status_file = ''; $shengguanok_status_file = '';
// 已備齊時間
$shengguanok_status_at = ''; $shengguanok_status_at = '';
// 已備齊檢查人
$shengguanok_status_owner = ''; $shengguanok_status_owner = '';
// 建立人
$creater = ''; $creater = '';
// 建立時間
$create_at = ''; $create_at = '';
if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") {
// 預設新梯代碼 A
$contract_type = postCheck('contract_type', 'B'); $contract_type = postCheck('contract_type', 'B');
// 汰改方案 B
$renovate_type = json_encode($_POST['renovate_type'], JSON_UNESCAPED_UNICODE); $renovate_type = json_encode($_POST['renovate_type'], JSON_UNESCAPED_UNICODE);
// 合約號
$contractno = postCheck('contractno'); $contractno = postCheck('contractno');
// 營業員ID
$salesid = postCheck('salesid'); $salesid = postCheck('salesid');
// 工務人員ID
$warehouseid = postCheck('warehouseid'); $warehouseid = postCheck('warehouseid');
// 客戶姓名
$custom = postCheck('custom'); $custom = postCheck('custom');
// 工地負責人
$site_manager = postCheck('site_manager'); $site_manager = postCheck('site_manager');
// 客戶id
$accountid = postCheck('accountid'); $accountid = postCheck('accountid');
// 作番號
$facilityno = postCheck('facilityno'); $facilityno = postCheck('facilityno');
// 作番號
$facility_temp_no = postCheck('facility_temp_no'); $facility_temp_no = postCheck('facility_temp_no');
// 緯度
$latitude = postCheck('latitude'); $latitude = postCheck('latitude');
// 經度
$longitude = postCheck('longitude'); $longitude = postCheck('longitude');
// 載重
$weight = postCheck('weight'); $weight = postCheck('weight');
// 人乘
$numberofpassenger = postCheck('numberofpassenger'); $numberofpassenger = postCheck('numberofpassenger');
// 樓停
$numberofstop = postCheck('numberofstop'); $numberofstop = postCheck('numberofstop');
// 樓層
$numberoffloor = postCheck('numberoffloor'); $numberoffloor = postCheck('numberoffloor');
// 開門方式
$opentype = postCheck('opentype'); $opentype = postCheck('opentype');
// 速度
$speed = postCheck('speed'); $speed = postCheck('speed');
// 機型
$facility_kind = postCheck('facility_kind'); $facility_kind = postCheck('facility_kind');
// 地址
$address = postCheck('address'); $address = postCheck('address');
// 合約到貨日
$contract_arrival_date = postCheck('contract_arrival_date'); $contract_arrival_date = postCheck('contract_arrival_date');
// 實際到貨日
$real_contract_arrival_date = postCheck('real_contract_arrival_date'); $real_contract_arrival_date = postCheck('real_contract_arrival_date');
// 營業規格確認
$sales_spec_verify = postCheck('sales_spec_verify'); $sales_spec_verify = postCheck('sales_spec_verify');
// 營業規格附件
$sales_spec_verify_file = postCheck('sales_spec_verify_file'); $sales_spec_verify_file = postCheck('sales_spec_verify_file');
// 營業規格確認時間
$sales_spec_verify_at = postCheck('sales_spec_verify_at'); $sales_spec_verify_at = postCheck('sales_spec_verify_at');
// 營業規格確認人
$sales_spec_verify_owner = postCheck('sales_spec_verify_owner'); $sales_spec_verify_owner = postCheck('sales_spec_verify_owner');
// 客戶計劃圖確認
$customer_planning_verify = postCheck('customer_planning_verify'); $customer_planning_verify = postCheck('customer_planning_verify');
// 客戶計劃圖附件
$customer_planning_verify_file = postCheck('customer_planning_verify_file'); $customer_planning_verify_file = postCheck('customer_planning_verify_file');
// 客戶計劃圖確認時間
$customer_planning_verify_at = postCheck('customer_planning_verify_at'); $customer_planning_verify_at = postCheck('customer_planning_verify_at');
// 客戶計劃圖確認人
$customer_planning_verify_owner = postCheck('customer_planning_verify_owner'); $customer_planning_verify_owner = postCheck('customer_planning_verify_owner');
// 客戶顏色確認
$customer_color_verify = postCheck('customer_color_verify'); $customer_color_verify = postCheck('customer_color_verify');
// 客戶顏色附件
$customer_color_verify_file = postCheck('customer_color_verify_file'); $customer_color_verify_file = postCheck('customer_color_verify_file');
// 客戶顏色確認時間
$customer_color_verify_at = postCheck('customer_color_verify_at'); $customer_color_verify_at = postCheck('customer_color_verify_at');
// 客戶顏色確認人
$customer_color_verify_owner = postCheck('customer_color_verify_owner'); $customer_color_verify_owner = postCheck('customer_color_verify_owner');
// 工勘聯絡表
$site_survey_contact_form_verify = postCheck('site_survey_contact_form_verify'); $site_survey_contact_form_verify = postCheck('site_survey_contact_form_verify');
// 工勘聯絡表附件
$site_survey_contact_form_verify_file = postCheck('site_survey_contact_form_verify_file'); $site_survey_contact_form_verify_file = postCheck('site_survey_contact_form_verify_file');
// 工勘聯絡表確認時間
$site_survey_contact_form_verify_at = postCheck('site_survey_contact_form_verify_at'); $site_survey_contact_form_verify_at = postCheck('site_survey_contact_form_verify_at');
// 工勘聯絡表確認人
$site_survey_contact_form_verify_owner = postCheck('site_survey_contact_form_verify_owner'); $site_survey_contact_form_verify_owner = postCheck('site_survey_contact_form_verify_owner');
// 設計規格確認
$desin_spec_verify = postCheck('desin_spec_verify'); $desin_spec_verify = postCheck('desin_spec_verify');
// 設計規格確認附件
$desin_spec_verify_file = postCheck('desin_spec_verify_file'); $desin_spec_verify_file = postCheck('desin_spec_verify_file');
// 設計規格確認時間
$desin_spec_verify_at = postCheck('desin_spec_verify_at'); $desin_spec_verify_at = postCheck('desin_spec_verify_at');
// 設計規格確認確認人
$desin_spec_verify_owner = postCheck('desin_spec_verify_owner'); $desin_spec_verify_owner = postCheck('desin_spec_verify_owner');
// 設計計劃圖確認
$desin_planning_verify = postCheck('desin_planning_verify'); $desin_planning_verify = postCheck('desin_planning_verify');
// 設計計劃圖確認附件
$desin_planning_verify_file = postCheck('desin_planning_verify_file'); $desin_planning_verify_file = postCheck('desin_planning_verify_file');
// 設計計劃圖確認時間
$desin_planning_verify_at = postCheck('desin_planning_verify_at'); $desin_planning_verify_at = postCheck('desin_planning_verify_at');
// 設計計劃圖確認人
$desin_planning_verify_owner = postCheck('desin_planning_verify_owner'); $desin_planning_verify_owner = postCheck('desin_planning_verify_owner');
// 設計顏色確認
$desin_color_verify = postCheck('desin_color_verify'); $desin_color_verify = postCheck('desin_color_verify');
// 設計顏色確認附件
$desin_color_verify_file = postCheck('desin_color_verify_file'); $desin_color_verify_file = postCheck('desin_color_verify_file');
// 設計顏色確認時間
$desin_color_verify_at = postCheck('desin_color_verify_at'); $desin_color_verify_at = postCheck('desin_color_verify_at');
// 設計顏色確認人
$desin_color_verify_owner = postCheck('desin_color_verify_owner'); $desin_color_verify_owner = postCheck('desin_color_verify_owner');
// 設計仕樣確認
$desin_style_verify = postCheck('desin_style_verify'); $desin_style_verify = postCheck('desin_style_verify');
// 設計仕樣確認附件
$desin_style_verify_file = postCheck('desin_style_verify_file'); $desin_style_verify_file = postCheck('desin_style_verify_file');
// 設計仕樣確認時間
$desin_style_verify_at = postCheck('desin_style_verify_at'); $desin_style_verify_at = postCheck('desin_style_verify_at');
// 設計仕樣確認人
$desin_style_verify_owner = postCheck('desin_style_verify_owner'); $desin_style_verify_owner = postCheck('desin_style_verify_owner');
// 設計主管確認
$desin_leader_verify = postCheck('desin_leader_verify'); $desin_leader_verify = postCheck('desin_leader_verify');
// 設計主管確認附件
$desin_leader_verify_file = postCheck('desin_leader_verify_file'); $desin_leader_verify_file = postCheck('desin_leader_verify_file');
// 設計主管確認時間
$desin_leader_verify_at = postCheck('desin_leader_verify_at'); $desin_leader_verify_at = postCheck('desin_leader_verify_at');
// 設計主管確認人
$desin_leader_verify_owner = postCheck('desin_leader_verify_owner'); $desin_leader_verify_owner = postCheck('desin_leader_verify_owner');
// 樓高通報
$building_heigh_verify = postCheck('building_heigh_verify'); $building_heigh_verify = postCheck('building_heigh_verify');
// 樓高通報附件
$building_heigh_verify_file = postCheck('building_heigh_verify_file'); $building_heigh_verify_file = postCheck('building_heigh_verify_file');
// 樓高通報時間
$building_heigh_verify_at = postCheck('building_heigh_verify_at'); $building_heigh_verify_at = postCheck('building_heigh_verify_at');
// 樓高通報確認人
$building_heigh_verify_owner = postCheck('building_heigh_verify_owner'); $building_heigh_verify_owner = postCheck('building_heigh_verify_owner');
// 電氣發貨明細
$electrical_design_publish = postCheck('electrical_design_publish'); $electrical_design_publish = postCheck('electrical_design_publish');
// 電氣資料發行時間
$electrical_design_publish_at = postCheck('electrical_design_publish_at'); $electrical_design_publish_at = postCheck('electrical_design_publish_at');
// 電氣資料發行人
$electrical_design_publish_owner = postCheck('electrical_design_publish_owner'); $electrical_design_publish_owner = postCheck('electrical_design_publish_owner');
// 機械資料發行
$mechanical_design_publish = postCheck('mechanical_design_publish'); $mechanical_design_publish = postCheck('mechanical_design_publish');
// 機械資料發行時間
$mechanical_design_publish_at = postCheck('mechanical_design_publish_at'); $mechanical_design_publish_at = postCheck('mechanical_design_publish_at');
// 機械資料發行人
$mechanical_design_publish_owner = postCheck('mechanical_design_publish_owner'); $mechanical_design_publish_owner = postCheck('mechanical_design_publish_owner');
// 電氣發貨明細
$electrical_shipping_date_publish = postCheck('electrical_shipping_date_publish'); $electrical_shipping_date_publish = postCheck('electrical_shipping_date_publish');
// 電氣發貨明細時間
$electrical_shipping_date_publish_at = postCheck('electrical_shipping_date_publish_at'); $electrical_shipping_date_publish_at = postCheck('electrical_shipping_date_publish_at');
// 電氣發貨明細發行人
$electrical_shipping_date_publish_owner = postCheck('electrical_shipping_date_publish_owner'); $electrical_shipping_date_publish_owner = postCheck('electrical_shipping_date_publish_owner');
// 機械發貨明細
$mechanical_shipping_date_publish = postCheck('mechanical_shipping_date_publish'); $mechanical_shipping_date_publish = postCheck('mechanical_shipping_date_publish');
// 機械發貨明細時間
$mechanical_shipping_date_publish_at = postCheck('mechanical_shipping_date_publish_at'); $mechanical_shipping_date_publish_at = postCheck('mechanical_shipping_date_publish_at');
// 機械發貨明細發行人
$mechanical_shipping_date_publish_owner = postCheck('mechanical_shipping_date_publish_owner'); $mechanical_shipping_date_publish_owner = postCheck('mechanical_shipping_date_publish_owner');
// 普來特富(下單日)
$prattford_order_date = postCheck('prattford_order_date'); $prattford_order_date = postCheck('prattford_order_date');
// 預計發貨日(到港日)
$estimated_shipping_date = postCheck('estimated_shipping_date'); $estimated_shipping_date = postCheck('estimated_shipping_date');
// 發貨類別(A.全級發貨、G.欠件發貨)
$goods_type = postCheck('goods_type'); $goods_type = postCheck('goods_type');
// 實際到貨日(到觀音廠日)
$actual_tofactory_date = postCheck('actual_tofactory_date'); $actual_tofactory_date = postCheck('actual_tofactory_date');
// 發貨確認人
$shipping_date_owner = postCheck('shipping_date_owner'); $shipping_date_owner = postCheck('shipping_date_owner');
// 預計船期
$estimated_shipping_schedule_date = postCheck('estimated_shipping_schedule_date'); $estimated_shipping_schedule_date = postCheck('estimated_shipping_schedule_date');
// 實際到貨日(到港日)
$actual_arrival_date = postCheck('actual_arrival_date'); $actual_arrival_date = postCheck('actual_arrival_date');
// 到貨確認人
$arrival_date_owner = postCheck('arrival_date_owner'); $arrival_date_owner = postCheck('arrival_date_owner');
// 是否齊備
$shengguanok_status = postCheck('shengguanok_status'); $shengguanok_status = postCheck('shengguanok_status');
// 生管確認附件
$shengguanok_status_file = postCheck('shengguanok_status_file'); $shengguanok_status_file = postCheck('shengguanok_status_file');
// 已備齊時間
$shengguanok_status_at = postCheck('shengguanok_status_at'); $shengguanok_status_at = postCheck('shengguanok_status_at');
// 已備齊檢查人
$shengguanok_status_owner = postCheck('shengguanok_status_owner'); $shengguanok_status_owner = postCheck('shengguanok_status_owner');
// QC與官檢種類
$qc_official_type = postCheck('qc_official_type'); $qc_official_type = postCheck('qc_official_type');
// 建立人
$creater = postCheck('creater'); $creater = postCheck('creater');
// 建立時間
$create_at = date("Y-m-d H:i:s"); $create_at = date("Y-m-d H:i:s");
//插入數據庫數據 gary_version //插入數據庫數據 gary_version
@ -449,6 +227,7 @@ if ($department_id == "321" || $department_id == "220") {
renovate_type, renovate_type,
contractno, contractno,
salesid, salesid,
warehouseid,
custom, custom,
site_manager, site_manager,
accountid, accountid,
@ -538,6 +317,7 @@ if ($department_id == "321" || $department_id == "220") {
'$renovate_type', '$renovate_type',
'$contractno', '$contractno',
'$salesid', '$salesid',
'$warehouseid',
'$custom', '$custom',
'$site_manager', '$site_manager',
'$accountid', '$accountid',
@ -668,6 +448,15 @@ if ($department_id == "321" || $department_id == "220") {
// 所有工務人員 select => options // 所有工務人員 select => options
$sql = " $sql = "
SELECT
accountid AS val ,
name AS label
FROM account
WHERE 1=1
-- AND department_id IN ('521','531','541','542','543','544','545')
AND accountid IN ('M0040','M0198','M0078','M0087','M0161')
ORDER BY label ASC
/*
SELECT SELECT
accountid AS val , accountid AS val ,
name AS label name AS label
@ -688,6 +477,7 @@ if ($department_id == "321" || $department_id == "220") {
FROM account FROM account
WHERE department_id IN ('521','531','541','542','543','544','545') WHERE department_id IN ('521','531','541','542','543','544','545')
ORDER BY label ASC ORDER BY label ASC
*/
"; ";
$warehouse_options = mysqli_query($link, $sql); $warehouse_options = mysqli_query($link, $sql);
@ -845,14 +635,36 @@ if ($department_id == "321" || $department_id == "220") {
<td style="vertical-align: middle"> <td style="vertical-align: middle">
<select class="form-control " id="warehouseid" name="warehouseid"> <select class="form-control " id="warehouseid" name="warehouseid">
<option value="">未選擇</option> <option value="">未選擇</option>
<optgroup label="北區">
<option value="M0041">張潘榮(桃竹以北)</option>
<option value="M0150">羅盛騰(桃竹)</option>
<option value="M0040">吳宗紘</option>
</optgroup>
<optgroup label="中區">
<option value="M0198">廖堉勝</option>
<option value="M0158">劉子睿(新梯)</option>
<option value="M0161">鄭永典(汰改)</option>
<option value="M0159">孫仲凱</option>
<option value="M0202">徐錦潤</option>
<option value="M0113">林瑋隆</option>
</optgroup>
<optgroup label="南區">
<option value="M0078">許益連</option>
<option value="M0102">鄭存邑(高屏、台東)</option>
<option value="M0187">田祖豪(台南、嘉義)</option>
<option value="M0077">鍾玉龍</option>
</optgroup>
<optgroup label="宜蘭">
<option value="M0087">高培軒</option>
</optgroup>
<?php <?php
foreach ($warehouse_options as $warehouse_option) : // foreach ($warehouse_options as $warehouse_option) :
if ($warehouse_option['val'] == $warehouseid) { // if ($warehouse_option['val'] == $warehouseid) {
echo "<option selected value='" . $warehouse_option['val'] . "'>" . $warehouse_option['val'] . $warehouse_option['label'] . "</option>"; // echo "<option selected value='" . $warehouse_option['val'] . "'>" . $warehouse_option['val'] . $warehouse_option['label'] . "</option>";
} else { // } else {
echo "<option value='" . $warehouse_option['val'] . "'>" . $warehouse_option['val'] . $warehouse_option['label'] . "</option>"; // echo "<option value='" . $warehouse_option['val'] . "'>" . $warehouse_option['val'] . $warehouse_option['label'] . "</option>";
} // }
endforeach // endforeach
?> ?>
</select> </select>
</td> </td>

123
wms/wipwhole-wipinstallstatus-index-modal.php

@ -0,0 +1,123 @@
<?php
// ini_set('display_errors', 'on');
include "database.php";
$method = $_POST['method'];
$type = $_POST['contract_type'];
$mtype = $_POST['renovate_type'];
$radsY = $_POST['radsY'];
$radsM = str_pad($_POST['radsM'], 2, "0", STR_PAD_LEFT);
$year = $_POST['radsYi'];
$month = str_pad($_POST['start_month'], 2, "0", STR_PAD_LEFT);
if ($method == 'getShippingDetails')
echo getShippingDetails($type, $mtype, $radsY, $radsM, $year, $month);
if ($method == 'getEndingDetails')
echo getEndingDetails($type, $mtype, $radsY, $radsM, $year, $month);
if ($method == 'getInstallingDetails')
echo getInstallingDetails($type, $mtype, $radsY, $radsM, $year, $month);
if ($method == 'getInstalling2Details')
echo getInstalling2Details($type, $mtype, $radsY, $radsM, $year, $month);
// 出貨台數
function getShippingDetails($type, $mtype, $radsY, $radsM, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
AND (
real_arrival_date IS NOT NULL
AND real_arrival_date != ''
)
AND real_arrival_date BETWEEN '$radsY-$radsM-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_all($result, MYSQLI_ASSOC);
return json_encode($data, JSON_UNESCAPED_UNICODE);
}
// 工收台數
function getEndingDetails($type, $mtype, $radsY, $radsM, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
AND real_arrival_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31'
AND (delivery_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31'
OR
official_check_date BETWEEN '$radsY-$radsM-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_all($result, MYSQLI_ASSOC);
return json_encode($data, JSON_UNESCAPED_UNICODE);
}
// 試車完台數
function getInstallingDetails($type, $mtype, $radsY, $radsM, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
AND (
real_arrival_date IS NOT NULL
AND real_arrival_date != ''
)
AND real_arrival_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31'
AND tryrun_end_date <= '$year-$month-31'
AND tryrun_end_date != ''
AND tryrun_end_date IS NOT NULL
";
$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 getInstalling2Details($type, $mtype, $radsY, $radsM, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
AND real_arrival_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31'
AND (
delivery_date IS NULL
OR delivery_date = ''
OR delivery_date >= '$year-$month-31'
)
AND(
official_check_date IS NULL
OR official_check_date = ''
OR official_check_date >= '$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_all($result, MYSQLI_ASSOC);
return json_encode($data, JSON_UNESCAPED_UNICODE);
}

299
wms/wipwhole-wipinstallstatus-index.php

@ -27,7 +27,6 @@ function getShipping($type, $mtype, $radsY, $radsM, $year, $month)
"; ";
$sql .= !empty($type) ? " AND contract_type = '$type'" : ""; $sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; $sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
// echo $sql . "<br/>";
$result = mysqli_query($link, $sql); $result = mysqli_query($link, $sql);
$data = mysqli_fetch_array($result, MYSQLI_ASSOC); $data = mysqli_fetch_array($result, MYSQLI_ASSOC);
return $data['all_count']; return $data['all_count'];
@ -55,13 +54,11 @@ function getInstalling($type, $mtype, $radsY, $radsM, $year, $month)
"; ";
$sql .= !empty($type) ? " AND contract_type = '$type'" : ""; $sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; $sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
// echo $sql."<br/>";
$result = mysqli_query($link, $sql); $result = mysqli_query($link, $sql);
$data = mysqli_fetch_array($result, MYSQLI_ASSOC); $data = mysqli_fetch_array($result, MYSQLI_ASSOC);
return $data['all_count']; return $data['all_count'];
} }
// 工收台數 // 工收台數
function getEnding($type, $mtype, $radsY, $radsM, $year, $month) function getEnding($type, $mtype, $radsY, $radsM, $year, $month)
{ {
@ -84,7 +81,6 @@ function getEnding($type, $mtype, $radsY, $radsM, $year, $month)
"; ";
$sql .= !empty($type) ? " AND contract_type = '$type'" : ""; $sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; $sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
// echo $sql . "<br/>";
$result = mysqli_query($link, $sql); $result = mysqli_query($link, $sql);
$data = mysqli_fetch_array($result, MYSQLI_ASSOC); $data = mysqli_fetch_array($result, MYSQLI_ASSOC);
return $data['all_count']; return $data['all_count'];
@ -153,7 +149,6 @@ function getInstalling2($type, $mtype, $radsY, $radsM, $year, $month)
<td style='text-align:center'> <td style='text-align:center'>
<button type="submit" style='text-align:center; margin:0 auto' class="btn btn-primary btn-sm">查詢</button> <button type="submit" style='text-align:center; margin:0 auto' class="btn btn-primary btn-sm">查詢</button>
<button type="button" style='text-align:center; margin:0 auto' class="btn btn-primary btn-sm" onclick='clean_all_input()'>清除</button> <button type="button" style='text-align:center; margin:0 auto' class="btn btn-primary btn-sm" onclick='clean_all_input()'>清除</button>
<!-- <button type="button" style='text-align:center; margin:0 auto' class="btn btn-primary btn-sm" onclick='generateButton()'>匯出excel</button> -->
</td> </td>
</tr> </tr>
</tfoot> </tfoot>
@ -189,10 +184,8 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) {
<?php <?php
} }
?> ?>
<!-- <th style='width:200px' colspan="3" rowspan="2">總計(全部)</th> -->
</tr> </tr>
<tr> <tr>
<!-- <th style="width:150px;"></th> -->
<?php <?php
$start_y = $radsY; $start_y = $radsY;
for ($radsYi = $radsY; $radsYi <= $radeY; $radsYi++) { for ($radsYi = $radsY; $radsYi <= $radeY; $radsYi++) {
@ -219,7 +212,6 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) {
<?php <?php
} }
?> ?>
<!-- <th style='width:200px' colspan="3" rowspan="2"></th> -->
</tr> </tr>
<tr> <tr>
<th>種類</th> <th>種類</th>
@ -252,9 +244,6 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) {
<?php <?php
} }
?> ?>
<!-- <th style="background-color:#FF8040;">出貨</th>
<th style="background-color:#FFAF60;">工收</th>
<th style="background-color:#9D9D9D;">試車完</th> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -284,29 +273,47 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) {
// 新梯出貨 // 新梯出貨
$all_count = 0; $all_count = 0;
$all_count = getShipping("A", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getShipping("A", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#CECECE;'>$all_count</td>"; ?>
<td style='background-color:#CECECE;'>
<a href='#' onclick='showDetails("getShippingDetails","A","","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
// 新梯工收 // 新梯工收
$all_count = 0; $all_count = 0;
$all_count = getEnding("A", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getEnding("A", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#DEDEDE;'>$all_count</td>"; ?>
<td style='background-color:#DEDEDE;'>
<a href='#' onclick='showDetails("getEndingDetails","A","","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
// 新梯試車完 // 新梯試車完
$all_count = 0; $all_count = 0;
$all_count = getInstalling("A", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getInstalling("A", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#EEEEEE;'>$all_count</td>"; ?>
<td style='background-color:#EEEEEE;'>
<a href='#' onclick='showDetails("getInstallingDetails","A","","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
// 新梯在裝中 // 新梯在裝中
$all_count = 0; $all_count = 0;
$all_count = getInstalling2("A", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getInstalling2("A", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#FFFFFF;'>$all_count</td>"; ?>
<td style='background-color:#FFFFFF;'>
<a href='#' onclick='showDetails("getInstalling2Details","A","","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
} }
?> ?>
<?php <?php
} }
// echo "<td style='background-color:#FF8040;'>$a_count</td>";
// echo "<td style='background-color:#FFAF60;'>$b_count</td>";
// echo "<td style='background-color:#9D9D9D;'>$c_count</td>";
?> ?>
</tr> </tr>
<tr> <tr>
@ -335,29 +342,47 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) {
// M1出貨 // M1出貨
$all_count = 0; $all_count = 0;
$all_count = getShipping("B", "M1", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getShipping("B", "M1", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#CECECE;'>$all_count</td>"; ?>
<td style='background-color:#CECECE;'>
<a href='#' onclick='showDetails("getShippingDetails","B","M1","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
// M1工收 // M1工收
$all_count = 0; $all_count = 0;
$all_count = getEnding("B", "M1", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getEnding("B", "M1", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#DEDEDE;'>$all_count</td>"; ?>
<td style='background-color:#DEDEDE;'>
<a href='#' onclick='showDetails("getEndingDetails","B","M1","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
// M1試車完 // M1試車完
$all_count = 0; $all_count = 0;
$all_count = getInstalling("B", "M1", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getInstalling("B", "M1", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#EEEEEE;'>$all_count</td>"; ?>
<td style='background-color:#EEEEEE;'>
<a href='#' onclick='showDetails("getInstallingDetails","B","M1","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
// M1在裝中 // M1在裝中
$all_count = 0; $all_count = 0;
$all_count = getInstalling2("B", "M1", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getInstalling2("B", "M1", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#FFFFFF;'>$all_count</td>"; ?>
<td style='background-color:#FFFFFF;'>
<a href='#' onclick='showDetails("getInstalling2Details","B","M1","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
} }
?> ?>
<?php <?php
} }
// echo "<td style='background-color:#FF8040;'>$a_count</td>";
// echo "<td style='background-color:#FFAF60;'>$b_count</td>";
// echo "<td style='background-color:#9D9D9D;'>$c_count</td>";
?> ?>
</tr> </tr>
<tr> <tr>
@ -386,29 +411,47 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) {
// MA出貨 // MA出貨
$all_count = 0; $all_count = 0;
$all_count = getShipping("B", "MA", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getShipping("B", "MA", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#CECECE;'>$all_count</td>"; ?>
<td style='background-color:#CECECE;'>
<a href='#' onclick='showDetails("getShippingDetails","B","MA","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
// MA工收 // MA工收
$all_count = 0; $all_count = 0;
$all_count = getEnding("B", "MA", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getEnding("B", "MA", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#DEDEDE;'>$all_count</td>"; ?>
<td style='background-color:#DEDEDE;'>
<a href='#' onclick='showDetails("getEndingDetails","B","MA","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
// MA試車完 // MA試車完
$all_count = 0; $all_count = 0;
$all_count = getInstalling("B", "MA", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getInstalling("B", "MA", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#EEEEEE;'>$all_count</td>"; ?>
<td style='background-color:#EEEEEE;'>
<a href='#' onclick='showDetails("getInstallingDetails","B","MA","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
// MA在裝中 // MA在裝中
$all_count = 0; $all_count = 0;
$all_count = getInstalling2("B", "MA", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getInstalling2("B", "MA", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#FFFFFF;'>$all_count</td>"; ?>
<td style='background-color:#FFFFFF;'>
<a href='#' onclick='showDetails("getInstalling2Details","B","MA","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
} }
?> ?>
<?php <?php
} }
// echo "<td style='background-color:#FF8040;'>$a_count</td>";
// echo "<td style='background-color:#FFAF60;'>$b_count</td>";
// echo "<td style='background-color:#9D9D9D;'>$c_count</td>";
?> ?>
</tr> </tr>
<tr> <tr>
@ -437,33 +480,187 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) {
// 出貨 // 出貨
$all_count = 0; $all_count = 0;
$all_count = getShipping("", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getShipping("", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#CECECE;'>$all_count</td>"; ?>
<td style='background-color:#CECECE;'>
<a href='#' onclick='showDetails("getShippingDetails","","","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
// 工收 // 工收
$all_count = 0; $all_count = 0;
$all_count = getEnding("", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getEnding("", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#DEDEDE;'>$all_count</td>"; ?>
<td style='background-color:#DEDEDE;'>
<a href='#' onclick='showDetails("getEndingDetails","","","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
// 試車完 // 試車完
$all_count = 0; $all_count = 0;
$all_count = getInstalling("", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getInstalling("", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#EEEEEE;'>$all_count</td>"; ?>
<td style='background-color:#EEEEEE;'>
<a href='#' onclick='showDetails("getInstallingDetails","","","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
// 在裝中 // 在裝中
$all_count = 0; $all_count = 0;
$all_count = getInstalling2("", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); $all_count = getInstalling2("", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
echo "<td style='background-color:#FFFFFF;'>$all_count</td>"; ?>
<td style='background-color:#FFFFFF;'>
<a href='#' onclick='showDetails("getInstalling2Details","","","<?php echo $radsY ?>","<?php echo $radsM ?>","<?php echo $radsYi ?>","<?php echo $start_month ?>")'>
<?php echo $all_count ?>
</a>
</td>
<?php
} }
?> ?>
<?php <?php
} }
// echo "<td style='background-color:#FF8040;'>$a_count</td>";
// echo "<td style='background-color:#FFAF60;'>$b_count</td>";
// echo "<td style='background-color:#9D9D9D;'>$c_count</td>";
?> ?>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<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="myTable" class="table table-bordered" style="width:50%; margin:0 auto;">
<thead>
<tr>
<td>序列</td>
<td>合約號</td>
<td>作番號</td>
<td>出貨日</td>
<td>試車完工日</td>
<td>官檢日</td>
<td>移交日</td>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<style>
/* The Modal (background) */
.modal {
display: none;
/* Hidden by default */
position: fixed;
/* Stay in place */
z-index: 1;
/* Sit on top */
padding-top: 100px;
/* Location of the box */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
}
.modal .back {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.4);
/* Black w/ opacity */
}
/* Modal Content */
.modal-content {
z-index: 9;
background-color: #fefefe;
margin: auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
}
/* The Close Button */
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
</style>
<script> <script>
var modal = document.getElementById("myModal");
function showDetails(method, contract_type, renovate_type, radsY, radsM, radsYi, start_month) {
$("#myModal").show();
$.ajax({
type: "POST",
dataType: "json",
url: "wipwhole-wipinstallstatus-index-modal.php",
data: {
method: method,
contract_type: contract_type,
renovate_type: renovate_type,
radsY: radsY,
radsM: radsM,
radsYi: radsYi,
start_month: start_month
},
success: function(data) {
var str = "";
for (var i = 0; i < data.length; i++) {
var contractno = data[i].contractno;
var facilityno = data[i].facilityno
var real_arrival_date = data[i].real_arrival_date == null ? "" : data[i].real_arrival_date
var tryrun_end_date = data[i].tryrun_end_date == null ? "" : data[i].tryrun_end_date
var official_check_date = data[i].official_check_date == null ? "" : data[i].official_check_date
var delivery_date = data[i].delivery_date == null ? "" : data[i].delivery_date
str += "<tr>";
str += "<td>" + (i + 1) + "</td>";
str += "<td>" + contractno + "</td>";
str += "<td>" + facilityno + "</td>";
str += "<td>" + real_arrival_date + "</td>";
str += "<td>" + tryrun_end_date + "</td>";
str += "<td>" + official_check_date + "</td>";
str += "<td>" + delivery_date + "</td>";
str += "</tr>";
}
$("#myTable tbody").html(str);
},
error: function(data) {
console.log(data);
}
})
}
$("#myCloseBtn").click(function(e) {
$("#myModal").hide();
});
$(".back").click(function(e) {
$("#myModal").hide();
});
</script> </script>

9
wms/wipwholeinstall-index-function.php

@ -899,11 +899,10 @@ function getMarketingStatus($link, $user_department_id, $role_id)
{ {
if ($user_department_id == 220) if ($user_department_id == 220)
return ""; return "";
if ($user_department_id == 311 || $user_department_id == 312 || $user_department_id == 313 || $user_department_id == 314 || $user_department_id == 315) if (in_array($user_department_id, [311, 312, 313, 314, 315]))
return checkNowFormYDStatus($link) == 'A' ? "" : "disabled"; return checkNowFormYDStatus($link) == 'A' ? "" : "disabled";
if ($user_department_id == 501 || $user_department_id == 511 || $user_department_id == 512 || $user_department_id == 513 || $user_department_id == 514) if (in_array($user_department_id, [501, 511, 512, 513, 514, 515]))
return checkNowFormYDStatus($link) == 'A' ? "" : "disabled"; return checkNowFormYDStatus($link) == 'A' ? "" : "disabled";
return "disabled"; return "disabled";
} }
@ -957,7 +956,7 @@ function getGunwuName($address)
$north_arr = array('台北', '基隆', '新北', '桃園', '新竹'); $north_arr = array('台北', '基隆', '新北', '桃園', '新竹');
$north_arr2 = array('宜蘭'); $north_arr2 = array('宜蘭');
$center_arr = array('南投', '彰化', '雲林', '台中', '苗栗'); $center_arr = array('南投', '彰化', '雲林', '台中', '苗栗');
$south_arr = array('台南', '嘉義', '屏東', '高雄'); $south_arr = array('台南', '嘉義', '屏東', '高雄', '台東');
foreach ($north_arr as $key => $value) foreach ($north_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false) if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "張潘榮"; return "張潘榮";
@ -966,7 +965,7 @@ function getGunwuName($address)
return "高培軒"; return "高培軒";
foreach ($center_arr as $key => $value) foreach ($center_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false) if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "林瑋隆"; return "劉子睿";
foreach ($south_arr as $key => $value) foreach ($south_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false) if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "鄭存邑"; return "鄭存邑";

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

@ -920,11 +920,10 @@ function getMarketingStatus($link, $user_department_id, $role_id)
{ {
if ($user_department_id == 220) if ($user_department_id == 220)
return ""; return "";
if ($user_department_id == 311 || $user_department_id == 312 || $user_department_id == 313 || $user_department_id == 314 || $user_department_id == 315) if (in_array($user_department_id, [311, 312, 313, 314, 315]))
return checkNowFormYDStatus($link) == 'A' ? "" : "disabled"; return checkNowFormYDStatus($link) == 'A' ? "" : "disabled";
if ($user_department_id == 501 || $user_department_id == 511 || $user_department_id == 512 || $user_department_id == 513 || $user_department_id == 514) if (in_array($user_department_id, [501, 511, 512, 513, 514, 515]))
return checkNowFormYDStatus($link) == 'A' ? "" : "disabled"; return checkNowFormYDStatus($link) == 'A' ? "" : "disabled";
return "disabled"; return "disabled";
} }
@ -978,7 +977,7 @@ function getGunwuName($address)
$north_arr = array('台北', '基隆', '新北', '桃園', '新竹'); $north_arr = array('台北', '基隆', '新北', '桃園', '新竹');
$north_arr2 = array('宜蘭'); $north_arr2 = array('宜蘭');
$center_arr = array('南投', '彰化', '雲林', '台中', '苗栗'); $center_arr = array('南投', '彰化', '雲林', '台中', '苗栗');
$south_arr = array('台南', '嘉義', '屏東', '高雄'); $south_arr = array('台南', '嘉義', '屏東', '高雄', '台東');
foreach ($north_arr as $key => $value) foreach ($north_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false) if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "吳宗紘"; return "吳宗紘";
@ -987,7 +986,7 @@ function getGunwuName($address)
return "高培軒"; return "高培軒";
foreach ($center_arr as $key => $value) foreach ($center_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false) if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "林瑋隆"; return "劉子睿";
foreach ($south_arr as $key => $value) foreach ($south_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false) if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "鄭存邑"; return "鄭存邑";

Loading…
Cancel
Save