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.
167 lines
4.9 KiB
167 lines
4.9 KiB
<?php
|
|
include "header.php";
|
|
|
|
// 設置一個空陣列來放資料
|
|
$data = array();
|
|
// sql語法存在變數中
|
|
$sql_cmd = sql_myself($user_id, "repairerid");
|
|
// 客服:莊雅涵
|
|
if ($user_id == "M0112") {
|
|
$last6mon = date("Y/m/d 00:00:00", strtotime("-6 month"));
|
|
$sql_cmd = "where create_date >= '$last6mon'";
|
|
}
|
|
$sql = "SELECT * FROM repair $sql_cmd ORDER BY id";
|
|
|
|
// 用mysqli_query方法執行(sql語法)將結果存在變數中
|
|
$data = mysqli_query($link,$sql);
|
|
|
|
?>
|
|
|
|
<!-- <a href="create.php"><h2>新增</h2></a> -->
|
|
<?php if ($user_auth&2) { ?>
|
|
<p>
|
|
<a href="repair-create.php?function_name=repair&<?php echo $token_link; ?>" 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:repair-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 class="width_style_1">圖片</th>
|
|
<th>聯絡人</th>
|
|
<th>聯繫電話</th>
|
|
<th>保養人員工號</th>
|
|
<th>保養人員</th>
|
|
<th>技術支持電話</th>
|
|
<th>實際處理人員工號</th>
|
|
<th>實際處理人員</th>
|
|
<th>處理進度</th>
|
|
<th>備註</th>
|
|
<th>報修時間</th>
|
|
<th>開始處理時間</th>
|
|
<th>結案時間</th>
|
|
<?php if ($user_auth&2) { ?>
|
|
<th>修改</th>
|
|
<th>刪除</th>
|
|
<?php } ?>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<?php foreach($data as $data) : ?>
|
|
<tr>
|
|
<td><?php echo $data['id']; ?></td>
|
|
<td><?php echo $data['fixnumber']; ?></td>
|
|
<td><?php echo $data['customerid']; ?></td>
|
|
<td><?php echo $data['contractno']; ?></td>
|
|
<td><?php echo $data['facilityno']; ?></td>
|
|
<td><?php echo $data['damage_detail']; ?></td>
|
|
<td class="width_style_1"><img src="<?php echo '../app/' . $data['file_path']; ?>" alt="" class="index-image"></td>
|
|
<td><?php echo $data['contact_person']; ?></td>
|
|
<td><?php echo $data['contact_number']; ?></td>
|
|
<td><?php echo $data['repairerid']; ?></td>
|
|
<td><?php echo $data['repairername']; ?></td>
|
|
<td><?php echo $data['phone_call_help']; ?></td>
|
|
<td><?php echo $data['actual_repairerid']; ?></td>
|
|
<td><?php echo $data['actual_repairername']; ?></td>
|
|
<td><?php echo $data['progress_flag']; ?></td>
|
|
<td><?php echo $data['memo']; ?></td>
|
|
<td><?php echo $data['create_date']; ?></td>
|
|
<td><?php echo $data['start_date']; ?></td>
|
|
<td><?php echo $data['end_date']; ?></td>
|
|
<?php if ($user_auth&2) { ?>
|
|
<td>
|
|
<p>
|
|
<a href="repair-edit.php?id=<?php echo $data['id']; ?>&function_name=repair&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
|
|
<span class="glyphicon glyphicon-pencil"></span>
|
|
</a>
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
<a href="repair-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" 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>
|
|
<?php } ?>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<?php
|
|
|
|
else:
|
|
echo "<h2>There is no record!</h2>";
|
|
endif;
|
|
|
|
#代表結束連線
|
|
mysqli_close($link);
|
|
|
|
include "footer.php";
|
|
|
|
?>
|
|
|