-
Notifications
You must be signed in to change notification settings - Fork 0
/
order.php
77 lines (72 loc) · 1.94 KB
/
order.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
<title>Add hostel</title>
<script>
function redirect(id){
if (confirm("Are You sure you want to delete this record")){
document.location = "deletehostel.php?id="+id
}
}
</script>
<script src="js/jquery.js"></script>
<script src="js/jquery.nyroModal.custom.js"></script>
<script src="js/login.js"></script>
</head>
<body>
<?php
include_once("header4.php");
?>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<div id="body" >
</div>
<fieldset id=mainfield>
<legend>TUM Hostel Management System </legend>
<fieldset id="regform" style="width:95%">
<legend>Add Hostel </legend>
<form action="addhostel.php" method="post">
<label for="hostelid">Hostelid:</label>
<input type="text" name="hostelid" id="hostelid" />
<label for="hostelname">Hostelname:</label>
<input type="text" name="hostelname" id="hostelname" />
<label for="capacity">Capacity: </label>
<input type="text" name="capacity" id="capacity" />
<label for="location">Location: </label>
<input type="text" name="location" id="location" />
<label for="gender">Gender:</label>
<select name="gender" id="gender">
<option value="male">Male</option>
<option value="female"> Female</option>
</select>
<input type="submit" name="submit" id="submit" value="submit" />
</form>
</fieldset>
</fieldset>
<fieldset>
<legend>Hostels Added</legend>
<table id=hostels border="1" align="center">
<tr><th>Hostel ID</th><th>Hostel Name</th><th>Locations</th><th>Capacity</th><th>Gender Allowed</th></tr>
<?php
include '../includes/Database.php';
$sql = "SELECT * FROM hostel";
$db = new Database($sql);
$resp = $db->execute_query();
while ($row = mysql_fetch_row($resp)){
echo "<tr><td>$row[0]</td><td>$row[1]</td><td>$row[2]</td><td>$row[3]</td><td>$row[4]</td><td><a href=javascript:redirect('$row[0]')>Delete</a></td></tr>";
}
?>
</table>
</fieldset>
</body>
<?php
include_once("footer.php");
?>