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";
$room_arr = ["1" => "C區會議室1", "2" => "C區會議室2", "3" => "大直會議室"];
$etime_arr = ["07:59" => "08:00", "08:29" => "08:30", "08:59" => "09:00", "09:29" => "09:30", "09:59" => "10:00", "10:29" => "10:30",
"10:59" => "11:00", "11:29" => "11:30", "11:59" => "12:00", "12:29" => "12:30", "12:59" => "13:00", "13:29" => "13:30",
"13:59" => "14:00", "14:29" => "14:30", "14:59" => "15:00", "15:29" => "15:30", "15:59" => "16:00", "16:29" => "16:30",
"16:59" => "17:00", "17:29" => "17:30", "17:59" => "18:00", "18:29" => "18:30", "18:59" => "19:00", "19:29" => "19:30",
"19:59" => "20:00", "20:29" => "20:30", "20:59" => "21:00", "21:29" => "21:30", "21:59" => "22:00", "22:29" => "22:30",
"22:59" => "23:00", "23:29" => "23:30", "23:59" => "00:00"];
// 設置一個空陣列來放資料
$data = array();
// sql語法存在變數中
$sql = "select * from meeting where (creater = '$user_id' or attend like '%$user_id%') 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="meeting-create.php?function_name=meeting&<?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>
<th>建檔時間</th>
<?php if ($user_auth&2) { ?>
<th>取消</th>
<?php } ?>
</tr>
</thead>
<tbody>
<?php foreach($data as $data) : ?>
<tr>
<td><?php echo $data['id']; ?></td>
<td><a href="meeting-edit.php?id=<?php echo $data['id']; ?>&function_name=meeting&<?php echo $token_link; ?>"><?php echo $data['title']; ?></a></td>
<td><?php echo $data['mdate']; ?></td>
<td><?php echo substr($data['stime'], 0, 5); ?></td>
<td><?php echo $etime_arr[substr($data['etime'], 0, 5)]; ?></td>
<td><?php echo $room_arr[$data['room']]; ?></td>
<td><?php if ($data['status']=="Y") echo "正常"; else echo "已取消"; ?></td>
<td><?php echo $data['creater']; ?></td>
<td><?php echo $data['create_at']; ?></td>
<?php if ($user_auth&2) { ?>
<td>
<p>
<?php if (($data['creater'] == $user_id) && ($data['status']=="Y")) { ?>
<a href="meeting-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>
<?php } else echo "-"; ?>
</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";
?>