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.
141 lines
3.7 KiB
141 lines
3.7 KiB
<?php
|
|
/**
|
|
* 北=張潘榮(M0041) 中=林瑋隆(M0113) 南=韋宗榮(M0039)
|
|
*/
|
|
include "header.php";
|
|
|
|
// 設置一個空陣列來放資料
|
|
$data = array();
|
|
$inst_arr = ["M0041" => "北", "M0113" => "中", "M0039" => "南"];
|
|
|
|
$sql_cmd = sql_myself($user_id);
|
|
$sql2 = (empty($sql_cmd)) ? "" : "and a.region = '$inst_arr[$user_id]'";
|
|
$sql = "select a.id, a.accountid, a.facilityno, a.issue_time, a.process, a.creater, a.create_at, b.custom from wipinstallation a, wipwholestatus b where a.accountid = b.contractno and a.facilityno = b.facilityno $sql2";
|
|
$data = mysqli_query($link,$sql);
|
|
?>
|
|
|
|
<!-- <a href="create.php"><h2>新增</h2></a> -->
|
|
<?php if ($user_auth&2) { ?>
|
|
<p>
|
|
<a href="wipinstallation-create.php?function_name=wipinstallation&<?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:wipinstallation-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>建檔時間</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['accountid']; ?></td>
|
|
<td><?php echo $data['facilityno']; ?></td>
|
|
<td><?php echo $data['custom']; ?></td>
|
|
<td><?php echo substr($data['issue_time'], 0, 10); ?></td>
|
|
<td><?php echo $data['process']; ?></td>
|
|
<td><?php echo $data['creater']; ?></td>
|
|
<td><?php echo $data['create_at']; ?></td>
|
|
<?php if ($user_auth&2) { ?>
|
|
<td>
|
|
<p>
|
|
<a href="wipinstallation-edit.php?id=<?php echo $data['id']; ?>&function_name=wipinstallation&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
|
|
<span class="glyphicon glyphicon-pencil"></span>
|
|
</a>
|
|
</p>
|
|
</td>
|
|
<!--<td>
|
|
<p>
|
|
<a href="wipinstallation-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";
|
|
|
|
?>
|