You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
698 lines
36 KiB
698 lines
36 KiB
<?php
|
|
|
|
//生成token
|
|
function CreateWmsToken($user_id, $user_name)
|
|
{
|
|
date_default_timezone_set("Asia/Taipei");
|
|
$start_time = date("Y-m-d H:i:s");
|
|
$end_time = date('Y-m-d H:i:s', strtotime('+24 hour')); #设定24小时
|
|
$info = $user_id . '.' . base64_encode(urlencode($user_name)) . '.' . $start_time . '.' . $end_time; //设置token过期时间为一天
|
|
$encryption_code = "MASADA!^***";
|
|
//根据以上信息信息生成签名(密钥为 SIGNATURE 自定义全局常量)
|
|
$signature = hash_hmac('md5', $info, $encryption_code);
|
|
//最后将这两部分拼接起来,得到最终的Token字符串
|
|
return $token = $info . '.' . $signature;
|
|
}
|
|
|
|
function getWipwholestatusData($id)
|
|
{
|
|
global $link;
|
|
return $sql = "
|
|
SELECT * FROM
|
|
wipwholestatus WHERE id = '$id'
|
|
";
|
|
}
|
|
|
|
function getUserName($user_id)
|
|
{
|
|
global $link;
|
|
$name = "";
|
|
$sql = "
|
|
select
|
|
name
|
|
from account
|
|
where accountid = '$user_id'
|
|
";
|
|
$res = mysqli_query($link, $sql);
|
|
while ($row = mysqli_fetch_row($res)) {
|
|
$name = $row[0];
|
|
}
|
|
mysqli_free_result($res);
|
|
return $name;
|
|
}
|
|
|
|
function getUserDepartId($user_id)
|
|
{
|
|
global $link;
|
|
$name = "";
|
|
$sql = "
|
|
select
|
|
d.department_id
|
|
from account AS a
|
|
LEFT JOIN department AS d
|
|
ON a.department_id = d.department_id
|
|
AND a.role_id = d.role_id
|
|
where a.accountid = '$user_id'
|
|
";
|
|
$res = mysqli_query($link, $sql);
|
|
while ($row = mysqli_fetch_row($res)) {
|
|
$name = $row[0];
|
|
}
|
|
mysqli_free_result($res);
|
|
return $name;
|
|
}
|
|
|
|
function getUserRoleId($user_id)
|
|
{
|
|
global $link;
|
|
$name = "";
|
|
$sql = "
|
|
select
|
|
d.role_id
|
|
from account AS a
|
|
LEFT JOIN department AS d
|
|
ON a.department_id = d.department_id
|
|
AND a.role_id = d.role_id
|
|
where a.accountid = '$user_id'
|
|
";
|
|
$res = mysqli_query($link, $sql);
|
|
while ($row = mysqli_fetch_row($res)) {
|
|
$name = $row[0];
|
|
}
|
|
mysqli_free_result($res);
|
|
return $name;
|
|
}
|
|
|
|
function getSelectOptionHtml($options, $selected_val)
|
|
{
|
|
$str = "";
|
|
foreach ($options as $option) :
|
|
if ($option['val'] == $selected_val) {
|
|
$str .= "<option selected value='" . $option['val'] . "'>" . $option['val'] . $option['label'] . "</option>";
|
|
} else {
|
|
$str .= "<option value='" . $option['val'] . "'>" . $option['val'] . $option['label'] . "</option>";
|
|
}
|
|
endforeach;
|
|
return $str;
|
|
}
|
|
|
|
function getAllUsersOptions()
|
|
{
|
|
global $link;
|
|
$sql = "
|
|
SELECT
|
|
accountid AS val ,
|
|
name AS label
|
|
FROM `account`
|
|
WHERE `accounttype` NOT IN ('A','X')
|
|
";
|
|
return mysqli_query($link, $sql);
|
|
}
|
|
|
|
// 查詢數據
|
|
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : '';
|
|
|
|
$area_status = array(
|
|
"" => "全部",
|
|
"N" => "N:北區",
|
|
"Y" => "Y:宜蘭",
|
|
"T" => "T:桃區",
|
|
"C" => "C:中區",
|
|
"K" => "K:南區"
|
|
);
|
|
|
|
$site_survey_status = array(
|
|
"0" => "已確認",
|
|
"1" => "未確認",
|
|
"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";
|
|
}
|
|
|
|
|
|
?>
|
|
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<?php
|
|
|
|
include "include-session-security.php";
|
|
require_once "db/database.php";
|
|
|
|
$data = array();
|
|
$sql = getWipwholestatusData($id);
|
|
$data = mysqli_query($link, $sql);
|
|
|
|
foreach ($data as $data) {
|
|
$id = $data['id'];
|
|
$contract_type = $data['contract_type'];
|
|
}
|
|
|
|
include "include-header.php";
|
|
?>
|
|
|
|
<body>
|
|
<div id="loader">
|
|
<div class="spinner-border text-primary" role="status"></div>
|
|
</div>
|
|
<div class="appHeader bg-primary text-light">
|
|
<div class="left">
|
|
<a href="javascript:;" class="headerButton goBack">
|
|
<ion-icon name="chevron-back-outline"></ion-icon>
|
|
</a>
|
|
</div>
|
|
<div class="pageTitle">工勘回報</div>
|
|
</div>
|
|
<form id="thisForm" action="app-investigation-update-success.php" method="post" enctype="multipart/form-data">
|
|
<div id="appCapsule">
|
|
<div class="wide-block pt-2 pb-2">
|
|
<form id="app-investigation" action="app-investigation-update.php" method="post" enctype="multipart/form-data">
|
|
<input type="hidden" value="<?php echo $token; ?>" name="token" />
|
|
<div class="section-title">合約號</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="text" class="form-control disabled_select" name="contractno" id="contractno" value="<?php echo $data['contractno']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">電梯號</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="text" class="form-control disabled_select" name="facilityno" id="facilityno" value="<?php echo $data['facilityno']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">客戶姓名</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="text" class="form-control disabled_select" name="custom" id="custom" value="<?php echo $data['custom']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">號機</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input type="text" class="form-control disabled_select" name="facility_temp_no" id="facility_temp_no" value="<?php echo $data['facility_temp_no']; ?>">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">經度</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="text" class="form-control disabled_select" name="longitude" id="longitude" value="<?php echo $data['longitude']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">緯度</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="text" class="form-control disabled_select" name="latitude" id="latitude" value="<?php echo $data['latitude']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">地址</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="text" class="form-control disabled_select" name="address" id="address" value="<?php echo $data['address']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">
|
|
工地地址
|
|
<a target="_blank" href="https://www.masada.com.tw/wms/wipwhole-change-contractdate.php?function_name=wipwholerenstatus&token=<?php echo CreateWmsToken($user_id, getUserName($user_id)); ?>&id=<?php echo $id; ?>">調整工地地址</a>
|
|
</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="text" class="form-control disabled_select" name="real_address" id="real_address" value="<?php echo $data['real_address']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">機型</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="text" class="form-control disabled_select" name="facility_kind" id="facility_kind" value="<?php echo $data['facility_kind']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">開門方式</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="text" class="form-control disabled_select" name="opentype" id="opentype" value="<?php echo $data['opentype']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">速度</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="text" class="form-control disabled_select" name="speed" id="speed" value="<?php echo $data['speed']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">載重</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="text" class="form-control disabled_select" name="weight" id="weight" value="<?php echo $data['weight']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">人乘</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="text" class="form-control disabled_select" name="numberofpassenger" id="numberofpassenger" value="<?php echo $data['numberofpassenger']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">樓停</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="text" class="form-control disabled_select" name="numberofstop" id="numberofstop" value="<?php echo $data['numberofstop']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">樓層</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="text" class="form-control disabled_select" name="numberoffloor" id="numberoffloor" value="<?php echo $data['numberoffloor']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">工地負責人</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="text" class="form-control disabled_select" name="site_manager" id="site_manager" value="<?php echo $data['site_manager']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">合約交期(到工地)</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="date" class="form-control disabled_select" name="contract_arrival_date" id="contract_arrival_date" value="<?php echo $data['contract_arrival_date']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">
|
|
預計交期(到工地)
|
|
<a target="_blank" href="https://www.masada.com.tw/wms/wipwhole-change-contractdate.php?function_name=wipwholerenstatus&token=<?php echo CreateWmsToken($user_id, getUserName($user_id)); ?>&id=<?php echo $id; ?>">調整預計交貨日</a>
|
|
</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="background-color:#EEE;" type="date" class="form-control disabled_select" name="real_contract_arrival_date" id="real_contract_arrival_date" value="<?php echo $data['real_contract_arrival_date']; ?>" readonly="readonly" disabled="disavbled">
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="wide-block pt-2 pb-2 mt-2">
|
|
<div class="section-title">
|
|
<h3>樓高通報</h3>
|
|
</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<select class="form-control disabled_select" name="building_heigh_verify" id="building_heigh_verify">
|
|
<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>
|
|
</div>
|
|
</div>
|
|
<div class="section-title">附件</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="width:70%;display:inline;" type="file" id="building_heigh_verify_file" name="building_heigh_verify_file">
|
|
<?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>" : "";
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="section-title">確認時間</div>
|
|
<div class="form-group boxed">
|
|
<input class="form-control disabled_select" style="background-color:#EEE;" type="datetime-local" id="building_heigh_verify_at" name="building_heigh_verify_at" value="<?= $data['building_heigh_verify_at']; ?>" readonly>
|
|
</div>
|
|
<div class="section-title">確認人</div>
|
|
<div class="form-group boxed">
|
|
<select name="building_heigh_verify_owner" class="form-control disabled_select" style="background-color:#EEE;" id="building_heigh_verify_owner" disabled>
|
|
<option value="">請選擇</option>
|
|
<?php echo getSelectOptionHtml(getAllUsersOptions(), $data['building_heigh_verify_owner']); ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="wide-block pt-2 pb-2 mt-2">
|
|
<div class="section-title">
|
|
<h3>工勘確認</h3>
|
|
</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<select class="form-control disabled_select" name="site_survey_contact_verify" id="site_survey_contact_verify">
|
|
<?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>
|
|
<input type="hidden" name="old_site_survey_contact_verify" value="<?php echo $data["site_survey_contact_verify"] ?>" />
|
|
</div>
|
|
</div>
|
|
<div class="section-title">附件</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input style="width:70%;display:inline;" type="file" id="site_survey_contact_verify_file" name="site_survey_contact_verify_file">
|
|
<?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>" : "";
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="section-title">確認時間</div>
|
|
<div class="form-group boxed">
|
|
<input class="form-control disabled_select" style="background-color:#EEE;" type="datetime-local" id="site_survey_contact_verify_at" name="site_survey_contact_verify_at" value="<?= $data['site_survey_contact_verify_at']; ?>" readonly>
|
|
</div>
|
|
<div class="section-title">確認人</div>
|
|
<div class="form-group boxed">
|
|
<select name="site_survey_contact_verify_owner" class="form-control disabled_select" style="background-color:#EEE;" id="site_survey_contact_verify_owner" disabled>
|
|
<option value="">請選擇</option>
|
|
<?php echo getSelectOptionHtml(getAllUsersOptions(), $data['site_survey_contact_verify_owner']); ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="wide-block pt-2 pb-2 mt-2">
|
|
<div class="section-title">
|
|
<h3>預計安裝及試車日程(工務助理項目)</h3>
|
|
</div>
|
|
<div class="section-title">安裝發包廠商</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input type="text" class="form-control disabled_select" name="install_outsourcer" id="install_outsourcer" value="<?php echo $data['install_outsourcer']; ?>">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">確認人</div>
|
|
<div class="form-group boxed">
|
|
<select name="install_outsourcer_owner" class="form-control disabled_select" style="background-color:#EEE;" id="install_outsourcer_owner" disabled>
|
|
<option value="">請選擇</option>
|
|
<?php echo getSelectOptionHtml(getAllUsersOptions(), $data['install_outsourcer_owner']); ?>
|
|
</select>
|
|
</div>
|
|
<div class="section-title">安裝發包日</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<div class="input-group">
|
|
<input class="form-control disabled_select" type="date" name="install_outsourcer_date" id="install_outsourcer_date" value="<?= $data['install_outsourcer_date']; ?>">
|
|
<span class="input-group-btn">
|
|
<button class="btn btn-default" type='button' onclick='$("#install_outsourcer_date").val("");'>清除</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section-title">確認人</div>
|
|
<div class="form-group boxed">
|
|
<select name="install_outsourcer_date_owner" class="form-control disabled_select" style="background-color:#EEE;" id="install_outsourcer_date_owner" disabled>
|
|
<option value="">請選擇</option>
|
|
<?php echo getSelectOptionHtml(getAllUsersOptions(), $data['install_outsourcer_date_owner']); ?>
|
|
</select>
|
|
</div>
|
|
<div class="section-title">預計安裝開工日</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<div class="input-group">
|
|
<input class="form-control disabled_select" type="date" name="estimate_install_start_date" id="estimate_install_start_date" value="<?= $data['estimate_install_start_date']; ?>">
|
|
<span class="input-group-btn">
|
|
<button class="btn btn-default" type='button' onclick='$("#estimate_install_start_date").val("");'>清除</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section-title">確認人</div>
|
|
<div class="form-group boxed">
|
|
<select name="estimate_install_start_date_owner" class="form-control disabled_select" style="background-color:#EEE;" id="estimate_install_start_date_owner" disabled>
|
|
<option value="">請選擇</option>
|
|
<?php echo getSelectOptionHtml(getAllUsersOptions(), $data['estimate_install_start_date_owner']); ?>
|
|
</select>
|
|
</div>
|
|
<div class="section-title">預計安裝完工日</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<div class="input-group">
|
|
<input class="form-control disabled_select" type="date" name="estimate_install_end_date" id="estimate_install_end_date" value="<?= $data['estimate_install_end_date']; ?>">
|
|
<span class="input-group-btn">
|
|
<button class="btn btn-default" type='button' onclick='$("#estimate_install_end_date").val("");'>清除</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section-title">確認人</div>
|
|
<div class="form-group boxed">
|
|
<select name="estimate_install_end_date_owner" class="form-control disabled_select" style="background-color:#EEE;" id="estimate_install_end_date_owner" disabled>
|
|
<option value="">請選擇</option>
|
|
<?php echo getSelectOptionHtml(getAllUsersOptions(), $data['estimate_install_end_date_owner']); ?>
|
|
</select>
|
|
</div>
|
|
<div class="section-title">試車發包廠商</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<input type="text" class="form-control disabled_select" name="tryrun_outsourcer" id="tryrun_outsourcer" value="<?php echo $data['tryrun_outsourcer']; ?>">
|
|
</div>
|
|
</div>
|
|
<div class="section-title">確認人</div>
|
|
<div class="form-group boxed">
|
|
<select name="tryrun_outsourcer_owner" class="form-control disabled_select" style="background-color:#EEE;" id="tryrun_outsourcer_owner" disabled>
|
|
<option value="">請選擇</option>
|
|
<?php echo getSelectOptionHtml(getAllUsersOptions(), $data['tryrun_outsourcer_owner']); ?>
|
|
</select>
|
|
</div>
|
|
<div class="section-title">試車發包日</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<div class="input-group">
|
|
<input class="form-control disabled_select" type="date" name="tryrun_outsourcer_date" id="tryrun_outsourcer_date" value="<?= $data['tryrun_outsourcer_date']; ?>">
|
|
<span class="input-group-btn">
|
|
<button class="btn btn-default" type='button' onclick='$("#tryrun_outsourcer_date").val("");'>清除</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section-title">確認人</div>
|
|
<div class="form-group boxed">
|
|
<select name="tryrun_outsourcer_date_owner" class="form-control disabled_select" style="background-color:#EEE;" id="tryrun_outsourcer_date_owner" disabled>
|
|
<option value="">請選擇</option>
|
|
<?php echo getSelectOptionHtml(getAllUsersOptions(), $data['tryrun_outsourcer_date_owner']); ?>
|
|
</select>
|
|
</div>
|
|
<div class="section-title">預計試車開工日</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<div class="input-group">
|
|
<input class="form-control disabled_select" type="date" name="estimate_tryrun_start_date" id="estimate_tryrun_start_date" value="<?= $data['estimate_tryrun_start_date']; ?>">
|
|
<span class="input-group-btn">
|
|
<button class="btn btn-default" type='button' onclick='$("#estimate_tryrun_start_date").val("");'>清除</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section-title">確認人</div>
|
|
<div class="form-group boxed">
|
|
<select name="estimate_tryrun_start_date_owner" class="form-control disabled_select" style="background-color:#EEE;" id="estimate_tryrun_start_date_owner" disabled>
|
|
<option value="">請選擇</option>
|
|
<?php echo getSelectOptionHtml(getAllUsersOptions(), $data['estimate_tryrun_start_date_owner']); ?>
|
|
</select>
|
|
</div>
|
|
<div class="section-title">預計試車完工日</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<div class="input-group">
|
|
<input class="form-control disabled_select" type="date" name="estimate_tryrun_end_date" id="estimate_tryrun_end_date" value="<?= $data['estimate_tryrun_end_date']; ?>">
|
|
<span class="input-group-btn">
|
|
<button class="btn btn-default" type='button' onclick='$("#estimate_tryrun_end_date").val("");'>清除</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section-title">確認人</div>
|
|
<div class="form-group boxed">
|
|
<select name="estimate_tryrun_end_date_owner" class="form-control disabled_select" style="background-color:#EEE;" id="estimate_tryrun_end_date_owner" disabled>
|
|
<option value="">請選擇</option>
|
|
<?php echo getSelectOptionHtml(getAllUsersOptions(), $data['estimate_tryrun_end_date_owner']); ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="wide-block pt-2 pb-2 mt-2">
|
|
<div class="section-title">
|
|
<h3>實際安裝及試車日程(項目經理項目)</h3>
|
|
</div>
|
|
<div class="section-title">實際安裝開工日</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<div class="input-group">
|
|
<input class="form-control disabled_select" type="date" name="install_start_date" id="install_start_date" value="<?= $data['install_start_date']; ?>">
|
|
<span class="input-group-btn">
|
|
<button class="btn btn-default" type='button' onclick='$("#install_start_date").val("");'>清除</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section-title">確認人</div>
|
|
<div class="form-group boxed">
|
|
<select name="install_start_date_owner" class="form-control disabled_select" style="background-color:#EEE;" id="install_start_date_owner" disabled>
|
|
<option value="">請選擇</option>
|
|
<?php echo getSelectOptionHtml(getAllUsersOptions(), $data['install_start_date_owner']); ?>
|
|
</select>
|
|
</div>
|
|
<div class="section-title">實際安裝完工日</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<div class="input-group">
|
|
<input class="form-control disabled_select" type="date" name="install_end_date" id="install_end_date" value="<?= $data['install_end_date']; ?>">
|
|
<span class="input-group-btn">
|
|
<button class="btn btn-default" type='button' onclick='$("#install_end_date").val("");'>清除</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section-title">確認人</div>
|
|
<div class="form-group boxed">
|
|
<select name="install_end_date_owner" class="form-control disabled_select" style="background-color:#EEE;" id="install_end_date_owner" disabled>
|
|
<option value="">請選擇</option>
|
|
<?php echo getSelectOptionHtml(getAllUsersOptions(), $data['install_end_date_owner']); ?>
|
|
</select>
|
|
</div>
|
|
<div class="section-title">實際試車開工日</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<div class="input-group">
|
|
<input class="form-control disabled_select" type="date" name="tryrun_start_date" id="tryrun_start_date" value="<?= $data['tryrun_start_date']; ?>">
|
|
<span class="input-group-btn">
|
|
<button class="btn btn-default" type='button' onclick='$("#tryrun_start_date").val("");'>清除</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section-title">確認人</div>
|
|
<div class="form-group boxed">
|
|
<select name="tryrun_start_date_owner" class="form-control disabled_select" style="background-color:#EEE;" id="tryrun_start_date_owner" disabled>
|
|
<option value="">請選擇</option>
|
|
<?php echo getSelectOptionHtml(getAllUsersOptions(), $data['tryrun_start_date_owner']); ?>
|
|
</select>
|
|
</div>
|
|
<div class="section-title">實際試車完工日</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<div class="input-group">
|
|
<input class="form-control disabled_select" type="date" name="tryrun_end_date" id="tryrun_end_date" value="<?= $data['tryrun_end_date']; ?>">
|
|
<span class="input-group-btn">
|
|
<button class="btn btn-default" type='button' onclick='$("#tryrun_end_date").val("");'>清除</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section-title">確認人</div>
|
|
<div class="form-group boxed">
|
|
<select name="tryrun_end_date_owner" class="form-control disabled_select" style="background-color:#EEE;" id="tryrun_end_date_owner" disabled>
|
|
<option value="">請選擇</option>
|
|
<?php echo getSelectOptionHtml(getAllUsersOptions(), $data['tryrun_end_date_owner']); ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="wide-block pt-2 pb-2 mt-2">
|
|
<div class="section-title">
|
|
<h3>備註</h3>
|
|
</div>
|
|
<div style="max-height:250px;overflow-y:auto;">
|
|
<?= nl2br($data["all_remark"]); ?>
|
|
</div>
|
|
<div class="form-group boxed">
|
|
<div class="input-wrapper">
|
|
<textarea class="form-control disabled_select" name="warehouse_remark"><?php echo $data['warehouse_remark']; ?></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<input type="hidden" value="<?php echo $token; ?>" name="token" />
|
|
<input type="hidden" value="<?php echo $data['id']; ?>" name="id" />
|
|
<input type="hidden" value="<?php echo $user_id; ?>" name="creater" />
|
|
<input type="hidden" value="<?php echo date("Y-m-d H:i:s"); ?>" name="create_at" />
|
|
<div class="wide-block pt-2 pb-2 mt-2">
|
|
<button type="button" class="btn btn-primary btn-block btn-lg" onclick="sendForm()">更新</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
|
|
<?php
|
|
include "include-footer.php";
|
|
mysqli_close($link);
|
|
include "include-jsfiles.php";
|
|
?>
|
|
|
|
<script>
|
|
var catchTime_input_arr = [
|
|
"building_heigh_verify",
|
|
"site_survey_contact_verify",
|
|
]
|
|
for (var i = 0; i < catchTime_input_arr.length; i++) {
|
|
inputChangeCatchTime(catchTime_input_arr[i]);
|
|
}
|
|
|
|
function inputChangeCatchTime(input_name) {
|
|
$("#" + input_name + ",#" + input_name + "_file").on("change", function() {
|
|
$("#" + input_name + "_at").val(formatDate());
|
|
$("#" + input_name + "_owner").val("<?php echo $user_id; ?>");
|
|
});
|
|
}
|
|
|
|
var oursourcer_input_arr = [
|
|
'install_outsourcer',
|
|
'install_outsourcer_date',
|
|
'install_start_date',
|
|
'install_end_date',
|
|
'tryrun_outsourcer',
|
|
'tryrun_outsourcer_date',
|
|
'tryrun_start_date',
|
|
'tryrun_end_date',
|
|
'estimate_install_outsourcer',
|
|
'estimate_install_start_date',
|
|
'estimate_install_end_date',
|
|
'estimate_tryrun_outsourcer',
|
|
'estimate_tryrun_start_date',
|
|
'estimate_tryrun_end_date',
|
|
]
|
|
for (var i = 0; i < oursourcer_input_arr.length; i++) {
|
|
inputChangeOutsourcer(oursourcer_input_arr[i]);
|
|
}
|
|
|
|
function inputChangeOutsourcer(input_name) {
|
|
$("#" + input_name).on("change", function() {
|
|
$("#" + input_name + "_owner").val("<?php echo $user_id; ?>");
|
|
});
|
|
}
|
|
|
|
|
|
function formatDate() {
|
|
var timestamp = Date.now();
|
|
var date = new Date(timestamp);
|
|
var year = date.getFullYear().toString().padStart(4, '0');
|
|
var month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
var day = date.getDate().toString().padStart(2, '0');
|
|
var hours = date.getHours().toString().padStart(2, '0');
|
|
var minutes = date.getMinutes().toString().padStart(2, '0');
|
|
var seconds = date.getSeconds().toString().padStart(2, '0');
|
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
}
|
|
|
|
function sendForm() {
|
|
$(".disabled_select").prop("disabled", false);
|
|
$("#thisForm").submit();
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|