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.
229 lines
11 KiB
229 lines
11 KiB
<?php
|
|
require_once "database.php";
|
|
include "header.php";
|
|
|
|
include "ngfeedback-update-submit.php";
|
|
|
|
$db_query = "
|
|
SELECT *,
|
|
f_return_account_name(verify) AS verify_name,
|
|
f_return_account_name(creater) AS creater_name,
|
|
f_return_account_name(responsibledepartmentleader) AS responsibledepartmentleader_name,
|
|
f_return_account_name(responder) AS responder_name,
|
|
f_return_department_name(responsibledepartment) AS responsibledepartment_name
|
|
FROM ngfeedback WHERE id = ?
|
|
";
|
|
$stmt = $link->prepare($db_query);
|
|
// 此處僅有字串格式
|
|
$stmt->bind_param("i", ...[$_REQUEST["no"]]);
|
|
$stmt->execute();
|
|
$result = $stmt->get_result();
|
|
$data = mysqli_fetch_assoc($result);
|
|
|
|
$progress = array(
|
|
"0" => "待判定",
|
|
"1" => "待處理",
|
|
"2" => "處理中",
|
|
"9" => "已完成"
|
|
);
|
|
?>
|
|
<style>
|
|
select,
|
|
textarea {
|
|
margin: 8px 0;
|
|
}
|
|
|
|
div.input-style,
|
|
textarea {
|
|
width: 100%;
|
|
padding: 12px 20px;
|
|
margin: 8px 0;
|
|
display: block;
|
|
border: 1px solid #ccc;
|
|
border-radius: 4px;
|
|
box-sizing: border-box;
|
|
background: var(--bs-white, #fff);
|
|
white-space: pre;
|
|
}
|
|
|
|
div.input-style:empty:after {
|
|
content: " ";
|
|
}
|
|
</style>
|
|
<?php if ($data["progress"] == "9") { // determination
|
|
?>
|
|
<div class="container">
|
|
<form role="form" class="form-horizontal" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data">
|
|
<input type="hidden" name="token" value="<?= $token; ?>">
|
|
<input type="hidden" name="closer" value="<?= $user_id; ?>">
|
|
<input type="hidden" name="progress" value="<?= $data["progress"]; ?>">
|
|
<input type="hidden" name="no" value="<?= $data["id"]; ?>">
|
|
<div class="form-group">
|
|
<div class="col-md-3">
|
|
<h3 style="font-weight: 700;">審查結果填寫</h3>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="reviewresult">審查判定結果</label>
|
|
<select id="reviewresult" name="reviewresult">
|
|
<option value="N">判定不良品</option>
|
|
<option value="G">判定良品</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label for="responsiblesupplier">責任供應商</label>
|
|
<input type="text" name="responsiblesupplier" id="responsiblesupplier" maxlength="20" placeholder="ex: 永佳捷科技">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-md-12">
|
|
<button type="submit" class="btn btn-primary btn-lg">點擊後結束不良反饋單</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="container">
|
|
<form role="form" class="form-horizontal" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data">
|
|
<div class="form-group">
|
|
<div class="col-md-3">
|
|
<h3 style="font-weight: 700;">責任單位回覆</h3>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="responder">責任單位回覆人</label>
|
|
<div class="input-style" id="responder"><?= implode(" ", array($data["responder"], $data["responder_name"])) ?></div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="progress">處理狀態</label>
|
|
<div class="input-style" id="progress"><?= $progress[$data["progress"]] ?></div>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-md-12">
|
|
<label for="replyhistory">回覆詳細</label>
|
|
<textarea class="input-style" id="replyhistory" rows="6" style="resize: none;" disabled><?= $data["replyhistory"] ?></textarea>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="container">
|
|
<form role="form" class="form-horizontal" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data">
|
|
<div class="form-group">
|
|
<div class="col-md-3">
|
|
<h3 style="font-weight: 700;">品證部門填寫</h3>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="verify">結案人員</label>
|
|
<div class="input-style" id="verify"><?= implode(" ", array($data["verify"], $data["verify_name"])) ?></div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="responsibledepartment">判定責任單位</label>
|
|
<div class="input-style" id="responsibledepartment"><?= $data["responsibledepartment_name"] ?></div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="responsibledepartmentleader">判定責任單位主管</label>
|
|
<div class="input-style" id="responsibledepartmentleader"><?= implode(" ", array($data["responsibledepartmentleader"], $data["responsibledepartmentleader_name"])) ?></div>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-md-6">
|
|
<label for="investigationreason">現場調查原因</label>
|
|
<textarea class="input-style" id="investigationreason" rows="6" maxlength="128" style="resize: none;" disabled><?= $data["investigationreason"] ?></textarea>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label for="countermeasure">對策方法及再發防止</label>
|
|
<textarea class="input-style" id="countermeasure" rows="6" maxlength="128" style="resize: none;" disabled><?= $data["countermeasure"] ?></textarea>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<?php } else { ?>
|
|
<div class="container">
|
|
<form role="form" class="form-horizontal" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data">
|
|
<input type="hidden" name="token" value="<?= $token; ?>">
|
|
<input type="hidden" name="verify" value="<?= $user_id; ?>">
|
|
<input type="hidden" name="progress" value="<?= $data["progress"]; ?>">
|
|
<input type="hidden" name="no" value="<?= $data["id"]; ?>">
|
|
<div class="form-group">
|
|
<div class="col-md-3">
|
|
<h3 style="font-weight: 700;">品證部門判定</h3>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="responsibledepartment">判定責任單位</label>
|
|
<select name="responsibledepartment" id="responsibledepartment" required>
|
|
<option value="250">廠務部</option>
|
|
<option value="321">業務部</option>
|
|
<option value="50">工務總處</option>
|
|
<option value="521">安裝開發支援部</option>
|
|
<option value="531">北區維修保養部</option>
|
|
<option value="532">桃竹維修保養部</option>
|
|
<option value="533">中區維修保養部</option>
|
|
<option value="534">南區維修保養部</option>
|
|
<option value="541">宜花東工事部</option>
|
|
<option value="542">北區工事部</option>
|
|
<option value="543">桃竹工事部</option>
|
|
<option value="544">中區工事部</option>
|
|
<option value="545">南區工事部</option>
|
|
<option value="platform">普來特富</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-md-6">
|
|
<label for="investigationreason">現場調查原因</label>
|
|
<textarea name="investigationreason" id="investigationreason" rows="6" maxlength="128" required></textarea>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label for="countermeasure">對策方法及再發防止</label>
|
|
<textarea name="countermeasure" id="countermeasure" rows="6" maxlength="255" required></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-md-12">
|
|
<button type="submit" class="btn btn-primary btn-lg">點擊後更新不良反饋單</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<?php } ?>
|
|
<div class="container">
|
|
<form role="form" class="form-horizontal" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data">
|
|
<div class="form-group">
|
|
<div class="col-md-3">
|
|
<h3 style="font-weight: 700;">不良單基本資料</h3>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="id">項次</label>
|
|
<div class="input-style" id="id"><?= $data["id"] ?></div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="create_at">反饋日期</label>
|
|
<div class="input-style" id="create_at"><?= $data["create_at"] ?></div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="creater">不良單填寫人</label>
|
|
<div class="input-style" id="creater"><?= implode(" ", array($data["creater"], $data["creater_name"])) ?></div>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-md-3">
|
|
<label for="facilityno">電梯ID</label>
|
|
<div class="input-style" id="facilityno"><?= $data["facilityno"] ?></div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="sitename">現場名稱</label>
|
|
<div class="input-style" id="sitename"><?= $data["sitename"] ?></div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label for="siteaddress">現場地址</label>
|
|
<div class="input-style" id="siteaddress"><?= $data["siteaddress"] ?></div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label for="ngdescribe">簡述不良內容</label>
|
|
<textarea class="input-style" id="ngdescribe" rows="6" maxlength="128" style="resize: none;" disabled><?= $data["ngdescribe"] ?></textarea>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label for="ngimage">照片上傳</label>
|
|
<div class="input-style" id="ngimage"><?php echo $data["ngimage"] ? "<img src='.." . $data["ngimage"] . "' style='margin: 0 auto; width: 100%; height: auto; border-radius: 0; float: none;'/>" : ""; ?></div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|