Browse Source

通知功能修改

gary
gary_chen\gary_chen 1 year ago
parent
commit
629f228d97
  1. 2
      wms/T8_APItest_from_bpm.php
  2. 6
      wms/frame/api_getdata.php
  3. 1
      wms/frame/notice.php
  4. 25
      wms/fun_global.php
  5. 2
      wms/ngfeedback-index.php
  6. 13
      wms/notice-delete-all.php
  7. 76
      wms/notice-edit.php
  8. 169
      wms/notice-index.php
  9. 363
      wms/schedule-index.php
  10. 3
      wms/wipwhole-index-export-excel.php
  11. 6
      wms/wipwhole-index-function.php
  12. 8
      wms/wipwhole-index-table-html.php
  13. 76
      wms/wipwhole-index.php
  14. 77
      wms/wipwhole-rec-invoice-edit-submit.php
  15. 106
      wms/wipwhole-rec-invoice-edit.php
  16. 251
      wms/wipwhole-rec-invoice.php
  17. 21
      wms/wipwhole-renovate-index-export-excel.php
  18. 33
      wms/wipwhole-renovate-index-function.php
  19. 18
      wms/wipwhole-renovate-index-table-html.php
  20. 16
      wms/wipwhole-renovate-index.php
  21. 74
      wms/wipwhole-renovate-rec-invoice-edit-submit.php
  22. 482
      wms/wipwhole-renovate-rec-invoice-edit.php
  23. 270
      wms/wipwhole-renovate-rec-invoice.php
  24. 4
      wms/wipwholeinstall-index-function.php
  25. 4
      wms/wipwholeinstall-renovate-index-function.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 = [

6
wms/frame/api_getdata.php

@ -81,7 +81,11 @@ 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...

25
wms/fun_global.php

@ -157,6 +157,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',
@ -599,3 +601,26 @@ function getAccounttype($link, $user_id)
$row = mysqli_fetch_array($data, MYSQLI_ASSOC); $row = mysqli_fetch_array($data, MYSQLI_ASSOC);
return $row['accounttype']; return $row['accounttype'];
} }
/**
* 算催收月份
* @param int $contractday
* @return int $month
*/
function collect_month($contractday)
{
$today_date = new DateTime(date('Y-m-d', strtotime('-1 month', strtotime(date('Y-m-d')))));
$latest_timestamp = $contractday;
$latest_date = new DateTime();
$latest_date->setTimestamp($latest_timestamp);
if ($latest_timestamp < $today_date->getTimestamp()) {
$interval = $latest_date->diff($today_date);
$interval2 = $latest_date->diff($today_date);
$year = $interval2->format('%y');
$month = $interval->format('%m');
$total_month = $year * 12 + $month;
return $total_month;
} else {
return 0;
}
}

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();
?>

76
wms/notice-edit.php

@ -1,45 +1,53 @@
<?php <?php
include "header.php"; include "header.php";
$id = isset($_GET['id']) ? $_GET['id'] : die('ERROR: Record ID not found.'); $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>
<input type="text" name="title" id="title" size="30" maxlength="25" value="<?php echo $data['title']; ?>" required> <input type="text" name="title" id="title" size="30" maxlength="25" value="<?php echo $data['title']; ?>" required>
</div> </div>
<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> <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>
<br> <br>
<button type="button" name="btn" id="btn">回上頁</button> <button type="button" name="btn" id="btn">回上頁</button>
</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;

169
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,80 +29,97 @@ $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%; 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_index_filter{
float:right;
}
#table_index_paginate{
float:right;
}
label {
display: inline-flex;
margin-bottom: .5rem;
margin-top: .5rem;
}
</style>
<div style="overflow-x:auto;">
<table id="table_index" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th>項次</th>
<th>類別</th>
<th>標題</th>
<th>內容</th>
<th>確認</th>
<th>建檔人</th>
<th>建檔時間</th>
</tr>
</thead>
<tbody>
<?php foreach($data as $data) : if (is_null($data['haveread'])):?>
<tr>
<td><?php echo $data['id']; ?></td>
<td><?php if ($data['kind']=='1') echo "系統"; else echo "會議"; ?></td>
<td><?php echo $data['title']; ?></td>
<td><?php echo $data['content']; ?></td>
<!-- <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('確認關閉通知嗎?')">
<span class="glyphicon glyphicon-ok"></span>
</a></td>
<td><?php echo $data['creater']; ?></td>
<td><?php echo $data['create_at']; ?></td>
</tr>
<?php endif;?>
<?php endforeach; ?>
</tbody>
</table>
</div>
#table_index_filter {
float: right;
}
#table_index_paginate {
float: right;
}
label {
display: inline-flex;
margin-bottom: .5rem;
margin-top: .5rem;
}
</style>
<div style="overflow-x:auto;">
<table id="table_index" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th>項次</th>
<th>類別</th>
<th>標題</th>
<th>內容</th>
<th>確認</th>
<th>已讀</th>
<th>建檔人</th>
<th>建檔時間</th>
</tr>
</thead>
<tbody>
<?php foreach ($data as $data) : ?>
<tr>
<td><?php echo $data['id']; ?></td>
<td><?php if ($data['kind'] == '1') echo "系統";
else echo "會議"; ?></td>
<td><?php echo $data['title']; ?></td>
<td><?php echo $data['content']; ?></td>
<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('確認關閉通知嗎?')">
<span class="glyphicon glyphicon-ok"></span>
</a></td>
<td><?php echo !empty(accountidToName($data['creater'])) ? accountidToName($data['creater']) : $data['creater']; ?></td>
<td><?php echo $data['create_at']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</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;
@ -102,4 +127,4 @@ endif;
mysqli_close($link); mysqli_close($link);
include "footer.php"; include "footer.php";
?> ?>

363
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); $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,77 +72,82 @@ 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_paginate{
float:right;
}
label {
display: inline-flex;
margin-bottom: .5rem;
margin-top: .5rem;
}
#preloader {/* 這是整個會蓋住畫面的底色色塊 */ #table_index2_filter {
position: fixed; float: right;
width: 100%; }
height: 100%;
left: 0%; #table_index2_paginate {
top: 10%; float: right;
background-color: #fff; }
z-index: 9999;
} label {
#status {/* 這是中間loading的gif坐標css,我們盡量讓他畫面置中 */ display: inline-flex;
position: fixed; margin-bottom: .5rem;
width: 218px; margin-top: .5rem;
height: 419px;
margin-left: -140px; }
margin-top: -160px;
left: 50%; #preloader {
top: 50%; /* 這是整個會蓋住畫面的底色色塊 */
} position: fixed;
width: 100%;
height: 100%;
left: 0%;
top: 10%;
background-color: #fff;
z-index: 9999;
}
</style> #status {
<script> /* 這是中間loading的gif坐標css,我們盡量讓他畫面置中 */
$(function(){ position: fixed;
$('#table_index2').DataTable({ width: 218px;
"pageLength": 50, height: 419px;
"searching": false, margin-left: -140px;
"paging": false, margin-top: -160px;
}); left: 50%;
$('.dataTables_length').hide(); top: 50%;
//$('.pagination').eq(0).hide(); }
<?php if (!$page_close) { ?> </style>
$('.dataTables_info').hide(); <script>
<?php } ?> $(function() {
}); $('#table_index2').DataTable({
</script> "pageLength": 50,
"searching": false,
"paging": false,
});
$('.dataTables_length').hide();
//$('.pagination').eq(0).hide();
<?php if (!$page_close) { ?>
$('.dataTables_info').hide();
<?php } ?>
});
</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>
@ -161,116 +166,118 @@ $(function(){
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">
</form><br> </form><br>
<table id="table_index2" class="table table-striped table-bordered" style="width:100%"> <table id="table_index2" class="table table-striped table-bordered" style="width:100%">
<thead> <thead>
<tr>
<th>項次</th>
<th>合約號</th>
<th>作番號</th>
<th>保養套餐編號</th>
<th>保養人員工號</th>
<th>保養人員姓名</th>
<th>應保養日期</th>
<th>實際保養日期</th>
<th>保養項目編號</th>
<th>保養項目內容</th>
<th>保養結果</th>
<th>上傳照片</th>
<th>說明</th>
<th>客戶評價登入帳號</th>
<th>客戶姓名</th>
<th>評價/保養品質</th>
<th>評價/服務態度</th>
<th>內容</th>
<th>簽名檔</th>
<th>建檔人</th>
<th>建檔時間</th>
<?php if ($user_auth&2) { ?>
<th>修改</th>
<th>刪除</th>
<?php } ?>
</tr>
</thead>
<tbody>
<?php foreach($data as $data) : ?>
<tr> <tr>
<td><?php echo $data['id']; ?></td> <th>項次</th>
<td style="width:100pd;word-break: break-all;"><?php echo $data['contractno']; ?></td> <th>合約號</th>
<td><a href="/app/app-maintenance-uploadsuccess-photo-review.php?id_schedule=<?php echo $data['id']; ?>&<?php echo $token_link; ?>"><?php echo $data['facilityno']; ?></a></td> <th>作番號</th>
<td><?php echo $data['combono']; ?></td> <th>保養套餐編號</th>
<td><?php echo $data['repairerid']; ?></td> <th>保養人員工號</th>
<td><?php echo $data['repairername']; ?></td> <th>保養人員姓名</th>
<td><?php echo $data['duedate']; ?></td> <th>應保養日期</th>
<td><?php echo $data['actualdate']; ?></td> <th>實際保養日期</th>
<td style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis;"><?php echo $data['item']; ?></td> <th>保養項目編號</th>
<td style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis;"><?php echo $data['item_detail']; ?></td> <th>保養項目內容</th>
<td style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis;"><?php echo $data['result']; ?></td> <th>保養結果</th>
<td><?php if ($data['evidences']) { echo "<a href=\"/app/".$data['evidences']."\">瀏覽</a>"; } ?></td> <th>上傳照片</th>
<td><?php echo $data['descriptons']; ?></td> <th>說明</th>
<td><?php echo $data['customer_login_id']; ?></td> <th>客戶評價登入帳號</th>
<td><?php echo $data['customer_login_name']; ?></td> <th>客戶姓名</th>
<td> <th>評價/保養品質</th>
<?php <th>評價/服務態度</th>
$stars_1 = ($data['stars_c1']) ? $data['stars_c1'] : $data['stars']; <th>內容</th>
echo $stars_1; <th>簽名檔</th>
?> <th>建檔人</th>
</td> <th>建檔時間</th>
<td> <?php if ($user_auth & 2) { ?>
<?php <th>修改</th>
$stars_2 = ($data['stars_c2']) ? $data['stars_c2'] : $data['stars_b2']; <th>刪除</th>
echo $stars_2;
?>
</td>
<td><?php echo $data['details']; ?></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['create_at']; ?></td>
<?php if ($user_auth&2) { ?>
<td>
<p>
<a href="schedule-edit.php?id=<?php echo $data['id']; ?>&function_name=schedule&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-pencil"></span>
</a>
</p>
</td>
<td>
<p>
<a href="schedule-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-info btn-sm" onClick="return confirm('Are you sure you want to delete?')">
<span class="glyphicon glyphicon-remove"></span>
</a>
</p>
</td>
<?php } ?> <?php } ?>
</tr> </tr>
<?php endforeach; ?> </thead>
</tbody> <tbody>
<?php foreach ($data as $data) : ?>
<tr>
<td><?php echo $data['id']; ?></td>
<td style="width:100pd;word-break: break-all;"><?php echo $data['contractno']; ?></td>
<td><a href="/app/app-maintenance-uploadsuccess-photo-review.php?id_schedule=<?php echo $data['id']; ?>&<?php echo $token_link; ?>"><?php echo $data['facilityno']; ?></a></td>
<td><?php echo $data['combono']; ?></td>
<td><?php echo $data['repairerid']; ?></td>
<td><?php echo $data['repairername']; ?></td>
<td><?php echo $data['duedate']; ?></td>
<td><?php echo $data['actualdate']; ?></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['result']; ?></td>
<td><?php if ($data['evidences']) {
echo "<a href=\"/app/" . $data['evidences'] . "\">瀏覽</a>";
} ?></td>
<td><?php echo $data['descriptons']; ?></td>
<td><?php echo $data['customer_login_id']; ?></td>
<td><?php echo $data['customer_login_name']; ?></td>
<td>
<?php
$stars_1 = ($data['stars_c1']) ? $data['stars_c1'] : $data['stars'];
echo $stars_1;
?>
</td>
<td>
<?php
$stars_2 = ($data['stars_c2']) ? $data['stars_c2'] : $data['stars_b2'];
echo $stars_2;
?>
</td>
<td><?php echo $data['details']; ?></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['create_at']; ?></td>
<?php if ($user_auth & 2) { ?>
<td>
<p>
<a href="schedule-edit.php?id=<?php echo $data['id']; ?>&function_name=schedule&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-pencil"></span>
</a>
</p>
</td>
<td>
<p>
<a href="schedule-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-info btn-sm" onClick="return confirm('Are you sure you want to delete?')">
<span class="glyphicon glyphicon-remove"></span>
</a>
</p>
</td>
<?php } ?>
</tr>
<?php endforeach; ?>
</tbody>
</table> </table>
</div> </div>
<?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
} }
?> ?>
<?php <?php
else: else :
echo "<h2>There is no record!</h2>"; echo "<h2>There is no record!</h2>";
endif; endif;
@ -279,4 +286,4 @@ mysqli_close($link);
include "footer.php"; include "footer.php";
?> ?>

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,

6
wms/wipwhole-index-function.php

@ -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 "鄭存邑";

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>

76
wms/wipwhole-index.php

@ -35,7 +35,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$form_name = empty($_REQUEST['form_name']) ? null : $_REQUEST['form_name']; $form_name = empty($_REQUEST['form_name']) ? null : $_REQUEST['form_name'];
$del_seq = empty($_REQUEST['del_seq']) ? null : $_REQUEST['del_seq']; $del_seq = empty($_REQUEST['del_seq']) ? null : $_REQUEST['del_seq'];
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);
$sql = "UPDATE flow set flow_code = 'Z' where form_id = '$del_seq' and flow_id = 'wws01' ";
mysqli_query($link, $sql); mysqli_query($link, $sql);
} }
} }
@ -461,39 +463,40 @@ mysqli_close($link);
} }
$('#table_index2').DataTable({ $('#table_index2').DataTable({
scrollX: true, fixedColumns: {
fixedHeader: true, leftColumns: 4
scrollY: 500, },
"language": { scrollX: true,
"emptyTable": "無資料...", fixedHeader: true,
"processing": "處理中...", scrollY: 500,
"loadingRecords": "載入中...", "language": {
"lengthMenu": "顯示_MENU_ 筆", "emptyTable": "無資料...",
"zeroRecords": "沒有符合的結果", "processing": "處理中...",
"info": "第 _START_ 至 _END_ 項,共 _TOTAL_ 項", "loadingRecords": "載入中...",
"infoEmpty": "第 0 至 0 項,共 0 項", "lengthMenu": "顯示_MENU_ 筆",
"infoFiltered": "(從 _MAX_ 項結果中過濾)", "zeroRecords": "沒有符合的結果",
"infoPostFix": "", "info": "第 _START_ 至 _END_ 項,共 _TOTAL_ 項",
"search": "", "infoEmpty": "第 0 至 0 項,共 0 項",
"paginate": { "infoFiltered": "(從 _MAX_ 項結果中過濾)",
"first": "第一頁", "infoPostFix": "",
"previous": "上一頁", "search": "",
"next": "下一頁", "paginate": {
"last": "最後一頁" "first": "第一頁",
}, "previous": "上一頁",
"aria": { "next": "下一頁",
"sortAscending": ": 升冪排列", "last": "最後一頁"
"sortDescending": ": 降冪排列" },
} "aria": {
"sortAscending": ": 升冪排列",
"sortDescending": ": 降冪排列"
} }
}, {
"order": [
[4, "desc"],
[8, "asc"]
]
} }
}, {
); "order": [
[4, "desc"],
[8, "asc"]
]
});
document.querySelector("#table_index2_filter > label > input").placeholder = "快速搜尋"; document.querySelector("#table_index2_filter > label > input").placeholder = "快速搜尋";
// datatable 畫面重整後保留資料 // datatable 畫面重整後保留資料
@ -582,4 +585,11 @@ mysqli_close($link);
<form id='del_form' method='post'> <form id='del_form' method='post'>
<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>

77
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,6 +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) {
@ -234,6 +265,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 +335,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',

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

@ -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,6 +515,9 @@ 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>
<td colspan='4'>
<span class="text-danger">有官檢日或QC合格日後才可填寫</span>
</td>
</tr> </tr>
<tr> <tr>
<td colspan="8"> <td colspan="8">
@ -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>
@ -1280,6 +1356,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>

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');

33
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
@ -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 "鄭存邑";
@ -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>

16
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,
@ -585,4 +590,11 @@ mysqli_close($link);
<form id='del_form' method='post'> <form id='del_form' method='post'>
<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>

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

@ -115,6 +115,37 @@ 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'];
// 指派工勘人員
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 ($site_survey_contact_verify !== $old_site_survey_contact_verify) { if ($site_survey_contact_verify !== $old_site_survey_contact_verify) {
$site_survey_status = array( $site_survey_status = array(
@ -233,6 +264,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'];
$creater = $_POST['creater']; $creater = $_POST['creater'];
@ -241,6 +273,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 (checkNowFormStatus($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 ($official_check_date !== $old_official_check_date) { if ($official_check_date !== $old_official_check_date) {
$sql = " $sql = "
@ -293,9 +352,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 +361,10 @@ 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 +381,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 +391,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',";
@ -1010,7 +1072,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;
} }
} }

482
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>
@ -597,6 +598,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>
@ -698,6 +771,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,6 +781,9 @@ 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>
<td colspan='4'>
<span class="text-danger">有官檢日或QC合格日後才可填寫</span>
</td>
</tr> </tr>
<tr> <tr>
<td colspan="8"> <td colspan="8">
@ -1258,6 +1335,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 +1374,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 +1470,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 +1733,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 +1849,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">
@ -1646,7 +1925,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").prop("disabled", true);
if ($("#end_qc_date").val() !== "") {
$("#delivery_date").prop("disabled", false);
}
if ($("#official_check_date").val() !== "") {
$("#delivery_date").prop("disabled", false);
}
}
$(function() { $(function() {
var tab = $('#tab').val(); var tab = $('#tab').val();
$("#tabs").tabs({ $("#tabs").tabs({
@ -1670,7 +1976,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]);
@ -1772,6 +2086,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 +2163,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)

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>

4
wms/wipwholeinstall-index-function.php

@ -957,7 +957,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 +966,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 "鄭存邑";

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

@ -978,7 +978,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 +987,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