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.
105 lines
2.4 KiB
105 lines
2.4 KiB
<?php
|
|
include "header.php";
|
|
|
|
// 設置一個空陣列來放資料
|
|
$data = array();
|
|
// sql語法存在變數中
|
|
$sql = "select * from department order by department_id, role_id";
|
|
|
|
// 用mysqli_query方法執行(sql語法)將結果存在變數中
|
|
$data = mysqli_query($link,$sql);
|
|
?>
|
|
|
|
<!-- <a href="create.php"><h2>新增</h2></a> -->
|
|
<!--
|
|
<p>
|
|
<a href="account_auth-create.php?function_name=account_auth&<?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;">
|
|
<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['id']; ?></td>
|
|
<td><?php echo $data['department_id']; ?></td>
|
|
<td><?php echo $data['name']; ?></td>
|
|
<td><?php echo $data['role_id']; ?></td>
|
|
<td><?php echo $data['role']; ?></td>
|
|
<td><?php echo $data['creater']; ?></td>
|
|
<td><?php echo $data['create_at']; ?></td>
|
|
<td>
|
|
<p>
|
|
<a href="account_auth-edit.php?id=<?php echo $data['id']; ?>&function_name=account_auth&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
|
|
<span class="glyphicon glyphicon-pencil"></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";
|
|
?>
|