This repository was archived by the owner on May 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbill_list.php
More file actions
67 lines (67 loc) · 2.48 KB
/
Copy pathbill_list.php
File metadata and controls
67 lines (67 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
require("scr_sql.php"); //$sql
$message = "<p style=\"text-align:center;\">คุณไม่ได้รับอนุญาตให้เข้าถึงส่วนนี้</p>";
//auth
session_start();
if(isset($_SESSION['mode'])){
if($_SESSION['mode'] === 2){
$query = mysqli_query($sql, "SELECT * FROM tb_room");
if($query){
$rows = mysqli_num_rows($query);
if($rows>0){
//data list
$message = "<table style=\"width:100%\">";
$message.= "<tr><th><span class=\"checkmark\"></span>ดูรายการบิลตามห้อง</th></tr><tr><td>";
for($i=0;$i<$rows;$i++){
$data = mysqli_fetch_array($query);
//button
$message.= "<button class=\"button-small button-blue\" onclick=\"detail('".$data['room_id']."')\"><h1><i class=\"fa fa-fw fa-home\"></i> ".$data['room_id']."</h1></button>";
//end-button
}
$message.= "</td></tr></table>";
}
else{
$message = "<p style=\"text-align:center;\">ไม่มีข้อมูลห้องพักในระบบ</p>";
}
}
else{
$messsage = "<p style=\"text-align:center;\">ติดต่อกับฐานข้อมูลผิดพลาด</p>";
}
}
}
mysqli_close($sql);?>
<html>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1.0">
<head>
<title>ระบบจัดการหอพัก</title>
</head>
<body>
<link rel="stylesheet" type="text/css" href="body.css">
<!--navbar-->
<script src="include-html.js"></script>
<script src="navbar.js""></script>
<p include-html="navbar.html"></p>
<script>includeHTML()</script>
<!--navbar-->
<div class="header"><h1>จัดการบิล</h1></div>
<?php echo $message;?>
<div style="text-align:center;">
<button class="button button-red" onclick="back()">ย้อนกลับ</button></p>
</div>
<script>
function add(){
window.open('bill_add.html','_self');
}
function back(){
window.open('admin_ui.html','_self')
}
function detail(id){
window.open('bill_room.php?id='+id,'_self')
}
</script>
<!--auth.js-->
<p id="page" type="admin"></p>
<script src="scr_auth.js"></script>
<!--auth.js-->
</body>
</html>