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.
 
 
 
 
 
 

127 lines
3.9 KiB

<?php
include "header.php";
// 載入db.php來連結資料庫
require_once "database.php";
// 設置一個空陣列來放資料
$data = array();
// sql語法存在變數中
$sql = "select id, version, contractno, company, facilitok_date, tai_count, serial, buildno3, buildno5, rtype, usefor, class, updater, update_dt from specsurvey_main order by id";
// 用mysqli_query方法執行(sql語法)將結果存在變數中
$data = mysqli_query($link, $sql);
$rtype_arr = ["MAE100" => "MAE100小機房", "MAM200" => "MAM200無機房", "MAH100" => "MAH100小電梯", "MAQ100" => "MAQ100強驅梯", "MAF100" => "MAF100貨梯", "MAZ100" => "MAZ100雜物梯"];
$usefor_arr = [1 => "人乘", 2 => "貨梯", 3 => "觀光", 4 => "客貨", 5 => "病床", 6 => "緊急", 7 => "殘障", 8 => "緊急兼殘障", 9 => "特殊環境"];
$class_arr = [1 => "新梯", 2 => "舊改M1", 3 => "舊改M2", 4 => "舊改M3", 5 => "舊改M4", 6 => "舊改M1+M4"];
?>
<p>
<a href="specsurvey-create.php" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-plus"></span>
</a>
</p>
<?php
if ($data):
/*
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if(empty($_POST["name"]) && empty($_POST["email"]) && empty($_POST["website"])){
echo "<p class='error'>Please fill up the required field!</p>";
} else {
header("Location:specsurvey-index.php");
}
}
*/
?>
<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;">
<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>電梯ID</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['id']; ?></td>
<td><?php echo $data['version']; ?></td>
<td><?php echo $data['contractno']; ?></td>
<td><?php echo $data['company']; ?></td>
<td><?php echo $data['facilitok_date']; ?></td>
<td><?php echo $data['tai_count']; ?></td>
<td><?php echo $data['serial']; ?></td>
<td><?php echo $data['buildno3'].$data['buildno5']; ?></td>
<td><?php echo $rtype_arr[$data['rtype']]; ?></td>
<td><?php echo $usefor_arr[$data['usefor']]; ?></td>
<td><?php echo $class_arr[$data['class']]; ?></td>
<td><?php echo $data['updater']; ?></td>
<td><?php echo $data['update_dt']; ?></td>
<td>
<p>
<a href="specsurvey-edit.php?id=<?php echo $data['id']; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-pencil"></span>
</a>
</p>
</td>
<td>
<p>
<a href="specsurvey-delete.php?id=<?php echo $data['id']; ?>" class="btn btn-info btn-sm" onClick="return confirm('Are you sure you want to delete?')">
<span class="glyphicon glyphicon-remove"></span>
</a>
</p>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php
else:
echo "<h2>There is no record!</h2>";
endif;
#代表結束連線
mysqli_close($link);
include "footer.php";
?>