-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview_packages.php
More file actions
89 lines (84 loc) · 2.5 KB
/
Copy pathview_packages.php
File metadata and controls
89 lines (84 loc) · 2.5 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
include_once 'includes/config.php';
if (isset($_GET['status'])&&isset($_GET['mod'])) {
?>
<div id="pk">
<?php
sleep(1);
$hosel_id=$_GET['status'];
$query = "SELECT * FROM packages where hostel_id='".$hosel_id."'";
$db=mysqli_connect($DBServer, $DBUser, $DBPass, $DBName);
$result = $db->query($query);
if (!empty($result)) {
?>
<table>
<thead>
<tr>
<th>Package Name</th>
<th>Package Price</th>
<th>Package Description</th>
</tr>
</thead>
<tbody>
<?php
while ($item = mysqli_fetch_assoc($result)) {
?>
<tr>
<td><?php echo $item['pack_name'] ?></td>
<td><?php echo $item['pack_price'] ?></td>
<td><?php echo $item['pack_des'] ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
}
else if (isset($_GET['status'])&&!(isset($_GET['mod']))) {
?>
<div id="pk">
<?php
sleep(1);
$hosel_id=$_GET['status'];
$query = "SELECT * FROM packages where hostel_id='".$hosel_id."'";
$db=mysqli_connect($DBServer, $DBUser, $DBPass, $DBName);
$result = $db->query($query);
if (!empty($result)) {
?>
<table>
<thead>
<tr>
<th>Package Name</th>
<th>Package Price</th>
<th>Package Description</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
while ($item = mysqli_fetch_assoc($result)) {
?>
<tr>
<td><?php echo $item['pack_name'] ?></td>
<td><?php echo $item['pack_price'] ?></td>
<td><?php echo $item['pack_des'] ?></td>
<td>
<a href="edit_package.php?id=<?php echo $item['id'] ?>">Edit</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
}
else
{
?>
<p>Not found!</p>
<?php
}