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.
363 lines
11 KiB
363 lines
11 KiB
<!doctype html>
|
|
<html lang="en">
|
|
|
|
<!-- 主頁header -->
|
|
<?php
|
|
|
|
/*--- 處理session ----*/
|
|
include "include-session-security.php"; #確認session
|
|
/*
|
|
if(isset($_SESSION['user_id'])){
|
|
#echo $_SESSION['user_id'];
|
|
$userid = $_SESSION['user_id'];
|
|
}
|
|
*/
|
|
/*--- 處理session ----*/
|
|
|
|
#$userid = "B000000001";
|
|
|
|
$facilityno = $_REQUEST["facilityno"];
|
|
require_once "db/database.php"; # 載入db.php來連結資料庫
|
|
$data = array(); # 設置一個空陣列來放資料is
|
|
|
|
if ($user_id == 'A000000001') {
|
|
$sql = "SELECT * FROM wipinstallation where (facilityno = '$facilityno') order by id desc"; # sql語法存在變數中
|
|
} else {
|
|
$sql = "
|
|
SELECT
|
|
'0' AS id,
|
|
facilityno,
|
|
SUBSTR(real_contract_arrival_date,1,10) AS issue_time,
|
|
'分配安裝人員' AS 'process',
|
|
'bg-success' AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
AND real_contract_arrival_date != ''
|
|
AND real_contract_arrival_date IS NOT NULL
|
|
|
|
UNION
|
|
|
|
SELECT
|
|
'1' AS id,
|
|
facilityno,
|
|
SUBSTR(real_arrival_date,1,10) AS issue_time,
|
|
'已出貨' AS 'process',
|
|
'bg-success' AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
AND real_arrival_date != ''
|
|
AND real_arrival_date IS NOT NULL
|
|
|
|
UNION
|
|
|
|
SELECT
|
|
'2' AS id,
|
|
facilityno,
|
|
SUBSTR(estimate_install_start_date,1,10) AS issue_time,
|
|
'預計安裝日期' AS 'process',
|
|
'bg-success' AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
AND estimate_install_start_date != ''
|
|
AND estimate_install_start_date IS NOT NULL
|
|
|
|
UNION
|
|
|
|
SELECT
|
|
'3' AS id,
|
|
facilityno,
|
|
SUBSTR(install_start_date,1,10) AS issue_time,
|
|
'已開工' AS 'process',
|
|
'bg-success' AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
AND install_start_date != ''
|
|
AND install_start_date IS NOT NULL
|
|
|
|
UNION
|
|
|
|
SELECT
|
|
'4' AS id,
|
|
facilityno,
|
|
SUBSTR(estimate_tryrun_start_date,1,10) AS issue_time,
|
|
'預計試車日期' AS 'process',
|
|
'bg-success' AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
AND estimate_tryrun_start_date != ''
|
|
AND estimate_tryrun_start_date IS NOT NULL
|
|
|
|
UNION
|
|
|
|
SELECT
|
|
'5' AS id,
|
|
facilityno,
|
|
SUBSTR(tryrun_start_date,1,10) AS issue_time,
|
|
'開始試車' AS 'process',
|
|
'bg-success' AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
AND tryrun_start_date != ''
|
|
AND tryrun_start_date IS NOT NULL
|
|
|
|
UNION
|
|
|
|
SELECT
|
|
'6' AS id,
|
|
facilityno,
|
|
SUBSTR(end_qc_date,1,10) AS issue_time,
|
|
'完成QC' AS 'process',
|
|
'bg-success' AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
AND end_qc_date != ''
|
|
AND end_qc_date IS NOT NULL
|
|
|
|
UNION
|
|
|
|
SELECT
|
|
'7' AS id,
|
|
facilityno,
|
|
SUBSTR(official_check_date,1,10) AS issue_time,
|
|
'完成官檢' AS 'process',
|
|
'bg-success' AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
AND official_check_date != ''
|
|
AND official_check_date IS NOT NULL
|
|
|
|
UNION
|
|
|
|
SELECT
|
|
'8' AS id,
|
|
facilityno,
|
|
SUBSTR(delivery_date,1,10) AS issue_time,
|
|
'完成移交' AS 'process',
|
|
'bg-success' AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
AND delivery_date != ''
|
|
AND delivery_date IS NOT NULL
|
|
|
|
|
|
/*
|
|
SELECT
|
|
'0' AS id,
|
|
facilityno,
|
|
SUBSTR(real_arrival_date,1,10) AS issue_time,
|
|
IF(real_arrival_date IS NOT NULL || real_arrival_date != '','已出貨','未出貨') AS 'process',
|
|
IF(real_arrival_date IS NOT NULL || real_arrival_date != '','bg-success','bg-warning') AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
UNION
|
|
SELECT
|
|
'0' AS id,
|
|
facilityno,
|
|
SUBSTR(install_outsourcer_date,1,10) AS issue_time,
|
|
IF(install_outsourcer_date IS NOT NULL || install_outsourcer_date != '','已分配安裝人員','分配安裝人員中') AS 'process',
|
|
IF(install_outsourcer_date IS NOT NULL || install_outsourcer_date != '','bg-success','bg-warning') AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
UNION
|
|
SELECT
|
|
'1' AS id,
|
|
facilityno,
|
|
SUBSTR(install_start_date,1,10) AS issue_time,
|
|
IF(install_start_date IS NOT NULL || install_start_date != '','已開工','未開工') AS 'process',
|
|
IF(install_start_date IS NOT NULL || install_start_date != '','bg-success','bg-warning') AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
UNION
|
|
SELECT
|
|
'2' AS id,
|
|
facilityno,
|
|
SUBSTR(estimate_install_end_date,1,10) AS issue_time,
|
|
IF(estimate_install_end_date IS NOT NULL || estimate_install_end_date != '','開始試車','未試車') AS 'process',
|
|
IF(estimate_install_end_date IS NOT NULL || estimate_install_end_date != '','bg-success','bg-warning') AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
UNION
|
|
SELECT
|
|
'3' AS id,
|
|
facilityno,
|
|
SUBSTR(qc_date,1,10) AS issue_time,
|
|
IF(qc_date IS NOT NULL || qc_date != '','完成QC','QC中') AS 'process',
|
|
IF(qc_date IS NOT NULL || qc_date != '','bg-success','bg-warning') AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
UNION
|
|
SELECT
|
|
'4' AS id,
|
|
facilityno,
|
|
SUBSTR(official_check_date,1,10) AS issue_time,
|
|
IF(official_check_date IS NOT NULL || official_check_date != '','完成官檢','官檢中') AS 'process',
|
|
IF(official_check_date IS NOT NULL || official_check_date != '','bg-success','bg-warning') AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
UNION
|
|
SELECT
|
|
'5' AS id,
|
|
facilityno,
|
|
SUBSTR(delivery_date,1,10) AS issue_time,
|
|
IF(delivery_date IS NOT NULL || delivery_date != '','完成移交','移交中') AS 'process',
|
|
IF(delivery_date IS NOT NULL || delivery_date != '','bg-success','bg-warning') AS 'light_color',
|
|
'' AS memo,
|
|
creater,
|
|
create_at
|
|
FROM wipwholestatus
|
|
WHERE (facilityno = '$facilityno')
|
|
*/
|
|
|
|
ORDER BY id DESC
|
|
";
|
|
}
|
|
$data = mysqli_query($link, $sql); # 用mysqli_query方法執行(sql語法)將結果存在變數中
|
|
|
|
include "include-header.php";
|
|
?>
|
|
<!-- * 主頁header -->
|
|
|
|
<body>
|
|
|
|
<!-- loader -->
|
|
<div id="loader">
|
|
<div class="spinner-border text-primary" role="status"></div>
|
|
</div>
|
|
<!-- * loader -->
|
|
|
|
<!-- App Header -->
|
|
<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 class="right"></div> -->
|
|
</div>
|
|
<!-- * App Header -->
|
|
|
|
<!-- App Capsule -->
|
|
<div id="appCapsule">
|
|
|
|
|
|
<div class="section full mt-2">
|
|
<div class="section-title">電梯編號:<?php echo $facilityno; ?></div>
|
|
<!-- <div class="content-header mb-05">訂單編號 <code>DDDDDD</code></div> -->
|
|
<div class="wide-block">
|
|
<!-- timeline -->
|
|
<div class="timeline timed">
|
|
<?php $j = 0;
|
|
foreach ($data as $data) {
|
|
$j = $j + 1;
|
|
?>
|
|
<div class="item">
|
|
<span class="time"><?php echo $data['issue_time']; ?></span>
|
|
<?php
|
|
// if ($j==1){
|
|
// echo "<div class='dot bg-warning'></div>";
|
|
// }else{
|
|
// echo "<div class='dot'></div>";
|
|
// }
|
|
?>
|
|
<div class="dot <?php echo $data['light_color']; ?>"></div>
|
|
<div class="content">
|
|
<h4 class="title"><?php echo $data['process']; ?></h4>
|
|
<div class="text"><?php echo $data['memo']; ?></div>
|
|
</div>
|
|
</div>
|
|
<!--
|
|
<div class="item">
|
|
<span class="time">09-01 17:34</span>
|
|
<div class="dot"></div>
|
|
<div class="content">
|
|
<h4 class="title">已發貨</h4>
|
|
<div class="text">
|
|
攬收成功(桃園)
|
|
<img src="assets/img/sample/photo/sensor-1.jpg" alt="avatar" class="imaged w24 rounded">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
-->
|
|
|
|
<?php } ?>
|
|
</div>
|
|
<!-- * timeline -->
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<!-- * App Capsule -->
|
|
|
|
<!-- 主頁頁尾 -->
|
|
<?php
|
|
include "include-footer.php";
|
|
mysqli_close($link); #代表結束連線
|
|
?>
|
|
<!-- * 主頁頁尾 -->
|
|
|
|
|
|
<!-- 主頁頁尾按鈕 -->
|
|
<?php
|
|
#include "include-bottom-menu.php";
|
|
?>
|
|
<!-- * 主頁頁尾按鈕 -->
|
|
|
|
|
|
<!-- ///////////// Js Files //////////////////// -->
|
|
<!-- Jquery -->
|
|
<?php
|
|
include "include-jsfiles.php";
|
|
?>
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|