01.
<!DOCTYPE html>
02.
<html>
03.
<head>
04.
<?php
05.
include
"css/css.php"
;
06.
include
"css/menu.php"
;
07.
include
'db/connect.php'
;
08.
?>
09.
</head>
10.
11.
<body
class
=
"w3-animate-opacity bg"
>
12.
<div
class
=
"container"
>
13.
<?php
14.
$perpage
= 10;
15.
if
(isset(
$_GET
[
'page'
])) {
16.
$page
=
$_GET
[
'page'
];
17.
}
else
{
18.
$page
= 1;
19.
}
20.
21.
$start
= (
$page
- 1) *
$perpage
;
22.
23.
$sql
=
"select * from informit inner join user on user.user_id = informit.user_id ORDER BY id DESC limit {$start} , {$perpage} "
;
24.
25.
$query
= mysqli_query(
$connect
,
$sql
);
26.
?>
27.
<center> <h3>รายการแจ้งซ่อมไอที</h3> </center>
28.
<br>
29.
30.
31.
<div
class
=
"table-responsive"
>
32.
<table
class
=
"table table-striped"
>
33.
<thead>
34.
<tr>
35.
<th>หมายเลข</th>
36.
<th>วันที่/เวลา</th>
37.
<th>ผู้แจ้ง</th>
38.
<th>ผู้รับงาน</th>
39.
<th>ผู้ปิดงาน</th>
40.
<th>สถานะ</th>
41.
<th>รายละเอียด</th>
42.
</tr>
43.
</thead>
44.
<tbody>
45.
<?php
while
(
$row
= mysqli_fetch_assoc(
$query
)) { ?>
46.
<tr>
47.
<td scope=
"row"
><?php
echo
$row
[
'id'
];?></td>
48.
<td><?php
echo
$row
[
'datet'
];?></td>
49.
<td><?php
echo
$row
[
'name'
];?></td>
50.
<td><?php
echo
$row
[
'wker'
];?></td>
51.
<td><?php
echo
$row
[
'wkerc'
];?></td>
52.
<td><?php
echo
$row
[
'statusit'
];?></td>
53.
<td><a href=
"vinformit.php?id=<?php echo $row["
id
"];?>"
target=
"_blank"
><button type=
"button"
class
=
"btn btn-info btn-sm"
>เปิด</button></a></td>
54.
</tr>
55.
<?php } ?>
56.
</tbody>
57.
</table>
58.
<!--Table-->
59.
<?php
60.
$sql2
=
"select * from informit"
;
61.
$query2
= mysqli_query(
$connect
,
$sql2
);
62.
$total_record
= mysqli_num_rows(
$query2
);
63.
$total_page
=
ceil
(
$total_record
/
$perpage
);
64.
?>
65.
66.
</div>
67.
68.
<div
class
=
"btn-group"
>
69.
<button type=
"button"
class
=
"btn btn-primary dropdown-toggle"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
>
70.
หน้า <?php
echo
$page
; ?>
71.
</button>
72.
<div
class
=
"dropdown-menu"
>
73.
<?php
for
(
$i
=1;
$i
<=
$total_page
;
$i
++){ ?>
74.
<a
class
=
"dropdown-item"
href=
"main.php?page=<?php echo $i; ?>"
><?php
echo
$i
; ?></a>
75.
<?php } ?>
76.
77.
</div>
78.
</div>
79.
</div>
80.
</body>
81.
</html>