forked from sushil11-art/Exam-Hall-Seating-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroomUpdate.php
107 lines (93 loc) · 2.37 KB
/
roomUpdate.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
<!DOCTYPE html>
<html>
<head>
<title>Update Room</title>
<style type="text/css">
.hr{
margin-top: 10px;
margin-right: 20px;
height: 3px;
background: darkgreen;
}
.space{
margin: 10px;
}
.table{
width: 400px;
margin-left: 250px;
}
</style>
</head>
<body>
<?php include "adminSlide.php"; ?>
<div style="margin-left: 220px; margin-top: 60px;">
<div class="container" style="margin-top: 20px;">
<p><b>Room Management</b></p>
</div>
<div class="container" style="margin-left: 200px;">
<p><b>Room Update</b></p>
</div>
<!-- -------------------------------------------------- -->
<?php
$host = "localhost";
$dbusername = "root";
$dbpassword = "";
$dbname = "dbphp";
$con = mysqli_connect($host,$dbusername,$dbpassword,$dbname);
if (mysqli_connect_error()) {
die('connect Error('.mysqli_connect_error().')'.mysqli_connect_error());
}
$ID= $_GET ['id'];
$sql="select * from room where id=$ID";
$result=mysqli_query($con,$sql);
$row=mysqli_num_rows($result);
$block=0;
$room=0;
$rw=0;
if ($row>0) {
while ($row = mysqli_fetch_array($result)) {
$id=$row['id'];
$block=$row['block'];
$room=$row['roomno'];
$rw=$row['row'];
}
}
?>
<!-- -------------------------------------------------- -->
<div class="container">
<table border="1" class="table">
<form action="roomUpdateStore.php" method="POST">
<input type="number" name="id" value="<?php echo $id; ?>" hidden>
<div class="space">
<tr >
<td style="width: 200px;"><label> Block : <input type="text" name="block" value="<?php echo $block; ?>" required style="width: 60px;"></label> </td>
<td colspan="2" align="center">column : 2</td>
</tr>
</div>
<div class="space">
<tr>
<td>
<label>Room no : <input type="number" name="room" value="<?php echo $room; ?>" required style="width: 100px;"> </label>
</td>
<td>
<label>Row <input type="number"name="row" value="<?php echo $rw; ?>" required style="width: 60px;"> </label>
</td>
</tr>
</div>
<tr>
<div class="space">
<td colspan="2" align="center">
<button type="submit" name="OK" >OK</button>
</td>
</div>
</tr>
</form>
</table>
</div>
<div class="container" style="margin-top: 20px;">
<hr class="hr">
</div>
<!-- -------------------------------------------------- -->
</div>
</body>
</html>