10994015 1 year ago
parent
commit
53ab8d0fd4
  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. 1036
      wms/account-receivable-index.php
  6. BIN
      wms/account-receivable-test.xlsx
  7. 2
      wms/board-record-submit.php
  8. 168
      wms/css/function.js
  9. 230
      wms/css/view/expression-index.php
  10. 282
      wms/expression-index.php
  11. 6
      wms/gary.php
  12. 21
      wms/header.php
  13. 2
      wms/login.php
  14. 2
      wms/loginapi.php
  15. 3
      wms/notice-delete.php
  16. 17
      wms/notice-edit.php
  17. 2
      wms/wipwhole-rec-invoice-edit-fileupload.php
  18. 389
      wms/wipwhole-rec-invoice-edit-submit.php
  19. 172
      wms/wipwhole-rec-invoice-edit.php
  20. 423
      wms/wipwhole-renovate-rec-invoice-edit-submit.php
  21. 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.

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

168
wms/css/function.js

@ -1,8 +1,8 @@
function tan(ty){
function tan(ty) {
alert('确定添加?');
if(ty=='f'){
var p= document.getElementById('facility');
var newfacility='<div class="form-group">\n' +
if (ty == 'f') {
var p = document.getElementById('facility');
var newfacility = '<div class="form-group">\n' +
' <div class="col-md-3">\n' +
' <label for="facilityno">作番号(必填)</label>\n' +
' <input class="form-control facilitynos" type="text" name="facilityno" id="facilityno" required>\n' +
@ -85,11 +85,11 @@ function tan(ty){
' </div>\n' +
'\n' +
' </div>'
p.innerHTML+=newfacility;
p.innerHTML += newfacility;
}else if(ty=='s'){
var s= document.getElementById('schedule');
var newschedule='<div class="form-group" >\n' +
} else if (ty == 's') {
var s = document.getElementById('schedule');
var newschedule = '<div class="form-group" >\n' +
' <div class="col-md-3">\n' +
' <label for="facilityno">作番号(必填)</label>\n' +
' <input class="form-control facilitynos" type="text" id="facilityno" required>\n' +
@ -115,15 +115,15 @@ function tan(ty){
' </div>\n' +
'\n' +
' </div>'
s.innerHTML+=newschedule;
}else{
s.innerHTML += newschedule;
} else {
alert('非法操作')
}
}
function tijiao(){
//作番号
var facilitynoslist = [];
function tijiao() {
//作番号
var facilitynoslist = [];
$(".facilitynos").each(function () {
facilitynoslist.push($(this).val());
});
@ -140,52 +140,52 @@ function tijiao(){
weightslist.push($(this).val());
});
//停数
var numberofstopslist=[];
var numberofstopslist = [];
$(".numberofstops").each(function () {
numberofstopslist.push($(this).val());
});
//楼层数
var numberoffloorslist=[];
var numberoffloorslist = [];
$(".numberoffloors").each(function () {
numberoffloorslist.push($(this).val());
});
//开门方式
var opentypeslist=[];
var opentypeslist = [];
$(".opentypes").each(function () {
opentypeslist.push($(this).val());
});
//速度
var speedslist=[];
var speedslist = [];
$(".speeds").each(function () {
speedslist.push($(this).val());
});
//维护形态
var repairtypeslist=[];
var repairtypeslist = [];
$(".repairtypes").each(function () {
repairtypeslist.push($(this).val());
});
//地址
var addressslist=[];
var addressslist = [];
$(".addresss").each(function () {
addressslist.push($(this).val());
});
//经度
var longitudeslist=[];
var longitudeslist = [];
$(".longitudes").each(function () {
longitudeslist.push($(this).val());
});
//维度
var latitudeslist=[];
var latitudeslist = [];
$(".latitudes").each(function () {
latitudeslist.push($(this).val());
});
//维护工号
var repaireridslist=[];
var repaireridslist = [];
$(".repairerids").each(function () {
repaireridslist.push($(this).val());
});
//维护人员姓名
var repairernameslist=[];
var repairernameslist = [];
$(".repairernames").each(function () {
repairernameslist.push($(this).val());
});
@ -208,28 +208,28 @@ function tijiao(){
data: {
facilitynos: JSON.stringify(facilitynoslist),
weights: JSON.stringify(weightslist),
numberofstops:JSON.stringify(numberofstopslist),
numberoffloors:JSON.stringify(numberoffloorslist),
opentypes:JSON.stringify(opentypeslist),
speeds:JSON.stringify(speedslist),
repairtypes:JSON.stringify(repairtypeslist),
addresss:JSON.stringify(addressslist),
longitudes:JSON.stringify(longitudeslist),
latitudes:JSON.stringify(latitudeslist),
repairerids:JSON.stringify(repaireridslist),
repairernames:JSON.stringify(repairernameslist),
type:type,
contractno:contractno,
customerid:customerid,
creater:creater,
create_at:create_at
numberofstops: JSON.stringify(numberofstopslist),
numberoffloors: JSON.stringify(numberoffloorslist),
opentypes: JSON.stringify(opentypeslist),
speeds: JSON.stringify(speedslist),
repairtypes: JSON.stringify(repairtypeslist),
addresss: JSON.stringify(addressslist),
longitudes: JSON.stringify(longitudeslist),
latitudes: JSON.stringify(latitudeslist),
repairerids: JSON.stringify(repaireridslist),
repairernames: JSON.stringify(repairernameslist),
type: type,
contractno: contractno,
customerid: customerid,
creater: creater,
create_at: create_at
},
success: function (data) {
var res=eval('('+data+')');
if(res.code=='200'){
window.location.href='custom-create-schedule.php?accountid='+customerid+'&contractno='+contractno;
}else{
var res = eval('(' + data + ')');
if (res.code == '200') {
window.location.href = 'custom-create-schedule.php?accountid=' + customerid + '&contractno=' + contractno;
} else {
alert('添加失败');
}
@ -241,7 +241,7 @@ function tijiao(){
}
function tijiaosch(){
function tijiaosch() {
//作番号
var facilitynoslist = [];
@ -249,24 +249,24 @@ function tijiaosch(){
facilitynoslist.push($(this).val());
});
//保养套餐
var combonoslist=[];
var combonoslist = [];
$(".combonos").each(function () {
combonoslist.push($(this).val());
});
//保养日期duedates
var duedateslist=[];
var duedateslist = [];
$(".duedates").each(function () {
duedateslist.push($(this).val());
});
//保养工号
var repaireridslist=[];
var repaireridslist = [];
$(".repairerids").each(function () {
repaireridslist.push($(this).val());
});
//保养人姓名
var repairernameslist=[];
var repairernameslist = [];
$(".repairernames").each(function () {
repairernameslist.push($(this).val());
});
@ -286,20 +286,20 @@ function tijiaosch(){
url: url,
data: {
facilitynos: JSON.stringify(facilitynoslist),
combonos:JSON.stringify(combonoslist),
duedates:JSON.stringify(duedateslist),
repairerids:JSON.stringify(repaireridslist),
repairernames:JSON.stringify(repairernameslist),
type:type,
contractno:contractno,
creater:creater,
create_at:create_at
combonos: JSON.stringify(combonoslist),
duedates: JSON.stringify(duedateslist),
repairerids: JSON.stringify(repaireridslist),
repairernames: JSON.stringify(repairernameslist),
type: type,
contractno: contractno,
creater: creater,
create_at: create_at
},
success: function (data) {
var res=eval('('+data+')');
if(res.code=='200'){
window.location.href='index.php';
}else{
var res = eval('(' + data + ')');
if (res.code == '200') {
window.location.href = 'index.php';
} else {
alert('添加失败,请检查数据');
}
@ -310,43 +310,49 @@ function tijiaosch(){
}
function show(id){
function show(id) {
//removeClass
var t = document.getElementById('account');//选取id为test的div元素
t.style.display = 'none';// 隐藏选择的元素
t.style.display = 'block';// 以块级样式显示
}
function login(){
function login() {
var account = $('.account').val();
var password = $('.password').val();
var url = "loginapi.php";
$.ajax({
method: 'post',
url: url,
data: {
account:account,
password:password
account: account,
password: password
},
success: function (data) {
console.log('返回的结果');
res=eval("("+data+")");
res = eval("(" + data + ")");
console.log(res);
console.log(window.location.host);
console.log(res.code);
if(res.code=='200'){
var token=res.token;
var name=res.name;
var login=res.login;
var menu=res.menu;
//console.log(token);
//window.localStorage.setItem("token",token);
//window.localStorage.setItem("name",name);
//window.localStorage.setItem("login",login);
window.localStorage.setItem("menu_"+res.uid,menu);
window.location.href='index.php?token='+token;
}else{
window.location.href='login.php?errno=1';
if (res.code == '200') {
var token = res.token;
var name = res.name;
var login = res.login;
var menu = res.menu;
var queryString = window.location.search;
var params = new URLSearchParams(queryString);
var redirect = params.get('redirect');
window.localStorage.setItem("menu_" + res.uid, menu);
if (redirect == '' || redirect == 'null' || redirect == null) {
window.location.href = 'index.php?token=' + token;
} else {
window.location.href = decodeURIComponent(redirect) + '&token=' + token;
}
} else {
window.location.href = 'login.php?errno=1';
}
@ -355,15 +361,15 @@ function login(){
}
function settoken(v){
window.localStorage.setItem("token",v);
function settoken(v) {
window.localStorage.setItem("token", v);
}
function gettoken(v){
function gettoken(v) {
window.localStorage.getItem("token");
}
function tttt(){
function tttt() {
//alert('無權限操作');
return "err";
}

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>

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";
?>

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

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