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.
 
 
 
 
 
 

282 lines
13 KiB

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