-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhistory.php
113 lines (57 loc) · 2.26 KB
/
history.php
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk="
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<?php
// include('connect.php');
if(isset($_SESSION['logged_in']['username'])){
$username = $_SESSION['logged_in']['username'];
?>
<div class="container-fluid" style="height: 20rem;">
<div class="row justify-content-center text-center">
<div id="history-head">ประวัติการใช้บริการ</div>
<div id="history-subhead">เช็คประวัติรายการข้างล่างนี้</div>
<table class="table table-striped">
<thead>
<tr>
<th scope="col">ชื่อบริการ</th>
<th scope="col">ผู้รับผิดชอบ</th>
<th scope="col">วันที่</th>
<th scope="col" >ขนาด</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM `individual_works` WHERE `work_customer` = '$username'";
$result = mysqli_query($connect,$sql);
while($arr = mysqli_fetch_array($result)){
?>
<tr>
<td style="font-size: 13px"><?php echo $arr['work_name']?></td>
<td style="font-size: 13px"><?php echo $arr['worker_name']?></td>
<td style="font-size: 13px"><?php echo $arr['work_date']?></td>
<td style="font-size: 13px"><?php echo $arr['work_scale']." ".$arr['scale_tag']?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<?php
} else {
?>
<script>
$(document).ready(function() {
Swal.fire({
icon: 'error',
title: 'โปรดเข้าสู่ระบบก่อน',
showConfirmButton: false,
timer: 2500
});
});
window.location.href = "index.php?page=login";
</script>
<?php
}
?>