-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview_hostels.php
More file actions
86 lines (79 loc) · 3.16 KB
/
Copy pathview_hostels.php
File metadata and controls
86 lines (79 loc) · 3.16 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
<?php include_once 'includes/config.php'; ?>
<br><br><br>
<div class="admin-form">
<?php
if (isset($_SESSION['email'])) {
?>
<h1>View all Hostels!</h1>
<div id="vh">
<?php
$member=getMemberId($_SESSION['email']);
$query = "SELECT * FROM hostels where owner_id='".$member."'";
$result = $db->query($query);
if (!empty($result)) {
?>
<table>
<thead>
<tr>
<th>Hostel Name</th>
<th>Hostel Type</th>
<th>Hostel City</th>
<th>Hostel Sector</th>
<th>Hostel Address</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
while ($item = mysqli_fetch_assoc($result)) {
?>
<tr>
<td><?php echo $item['hostel_name'] ?></td>
<td><?php echo $item['hostel_type'] ?></td>
<td><?php echo $item['hostel_city'] ?></td>
<td><?php echo $item['hostel_sector'] ?></td>
<td><?php echo $item['hostel_address'] ?></td>
<td>
<button value="<?php echo $item['id'] ?>" class="pks">View Packages</button>
</td>
<td >
<button value="<?php echo $item['id'] ?>" class="fks">View Features</button>
</td>
<td>
<a href="edit_hostel.php?id=<?php echo $item['id'] ?>">Edit</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
</div>
<div id="pfdata">
<?php include 'view_packages.php' ?>
</div>
<?php
}
else
{
?><p>Not Logged In!</p><?php
}
?>
</div>
<script>
$(document).ready(function(){
$('.pks').click(function(){
$('#pfdata').load('view_packages.php','status='+$(this).val());
$('#pfdata').html("<img src='graphics/loading.gif' alt='Loading Packages...'>");
});
$('.fks').click(function(){
$('#pfdata').load('view_features.php','status1='+$(this).val());
$('#pfdata').html("<img src='graphics/loading.gif' alt='Loading Packages...'>");
});
});
</script>