Browse Source

Merge branch 'cheng'

main
Cheng 1 year ago
parent
commit
33a38490d1
  1. 134
      wms/T8_API_SALDISPATCHLIST.php
  2. 48
      wms/T8_Authorization_curl_ver.php
  3. 29
      wms/T8_Authorization_from_bpm.php
  4. BIN
      wms/account-receivable-facility.xlsx
  5. 992
      wms/account-receivable-index.php
  6. BIN
      wms/account-receivable-test.xlsx
  7. 2
      wms/board-record-submit.php
  8. 8
      wms/css/function.js
  9. 230
      wms/css/view/expression-index.php
  10. 1
      wms/excel-upload.php
  11. 282
      wms/expression-index.php
  12. 195
      wms/frame/pending.php
  13. 6
      wms/gary.php
  14. 21
      wms/header.php
  15. 2
      wms/login.php
  16. 2
      wms/loginapi.php
  17. 40
      wms/mkt/assets/js/alpine.js
  18. 6
      wms/mkt/price_normal-index.php
  19. 20
      wms/mkt/pricereview-check.php
  20. 38
      wms/mkt/pricereview-create.php
  21. 1
      wms/mkt/pricereview_facility-api.php
  22. 8
      wms/mkt/pricereview_mi-api.php
  23. 3
      wms/notice-delete.php
  24. 17
      wms/notice-edit.php
  25. 2
      wms/wipwhole-rec-invoice-edit-fileupload.php
  26. 389
      wms/wipwhole-rec-invoice-edit-submit.php
  27. 172
      wms/wipwhole-rec-invoice-edit.php
  28. 423
      wms/wipwhole-renovate-rec-invoice-edit-submit.php
  29. 150
      wms/wipwhole-renovate-rec-invoice-edit.php

134
wms/T8_API_SALDISPATCHLIST.php

@ -0,0 +1,134 @@
<?php
ini_set('display_errors', 'on');
date_default_timezone_set('Asia/Taipei');
include "T8_Authorization_curl_ver.php";
$user_id = "M0117";
$user_password = "90493119";
$validation = get_Auth($user_id, $user_password);
// getDataSchemaDetails($validation);
// getSALDISPATCHLIST($validation);
$body = [
[
"name" => "salDispatchListMaster",
"rows" => [
[
"BillNo" => "SS20230208001",
"BillDate" => 20230208,
"SupplyFOrgId" => "1000",
"FOrgId" => "1000",
"TypeId" => "SS",
"OrgId" => "1000",
"CompId" => "A",
"ModeId" => "DS",
"BizPartnerId" => "A0000001",
"PersonId" => "POS001",
"CurrId" => "TWD",
"CurrOAmount" => 1,
"CurrLAmount" => 1,
"TrusteeWarehouseId" => "",
"SendGoodsDate" => 20230208,
"DueToId" => "A0000001",
"TaxId" => "ST005",
"CreditorOrgId" => "1000",
"CreditorCompId" => "A",
"CreditorCurrOAmount" => 1,
"CreditorCurrLAmount" => 1,
"TradeConditionId" => "",
"TrusteeWarehouseBPType" => 0
]
]
],
[
"name" => "salDispatchListDetail",
"rows" => [
"SupplyCompId" => "A",
"SupplyOrgId" => "1000",
"DispatchCompId" => "A",
"DispatchOrgId" => "1000",
"SQuantity" => "1",
"TaxId" => "ST005",
"BillNo" => "SS20230208001",
"RowCode" => 1,
"ItemType" => 0,
"MaterialId" => "POS01CF0001",
"SUnitId" => "CAP",
"SPrice" => "100"
]
]
];
createSALDISPATCHLIST($validation, $data);
// 新增發貨單
function createSALDISPATCHLIST($validation, $body)
{
// 新增
$apiurl = 'http://60.244.87.101:880/twWebAPI/V1/SALDISPATCHLIST/PostERPData';
// $apiurl = 'http://10.10.145.2:880/twWebAPI/V1/SALDISPATCHLIST/PostERPData';
// $apiurl = 'https://127.0.0.1:780/twWebAPI/V1/SALDISPATCHLIST/PostERPData';
$headerParam = [
'CHI_Authorization: ' . $validation,
'Content-Type: application/json'
];
$json = json_encode($body);
myCurl($apiurl, $headerParam, $json);
}
// 發貨單查詢
function getSALDISPATCHLIST($validation)
{
// 新增 刪除
$apiurl = 'http://60.244.87.101:880/twWebAPI/V1/SALDISPATCHLIST/GetERPData?pkValue=SS20231114001';
// $apiurl = 'http://10.10.145.2:880/twWebAPI/V1/SALDISPATCHLIST/GetERPData';
// $apiurl = 'https://127.0.0.1:780/twWebAPI/V1/SALDISPATCHLIST/GetERPData';
$headerParam = [
'CHI_Authorization: ' . $validation,
'Content-Type: application/json'
];
$body = [];
$json = json_encode($body);
myCurl($apiurl, $headerParam, $json);
}
// 發貨單資料表結構
function getDataSchemaDetails($validation)
{
// 取得資料表結構
$apiurl = 'http://60.244.87.101:880/twWebAPI/V1/SALDISPATCHLIST/GetTableSchema';
// $apiurl = 'http://10.10.145.2:880/twWebAPI/V1/SALDISPATCHLIST/GetTableSchema';
// $apiurl = 'https://127.0.0.1:780/twWebAPI/V1/SALDISPATCHLIST/GetTableSchema';
$headerParam = [
'CHI_Authorization: ' . $validation,
'Content-Type: application/json'
];
$body = [];
$json = json_encode($body);
myCurl($apiurl, $headerParam, $json);
}
function myCurl($apiurl, $headerParam, $json)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $apiurl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headerParam);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
$response = curl_exec($ch);
if ($response === false) {
echo 'Curl error: ' . curl_error($ch);
} else {
$result = json_decode($response, true);
if ($result['Status'] == 'Success') {
echo json_encode($result['Data'], JSON_UNESCAPED_UNICODE);
} else {
echo $result['ErrorMsg'];
}
}
curl_close($ch);
}

48
wms/T8_Authorization_curl_ver.php

@ -0,0 +1,48 @@
<?php
// $user_id = "M0000";
// $user_password = "M012290493119";
$user_id = "M0117";
$user_password = "90493119";
$validation = get_Auth($user_id, $user_password);
function get_Auth($user_id = "M0000", $user_password = "M012290493119")
{
// $now = gmdate("YmdHis");
$now = gmdate("YmdHis", strtotime("-2 minutes"));
$data = "$user_id." . $now;
$sign = hash_hmac('SHA256', $data, 'B2D6395D2883E26C', false);
// $apiurl = 'https://erp.masada.com.tw:780/twWebAPI/GetAuth';
$apiurl = 'http://60.244.87.101:880//twWebAPI/GetAuth';
// $apiurl = 'http://10.10.145.2:880//twWebAPI/GetAuth';
// $apiurl = 'https://erp.masada.com.tw:780/twWebAPI/GetAuth';
$headerParam = [
"UserId: $user_id",
"Pwd: $user_password",
"TimestampUTC: $now",
"Sign: $sign"
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $apiurl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headerParam);
$response = curl_exec($ch);
if ($response === false) {
echo 'Curl error: ' . curl_error($ch);
} else {
$result = json_decode($response, true);
if ($result['Status'] == 'Success')
return $result['Data']['CHI_Authorization'];
if ($result['Status'] == 'Error')
return $result['ErrorMsg'];
}
curl_close($ch);
}

29
wms/T8_Authorization_from_bpm.php

@ -1,22 +1,28 @@
<?php
$user_id = "M0000";
$user_password = "M012290493119";
// $user_id = "M0000";
// $user_password = "M012290493119";
$user_id = "M0117";
$user_password = "90493119";
echo $validation = get_Auth($user_id, $user_password);
function get_Auth($user_id = "M0000", $user_password = "M012290493119")
{
$currentTime = time();
$twoMinutesLater = $currentTime - (2 * 60);
$now = gmdate("YmdHis", $twoMinutesLater);
// $now = gmdate("YmdHis");
$now = gmdate("YmdHis", strtotime("-2 minutes"));
$data = "$user_id." . $now;
$sign = hash_hmac('SHA256', $data, 'B2D6395D2883E26C', false);
// $apiurl = 'https://erp.masada.com.tw:880/twWebAPI/GetAuth';
// $apiurl = 'http://60.244.87.101:880//twWebAPI/GetAuth';
// $apiurl = 'https://erp.masada.com.tw:780/twWebAPI/GetAuth';
$apiurl = 'http://60.244.87.101:880//twWebAPI/GetAuth';
// $apiurl = 'http://10.10.145.2:880//twWebAPI/GetAuth';
$apiurl = 'https://erp.masada.com.tw:780/twWebAPI/GetAuth';
// $apiurl = 'https://erp.masada.com.tw:780/twWebAPI/GetAuth';
$headerParam = [
"UserId: $user_id",
@ -35,14 +41,11 @@ function get_Auth($user_id = "M0000", $user_password = "M012290493119")
if ($response === false) {
echo '123Curl error: ' . curl_error($ch);
} else {
// print_r($response);
// exit;
$result = json_decode($response, true);
$validation = $result['Data']['CHI_Authorization'];
echo '<pre>';
print_r($result);
echo '</pre>';
return $validation;
if ($result['Status'] == 'Success')
return $result['Data']['CHI_Authorization'];
if ($result['Status'] == 'Error')
return $result['ErrorMsg'];
}
curl_close($ch);

BIN
wms/account-receivable-facility.xlsx

Binary file not shown.

992
wms/account-receivable-index.php

File diff suppressed because it is too large

BIN
wms/account-receivable-test.xlsx

Binary file not shown.

2
wms/board-record-submit.php

@ -53,7 +53,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'creater' => $user_id,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);

8
wms/css/function.js

@ -321,6 +321,7 @@ function login() {
var account = $('.account').val();
var password = $('.password').val();
var url = "loginapi.php";
$.ajax({
method: 'post',
url: url,
@ -332,9 +333,9 @@ function login() {
// console.log(data);
console.log('返回的结果');
res = eval("(" + data + ")");
// console.log(res);
// console.log(window.location.host);
// console.log(res.code);
console.log(res);
console.log(window.location.host);
console.log(res.code);
if (res.code == '200') {
var token = res.token;
var name = res.name;
@ -348,7 +349,6 @@ function login() {
window.location.href = 'index.php?token=' + token;
} else {
window.location.href = 'login.php?errno=1';
}

230
wms/css/view/expression-index.php

@ -0,0 +1,230 @@
<style>
#table_index2_filter,
#table_index2_paginate {
text-align: right;
}
#table_index3_filter,
#table_index3_paginate {
text-align: right;
}
#table_index4_filter,
#table_index4_paginate {
text-align: right;
}
#table_index5_filter,
#table_index5_paginate {
text-align: right;
}
#table_index6_filter,
#table_index6_paginate {
text-align: right;
}
#table_index7_filter,
#table_index7_paginate {
text-align: right;
}
table {
table-layout: fixed;
width: 100%;
margin-left: 12px;
}
td {
word-wrap: break-word;
}
img {
width: 125px;
}
.width_style_1 {
width: 125px;
}
#table_index_filter {
float: right;
}
#table_index_paginate {
float: right;
}
label {
display: inline-flex;
margin-bottom: .5rem;
margin-top: .5rem;
}
.table>tbody>tr>th {
vertical-align: middle !important;
text-align: center;
}
.table>tbody>tr>td {
vertical-align: middle !important;
text-align: center;
}
#loadingOverlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.7);
/* 透明度的背景颜色 */
z-index: 9999;
/* 确保在最上层显示 */
/* 添加加载动画的样式 */
}
.hidden {
display: none;
}
#loadingOverlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.7);
/* 半透明的背景 */
z-index: 9999;
/* 确保显示在最上层 */
display: flex;
justify-content: center;
align-items: center;
}
.loading-text {
text-align: center;
margin-top: 10px;
/* 调整文字与图标之间的间距 */
font-size: 16px;
color: #333;
/* 文字颜色 */
}
.loading-icon {
/* 这里是你加载图标的样式,可以是一个动画、GIF图或者SVG等 */
/* 例如一个简单的加载圆圈动画 */
border: 10px solid #f3f3f3;
/* 灰色边框 */
border-top: 10px solid #3498db;
/* 蓝色顶部边框 */
border-radius: 50%;
width: 80px;
height: 80px;
animation: spin 2s linear infinite;
/* 旋转动画 */
}
/* The Modal (background) */
.modal {
display: none;
/* Hidden by default */
position: fixed;
/* Stay in place */
z-index: 1;
/* Sit on top */
padding-top: 100px;
/* Location of the box */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
}
.modal .back {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.4);
/* Black w/ opacity */
}
/* Modal Content */
.modal-content {
z-index: 9;
background-color: #fefefe;
margin: auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
}
/* The Close Button */
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@media screen and (max-width: 600px) {
table {
border: 0;
}
table thead {
display: none;
}
table tr {
margin-bottom: 10px;
display: block;
border-bottom: 2px solid #ddd;
}
table td {
display: block;
text-align: right;
font-size: 14px;
border-bottom: 1px dotted #ccc;
}
table td:last-child {
border-bottom: 0;
}
table td:before {
content: attr(data-label);
float: left;
text-transform: uppercase;
font-weight: bold;
}
}
</style>

1
wms/excel-upload.php

@ -3,6 +3,7 @@
include "header.php";
require_once 'PHPExcel/PHPExcel.php';
require_once 'PHPExcel/IOFactory.php';
$file_name = $_FILES["fileToUpload"]["name"];
$temp_file_name = $_FILES["fileToUpload"]["tmp_name"];
$target_dir = "excel-uploads/";

282
wms/expression-index.php

@ -0,0 +1,282 @@
<div id="loadingOverlay" class="hidden">
<div class="loading-icon"></div>
</div>
<script>
document.getElementById('loadingOverlay').classList.remove('hidden');
</script>
<?php
include "header.php";
include "css/view/wipwhole-index.php";
// 設置一個空陣列來放資料
$data = array();
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
$contractno = isset($_REQUEST['contractno']) ? $_REQUEST['contractno'] : null;
$facilityno = isset($_REQUEST['facilityno']) ? $_REQUEST['facilityno'] : null;
// sql語法存在變數中
$sql = "
SELECT *
FROM wipwholestatus
WHERE status = '1'
";
$sql .= !empty($id) ? " AND id = '$id'" : "";
$sql .= !empty($contractno) ? " AND contractno = '$contractno'" : "";
$sql .= !empty($facilityno) ? " AND facilityno = '$facilityno'" : "";
// 用mysqli_query方法執行(sql語法)將結果存在變數中
$data = mysqli_query($link, $sql);
$data2 = $data;
function getAllCustomerPlanningVerify($link, $id)
{
$sql = "
SELECT
real_custom_name AS custom_name,
customer_planning_verify_file,
date_format(customer_planning_verify_at, '%Y-%m-%d %H:%i:%s') AS create_at
FROM wipwholestatus
WHERE id = $id
AND customer_planning_verify_file != ''
AND customer_planning_verify_file IS NOT NULL
UNION
SELECT
custom_name,
customer_planning_verify_file,
create_at
FROM wipwhole_change_planning_customer_details
WHERE wipwholestatus_id = $id
AND customer_planning_verify_file != ''
AND customer_planning_verify_file IS NOT NULL
";
return mysqli_query($link, $sql);
}
?>
<?php if ($user_auth & 2) { ?>
<!-- <p>
<a href="board-create.php?function_name=board&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-plus"></span>
</a>
</p> -->
<?php
}
if ($data) :
?>
<style>
table {
table-layout: fixed;
width: 100%;
}
td {
word-wrap: break-word;
}
img {
width: 125px;
}
.width_style_1 {
width: 125px;
}
table {
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;">
<form id='myForm' method='post' action='expression-index.php?<?= $token_link ?>'>
<table class='table query-table table-striped table-bordered display compact' style='width:98%;text-align:center;margin:0 auto'>
<thead>
<tr>
<td colspan="5">
<h3 style='text-align:center'>永佳捷 - 普萊特富 規格聯繫</h3>
</td>
</tr>
</thead>
<tbody>
<tr>
<th style='text-align:center;vertical-align: middle;'>合約號</th>
<td style='text-align:center;vertical-align: middle;'><input type="text" class='form-control' id='contractno' name='contractno' value="<?php echo $contractno; ?>"></td>
<th style='text-align:center;vertical-align: middle;'>電梯編號</th>
<td style='text-align:center;vertical-align: middle;'><input type="text" class='form-control' id='facilityno' name='facilityno' value="<?php echo $facilityno; ?>"></td>
<td style='text-align:left;vertical-align: middle;'>
<button type="submit" style='text-align:center; margin:0 auto' class="btn btn-primary btn-sm">查詢</button>
</td>
</tr>
</tbody>
</table>
</form>
</div>
<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['contractno']; ?>
</td>
<td>
<?php echo $data['facilityno']; ?>
</td>
<td>
<select class="disabled_select" name="building_heigh_verify" id="building_heigh_verify" disabled>
<option <?php if ($data["building_heigh_verify"] == "1") echo " selected"; ?> value="1">請選擇</option>
<option <?php if ($data["building_heigh_verify"] == "0") echo " selected"; ?> value="0">已完成</option>
<option <?php if ($data["building_heigh_verify"] == "1") echo " selected"; ?> value="1">進行中</option>
<option <?php if ($data["building_heigh_verify"] == "2") echo " selected"; ?> value="2">無需求</option>
</select>
<?php
echo !empty($data['building_heigh_verify_file']) ? "<a id='building_heigh_verify_file_a' style='color:#00F;' href='" . $data['building_heigh_verify_file'] . "' target='_blank'>下載附件</a>" : "";
?>
</td>
<td>
<?php
$site_survey_status = array(
"1" => "請選擇",
"0" => "已確認",
"2" => "無工勘需求",
"A" => "未動工",
"B" => "地下室施工",
"C" => "打樁",
"D" => "地基",
"E" => "挖土",
"G" => "機房",
"H" => "機械式淨高",
"M" => "樓中樓",
"OH" => "最高層(頂樓高度)",
"P" => "PIT(機坑深度)",
"R" => "R 樓",
"S" => "停工",
"T" => "TOP",
"TC" => "頂部間隙",
"TS" => "行程",
"TH" => "全高",
"Y" => "已搭、已出",
"YB" => "退購結案",
"YF" => "既有建物",
"YN" => "已搭、未出"
);
for ($i = 1; $i < 200; $i++) {
$site_survey_status[$i . "F"] = $i . "F";
}
?>
<select class="disabled_select" name="site_survey_contact_verify" id="site_survey_contact_verify" disabled>
<?php
foreach ($site_survey_status as $key => $val) {
if ($data["site_survey_contact_verify"] == $key) {
echo "<option value='$key' selected>$val</option>";
} else {
echo "<option value='$key'>$val</option>";
}
}
?>
</select>
<?php
echo !empty($data['site_survey_contact_verify_file']) ? "<a id='site_survey_contact_verify_file_a' style='color:#00F;' href='" . $data['site_survey_contact_verify_file'] . "' target='_blank'>下載附件</a>" : "";
?>
</td>
<td>
<select class="disabled_select" name="desin_spec_verify" id="desin_spec_verify" disabled>
<option <?php if ($data["desin_spec_verify"] == "1") echo " selected"; ?> value="1">請選擇</option>
<option <?php if ($data["desin_spec_verify"] == "0") echo " selected"; ?> value="0">已完成</option>
<option <?php if ($data["desin_spec_verify"] == "1") echo " selected"; ?> value="1">進行中</option>
<option <?php if ($data["desin_spec_verify"] == "2") echo " selected"; ?> value="2">無需求</option>
</select>
<?php
echo !empty($data['sales_spec_verify_file']) ? "<a id='sales_spec_verify_file_a' style='color:#00F;' href='" . $data['sales_spec_verify_file'] . "' target='_blank'>下載附件</a>" : "";
?>
</td>
<td>
<select name="desin_planning_verify" id="desin_planning_verify" disabled>
<option <?php if ($data["desin_planning_verify"] == "1") echo " selected"; ?> value="1">請選擇</option>
<option <?php if ($data["desin_planning_verify"] == "0") echo " selected"; ?> value="0">已完成</option>
<option <?php if ($data["desin_planning_verify"] == "1") echo " selected"; ?> value="1">進行中</option>
<option <?php if ($data["desin_planning_verify"] == "2") echo " selected"; ?> value="2">無需求</option>
</select>
<?php
$customer_planning_verify_files = getAllCustomerPlanningVerify($link, $data['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'>下載附件_" . $data['create_at'] . "</a><br/>";
endforeach;
?>
</td>
<td>
<select name="desin_color_verify" id="desin_color_verify" disabled>
<option <?php if ($data["desin_color_verify"] == "1") echo " selected"; ?> value="1">請選擇</option>
<option <?php if ($data["desin_color_verify"] == "0") echo " selected"; ?> value="0">已完成</option>
<option <?php if ($data["desin_color_verify"] == "1") echo " selected"; ?> value="1">進行中</option>
<option <?php if ($data["desin_color_verify"] == "2") echo " selected"; ?> value="2">無需求</option>
</select>
<?php
echo !empty($data['customer_color_verify_file']) ? "<a id='customer_color_verify_file_a' style='color:#00F;' href='" . $data['customer_color_verify_file'] . "' target='_blank'>下載附件</a>" : "";
?>
</td>
<td>
<select name="desin_style_verify" id="desin_style_verify" disabled>
<option <?php if ($data["desin_style_verify"] == "1") echo " selected"; ?> value="1">請選擇</option>
<option <?php if ($data["desin_style_verify"] == "0") echo " selected"; ?> value="0">已完成</option>
<option <?php if ($data["desin_style_verify"] == "1") echo " selected"; ?> value="1">進行中</option>
<option <?php if ($data["desin_style_verify"] == "2") echo " selected"; ?> value="2">無需求</option>
</select>
<?php
echo !empty($data['customer_style_verify_file']) ? "<a id='customer_style_verify_file_a' style='color:#00F;' href='" . $data['customer_style_verify_file'] . "' target='_blank'>下載附件</a>" : "";
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<script>
$(function() {
document.getElementById('loadingOverlay').classList.add('hidden');
})
</script>
<?php
else :
echo "<h2>There is no record!</h2>";
endif;
#代表結束連線
mysqli_close($link);
include "footer.php";
?>

195
wms/frame/pending.php

@ -3,134 +3,107 @@ $token = $_REQUEST["token"];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, viewport-fit=cover" />
<title>待我簽核</title>
<link rel="stylesheet" href="css/plugins/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="css/dist/css/adminlte.min.css">
<script src="../css/jquery.min.js"></script>
<script src="../css/bootstrap.min.js"></script>
<style>
.content-wrapper {
background-color: #fff;
}
.col-lg-6 {
padding: 8px 0 0 0 !important;
}
.card {
height: 90vh;
line-height: 14 px;
font-size: 14px;
}
.card-header {
background-color: #f4f6f9;
padding-left: 16px;
}
.card-body ol {
font-size: 14px;
margin-left: -30px;
}
.nav-pills .nav-link {
color: #446887;
}
h5 svg {
vertical-align: baseline;
}
h5 a {
color: #000;
}
@media screen and (max-width: 992px) {
.card {
height: 95vh;
}
}
</style>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, viewport-fit=cover" />
<title>待我簽核</title>
<link rel="stylesheet" href="css/plugins/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="css/dist/css/adminlte.min.css">
<script src="../css/jquery.min.js"></script>
<script src="../css/bootstrap.min.js"></script>
<style>
.content-wrapper {
background-color: #fff;
}
.col-lg-6 {
padding:8px 0 0 0!important;
}
.card {
height: 90vh;
line-height: 14 px;
font-size: 14px;
}
.card-header {
background-color: #f4f6f9;
padding-left: 16px;
}
.card-body ol {
font-size: 14px;
margin-left: -30px;
}
.nav-pills .nav-link {
color: #446887;
}
h5 svg {
vertical-align: baseline;
}
h5 a {
color: #000;
}
@media screen and (max-width: 992px){
.card {
height: 95vh;
}
}
</style>
</head>
<body>
<div class="wrapper">
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Main content -->
<div class="content">
<div class="container">
<div class="row">
<!-- /.col-md-6 -->
<div class="col-lg-6">
<div class="card">
<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-pencil-square" viewBox="0 0 16 16">
<path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z" />
<path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z" />
</svg>
<a href="/wms/sign/list.php?function_name=show&token=<?php echo $token; ?>" target="_parent">待我簽核</a>
</h5>
</div>
<div class="card-body p-0">
Loading...
</div>
</div>
<div class="container">
<div class="row">
<!-- /.col-md-6 -->
<div class="col-lg-6">
<div class="card">
<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-pencil-square" viewBox="0 0 16 16"><path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"/><path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z"/></svg>
<a href="/wms/sign/list.php?function_name=show&token=<?php echo $token; ?>" target="_parent">待我簽核</a></h5>
</div>
<div class="card-body p-0">
Loading...
</div>
<!-- /.col-md-6 -->
</div>
<!-- /.row -->
</div><!-- /.container-fluid -->
</div>
<!-- /.col-md-6 -->
</div>
<!-- /.row -->
</div><!-- /.container-fluid -->
</div>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
</div>
<script>
$(document).ready(function() {
here();
});
<script>
$(document).ready(function() {
here();
});
function here() {
var URL = 'api_getdata.php';
$.ajax({
type: "GET",
data: {
p: 'pending',
token: '<?php echo $token; ?>'
},
url: URL,
success: function(msg) {
var obj = JSON.parse(msg);
console.log(msg);
var myhtml = '';
if (obj.st == 'ok') {
myhtml += '<ul class="nav nav-pills flex-column">';
for (i = 1; i <= Object.keys(obj.content).length; i++) {
if (obj.content[i].fname == '新梯價審流程') {
myhtml += '<li class="nav-item"><a href="/wms/mkt/pricereview-index.php?system_id=' + obj.content[i].sid + '&flow_id=' + obj.content[i].fid + '&function_name=show&token=<?php echo $token; ?>" class="nav-link" target="_parent">' + obj.content[i].sname + ' > ' + obj.content[i].fname + '(' + obj.content[i].cnt + ')</a></li>';
} else if (obj.content[i].fname == '汰改價審流程') {
myhtml += '<li class="nav-item"><a href="/wms/mkt/pricereview_renovate-index.php?system_id=' + obj.content[i].sid + '&flow_id=' + obj.content[i].fid + '&function_name=show&token=<?php echo $token; ?>" class="nav-link" target="_parent">' + obj.content[i].sname + ' > ' + obj.content[i].fname + '(' + obj.content[i].cnt + ')</a></li>';
} else if (obj.content[i].fname == '契约價審流程') {
myhtml += '<li class="nav-item"><a href="/wms/cont/sign_list.php?system_id=' + obj.content[i].sid + '&flow_id=' + obj.content[i].fid + '&function_name=show&token=<?php echo $token; ?>" class="nav-link" target="_parent">' + obj.content[i].sname + ' > ' + obj.content[i].fname + '(' + obj.content[i].cnt + ')</a></li>';
} else {
myhtml += '<li class="nav-item"><a href="/wms/sign/list.php?system_id=' + obj.content[i].sid + '&flow_id=' + obj.content[i].fid + '&function_name=show&token=<?php echo $token; ?>" class="nav-link" target="_parent">' + obj.content[i].sname + ' > ' + obj.content[i].fname + '(' + obj.content[i].cnt + ')</a></li>';
}
}
if (Object.keys(obj.content).length == 6) {
myhtml += '<li class="nav-item"><a href="/wms/sign/list.php?function_name=show&token=<?php echo $token; ?>" class="nav-link" target="_parent">.... 顯示更多</a></li>';
}
myhtml += '</ul>';
$('.card-body').empty().append(myhtml);
}
function here() {
var URL = 'api_getdata.php';
$.ajax({
type: "GET",
data: {p: 'pending', token: '<?php echo $token; ?>'},
url: URL,
success: function (msg) {
var obj = JSON.parse(msg);
var myhtml = '';
if (obj.st == 'ok') {
myhtml += '<ul class="nav nav-pills flex-column">';
for (i=1; i<=Object.keys(obj.content).length; i++) {
myhtml += '<li class="nav-item"><a href="/wms/sign/list.php?system_id='+obj.content[i].sid+'&flow_id='+obj.content[i].fid+'&function_name=show&token=<?php echo $token; ?>" class="nav-link" target="_parent">'+obj.content[i].sname+' > '+obj.content[i].fname+'('+obj.content[i].cnt+')</a></li>';
}
})
if (Object.keys(obj.content).length == 6) {
myhtml += '<li class="nav-item"><a href="/wms/sign/list.php?function_name=show&token=<?php echo $token; ?>" class="nav-link" target="_parent">.... 顯示更多</a></li>';
}
myhtml += '</ul>';
$('.card-body').empty().append(myhtml);
}
}
</script>
})
}
</script>
</body>
</html>

6
wms/gary.php

@ -1,4 +1,10 @@
<?php
$encodedString = urlencode("expression-index.php?function_name=expression&id=83");
?>
<a href='/wms/login.php?redirect=<?php echo $encodedString;?>' target='_blank'>永佳捷外事系統</a>
<?php
exit;
// 接收 referer 參數
if (isset($_GET['referer'])) {
$referer = urldecode($_GET['referer']);

21
wms/header.php

@ -33,15 +33,16 @@ if (isset($_REQUEST["function_name"])) {
/**
* 連線T8 MSSQL
*/
// try {
// $conn = new PDO("sqlsrv:Server=220.130.203.251;Database=T8MASADA", "M0225", "IFFBU1E=");
// if ($conn) {
// $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// }
// } catch (PDOException $e) {
// //echo "fail";
// //echo $e->getMessage();
// }
try {
// $conn = new PDO("sqlsrv:Server=220.130.203.251;Database=T8MASADA", "masada", "@m222222");
// $conn = new PDO("sqlsrv:Server=10.10.145.2;Database=T8MASADA", "masada", "@m222222");
// if ($conn) {
// $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// }
} catch (PDOException $e) {
//echo "fail";
//echo $e->getMessage();
}
@ -210,7 +211,7 @@ $user_auth = check_user_permission($user_id, $token);
<script src="<?php dirname(__DIR__); ?>/wms/css/bootstrap.min.js"></script>
<script src="<?php dirname(__DIR__); ?>/wms/css/jquery.dataTables.min.js"></script>
<script src="<?php dirname(__DIR__); ?>/wms/css/dataTables.bootstrap4.min.js"></script>
<script src="<?php dirname(__DIR__); ?>/wms/css/function.js"></script>
<script src="<?php dirname(__DIR__); ?>/wms/css/function.js?clean=<?php echo date("YmdHis");?>"></script>
<script>
$(document).ready(function() {
if ($('#table_index').length !== 0) $('#table_index').DataTable();

2
wms/login.php

@ -24,7 +24,7 @@
<!-- <link rel="manifest" href="__manifest.json">-->
<script src="css/jquery.min.js"></script>
<script src="css/function.js"></script>
<script src="css/function.js?clean=<?php echo date("YmdHis");?>"></script>
</head>
<!-- * 主頁header -->

2
wms/loginapi.php

@ -10,6 +10,7 @@ include 'IncludeCommon.php';
if (!empty($_REQUEST["account"]) && !empty($_REQUEST["password"])) {
$account = $_REQUEST["account"];
$password = $_REQUEST["password"];
$redirect = empty($_REQUEST["redirect"]) ? "" : $_REQUEST["redirect"];
$includecommon = new IncludeCommon();
$data = array(); # 设置一个空阵列来放资料is
$sql = "SELECT * FROM account where ((accountid = '$account') and (pwd = '$password'))"; # sql语法存在变数中
@ -60,6 +61,7 @@ if (!empty($_REQUEST["account"]) && !empty($_REQUEST["password"])) {
$jsonres['login'] = date("Y-m-d H:i:s"); // 登入時間
$jsonres['uid'] = $account;
$jsonres['menu'] = $response_menu;
$jsonres['redirect'] = $redirect;
echo json_encode($jsonres);
} else {
$jsonres['code'] = '1';

40
wms/mkt/assets/js/alpine.js

@ -199,7 +199,6 @@ const pricereviewOptionSelect = () => {
init() {
this.optionCategory = 0
this.initButtons();
console.log(this.options)
},
options: options,
orioptions: options,
@ -253,20 +252,22 @@ const pricereviewOptionSelect = () => {
},
optionSubCategory: 1,
changeCategory(category, subcategory = 0) {
// console.log(this.$refs.selectModalBody);
this.initButtons(category)
this.kind = (category == 'sub') ? this.kind : category;
if (subcategory != 0) {
this.subkind = subcategory
} else {
this.subkind = 0
}
if (category == 0) {
this.kind = 0;
this.subkind = 0;
}
this.initButtons(category)
this.searchtext = ""
this.reloadOptions();
},
reloadOptions() {
if (this.kind == 0) {
@ -274,23 +275,40 @@ const pricereviewOptionSelect = () => {
return;
}
if (this.subkind == 0) {
this.options = this.orioptions.filter(option => option.kind == this.kind)
this.options.forEach(option =>{
if (option.kind == this.kind) {
option.status = "Y"
}else{
option.status = "H"
}
})
return;
}
this.options = this.orioptions.filter(option => option.kind == this.kind && option.subkind == this.subkind)
this.options.forEach(option => {
if(option.kind == this.kind && option.subkind == this.subkind){
option.status = "Y"
}else{
option.status = "H"
}
})
},
searchOptions(e) {
e = null;
this.options = this.orioptions
this.reloadOptions();
let val = e.target.value.toLowerCase()
this.options = (this.options).filter(option=>{
let val = (e== null) ? this.searchtext.toLowerCase() : e.target.value.toLowerCase()
this.options.forEach(option=>{
if(option.group_name == null) option.group_name = ''
if(option.spec == null) option.spec = ''
if(option.memo == null) option.memo = ''
if(option.price == null) option.price = 0
if(option.unit == null) option.unit = ''
return option.group_name.includes(val) || option.memo.toLowerCase().includes(val) || option.spec.toLowerCase().includes(val) || option.unit.includes(val) || String(option.price).includes(val)
if(option.group_name.includes(val) || option.memo.toLowerCase().includes(val) || option.spec.toLowerCase().includes(val) || option.unit.includes(val) || String(option.price).includes(val)){
option.status = "Y"
}else{
option.status = "N"
}
})
}
},
}
}

6
wms/mkt/price_normal-index.php

@ -39,6 +39,7 @@ include "../header.php";
</ul>
<div class="tab-content clearfix">
<div class="tab-pane active" id="1a">
<a href="./files/MAE100小機房.docx" download class="btn btn-success" style="margin:16px 0 ">下載電子檔(小機房)</a>
<table border=0 cellpadding=0 cellspacing=0 width=1012 style='border-collapse:
collapse;table-layout:fixed;width:760pt'>
<col class=xl71 width=285 style='mso-width-source:userset;mso-width-alt:9130;
@ -215,6 +216,7 @@ include "../header.php";
</table>
</div>
<div class="tab-pane" id="2a">
<a href="./files/MAM200.docx" download class="btn btn-success" style="margin:16px 0 ">下載電子檔(無機房)</a>
<table border=0 cellpadding=0 cellspacing=0 width=1021 style='border-collapse:
collapse;table-layout:fixed;width:767pt'>
<col width=285 style='mso-width-source:userset;mso-width-alt:9130;width:214pt'>
@ -369,6 +371,7 @@ include "../header.php";
</table>
</div>
<div class="tab-pane" id="3a">
<a href="./files/MAH100.docx" download class="btn btn-success" style="margin:16px 0 ">下載電子檔(小電梯)</a>
<table border=0 cellpadding=0 cellspacing=0 width=854 style='border-collapse:
collapse;table-layout:fixed;width:641pt'>
<col class=xl65 width=261 style='mso-width-source:userset;mso-width-alt:8362;
@ -433,6 +436,7 @@ include "../header.php";
</table>
</div>
<div class="tab-pane" id="4a">
<a href="./files/MAE100.docx" download class="btn btn-success" style="margin:16px 0 ">下載電子檔(高速梯)</a>
<table border=0 cellpadding=0 cellspacing=0 width=783 style='border-collapse:
collapse;table-layout:fixed;width:588pt'>
<tr height=51 style='mso-height-source:userset;height:38.0pt'>
@ -532,6 +536,7 @@ include "../header.php";
</table>
</div>
<div class="tab-pane" id="5a">
<a href="./files/MAF100.docx" download class="btn btn-success" style="margin:16px 0 ">下載電子檔(小機房貨梯)</a>
<table border=0 cellpadding=0 cellspacing=0 width=783 style='border-collapse:
collapse;table-layout:fixed;width:588pt'>
<tr height=51 style='mso-height-source:userset;height:38.0pt'>
@ -653,6 +658,7 @@ include "../header.php";
</table>
</div>
<div class="tab-pane" id="6a">
<a href="./files/MAP100.docx" download class="btn btn-success" style="margin:16px 0 ">下載電子檔(平台梯)</a>
<table border=0 cellpadding=0 cellspacing=0 width=1052>
<tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl123 width=261 style='height:38.0pt;width:196pt'></td>

20
wms/mkt/pricereview-check.php

@ -325,12 +325,9 @@ foreach ($res as $data) {
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
data = JSON.parse(this.responseText);
console.log('123');
console.log(data);
//console.log(data);return false;
if (data.st == 'err') {
console.log('123');
//alert(data.err);
return false;
}
@ -346,8 +343,6 @@ foreach ($res as $data) {
let a = data.content[k][0] + data.content[k][19][1];
$("#tb1").find("input[name=mi_fix]").eq(k).val(commafy(a));
}
console.log('123');
let a = data.content[k][0] + data.content[k][19][1];
$("#tb1").find("input[name=mi_fix]").eq(k).val(commafy(a));
var mihtml = "";
@ -368,7 +363,7 @@ foreach ($res as $data) {
console.log(data.content[k][12]);
Object.keys(data.content[k][14]).forEach(function(m) {
if (data.content[k][14][m][0] != '') {
mihtml += "<li>" + data.content[k][14][m][0] + ":" + commafy(data.content[k][14][m][1]) + "</li>";
mihtml += "<li>" + data.content[k][14][m][0].replace("&lt;br&gt;", "").replace("&amp;", "").replace("amp;", "").replace("()", "").replace(/\s+/g, '') + ":" + commafy(data.content[k][14][m][1]) + "</li>";
}
});
Object.keys(data.content[k][16]).forEach(function(m) {
@ -382,9 +377,16 @@ foreach ($res as $data) {
mihtml += "<li>" + data.content[k][19][0] + ":" + commafy(data.content[k][19][1]) + "</li>";
mihtml += "以上合計:" + commafy(data.content[k][13]) +
"<br>";
total_mi += data.content[k][13];
if(total_mi == ""){
console.log("undefided!!!");
}
$("#tb1").find("tr[name=facil_templ2]").eq(k).find('td').eq(1).html(mihtml);
//$("#tb1").find("input[name=mi_fix]").eq(k).closest('td').append(mihtml);
document.getElementsByClassName('total_mi_fix')[k].value = commafy(total_mi)
// document.getElementsByClassName('item_price_ct')[k].value =commafy(total_mi)
document.getElementsByClassName('gross_profit')[k].value = commafy(Number(document.getElementsByClassName('item_price_ct')[k].value.replace(/[,]+/g, "")) - total_mi)
document.getElementsByClassName('gross_profit_rate')[k].value = Math.round((Number(document.getElementsByClassName('gross_profit')[k].value.replace(/[,]+/g, "")) / Number(document.getElementsByClassName('item_price_ct')[k].value.replace(/[,]+/g, "")) * 100) * 10) / 10
@ -587,8 +589,8 @@ foreach ($res as $data) {
<td><input type="text" name="item_unit_price" class="form-control dollar-right" size="8" value="<?= number_format($val["item_unit_price"]); ?>"></td>
<td><input type="text" name="item_qty" class="form-control" size="2" value="1"></td>
<td><input type="text" name="item_price_bp" class="form-control dollar-right" size="9" value="<?= number_format($val["item_unit_price"]); ?>"></td>
<td><input type="text" name="mi_fix" class="form-control dollar-right" size="9" value="<?php echo ($val["mi_fix"]) ? number_format($val["mi_fix"]) : ""; ?>" disabled></td>
<td><input type="text" name="item_price_ct" class="form-control dollar-right" size="9" value="<?= number_format($val["item_price_ct"] / $val["item_qty"]); ?>"></td>
<td><input type="text" name="mi_fix" class="form-control dollar-right total_mi_fix" size="9" value="<?php echo ($val["mi_fix"]) ? number_format($val["mi_fix"]) : ""; ?>" disabled></td>
<td><input type="text" name="item_price_ct" class="form-control dollar-right item_price_ct" size="9" value="<?= number_format($val["item_price_ct"] / $val["item_qty"]); ?>"></td>
<!--<td><input type="text" name="item_price" class="form-control dollar-right" size="8" value="<?php echo ($val["item_price"]) ? number_format($val["item_price"]) : ""; ?>"></td>
<td><input type="text" name="pv_rate" class="form-control" size="1" value="<?= $val["pv_rate"]; ?>"></td>
<td><input type="text" name="allocate" class="form-control" size="6" value="<?= $val["allocate"]; ?>"></td>-->

38
wms/mkt/pricereview-create.php

@ -146,7 +146,7 @@ if ($last_pr_arr) {
// Option Data
$opt_data_arr = [];
$opt_kind_arr = ["A" => "小電梯型錄選配加價報價", "B" => "客梯型錄選配加價報價", "C" => "550-1600kg選配業務報價", "D" => "其它"];
$sql = "select * from option_price where status = 'Y' order by kind, id";
$sql = "select * from option_price where status = 'Y' order by id";
$res = mysqli_query($link, $sql);
while ($row = mysqli_fetch_assoc($res)) {
$opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["spec"] = $row["spec"];
@ -753,18 +753,12 @@ $option_str .= "</tbody></table>";
$("#optionModal").modal('show');
var jobj = $(this); // 父視窗
$("#optionModal .modal-body td").unbind().click(function() {
$("#optionModal .modal-body td").unbind().click(function(){
var pobj = $(this).closest('td').parent();
// console.log(pobj.find('input[name=optionID]').val());
// console.log(jobj.html(pobj.find('td').eq(0).html() + ' ' + pobj.find('td').eq(1).html()));
console.log(pobj.find('td').eq(0).html());
jobj.html(pobj.find('td').eq(1).html() + " " + pobj.find('td').eq(2).html() + '<br />(' + pobj.find('td').eq(3).html() + ')');
jobj.closest('td').parent().find('input[name=option_unit_price]').val(pobj.find('td').eq(6).html());
jobj.closest('td').parent().find('input[name=option_price_bp]').val(commafy(pobj.find('td').eq(6).html().replace(/[,]+/g, "") * jobj.closest('td').parent().find('input[name=option_qty]').val().replace(/[,]+/g, "")));
jobj.closest('td').parent().find('input[name=op_id]').val(pobj.find('td').eq(0).html());
$("#optionModal").modal('hide');
selectOptionFn(pobj, jobj)
});
$('#tb2').unbind('focus', 'tr[name=option_templ] a[name=option_href]');
});
$("#optionFaciModal").on("hidden.bs.modal", function() {
$("#optionFaciModal .modal-body").html('');
@ -876,7 +870,7 @@ $option_str .= "</tbody></table>";
});
$("input[name=pay_scale]").keyup(function() {
$(this).closest('td').next('td').find('input[name=pay_amount]').val(commafy(($("#price_total").val().replace(/[,]+/g, "") / 100 * $(this).val()).toFixed(0)));
$(this).closest('td').next('td').find('input[nam e=pay_amount]').val(commafy(($("#price_total").val().replace(/[,]+/g, "") / 100 * $(this).val()).toFixed(0)));
var payAllScale = 0;
var payAllAmt = 0;
$("input[name=pay_scale]").each(function() {
@ -1281,9 +1275,9 @@ $options = $stmt->fetchAll(PDO::FETCH_ASSOC);
<th scope="col" nowrap>定價</th>
</tr>
</thead>
<tbody>
<template x-for="option in options">
<tr style="cursor:pointer">
<tbody id="selectModalBody" x-ref="selectModalBody">
<template x-for="option in options" :key="option.id">
<tr style="cursor:pointer" x-show="option.status == 'Y'">
<td x-text='option.id' name="optionID"></td>
<td x-text="option.group_name"> </td>
<td x-text="option.spec"></td>
@ -2534,4 +2528,18 @@ include "../footer.php";
<script>
const options = [...<?php echo json_encode($options); ?>];
function selectOptionFn(pobj, jobj){
// var pobj = $(this).closest('td').parent();
console.log(pobj);
// console.log(pobj.find('input[name=optionID]').val());
// console.log(jobj.html(pobj.find('td').eq(0).html() + ' ' + pobj.find('td').eq(1).html()));
console.log(pobj.find('td').eq(0).html());
jobj.html(pobj.find('td').eq(1).html() + " " + pobj.find('td').eq(2).html() + '<br />(' + pobj.find('td').eq(3).html() + ')');
jobj.closest('td').parent().find('input[name=option_unit_price]').val(pobj.find('td').eq(6).html());
jobj.closest('td').parent().find('input[name=option_price_bp]').val(commafy(pobj.find('td').eq(6).html().replace(/[,]+/g, "") * jobj.closest('td').parent().find('input[name=option_qty]').val().replace(/[,]+/g, "")));
jobj.closest('td').parent().find('input[name=op_id]').val(pobj.find('td').eq(0).html());
$("#optionModal").modal('hide');
}
</script>

1
wms/mkt/pricereview_facility-api.php

@ -27,7 +27,6 @@ try {
foreach ($_POST as $k => $v) {
$$k = htmlspecialchars(stripslashes(trim($v)));
}
echo $fval;
list($source, $kind, $seat, $numberofstop, $speed, $op) = explode(",", $fval);
if (!$source || !$kind || !$seat) throw new \Exception("parameter empty[2]");

8
wms/mkt/pricereview_mi-api.php

@ -229,6 +229,7 @@ try {
$stmt->bindParam(':quotation_no', $quotation_no);
$stmt->execute();
$row_e = $stmt->fetch(PDO::FETCH_ASSOC);
// $sql2 = "select o.*, r.* from elevator_mi_option o, elevator_quotation_rule r ";
// $sql2 .= "where o.quotation_no = r.quotation_no and o.elevator_type = '" . $v['etype'] . "' ";
// $sql2 .= "and ($v[item_weight] between o.min_weight and o.max_weight) ";
@ -240,9 +241,12 @@ try {
// // echo $sql2;
// $res_e = mysqli_query($link, $sql2);
//$row_e = mysqli_fetch_assoc($res_e)
if ($row_e || true) {
if ($row_e) {
// 加價:先不納入
$row_e["option_price"] = 0;
if(!isset($row_e["purchase_cost"])){
}
// 基准采购成本+±1停材料费+设计费+出口费用
$part1 = $row_e["purchase_cost"] + ($v["floors"] - $row_e["base_floor"]) * $row_e["material_plus"] + $row_e["design"] * $row_e["design_hour"] + $row_e["export_fee"];
// 利潤
@ -424,6 +428,8 @@ try {
$mi_arr[$i][19] = $specarr;
$i++;
}
}else{
$rarr['err'] = "notfoundmi";
}
// mysqli_free_result($res_e);
}

3
wms/notice-delete.php

@ -6,6 +6,7 @@ $id = isset($_GET['id']) ? $_GET['id'] : die('ERROR: Record ID not found.');
$db_query = "update notice set haveread = 1 where id = '$id'";
$res = mysqli_query($link, $db_query);
header("Refresh:0; url=notice-index.php?function_name=notice&".$token_link);
// header("Refresh:0; url=notice-index.php?function_name=notice&".$token_link);
header("Refresh:0; url=index.php?".$token_link);
ob_end_flush();
?>

17
wms/notice-edit.php

@ -7,12 +7,12 @@ $db_query = "select * from notice where id = '$id'";
$data = mysqli_query($link, $db_query);
// 進入等於已讀
$sql = "
UPDATE notice SET
haveread = 1
WHERE id = '$id'
";
mysqli_query($link, $sql);
// $sql = "
// UPDATE notice SET
// haveread = 1
// WHERE id = '$id'
// ";
// mysqli_query($link, $sql);
foreach ($data as $data) :
?>
@ -46,7 +46,10 @@ foreach ($data as $data) :
<div class="nextline"></div>
<div>
<br>
<button type="button" name="btn" id="btn">回上頁</button>
<a class="btn btn-info " type="button" name="btn" id="btn">回上頁</a>
<a href="notice-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-info " onClick="return confirm('確認關閉通知嗎?')">
已讀
</a>
</div>
<input type="hidden" name="id" value="<?php echo $id; ?>">
</form>

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

@ -63,6 +63,8 @@ $building_heigh_verify_file = fileIUpload("building_heigh_verify_file");
$site_survey_contact_verify_file = fileIUpload("site_survey_contact_verify_file");
$plan_diagram_file = fileIUpload("plan_diagram_file");
$completion_acceptance_file = fileIUpload("completion_acceptance_file");
$delivery_date_file = fileIUpload("delivery_date_file");
// 生管
$shengguanok_status_file = fileIUpload("shengguanok_status_file");
// 工務助理

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

@ -1,10 +1,11 @@
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
include("class/Cnotice.php");
$cn = new Cnotice();
if ($_POST['form_name'] == 'main_form') {
include "class/Cnotice.php";
include "./class/Cmail.php";
$cmail = new Cmail();
$cn = new Cnotice();
foreach ($_POST as $k => $v) {
if ($k !== 'desin_taiwan_items_no' && $k !== 'desin_taiwan_items_name')
$$k = htmlspecialchars(stripslashes(trim($v)));
@ -128,10 +129,20 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$estimate_tryrun_end_date = $_POST['estimate_tryrun_end_date'];
$estimate_tryrun_end_date_owner = $_POST['estimate_tryrun_end_date_owner'];
$warehouse_assistant_remark = $_POST['warehouse_assistant_remark'];
$warehouseid = $_POST['warehouseid'] ?: $row['warehouseid'];
$old_warehouseid = $_POST['old_warehouseid'] ?: $row['warehouseid'];
$salesid = $_POST['salesid'] ?: $row['salesid'];
$install_start_date = $_POST['install_start_date'];
$install_start_date_owner = $_POST['install_start_date_owner'];
$install_end_date = $_POST['install_end_date'];
$install_end_date_owner = $_POST['install_end_date_owner'];
$tryrun_start_date = $_POST['tryrun_start_date'];
$tryrun_start_date_owner = $_POST['tryrun_start_date_owner'];
$tryrun_end_date = $_POST['tryrun_end_date'];
$tryrun_end_date_owner = $_POST['tryrun_end_date_owner'];
$salesname = accountid2name($salesid)[$salesid];
$salesmail = accountid2email([$salesid])[$salesid];
// $creater = $_POST['creater'];
$creater = $user_id;
$create_at = date("Y-m-d H:i:s");
@ -287,57 +298,64 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$cn->sendx($data);
}
}
if (!empty($delivery_date)) {
if ($delivery_date !== $old_delivery_date) {
$permission = "M0168";
$title = "移交日變更 客戶:$custom 作番:$facilityno";
$content = "客戶:$custom
$permission_arr = ['M0168', 'M0012'];
foreach ($permission_arr as $permission) {
$title = "移交日變更 客戶:$custom 作番:$facilityno";
$content = "客戶:$custom
作番:$facilityno
移交日 $old_delivery_date => $delivery_date";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
}
if (!empty($delivery_date)) {
if ($old_delivery_date !== $delivery_date) {
if (empty($change_all_contractno)) {
$mail_title = "作番大日程(新梯)合約號:" . $contractno . "-移交日變更通知";
$mail_content = "作番大日程(新梯)
合約號:" . $contractno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
} else {
$mail_title = "作番大日程(新梯)合約號:" . $contractno . "作番號:" . $facilityno . "-移交日變更通知";
$mail_content = "作番大日程(新梯)
合約號:" . $contractno
. "
作番號:" . $facilityno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
}
$cmail->sendx(
$mail_title,
$mail_content,
[
[$salesname, $salesmail]
// ['gary', 'gary_chen@masada.com.tw']
],
"永佳捷科技"
);
}
}
$updatesql = "
UPDATE wipwholestatus
SET
";
if (
in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188', 'M0117', 'M0054'])
|| in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545])
) {
// 工務助理 工務更新
$updatesql .= "
building_heigh_verify = '$building_heigh_verify',
building_heigh_verify_at = '$building_heigh_verify_at',
building_heigh_verify_owner = '$building_heigh_verify_owner',
site_survey_contact_verify = '$site_survey_contact_verify',
site_survey_contact_verify_at = '$site_survey_contact_verify_at',
site_survey_contact_verify_owner = '$site_survey_contact_verify_owner',
warehouse_remark = '',
";
if (!empty(trim($warehouse_remark))) {
$updatesql .= "
all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "<br/>" . $warehouse_remark . "<br/><br/>',IF(all_remark IS NULL,'',all_remark)),
";
}
if (!empty($building_heigh_verify_file))
$updatesql .= "building_heigh_verify_file = '$building_heigh_verify_file', ";
if (!empty($site_survey_contact_verify_file))
$updatesql .= "site_survey_contact_verify_file = '$site_survey_contact_verify_file', ";
}
if (in_array($user_department_id, [311, 312, 313, 314, 315])) {
// 營業更新;
$updatesql .= "
@ -523,45 +541,26 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|| in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545])
) {
// $outsourcer_type = $_POST['outsourcer_type'];
// $qc_official_type = $_POST['qc_official_type2'] ?: $row['qc_official_type'];
// $qc_date = $_POST['qc_date2'] ?: $row['qc_date'];
// $qc_date_owner = $_POST['qc_date2_owner'] ?: $row['qc_date_owner'];
// $end_qc_date = $_POST['end_qc_date2'] ?: $row['end_qc_date'];
// $end_qc_date_owner = $_POST['end_qc_date2_owner'] ?: $row['end_qc_date_owner'];
// $official_check_date = $_POST['official_check_date2'] ?: $row['official_check_date'];
// $old_official_check_date = $_POST['old_official_check_date2'] ?: $row['old_official_check_date'];
// $official_check_date_owner = $_POST['official_check_date2_owner'] ?: $row['official_check_date_owner'];
// $delivery_date = $_POST['delivery_date2'] ?: $row['delivery_date'];
// $delivery_date_owner = $_POST['delivery_date2_owner'] ?: $row['delivery_date_owner'];
// $install_start_date = $_POST['install_start_date2'] ?: $row['install_start_date'];
// $install_start_date_owner = $_POST['install_start_date2_owner'] ?: $row['install_start_date_owner'];
// $install_end_date = $_POST['install_end_date2'] ?: $row['install_end_date'];
// $install_end_date_owner = $_POST['install_end_date2_owner'] ?: $row['install_end_date_owner'];
// $tryrun_start_date = $_POST['tryrun_start_date2'] ?: $row['tryrun_start_date'];
// $tryrun_start_date_owner = $_POST['tryrun_start_date2_owner'] ?: $row['tryrun_start_date_owner'];
// $tryrun_end_date = $_POST['tryrun_end_date2'] ?: $row['tryrun_end_date'];
// $tryrun_end_date_owner = $_POST['tryrun_end_date2_owner'] ?: $row['tryrun_end_date_owner'];
$outsourcer_type = isset($_POST['outsourcer_type']) ? $_POST['outsourcer_type'] : $row['outsourcer_type'];
$qc_official_type = isset($_POST['qc_official_type2']) ? $_POST['qc_official_type2'] : $row['qc_official_type'];
$qc_date = isset($_POST['qc_date2']) ? $_POST['qc_date2'] : $row['qc_date'];
$qc_date_owner = isset($_POST['qc_date2_owner']) ? $_POST['qc_date2_owner'] : $row['qc_date_owner'];
$outsourcer_type = isset($_POST['outsourcer_type']) ? $_POST['outsourcer_type'] : $outsourcer_type;
$qc_official_type = isset($_POST['qc_official_type2']) ? $_POST['qc_official_type2'] : $qc_official_type;
$qc_date = isset($_POST['qc_date2']) ? $_POST['qc_date2'] : $qc_date;
$qc_date_owner = isset($_POST['qc_date2_owner']) ? $_POST['qc_date2_owner'] : $qc_date_owner;
$end_qc_date = isset($_POST['end_qc_date2']) ? $_POST['end_qc_date2'] : $row['end_qc_date'];
$end_qc_date_owner = isset($_POST['end_qc_date2_owner']) ? $_POST['end_qc_date2_owner'] : $row['end_qc_date_owner'];
$official_check_date = isset($_POST['official_check_date2']) ? $_POST['official_check_date2'] : $row['official_check_date'];
$old_official_check_date = isset($_POST['old_official_check_date2']) ? $_POST['old_official_check_date2'] : $row['old_official_check_date'];
$official_check_date_owner = isset($_POST['official_check_date2_owner']) ? $_POST['official_check_date2_owner'] : $row['official_check_date_owner'];
$delivery_date = isset($_POST['delivery_date2']) ? $_POST['delivery_date2'] : $row['delivery_date'];
$delivery_date_owner = isset($_POST['delivery_date2_owner']) ? $_POST['delivery_date2_owner'] : $row['delivery_date_owner'];
$install_start_date = isset($_POST['install_start_date2']) ? $_POST['install_start_date2'] : $row['install_start_date'];
$install_start_date_owner = isset($_POST['install_start_date2_owner']) ? $_POST['install_start_date2_owner'] : $row['install_start_date_owner'];
$install_end_date = isset($_POST['install_end_date2']) ? $_POST['install_end_date2'] : $row['install_end_date'];
$install_end_date_owner = isset($_POST['install_end_date2_owner']) ? $_POST['install_end_date2_owner'] : $row['install_end_date_owner'];
$tryrun_start_date = isset($_POST['tryrun_start_date2']) ? $_POST['tryrun_start_date2'] : $row['tryrun_start_date'];
$tryrun_start_date_owner = isset($_POST['tryrun_start_date2_owner']) ? $_POST['tryrun_start_date2_owner'] : $row['tryrun_start_date_owner'];
$tryrun_end_date = isset($_POST['tryrun_end_date2']) ? $_POST['tryrun_end_date2'] : $row['tryrun_end_date'];
$tryrun_end_date_owner = isset($_POST['tryrun_end_date2_owner']) ? $_POST['tryrun_end_date2_owner'] : $row['tryrun_end_date_owner'];
$end_qc_date_owner = isset($_POST['end_qc_date2_owner']) ? $_POST['end_qc_date2_owner'] : $end_qc_date_owner;
$official_check_date = isset($_POST['official_check_date2']) ? $_POST['official_check_date2'] : $official_check_date;
$old_official_check_date = isset($_POST['old_official_check_date2']) ? $_POST['old_official_check_date2'] : $old_official_check_date;
$official_check_date_owner = isset($_POST['official_check_date2_owner']) ? $_POST['official_check_date2_owner'] : $official_check_date_owner;
$delivery_date = isset($_POST['delivery_date2']) ? $_POST['delivery_date2'] : $delivery_date;
$delivery_date_owner = isset($_POST['delivery_date2_owner']) ? $_POST['delivery_date2_owner'] : $delivery_date_owner;
$install_start_date = isset($_POST['install_start_date2']) ? $_POST['install_start_date2'] : $install_start_date;
$install_start_date_owner = isset($_POST['install_start_date2_owner']) ? $_POST['install_start_date2_owner'] : $install_start_date_owner;
$install_end_date = isset($_POST['install_end_date2']) ? $_POST['install_end_date2'] : $install_end_date;
$install_end_date_owner = isset($_POST['install_end_date2_owner']) ? $_POST['install_end_date2_owner'] : $install_end_date_owner;
$tryrun_start_date = isset($_POST['tryrun_start_date2']) ? $_POST['tryrun_start_date2'] : $tryrun_start_date;
$tryrun_start_date_owner = isset($_POST['tryrun_start_date2_owner']) ? $_POST['tryrun_start_date2_owner'] : $tryrun_start_date_owner;
$tryrun_end_date = isset($_POST['tryrun_end_date2']) ? $_POST['tryrun_end_date2'] : $tryrun_end_date;
$tryrun_end_date_owner = isset($_POST['tryrun_end_date2_owner']) ? $_POST['tryrun_end_date2_owner'] : $tryrun_end_date_owner;
$updatesql .= "
@ -600,8 +599,24 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
estimate_tryrun_end_date = '$estimate_tryrun_end_date',
estimate_tryrun_end_date_owner = '$estimate_tryrun_end_date_owner',
warehouse_assistant_remark = '$warehouse_assistant_remark',
building_heigh_verify = '$building_heigh_verify',
building_heigh_verify_at = '$building_heigh_verify_at',
building_heigh_verify_owner = '$building_heigh_verify_owner',
site_survey_contact_verify = '$site_survey_contact_verify',
site_survey_contact_verify_at = '$site_survey_contact_verify_at',
site_survey_contact_verify_owner = '$site_survey_contact_verify_owner',
warehouse_remark = '',
install_start_date = '$install_start_date',
install_start_date_owner = '$install_start_date_owner',
install_end_date = '$install_end_date',
install_end_date_owner = '$install_end_date_owner',
tryrun_start_date = '$tryrun_start_date',
tryrun_start_date_owner = '$tryrun_start_date_owner',
tryrun_end_date = '$tryrun_end_date',
tryrun_end_date_owner = '$tryrun_end_date_owner',
delivery_date = '$delivery_date',
delivery_date_owner = '$delivery_date_owner',
";
if (!empty($plan_diagram_file)) {
$updatesql .= "plan_diagram_file = '$plan_diagram_file', ";
$updatesql .= "
@ -617,6 +632,17 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!empty($outsourcer_contract_file)) {
echo $updatesql .= "outsourcer_contract_file = '$outsourcer_contract_file', ";
}
if (!empty(trim($warehouse_remark))) {
$updatesql .= "
all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "<br/>" . $warehouse_remark . "<br/><br/>',IF(all_remark IS NULL,'',all_remark)),
";
}
if (!empty($building_heigh_verify_file))
$updatesql .= "building_heigh_verify_file = '$building_heigh_verify_file', ";
if (!empty($site_survey_contact_verify_file))
$updatesql .= "site_survey_contact_verify_file = '$site_survey_contact_verify_file', ";
if (!empty($delivery_date_file))
$updatesql .= "delivery_date_file = '$delivery_date_file', ";
}
// 許協更新業務確認項目權限
@ -871,89 +897,89 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
}
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($_POST['form_name'] == 'update_install_date_form') {
include "./class/Cmail.php";
$cmail = new Cmail();
foreach ($_POST as $k => $v)
$$k = htmlspecialchars(stripslashes(trim($v)));
$change_all_contractno = $_POST['change_all_contractno'];
$contractno2 = $_POST['contractno2'];
$install_start_date = $_POST['install_start_date'];
$install_start_date_owner = $_POST['install_start_date_owner'];
$install_end_date = $_POST['install_end_date'];
$install_end_date_owner = $_POST['install_end_date_owner'];
$tryrun_start_date = $_POST['tryrun_start_date'];
$tryrun_start_date_owner = $_POST['tryrun_start_date_owner'];
$tryrun_end_date = $_POST['tryrun_end_date'];
$tryrun_end_date_owner = $_POST['tryrun_end_date_owner'];
$old_delivery_date = $_POST['old_delivery_date'];
$delivery_date = $_POST['delivery_date'];
$delivery_date_owner = $_POST['delivery_date_owner'];
$contractno = $_POST['contractno'];
$facilityno = $_POST['facilityno'];
$salesid = $_POST['salesid'];
$salesname = accountid2name($salesid)[$salesid];
$salesmail = accountid2email([$salesid])[$salesid];
if ($old_delivery_date !== $delivery_date) {
if (empty($change_all_contractno)) {
$mail_title = "作番大日程(新梯)合約號:" . $contractno . "-移交日變更通知";
$mail_content = "作番大日程(新梯)
合約號:" . $contractno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
} else {
$mail_title = "作番大日程(新梯)合約號:" . $contractno . "作番號:" . $facilityno . "-移交日變更通知";
$mail_content = "作番大日程(新梯)
合約號:" . $contractno
. "
作番號:" . $facilityno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
}
$cmail->sendx(
$mail_title,
$mail_content,
[
[$salesname, $salesmail]
],
"永佳捷科技"
);
}
$updatesql = "
UPDATE wipwholestatus
SET
install_start_date = '$install_start_date',
install_start_date_owner = '$install_start_date_owner',
install_end_date = '$install_end_date',
install_end_date_owner = '$install_end_date_owner',
tryrun_start_date = '$tryrun_start_date',
tryrun_start_date_owner = '$tryrun_start_date_owner',
tryrun_end_date = '$tryrun_end_date',
tryrun_end_date_owner = '$tryrun_end_date_owner',
delivery_date = '$delivery_date',
delivery_date_owner = '$delivery_date_owner'
";
if (empty($change_all_contractno)) {
$updatesql .= "WHERE id = '$id' ";
} else {
$updatesql .= "WHERE contractno = '$contractno2' ";
}
// echo $updatesql;
// exit;
mysqli_query($link, $updatesql);
echo "<script type ='text/JavaScript'>";
echo "alert('已更新日期');";
echo "location.href='wipwhole-rec-invoice-edit.php?function_name=pricereview&id=$id&" . $token_link . "';";
echo "</script>";
}
}
// if ($_SERVER["REQUEST_METHOD"] == "POST") {
// if ($_POST['form_name'] == 'update_install_date_form') {
// include "./class/Cmail.php";
// $cmail = new Cmail();
// foreach ($_POST as $k => $v)
// $$k = htmlspecialchars(stripslashes(trim($v)));
// $change_all_contractno = $_POST['change_all_contractno'];
// $contractno2 = $_POST['contractno2'];
// $install_start_date = $_POST['install_start_date'];
// $install_start_date_owner = $_POST['install_start_date_owner'];
// $install_end_date = $_POST['install_end_date'];
// $install_end_date_owner = $_POST['install_end_date_owner'];
// $tryrun_start_date = $_POST['tryrun_start_date'];
// $tryrun_start_date_owner = $_POST['tryrun_start_date_owner'];
// $tryrun_end_date = $_POST['tryrun_end_date'];
// $tryrun_end_date_owner = $_POST['tryrun_end_date_owner'];
// $old_delivery_date = $_POST['old_delivery_date'];
// $delivery_date = $_POST['delivery_date'];
// $delivery_date_owner = $_POST['delivery_date_owner'];
// $contractno = $_POST['contractno'];
// $facilityno = $_POST['facilityno'];
// $salesid = $_POST['salesid'];
// $salesname = accountid2name($salesid)[$salesid];
// $salesmail = accountid2email([$salesid])[$salesid];
// if ($old_delivery_date !== $delivery_date) {
// if (empty($change_all_contractno)) {
// $mail_title = "作番大日程(新梯)合約號:" . $contractno . "-移交日變更通知";
// $mail_content = "作番大日程(新梯)
// 合約號:" . $contractno
// . "
// 移交日:" . $old_delivery_date . " => " . $delivery_date;
// } else {
// $mail_title = "作番大日程(新梯)合約號:" . $contractno . "作番號:" . $facilityno . "-移交日變更通知";
// $mail_content = "作番大日程(新梯)
// 合約號:" . $contractno
// . "
// 作番號:" . $facilityno
// . "
// 移交日:" . $old_delivery_date . " => " . $delivery_date;
// }
// $cmail->sendx(
// $mail_title,
// $mail_content,
// [
// [$salesname, $salesmail]
// ],
// "永佳捷科技"
// );
// }
// $updatesql = "
// UPDATE wipwholestatus
// SET
// install_start_date = '$install_start_date',
// install_start_date_owner = '$install_start_date_owner',
// install_end_date = '$install_end_date',
// install_end_date_owner = '$install_end_date_owner',
// tryrun_start_date = '$tryrun_start_date',
// tryrun_start_date_owner = '$tryrun_start_date_owner',
// tryrun_end_date = '$tryrun_end_date',
// tryrun_end_date_owner = '$tryrun_end_date_owner',
// delivery_date = '$delivery_date',
// delivery_date_owner = '$delivery_date_owner'
// ";
// if (empty($change_all_contractno)) {
// $updatesql .= "WHERE id = '$id' ";
// } else {
// $updatesql .= "WHERE contractno = '$contractno2' ";
// }
// // echo $updatesql;
// // exit;
// mysqli_query($link, $updatesql);
// echo "<script type ='text/JavaScript'>";
// echo "alert('已更新日期');";
// echo "location.href='wipwhole-rec-invoice-edit.php?function_name=pricereview&id=$id&" . $token_link . "';";
// echo "</script>";
// }
// }
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($_POST['form_name'] == 'update_shengguan_form') {
@ -989,6 +1015,41 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
}
}
// 外示系統寄信
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($_POST['form_name'] == 'send_expression_mail_to_platform_form') {
include "./class/Cmail.php";
$cmail = new Cmail();
$id = $_POST['id'];
$sql = "
SELECT * FROM wipwholestatus WHERE id = '$id'
AND status = '1'
";
$data = mysqli_fetch_assoc(mysqli_query($link, $sql));
$encodedString = urlencode("expression-index.php?function_name=expression&id=$id");
$href = "<a href='https://www.masada.com.tw/wms/login.php?redirect=$encodedString' target='_blank'>永佳捷 - 普萊特富 規格聯繫</a>";
$mail_title = "外示系統通知 合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'];
$mail_content = "外示系統通知 合約號:" . $data['contractno']
. "
作番號:" . $data['facilityno'] . "
$href
";
$cmail->sendx(
$mail_title,
$mail_content,
[
["gary", "gary_chen@masada.com.tw"],
["owen", "owen@masada.com.tw"],
["舒立成", "shulicheng@platform-cn.com"]
],
"永佳捷科技"
);
}
}
function write_note($link, $id, $user_id, $content)
{

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

@ -940,7 +940,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
}
?>
</select>
<input type="hidden" name="old_site_survey_contact_verify" value="<?php echo $row["site_survey_contact_verify"] ?>" <?= $warehouse2; ?> />
<input type="hidden" name="old_site_survey_contact_verify" value="<?php echo $row["site_survey_contact_verify"] ?>" />
</td>
<td style="vertical-align: middle;">附件</td>
<td style="vertical-align: middle;">
@ -985,20 +985,19 @@ include "wipwhole-rec-invoice-edit-submit.php";
(項目經理項目)
</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="install_start_date_tmp" value="<?= $row['install_start_date']; ?>" <?= $warehouse2; ?>>
<input class="form-control" type="date" id="install_start_date" name="install_start_date" value="<?= $row['install_start_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#install_start_date_tmp").val("");' <?= $warehouse2; ?>>清除</button>
<button class="btn btn-default" type='button' onclick='$("#install_start_date").val("");' <?= $warehouse2; ?>>清除</button>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="install_start_date_owner_tmp" disabled>
<select class="disabled_select" id="install_start_date_owner" name="install_start_date_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['install_start_date_owner']); ?>
</select>
@ -1008,15 +1007,15 @@ include "wipwhole-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">實際安裝完工日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="install_end_date_tmp" value="<?= $row['install_end_date']; ?>" <?= $warehouse2; ?>>
<input class="form-control" type="date" id="install_end_date" name="install_end_date" value="<?= $row['install_end_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#install_end_date_tmp").val("");' <?= $warehouse2; ?>>清除</button>
<button class="btn btn-default" type='button' onclick='$("#install_end_date").val("");' <?= $warehouse2; ?>>清除</button>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="install_end_date_owner_tmp" disabled>
<select class="disabled_select" id="install_end_date_owner" name="install_end_date_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['install_end_date_owner']); ?>
</select>
@ -1026,15 +1025,15 @@ include "wipwhole-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">實際試車開工日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="tryrun_start_date_tmp" value="<?= $row['tryrun_start_date']; ?>" <?= $warehouse2; ?>>
<input class="form-control" type="date" id="tryrun_start_date" name="tryrun_start_date" value="<?= $row['tryrun_start_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#tryrun_start_date_tmp").val("");' <?= $warehouse2; ?>>清除</button>
<button class="btn btn-default" type='button' onclick='$("#tryrun_start_date").val("");' <?= $warehouse2; ?>>清除</button>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="tryrun_start_date_owner_tmp" disabled>
<select class="disabled_select" id="tryrun_start_date_owner" name="tryrun_start_date_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['tryrun_start_date_owner']); ?>
</select>
@ -1044,15 +1043,15 @@ include "wipwhole-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">實際試車完工日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="tryrun_end_date_tmp" value="<?= $row['tryrun_end_date']; ?>" <?= $warehouse2; ?>>
<input class="form-control" type="date" id="tryrun_end_date" name="tryrun_end_date" value="<?= $row['tryrun_end_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#tryrun_end_date_tmp").val("");' <?= $warehouse2; ?>>清除</button>
<button class="btn btn-default" type='button' onclick='$("#tryrun_end_date").val("");' <?= $warehouse2; ?>>清除</button>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="tryrun_end_date_owner_tmp" disabled>
<select class="disabled_select" id="tryrun_end_date_owner" name="tryrun_end_date_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['tryrun_end_date_owner']); ?>
</select>
@ -1062,31 +1061,46 @@ include "wipwhole-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">移交日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control disabled_select" type="date" id="delivery_date_tmp" value="<?= $row['delivery_date']; ?>" <?= $warehouse2; ?>>
<input class="form-control disabled_select" type="date" min="<?php echo date("Y-m-01"); ?>" max="<?php echo date("Y-m-t"); ?>" id="delivery_date" name="delivery_date" value="<?= $row['delivery_date']; ?>" <?= $warehouse2; ?>>
<input type="hidden" id="old_delivery_date" name="old_delivery_date" value="<?= $row['delivery_date']; ?>">
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#delivery_date_tmp").val("");' <?= $warehouse2; ?>>清除</button>
<button class="btn btn-default" type='button' onclick='$("#delivery_date").val("");' <?= $warehouse2; ?>>清除</button>
</span>
<input type="hidden" id="old_delivery_date_tmp" value="<?= $row['delivery_date']; ?>">
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="delivery_date_owner_tmp" disabled>
<select class="disabled_select" id="delivery_date_owner" name="delivery_date_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['delivery_date_owner']); ?>
</select>
</td>
</tr>
<tr>
<td style="vertical-align: middle;">移交日附件(核准函)</td>
<td colspan='3' style="vertical-align: middle;">
<input style="width:70%;display:inline;" type="file" id="delivery_date_file" name="delivery_date_file" <?= $warehouse2; ?>>
<?php
echo !empty($row['delivery_date_file']) ? "<a id='delivery_date_a' style='color:#00F;' href='" . $row['delivery_date_file'] . "' target='_blank'>下載附件</a>" : "";
?>
</td>
</tr>
<tr>
<td colspan='4'>
<span class="text-danger">有官檢日或QC合格日後才可填寫</span>
<p class="text-danger">1.有官檢日或QC合格日後才可填寫。</p>
<p class="text-danger">2.注意填寫後不可更改!</p>
<p class="text-danger">3.只能維護當前月份。</p>
</td>
</tr>
<tr>
<td colspan="4">
<?php
if (saveInstallData($user_department_id, $role_id)) {
echo "<button onclick='saveInstallData()' type='button' class='btn btn-primary btn-lg pull-right' style='margin-left:3px;'>存檔</button>";
echo "<label class='pull-right' for='change_all_contractno_tmp'> 變更此合約全部日期</label>";
echo "<input class='pull-right' type='checkbox' id='change_all_contractno_tmp' value='1' />";
echo "<button type='button' onclick='savedata()' class='btn btn-primary btn-lg pull-right' style='margin-left:3px;'>提交</button>";
// echo "<button onclick='saveInstallData()' type='button' class='btn btn-primary btn-lg pull-right' style='margin-left:3px;'>存檔</button>";
// echo "<label class='pull-right' for='change_all_contractno_tmp'> 變更此合約全部日期</label>";
// echo "<input class='pull-right' type='checkbox' id='change_all_contractno_tmp' value='1' />";
}
?>
</td>
@ -1270,7 +1284,13 @@ include "wipwhole-rec-invoice-edit-submit.php";
<input class="form-control " type="hidden" name="creater" value="<?= $user_id; ?>" readonly>
<input class="form-control " type="hidden" name="create_at" value="<?= $row["create_at"]; ?>" readonly>
<?php
if (checkNowFormGStatus($link) == 'Z' && checkNowFormYDStatus($link) == 'Z' && ($user_department_id == 220 || $user_department_id == 321)) {
if (in_array($user_department_id, [220, 321])) {
?>
<button class="btn btn-primary btn-lg pull-right" type="button" onclick="sendExpressionMailToPlatform(<?php echo $row['id']; ?>)" style="margin-left:3px;">寄送普來特富外示系統信件</button>
<?php
}
if (checkNowFormGStatus($link) == 'Z' && checkNowFormYDStatus($link) == 'Z' && in_array($user_department_id, [220, 321])) {
?>
<button class="btn btn-primary btn-lg pull-right" type="button" style="margin-left:3px;" disabled>日程已結案</button>
<?php
@ -1466,7 +1486,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="official_check_date" name="official_check_date" value="<?= $row['official_check_date']; ?>" <?= $pinzheng; ?>>
<input type="hidden" id="old_official_check_date" name="old_official_check_date" value="<?= $row['official_check_date']; ?>" <?= $pinzheng; ?>>
<input type="hidden" id="old_official_check_date" name="old_official_check_date" value="<?= $row['official_check_date']; ?>">
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#official_check_date").val("");' <?= $pinzheng; ?>>清除</button>
</span>
@ -1566,7 +1586,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<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; ?>>
<input type="hidden" id="old_official_check_date2" name="old_official_check_date2" value="<?= $row['official_check_date']; ?>">
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#official_check_date2").val("");' <?= $warehouse2; ?>>清除</button>
</span>
@ -1923,7 +1943,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<input type="hidden" name='form_name' value="update_date_form" />
</form>
<form method="post" id="update_install_date_form" enctype="multipart/form-data">
<!-- <form method="post" id="update_install_date_form" enctype="multipart/form-data">
<input type="hidden" id="change_all_contractno" name='change_all_contractno' value="0" />
<input type="hidden" id="contractno2" name='contractno2' value="<?php echo $row['contractno']; ?>" />
<input type="hidden" id="install_start_date" name='install_start_date' value="<?php echo $row['install_start_date']; ?>" />
@ -1941,7 +1961,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<input type="hidden" id="contractno" name='contractno' value="<?php echo $row['contractno']; ?>" />
<input type="hidden" name='salesid' value="<?php echo $row['salesid']; ?>" />
<input type="hidden" name='form_name' value="update_install_date_form" />
</form>
</form> -->
<form method="post" id="update_shengguan_form" enctype="multipart/form-data">
<input class="form-control " type="hidden" name="creater" value="<?= $user_id; ?>">
<input type="hidden" id="arrival_date_verify" name='arrival_date_verify' value="<?php echo $row['arrival_date_verify']; ?>" />
@ -1950,6 +1970,10 @@ include "wipwhole-rec-invoice-edit-submit.php";
<input type="hidden" id="shengguan_remark" name='shengguan_remark' value="<?php echo $row['shengguan_remark']; ?>" />
<input type="hidden" name='form_name' value="update_shengguan_form" />
</form>
<form method="post" id="send_expression_mail_to_platform_form" enctype="multipart/form-data">
<input type="hidden" id="wipwholestatusid" name='id' value="<?= $id; ?>" />
<input type="hidden" name='form_name' value="send_expression_mail_to_platform_form" />
</form>
<link rel="stylesheet" href="css\jquery-ui.css">
<script src="js\jquery-1.9.1.js"></script>
@ -1963,6 +1987,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<!-- <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /> -->
<!-- <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script> -->
<script type="text/javascript">
// 台灣自製件id
var taiwan_item_id = <?php echo empty($taiwan_item_id) ? 0 : $taiwan_item_id; ?>;
@ -1988,12 +2013,15 @@ include "wipwhole-rec-invoice-edit-submit.php";
}
function checkDeliveryDateKeyinStatus() {
$("#delivery_date,#delivery_date_tmp").prop("disabled", true);
$("#delivery_date").prop("disabled", true);
if ($("#end_qc_date").val() !== "") {
$("#delivery_date,#delivery_date_tmp").prop("disabled", false);
$("#delivery_date").prop("disabled", false);
}
if ($("#official_check_date").val() !== "") {
$("#delivery_date,#delivery_date_tmp").prop("disabled", false);
$("#delivery_date").prop("disabled", false);
}
if ($("#delivery_date").val() !== "") {
$("#delivery_date").prop("disabled", true);
}
}
$(function() {
@ -2023,7 +2051,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
'qc_date2',
'end_qc_date2',
'official_check_date2',
// 'delivery_date',
'delivery_date',
'delivery_date2',
'install_start_date2',
'install_end_date2',
@ -2058,7 +2086,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
'install_end_date',
'tryrun_start_date',
'tryrun_end_date',
'delivery_date'
'delivery_date',
]
for (var i = 0; i < oursourcer_input_arr.length; i++) {
inputChangeOutsourcer(oursourcer_input_arr[i]);
@ -2089,9 +2117,14 @@ include "wipwhole-rec-invoice-edit-submit.php";
});
}
// function inputChangeOutsourcer(input_name) {
// $("#" + input_name + "_tmp").on("change", function() {
// $("#" + input_name + "_owner_tmp").val("<?php echo $user_id; ?>");
// });
// }
function inputChangeOutsourcer(input_name) {
$("#" + input_name + "_tmp").on("change", function() {
$("#" + input_name + "_owner_tmp").val("<?php echo $user_id; ?>");
$("#" + input_name).on("change", function() {
$("#" + input_name + "_owner").val("<?php echo $user_id; ?>");
});
}
@ -2317,42 +2350,49 @@ include "wipwhole-rec-invoice-edit-submit.php";
}
}
function saveInstallData() {
if (confirm('確定要更改實際安裝日程嗎?') == true) {
if ($("#change_all_contractno_tmp").prop('checked')) {
if ($("#contractno").val() == '' || $("#contractno").val() == null) {
alert("合約號空白");
} else {
$("#change_all_contractno").val($("#change_all_contractno_tmp").prop('checked'));
$("#contractno2").val($("#contractno").val());
$("#install_start_date").val($("#install_start_date_tmp").val());
$("#install_start_date_owner").val($("#install_start_date_owner_tmp").val());
$("#install_end_date").val($("#install_end_date_tmp").val());
$("#install_end_date_owner").val($("#install_end_date_owner_tmp").val());
$("#tryrun_start_date").val($("#tryrun_start_date_tmp").val());
$("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val());
$("#tryrun_end_date").val($("#tryrun_end_date_tmp").val());
$("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val());
$("#delivery_date").val($("#delivery_date_tmp").val());
$("#delivery_date_owner").val($("#delivery_date_owner_tmp").val());
$('#update_install_date_form').submit();
}
} else {
$("#install_start_date").val($("#install_start_date_tmp").val());
$("#install_start_date_owner").val($("#install_start_date_owner_tmp").val());
$("#install_end_date").val($("#install_end_date_tmp").val());
$("#install_end_date_owner").val($("#install_end_date_owner_tmp").val());
$("#tryrun_start_date").val($("#tryrun_start_date_tmp").val());
$("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val());
$("#tryrun_end_date").val($("#tryrun_end_date_tmp").val());
$("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val());
$("#delivery_date").val($("#delivery_date_tmp").val());
$("#delivery_date_owner").val($("#delivery_date_owner_tmp").val());
$('#update_install_date_form').submit();
}
function sendExpressionMailToPlatform(id) {
if (confirm('確定要發送郵件嗎?') == true) {
$("#wipwholestatusid").val(id);
$('#send_expression_mail_to_platform_form').submit();
}
}
// function saveInstallData() {
// if (confirm('確定要更改實際安裝日程嗎?') == true) {
// if ($("#change_all_contractno_tmp").prop('checked')) {
// if ($("#contractno").val() == '' || $("#contractno").val() == null) {
// alert("合約號空白");
// } else {
// $("#change_all_contractno").val($("#change_all_contractno_tmp").prop('checked'));
// $("#contractno2").val($("#contractno").val());
// $("#install_start_date").val($("#install_start_date_tmp").val());
// $("#install_start_date_owner").val($("#install_start_date_owner_tmp").val());
// $("#install_end_date").val($("#install_end_date_tmp").val());
// $("#install_end_date_owner").val($("#install_end_date_owner_tmp").val());
// $("#tryrun_start_date").val($("#tryrun_start_date_tmp").val());
// $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val());
// $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val());
// $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val());
// $("#delivery_date").val($("#delivery_date_tmp").val());
// $("#delivery_date_owner").val($("#delivery_date_owner_tmp").val());
// $('#update_install_date_form').submit();
// }
// } else {
// $("#install_start_date").val($("#install_start_date_tmp").val());
// $("#install_start_date_owner").val($("#install_start_date_owner_tmp").val());
// $("#install_end_date").val($("#install_end_date_tmp").val());
// $("#install_end_date_owner").val($("#install_end_date_owner_tmp").val());
// $("#tryrun_start_date").val($("#tryrun_start_date_tmp").val());
// $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val());
// $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val());
// $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val());
// $("#delivery_date").val($("#delivery_date_tmp").val());
// $("#delivery_date_owner").val($("#delivery_date_owner_tmp").val());
// $('#update_install_date_form').submit();
// }
// }
// }
function setOutSourcerDate() {
// 發包類型

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

@ -1,10 +1,11 @@
<?php
// ini_set('display_errors', 'on');
if ($_SERVER["REQUEST_METHOD"] == "POST") {
include("class/Cnotice.php");
$cn = new Cnotice();
if ($_POST['form_name'] == 'main_form') {
include "class/Cnotice.php";
include "./class/Cmail.php";
$cmail = new Cmail();
$cn = new Cnotice();
foreach ($_POST as $k => $v) {
if ($k !== 'renovate_type' && $k !== 'desin_taiwan_items_no' && $k !== 'desin_taiwan_items_name')
$$k = htmlspecialchars(stripslashes(trim($v)));
@ -285,23 +286,57 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$cn->sendx($data);
}
}
if (!empty($delivery_date)) {
if ($delivery_date !== $old_delivery_date) {
$permission = "M0168";
$title = "移交日變更 客戶:$custom 作番:$facilityno";
$content = "客戶:$custom
$permission_arr = ['M0168', 'M0012'];
foreach ($permission_arr as $permission) {
// $permission = "M0168";
$title = "移交日變更 客戶:$custom 作番:$facilityno";
$content = "客戶:$custom
作番:$facilityno
移交日 $old_delivery_date => $delivery_date";
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
$data = array(
'kind' => 1,
'related_id' => $id,
'title' => $title,
'content' => $content,
'permission' => $permission,
'creater' => $creater,
'create_at' => date("Y-m-d H:i:s")
);
$cn->sendx($data);
}
}
}
if (!empty($delivery_date)) {
if ($old_delivery_date !== $delivery_date) {
if (empty($change_all_contractno)) {
$mail_title = "作番大日程(汰改)合約號:" . $contractno . "-移交日變更通知";
$mail_content = "作番大日程(汰改)
合約號:" . $contractno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
} else {
$mail_title = "作番大日程(汰改)合約號:" . $contractno . "作番號:" . $facilityno . "-移交日變更通知";
$mail_content = "作番大日程(汰改)
合約號:" . $contractno
. "
作番號:" . $facilityno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
}
$cmail->sendx(
$mail_title,
$mail_content,
[
[$salesname, $salesmail]
// ['gary', 'gary_chen@masada.com.tw']
],
"永佳捷科技"
);
$cn->sendx($data);
}
}
@ -522,84 +557,81 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|| in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545])
) {
// $outsourcer_type = $_POST['outsourcer_type'];
// $qc_official_type = $_POST['qc_official_type2'] ?: $row['qc_official_type'];
// $qc_date = $_POST['qc_date2'] ?: $row['qc_date'];
// $qc_date_owner = $_POST['qc_date2_owner'] ?: $row['qc_date_owner'];
// $end_qc_date = $_POST['end_qc_date2'] ?: $row['end_qc_date'];
// $end_qc_date_owner = $_POST['end_qc_date2_owner'] ?: $row['end_qc_date_owner'];
// $official_check_date = $_POST['official_check_date2'] ?: $row['official_check_date'];
// $old_official_check_date = $_POST['old_official_check_date2'] ?: $row['old_official_check_date'];
// $official_check_date_owner = $_POST['official_check_date2_owner'] ?: $row['official_check_date_owner'];
// $delivery_date = $_POST['delivery_date2'] ?: $row['delivery_date'];
// $delivery_date_owner = $_POST['delivery_date2_owner'] ?: $row['delivery_date_owner'];
// $install_start_date = $_POST['install_start_date2'] ?: $row['install_start_date'];
// $install_start_date_owner = $_POST['install_start_date2_owner'] ?: $row['install_start_date_owner'];
// $install_end_date = $_POST['install_end_date2'] ?: $row['install_end_date'];
// $install_end_date_owner = $_POST['install_end_date2_owner'] ?: $row['install_end_date_owner'];
// $tryrun_start_date = $_POST['tryrun_start_date2'] ?: $row['tryrun_start_date'];
// $tryrun_start_date_owner = $_POST['tryrun_start_date2_owner'] ?: $row['tryrun_start_date_owner'];
// $tryrun_end_date = $_POST['tryrun_end_date2'] ?: $row['tryrun_end_date'];
// $tryrun_end_date_owner = $_POST['tryrun_end_date2_owner'] ?: $row['tryrun_end_date_owner'];
$outsourcer_type = isset($_POST['outsourcer_type']) ? $_POST['outsourcer_type'] : $row['outsourcer_type'];
$qc_official_type = isset($_POST['qc_official_type2']) ? $_POST['qc_official_type2'] : $row['qc_official_type'];
$qc_date = isset($_POST['qc_date2']) ? $_POST['qc_date2'] : $row['qc_date'];
$qc_date_owner = isset($_POST['qc_date2_owner']) ? $_POST['qc_date2_owner'] : $row['qc_date_owner'];
$outsourcer_type = isset($_POST['outsourcer_type']) ? $_POST['outsourcer_type'] : $outsourcer_type;
$qc_official_type = isset($_POST['qc_official_type2']) ? $_POST['qc_official_type2'] : $qc_official_type;
$qc_date = isset($_POST['qc_date2']) ? $_POST['qc_date2'] : $qc_date;
$qc_date_owner = isset($_POST['qc_date2_owner']) ? $_POST['qc_date2_owner'] : $qc_date_owner;
$end_qc_date = isset($_POST['end_qc_date2']) ? $_POST['end_qc_date2'] : $row['end_qc_date'];
$end_qc_date_owner = isset($_POST['end_qc_date2_owner']) ? $_POST['end_qc_date2_owner'] : $row['end_qc_date_owner'];
$official_check_date = isset($_POST['official_check_date2']) ? $_POST['official_check_date2'] : $row['official_check_date'];
$old_official_check_date = isset($_POST['old_official_check_date2']) ? $_POST['old_official_check_date2'] : $row['old_official_check_date'];
$official_check_date_owner = isset($_POST['official_check_date2_owner']) ? $_POST['official_check_date2_owner'] : $row['official_check_date_owner'];
$delivery_date = isset($_POST['delivery_date2']) ? $_POST['delivery_date2'] : $row['delivery_date'];
$delivery_date_owner = isset($_POST['delivery_date2_owner']) ? $_POST['delivery_date2_owner'] : $row['delivery_date_owner'];
$install_start_date = isset($_POST['install_start_date2']) ? $_POST['install_start_date2'] : $row['install_start_date'];
$install_start_date_owner = isset($_POST['install_start_date2_owner']) ? $_POST['install_start_date2_owner'] : $row['install_start_date_owner'];
$install_end_date = isset($_POST['install_end_date2']) ? $_POST['install_end_date2'] : $row['install_end_date'];
$install_end_date_owner = isset($_POST['install_end_date2_owner']) ? $_POST['install_end_date2_owner'] : $row['install_end_date_owner'];
$tryrun_start_date = isset($_POST['tryrun_start_date2']) ? $_POST['tryrun_start_date2'] : $row['tryrun_start_date'];
$tryrun_start_date_owner = isset($_POST['tryrun_start_date2_owner']) ? $_POST['tryrun_start_date2_owner'] : $row['tryrun_start_date_owner'];
$tryrun_end_date = isset($_POST['tryrun_end_date2']) ? $_POST['tryrun_end_date2'] : $row['tryrun_end_date'];
$tryrun_end_date_owner = isset($_POST['tryrun_end_date2_owner']) ? $_POST['tryrun_end_date2_owner'] : $row['tryrun_end_date_owner'];
$end_qc_date_owner = isset($_POST['end_qc_date2_owner']) ? $_POST['end_qc_date2_owner'] : $end_qc_date_owner;
$official_check_date = isset($_POST['official_check_date2']) ? $_POST['official_check_date2'] : $official_check_date;
$old_official_check_date = isset($_POST['old_official_check_date2']) ? $_POST['old_official_check_date2'] : $old_official_check_date;
$official_check_date_owner = isset($_POST['official_check_date2_owner']) ? $_POST['official_check_date2_owner'] : $official_check_date_owner;
$delivery_date = isset($_POST['delivery_date2']) ? $_POST['delivery_date2'] : $delivery_date;
$delivery_date_owner = isset($_POST['delivery_date2_owner']) ? $_POST['delivery_date2_owner'] : $delivery_date_owner;
$install_start_date = isset($_POST['install_start_date2']) ? $_POST['install_start_date2'] : $install_start_date;
$install_start_date_owner = isset($_POST['install_start_date2_owner']) ? $_POST['install_start_date2_owner'] : $install_start_date_owner;
$install_end_date = isset($_POST['install_end_date2']) ? $_POST['install_end_date2'] : $install_end_date;
$install_end_date_owner = isset($_POST['install_end_date2_owner']) ? $_POST['install_end_date2_owner'] : $install_end_date_owner;
$tryrun_start_date = isset($_POST['tryrun_start_date2']) ? $_POST['tryrun_start_date2'] : $tryrun_start_date;
$tryrun_start_date_owner = isset($_POST['tryrun_start_date2_owner']) ? $_POST['tryrun_start_date2_owner'] : $tryrun_start_date_owner;
$tryrun_end_date = isset($_POST['tryrun_end_date2']) ? $_POST['tryrun_end_date2'] : $tryrun_end_date;
$tryrun_end_date_owner = isset($_POST['tryrun_end_date2_owner']) ? $_POST['tryrun_end_date2_owner'] : $tryrun_end_date_owner;
$updatesql .= "
qc_official_type = '$qc_official_type',
install_start_date = '$install_start_date',
install_start_date_owner = '$install_start_date_owner',
install_end_date = '$install_end_date',
install_end_date_owner = '$install_end_date_owner',
tryrun_start_date = '$tryrun_start_date',
tryrun_start_date_owner = '$tryrun_start_date_owner',
tryrun_end_date = '$tryrun_end_date',
tryrun_end_date_owner = '$tryrun_end_date_owner',
delivery_date = '$delivery_date',
delivery_date_owner = '$delivery_date_owner',
qc_date = '$qc_date',
qc_date_owner = '$qc_date_owner',
end_qc_date = '$end_qc_date',
end_qc_date_owner = '$end_qc_date_owner',
official_check_date = '$official_check_date',
official_check_date_owner = '$official_check_date_owner',
outsourcer_type = '$outsourcer_type',
install_outsourcer = '$install_outsourcer',
install_outsourcer_owner = '$install_outsourcer_owner',
install_outsourcer_date = '$install_outsourcer_date',
install_outsourcer_date_owner = '$install_outsourcer_date_owner',
estimate_install_start_date = '$estimate_install_start_date',
estimate_install_start_date_owner = '$estimate_install_start_date_owner',
estimate_install_end_date = '$estimate_install_end_date',
estimate_install_end_date_owner = '$estimate_install_end_date_owner',
tryrun_outsourcer = '$tryrun_outsourcer',
tryrun_outsourcer_owner = '$tryrun_outsourcer_owner',
tryrun_outsourcer_date = '$tryrun_outsourcer_date',
tryrun_outsourcer_date_owner = '$tryrun_outsourcer_date_owner',
estimate_tryrun_start_date = '$estimate_tryrun_start_date',
estimate_tryrun_start_date_owner = '$estimate_tryrun_start_date_owner',
estimate_tryrun_end_date = '$estimate_tryrun_end_date',
estimate_tryrun_end_date_owner = '$estimate_tryrun_end_date_owner',
warehouse_assistant_remark = '$warehouse_assistant_remark',
qc_official_type = '$qc_official_type',
install_start_date = '$install_start_date',
install_start_date_owner = '$install_start_date_owner',
install_end_date = '$install_end_date',
install_end_date_owner = '$install_end_date_owner',
tryrun_start_date = '$tryrun_start_date',
tryrun_start_date_owner = '$tryrun_start_date_owner',
tryrun_end_date = '$tryrun_end_date',
tryrun_end_date_owner = '$tryrun_end_date_owner',
delivery_date = '$delivery_date',
delivery_date_owner = '$delivery_date_owner',
qc_date = '$qc_date',
qc_date_owner = '$qc_date_owner',
end_qc_date = '$end_qc_date',
end_qc_date_owner = '$end_qc_date_owner',
official_check_date = '$official_check_date',
official_check_date_owner = '$official_check_date_owner',
outsourcer_type = '$outsourcer_type',
install_outsourcer = '$install_outsourcer',
install_outsourcer_owner = '$install_outsourcer_owner',
install_outsourcer_date = '$install_outsourcer_date',
install_outsourcer_date_owner = '$install_outsourcer_date_owner',
estimate_install_start_date = '$estimate_install_start_date',
estimate_install_start_date_owner = '$estimate_install_start_date_owner',
estimate_install_end_date = '$estimate_install_end_date',
estimate_install_end_date_owner = '$estimate_install_end_date_owner',
tryrun_outsourcer = '$tryrun_outsourcer',
tryrun_outsourcer_owner = '$tryrun_outsourcer_owner',
tryrun_outsourcer_date = '$tryrun_outsourcer_date',
tryrun_outsourcer_date_owner = '$tryrun_outsourcer_date_owner',
estimate_tryrun_start_date = '$estimate_tryrun_start_date',
estimate_tryrun_start_date_owner = '$estimate_tryrun_start_date_owner',
estimate_tryrun_end_date = '$estimate_tryrun_end_date',
estimate_tryrun_end_date_owner = '$estimate_tryrun_end_date_owner',
warehouse_assistant_remark = '$warehouse_assistant_remark',
building_heigh_verify = '$building_heigh_verify',
building_heigh_verify_at = '$building_heigh_verify_at',
building_heigh_verify_owner = '$building_heigh_verify_owner',
site_survey_contact_verify = '$site_survey_contact_verify',
site_survey_contact_verify_at = '$site_survey_contact_verify_at',
site_survey_contact_verify_owner = '$site_survey_contact_verify_owner',
warehouse_remark = '',
install_start_date = '$install_start_date',
install_start_date_owner = '$install_start_date_owner',
install_end_date = '$install_end_date',
install_end_date_owner = '$install_end_date_owner',
tryrun_start_date = '$tryrun_start_date',
tryrun_start_date_owner = '$tryrun_start_date_owner',
tryrun_end_date = '$tryrun_end_date',
tryrun_end_date_owner = '$tryrun_end_date_owner',
delivery_date = '$delivery_date',
delivery_date_owner = '$delivery_date_owner',
";
if (!empty($plan_diagram_file)) {
$updatesql .= "plan_diagram_file = '$plan_diagram_file', ";
$updatesql .= "
@ -615,6 +647,17 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!empty($outsourcer_contract_file)) {
echo $updatesql .= "outsourcer_contract_file = '$outsourcer_contract_file', ";
}
if (!empty(trim($warehouse_remark))) {
$updatesql .= "
all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "<br/>" . $warehouse_remark . "<br/><br/>',IF(all_remark IS NULL,'',all_remark)),
";
}
if (!empty($building_heigh_verify_file))
$updatesql .= "building_heigh_verify_file = '$building_heigh_verify_file', ";
if (!empty($site_survey_contact_verify_file))
$updatesql .= "site_survey_contact_verify_file = '$site_survey_contact_verify_file', ";
if (!empty($delivery_date_file))
$updatesql .= "delivery_date_file = '$delivery_date_file', ";
}
// 許協更新業務確認項目權限
@ -892,89 +935,89 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($_POST['form_name'] == 'update_install_date_form') {
include "./class/Cmail.php";
$cmail = new Cmail();
foreach ($_POST as $k => $v)
$$k = htmlspecialchars(stripslashes(trim($v)));
$change_all_contractno = $_POST['change_all_contractno'];
$contractno = $_POST['contractno2'];
$install_start_date = $_POST['install_start_date'];
$install_start_date_owner = $_POST['install_start_date_owner'];
$install_end_date = $_POST['install_end_date'];
$install_end_date_owner = $_POST['install_end_date_owner'];
$tryrun_start_date = $_POST['tryrun_start_date'];
$tryrun_start_date_owner = $_POST['tryrun_start_date_owner'];
$tryrun_end_date = $_POST['tryrun_end_date'];
$tryrun_end_date_owner = $_POST['tryrun_end_date_owner'];
$old_delivery_date = $_POST['old_delivery_date'];
$delivery_date = $_POST['delivery_date'];
$delivery_date_owner = $_POST['delivery_date_owner'];
$contractno = $_POST['contractno'];
$facilityno = $_POST['facilityno'];
$salesid = $_POST['salesid'];
$salesname = accountid2name($salesid)[$salesid];
$salesmail = accountid2email([$salesid])[$salesid];
if ($old_delivery_date !== $delivery_date) {
if (empty($change_all_contractno)) {
$mail_title = "作番大日程(汰改)合約號:" . $contractno . "-移交日變更通知";
$mail_content = "作番大日程(汰改)$salesname$salesmail
合約號:" . $contractno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
} else {
$mail_title = "作番大日程(汰改)合約號:" . $contractno . "作番號:" . $facilityno . "-移交日變更通知";
$mail_content = "作番大日程(汰改)
合約號:" . $contractno
. "
作番號:" . $facilityno
. "
移交日:" . $old_delivery_date . " => " . $delivery_date;
}
$cmail->sendx(
$mail_title,
$mail_content,
[
[$salesname, $salesmail]
],
"永佳捷科技"
);
}
$updatesql = "
UPDATE wipwholestatus
SET
install_start_date = '$install_start_date',
install_start_date_owner = '$install_start_date_owner',
install_end_date = '$install_end_date',
install_end_date_owner = '$install_end_date_owner',
tryrun_start_date = '$tryrun_start_date',
tryrun_start_date_owner = '$tryrun_start_date_owner',
tryrun_end_date = '$tryrun_end_date',
tryrun_end_date_owner = '$tryrun_end_date_owner',
delivery_date = '$delivery_date',
delivery_date_owner = '$delivery_date_owner'
";
if (empty($change_all_contractno)) {
$updatesql .= "WHERE id = '$id' ";
} else {
$updatesql .= "WHERE contractno = '$contractno' ";
}
// echo $updatesql;
// exit;
mysqli_query($link, $updatesql);
echo "<script type ='text/JavaScript'>";
echo "alert('已更新日期');";
echo "location.href='wipwhole-renovate-rec-invoice-edit.php?function_name=pricereview&id=$id&" . $token_link . "';";
echo "</script>";
}
}
// if ($_SERVER["REQUEST_METHOD"] == "POST") {
// if ($_POST['form_name'] == 'update_install_date_form') {
// include "./class/Cmail.php";
// $cmail = new Cmail();
// foreach ($_POST as $k => $v)
// $$k = htmlspecialchars(stripslashes(trim($v)));
// $change_all_contractno = $_POST['change_all_contractno'];
// $contractno = $_POST['contractno2'];
// $install_start_date = $_POST['install_start_date'];
// $install_start_date_owner = $_POST['install_start_date_owner'];
// $install_end_date = $_POST['install_end_date'];
// $install_end_date_owner = $_POST['install_end_date_owner'];
// $tryrun_start_date = $_POST['tryrun_start_date'];
// $tryrun_start_date_owner = $_POST['tryrun_start_date_owner'];
// $tryrun_end_date = $_POST['tryrun_end_date'];
// $tryrun_end_date_owner = $_POST['tryrun_end_date_owner'];
// $old_delivery_date = $_POST['old_delivery_date'];
// $delivery_date = $_POST['delivery_date'];
// $delivery_date_owner = $_POST['delivery_date_owner'];
// $contractno = $_POST['contractno'];
// $facilityno = $_POST['facilityno'];
// $salesid = $_POST['salesid'];
// $salesname = accountid2name($salesid)[$salesid];
// $salesmail = accountid2email([$salesid])[$salesid];
// if ($old_delivery_date !== $delivery_date) {
// if (empty($change_all_contractno)) {
// $mail_title = "作番大日程(汰改)合約號:" . $contractno . "-移交日變更通知";
// $mail_content = "作番大日程(汰改)$salesname$salesmail
// 合約號:" . $contractno
// . "
// 移交日:" . $old_delivery_date . " => " . $delivery_date;
// } else {
// $mail_title = "作番大日程(汰改)合約號:" . $contractno . "作番號:" . $facilityno . "-移交日變更通知";
// $mail_content = "作番大日程(汰改)
// 合約號:" . $contractno
// . "
// 作番號:" . $facilityno
// . "
// 移交日:" . $old_delivery_date . " => " . $delivery_date;
// }
// $cmail->sendx(
// $mail_title,
// $mail_content,
// [
// [$salesname, $salesmail]
// ],
// "永佳捷科技"
// );
// }
// $updatesql = "
// UPDATE wipwholestatus
// SET
// install_start_date = '$install_start_date',
// install_start_date_owner = '$install_start_date_owner',
// install_end_date = '$install_end_date',
// install_end_date_owner = '$install_end_date_owner',
// tryrun_start_date = '$tryrun_start_date',
// tryrun_start_date_owner = '$tryrun_start_date_owner',
// tryrun_end_date = '$tryrun_end_date',
// tryrun_end_date_owner = '$tryrun_end_date_owner',
// delivery_date = '$delivery_date',
// delivery_date_owner = '$delivery_date_owner'
// ";
// if (empty($change_all_contractno)) {
// $updatesql .= "WHERE id = '$id' ";
// } else {
// $updatesql .= "WHERE contractno = '$contractno' ";
// }
// // echo $updatesql;
// // exit;
// mysqli_query($link, $updatesql);
// echo "<script type ='text/JavaScript'>";
// echo "alert('已更新日期');";
// echo "location.href='wipwhole-renovate-rec-invoice-edit.php?function_name=pricereview&id=$id&" . $token_link . "';";
// echo "</script>";
// }
// }
if ($_SERVER["REQUEST_METHOD"] == "POST") {
@ -1010,6 +1053,42 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
}
}
// 外示系統寄信
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($_POST['form_name'] == 'send_expression_mail_to_platform_form') {
include "./class/Cmail.php";
$cmail = new Cmail();
$id = $_POST['id'];
$sql = "
SELECT * FROM wipwholestatus WHERE id = '$id'
AND status = '1'
";
$data = mysqli_fetch_assoc(mysqli_query($link, $sql));
$encodedString = urlencode("expression-index.php?function_name=expression&id=$id");
$href = "<a href='https://www.masada.com.tw/wms/login.php?redirect=$encodedString' target='_blank'>永佳捷 - 普萊特富 規格聯繫</a>";
$mail_title = "外示系統通知 合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'];
$mail_content = "外示系統通知 合約號:" . $data['contractno']
. "
作番號:" . $data['facilityno'] . "
$href
";
$cmail->sendx(
$mail_title,
$mail_content,
[
["gary", "gary_chen@masada.com.tw"],
["owen", "owen@masada.com.tw"],
["舒立成", "shulicheng@platform-cn.com"],
],
"永佳捷科技"
);
}
}
// 退回至工務階段
function backWarehouse($link, $user_id)
{

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

@ -482,15 +482,15 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">實際安裝開工日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="install_start_date_tmp" value="<?= $row['install_start_date']; ?>" <?= $warehouse2; ?>>
<input class="form-control" type="date" id="install_start_date" name="install_start_date" value="<?= $row['install_start_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#install_start_date_tmp").val("");' <?= $warehouse2; ?>>清除</button>
<button class="btn btn-default" type='button' onclick='$("#install_start_date").val("");' <?= $warehouse2; ?>>清除</button>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="install_start_date_owner_tmp" disabled>
<select class="disabled_select" id="install_start_date_owner" name="install_start_date_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['install_start_date_owner']); ?>
</select>
@ -500,15 +500,15 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">實際安裝完工日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="install_end_date_tmp" value="<?= $row['install_end_date']; ?>" <?= $warehouse2; ?>>
<input class="form-control" type="date" id="install_end_date" name="install_end_date" value="<?= $row['install_end_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#install_end_date_tmp").val("");' <?= $warehouse2; ?>>清除</button>
<button class="btn btn-default" type='button' onclick='$("#install_end_date").val("");' <?= $warehouse2; ?>>清除</button>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="install_end_date_owner_tmp" disabled>
<select class="disabled_select" id="install_end_date_owner" name="install_end_date_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['install_end_date_owner']); ?>
</select>
@ -518,15 +518,15 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">實際試車開工日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="tryrun_start_date_tmp" value="<?= $row['tryrun_start_date']; ?>" <?= $warehouse2; ?>>
<input class="form-control" type="date" id="tryrun_start_date" name="tryrun_start_date" value="<?= $row['tryrun_start_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#tryrun_start_date_tmp").val("");' <?= $warehouse2; ?>>清除</button>
<button class="btn btn-default" type='button' onclick='$("#tryrun_start_date").val("");' <?= $warehouse2; ?>>清除</button>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="tryrun_start_date_owner_tmp" disabled>
<select class="disabled_select" id="tryrun_start_date_owner" name="tryrun_start_date_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['tryrun_start_date_owner']); ?>
</select>
@ -536,15 +536,15 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">實際試車完工日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="tryrun_end_date_tmp" value="<?= $row['tryrun_end_date']; ?>" <?= $warehouse2; ?>>
<input class="form-control" type="date" id="tryrun_end_date" name="tryrun_end_date" value="<?= $row['tryrun_end_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#tryrun_end_date_tmp").val("");' <?= $warehouse2; ?>>清除</button>
<button class="btn btn-default" type='button' onclick='$("#tryrun_end_date").val("");' <?= $warehouse2; ?>>清除</button>
</span>
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="tryrun_end_date_owner_tmp" disabled>
<select class="disabled_select" id="tryrun_end_date_owner" name="tryrun_end_date_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['tryrun_end_date_owner']); ?>
</select>
@ -554,31 +554,46 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">移交日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control disabled_select" type="date" id="delivery_date_tmp" value="<?= $row['delivery_date']; ?>" <?= $warehouse2; ?>>
<input class="form-control disabled_select" type="date" min="<?php echo date("Y-m-01"); ?>" max="<?php echo date("Y-m-t"); ?>" id="delivery_date" name="delivery_date" value="<?= $row['delivery_date']; ?>" <?= $warehouse2; ?>>
<input type="hidden" id="old_delivery_date" name="old_delivery_date" value="<?= $row['delivery_date']; ?>">
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#delivery_date_tmp").val("");' <?= $warehouse2; ?>>清除</button>
<button class="btn btn-default" type='button' onclick='$("#delivery_date").val("");' <?= $warehouse2; ?>>清除</button>
</span>
<input type="hidden" id="old_delivery_date_tmp" value="<?= $row['delivery_date']; ?>">
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="delivery_date_owner_tmp" disabled>
<select class="disabled_select" id="delivery_date_owner" name="delivery_date_owner" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['delivery_date_owner']); ?>
</select>
</td>
</tr>
<tr>
<td style="vertical-align: middle;">移交日附件(客戶確認單)</td>
<td colspan='3' style="vertical-align: middle;">
<input style="width:70%;display:inline;" type="file" id="delivery_date_file" name="delivery_date_file" <?= $warehouse2; ?>>
<?php
echo !empty($row['delivery_date_file']) ? "<a id='delivery_date_a' style='color:#00F;' href='" . $row['delivery_date_file'] . "' target='_blank'>下載附件</a>" : "";
?>
</td>
</tr>
<tr>
<td colspan='4'>
<span class="text-danger">有官檢日或QC合格日後才可填寫</span>
<p class="text-danger">1.有官檢日或QC合格日後才可填寫。</p>
<p class="text-danger">2.注意填寫後不可更改!</p>
<p class="text-danger">3.只能維護當前月份。</p>
</td>
</tr>
<tr>
<td colspan="4">
<?php
if (getSaveInstallDataButtonStatus($user_department_id, $role_id)) {
echo "<button onclick='saveInstallData()' type='button' class='btn btn-primary btn-lg pull-right' style='margin-left:3px;'>存檔</button>";
echo "<label class='pull-right' for='change_all_contractno_tmp'> 變更此合約全部日期</label>";
echo "<input class='pull-right' type='checkbox' id='change_all_contractno_tmp' value='1' />";
echo "<button type='button' onclick='savedata()' class='btn btn-primary btn-lg pull-right' style='margin-left:3px;'>提交</button>";
// echo "<button onclick='saveInstallData()' type='button' class='btn btn-primary btn-lg pull-right' style='margin-left:3px;'>存檔</button>";
// echo "<label class='pull-right' for='change_all_contractno_tmp'> 變更此合約全部日期</label>";
// echo "<input class='pull-right' type='checkbox' id='change_all_contractno_tmp' value='1' />";
}
?>
</td>
@ -1272,6 +1287,11 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<input class="form-control " type="hidden" name="creater" value="<?= $user_id; ?>" readonly>
<input class="form-control " type="hidden" name="create_at" value="<?= $row["create_at"]; ?>" readonly>
<?php
if (in_array($user_department_id, [220, 321])) {
?>
<button class="btn btn-primary btn-lg pull-right" type="button" onclick="sendExpressionMailToPlatform(<?php echo $row['id']; ?>)" style="margin-left:3px;">寄送普來特富外示系統信件</button>
<?php
}
if (checkNowFormStatus($link) == 'Z' && ($user_department_id == '220' || ($user_department_id == '321' && $role_id !== '5'))) {
?>
<button class="btn btn-primary btn-lg pull-right" type="button" style="margin-left:3px;" disabled>日程已結案</button>
@ -1918,7 +1938,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<input type="hidden" name='form_name' value="update_date_form" />
</form>
<form method="post" id="update_install_date_form" enctype="multipart/form-data">
<!-- <form method="post" id="update_install_date_form" enctype="multipart/form-data">
<input type="hidden" id="change_all_contractno" name='change_all_contractno' value="0" />
<input type="hidden" id="contractno2" name='contractno2' value="<?php echo $row['contractno']; ?>" />
<input type="hidden" id="install_start_date" name='install_start_date' value="<?php echo $row['install_start_date']; ?>" />
@ -1936,7 +1956,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<input type="hidden" id="contractno" name='contractno' value="<?php echo $row['contractno']; ?>" />
<input type="hidden" name='salesid' value="<?php echo $row['salesid']; ?>" />
<input type="hidden" name='form_name' value="update_install_date_form" />
</form>
</form> -->
<form method="post" id="update_shengguan_form" enctype="multipart/form-data">
<input class="form-control " type="hidden" name="creater" value="<?= $user_id; ?>">
<input type="hidden" id="arrival_date_verify" name='arrival_date_verify' value="<?php echo $row['arrival_date_verify']; ?>" />
@ -1945,6 +1965,10 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<input type="hidden" id="shengguan_remark" name='shengguan_remark' value="<?php echo $row['shengguan_remark']; ?>" />
<input type="hidden" name='form_name' value="update_shengguan_form" />
</form>
<form method="post" id="send_expression_mail_to_platform_form" enctype="multipart/form-data">
<input type="hidden" id="wipwholestatusid" name='id' value="<?= $id; ?>" />
<input type="hidden" name='form_name' value="send_expression_mail_to_platform_form" />
</form>
<link rel="stylesheet" href="css\jquery-ui.css">
<script src="js\jquery-1.9.1.js"></script>
@ -1987,12 +2011,15 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
}
function checkDeliveryDateKeyinStatus() {
$("#delivery_date,#delivery_date_tmp").prop("disabled", true);
$("#delivery_date").prop("disabled", true);
if ($("#end_qc_date").val() !== "") {
$("#delivery_date,#delivery_date_tmp").prop("disabled", false);
$("#delivery_date").prop("disabled", false);
}
if ($("#official_check_date").val() !== "") {
$("#delivery_date,#delivery_date_tmp").prop("disabled", false);
$("#delivery_date").prop("disabled", false);
}
if ($("#delivery_date").val() !== "") {
$("#delivery_date").prop("disabled", true);
}
}
$(function() {
@ -2018,10 +2045,10 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
'qc_date',
'end_qc_date',
'official_check_date',
// 'delivery_date',
'qc_date2',
'end_qc_date2',
'official_check_date2',
'delivery_date',
'delivery_date2',
'install_start_date2',
'install_end_date2',
@ -2342,42 +2369,49 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
}
}
function saveInstallData() {
if (confirm('確定要更改實際安裝日程嗎?') == true) {
if ($("#change_all_contractno_tmp").prop('checked')) {
if ($("#contractno").val() == '' || $("#contractno").val() == null) {
alert("合約號空白");
} else {
$("#change_all_contractno").val($("#change_all_contractno_tmp").prop('checked'));
$("#contractno2").val($("#contractno").val());
$("#install_start_date").val($("#install_start_date_tmp").val());
$("#install_start_date_owner").val($("#install_start_date_owner_tmp").val());
$("#install_end_date").val($("#install_end_date_tmp").val());
$("#install_end_date_owner").val($("#install_end_date_owner_tmp").val());
$("#tryrun_start_date").val($("#tryrun_start_date_tmp").val());
$("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val());
$("#tryrun_end_date").val($("#tryrun_end_date_tmp").val());
$("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val());
$("#delivery_date").val($("#delivery_date_tmp").val());
$("#delivery_date_owner").val($("#delivery_date_owner_tmp").val());
$('#update_install_date_form').submit();
}
} else {
$("#install_start_date").val($("#install_start_date_tmp").val());
$("#install_start_date_owner").val($("#install_start_date_owner_tmp").val());
$("#install_end_date").val($("#install_end_date_tmp").val());
$("#install_end_date_owner").val($("#install_end_date_owner_tmp").val());
$("#tryrun_start_date").val($("#tryrun_start_date_tmp").val());
$("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val());
$("#tryrun_end_date").val($("#tryrun_end_date_tmp").val());
$("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val());
$("#delivery_date").val($("#delivery_date_tmp").val());
$("#delivery_date_owner").val($("#delivery_date_owner_tmp").val());
$('#update_install_date_form').submit();
}
function sendExpressionMailToPlatform(id){
if (confirm('確定要發送郵件嗎?') == true) {
$("#wipwholestatusid").val(id);
$('#send_expression_mail_to_platform_form').submit();
}
}
// function saveInstallData() {
// if (confirm('確定要更改實際安裝日程嗎?') == true) {
// if ($("#change_all_contractno_tmp").prop('checked')) {
// if ($("#contractno").val() == '' || $("#contractno").val() == null) {
// alert("合約號空白");
// } else {
// $("#change_all_contractno").val($("#change_all_contractno_tmp").prop('checked'));
// $("#contractno2").val($("#contractno").val());
// $("#install_start_date").val($("#install_start_date_tmp").val());
// $("#install_start_date_owner").val($("#install_start_date_owner_tmp").val());
// $("#install_end_date").val($("#install_end_date_tmp").val());
// $("#install_end_date_owner").val($("#install_end_date_owner_tmp").val());
// $("#tryrun_start_date").val($("#tryrun_start_date_tmp").val());
// $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val());
// $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val());
// $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val());
// $("#delivery_date").val($("#delivery_date_tmp").val());
// $("#delivery_date_owner").val($("#delivery_date_owner_tmp").val());
// $('#update_install_date_form').submit();
// }
// } else {
// $("#install_start_date").val($("#install_start_date_tmp").val());
// $("#install_start_date_owner").val($("#install_start_date_owner_tmp").val());
// $("#install_end_date").val($("#install_end_date_tmp").val());
// $("#install_end_date_owner").val($("#install_end_date_owner_tmp").val());
// $("#tryrun_start_date").val($("#tryrun_start_date_tmp").val());
// $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val());
// $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val());
// $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val());
// $("#delivery_date").val($("#delivery_date_tmp").val());
// $("#delivery_date_owner").val($("#delivery_date_owner_tmp").val());
// $('#update_install_date_form').submit();
// }
// }
// }
function setOutSourcerDate() {

Loading…
Cancel
Save