-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedres.php
More file actions
264 lines (246 loc) · 5.29 KB
/
edres.php
File metadata and controls
264 lines (246 loc) · 5.29 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<html>
<head>
<title>edit reservation</title>
<script language=javascript src="function.js">
</script>
<script language=javascript>
function checkout()
{
var i=0;
for(x=0;x<document.f1.elements.length;x++)
{
if(document.f1.elements[x].value=="")
{
f1.txtname.focus();
alert("Plz Enter All Value");
i=1;
break;
}
}
if(i==0)
{
f1.method="POST";
f1.action="editres.php";
f1.submit();
}
}
</script>
</head>
<body bgcolor="#fff2e5">
<form method=POST>
Enter E-mail:
<input type="text" name="txtemail" value="<?php echo $_REQUEST['txtemail'];?>">
<table>
<tr>
<th align=left>CHECKIN DT:</th>
<td>
<select name=cmdday>
<?php
for($i=1;$i<=31;$i++)
if($i==date("d"))
{
echo "<option value='$i' selected>$i</option>";
}
else
{
echo "<option value='$i'>$i</option>";
}
?>
</select>
<select name=cmdmonth>
<?php
for($i=1;$i<=12;$i++)
if($i==date("m"))
{
echo "<option value='$i' selected>$i</option>";
}
else
{
echo "<option value='$i'>$i</option>";
}
?>
</select>
<select name=cmdyear>
<?php
for($i=2010;$i<=2020;$i++)
{
if($i==date("Y"))
{
echo "<option value='$i' selected>$i</option>";
}
else
{
echo "<option value='$i'>$i</option>";
}
}
?>
</select>
</td>
</tr>
</table>
<input type=submit value="go" name=sgo>
</form>
<?php
if(isset($_POST["sgo"]))
{
include "connection.php";
$email=$_POST["txtemail"];
$cid=$_POST["cmdday"]."-".$_POST["cmdmonth"]."-".$_POST["cmdyear"];
$qsel="select * from reservation where r_email='".$email."' and r_chkindt='".$cid."'";
$rs=mysqli_query($qsel);
if(mysqli_num_rows($rs)<1)
{
echo "<font color=purple>Record not found.</font>";
exit();
}
$v=mysql_fetch_array($rs);
?>
<form action="editres.php" method=POST name=f1>
<table>
<tr>
<th align=left>CHECKIN DT :</th>
<td>
<select name=cmdday>
<?php
$d=substr($v["r_chkindt"],8);
for($i=1;$i<=31;$i++)
if($i==$d)
{
echo "<option value='$i' selected>$i</option>";
}
else
{
echo "<option value='$i'>$i</option>";
}
?>
</select>
<select name=cmdmonth>
<?php
$m=substr($v["r_chkindt"],5,2);
for($i=1;$i<=12;$i++)
if($i==$m)
{
echo "<option value='$i' selected>$i</option>";
}
else
{
echo "<option value='$i'>$i</option>";
}
?>
</select>
<select name=cmdyear>
<?php
$y=substr($v["r_chkindt"],0,4);
for($i=2010;$i<=2020;$i++)
{
if($i==$Y)
{
echo "<option value='$i' selected>$i</option>";
}
else
{
echo "<option value='$i'>$i</option>";
}
}
?>
</select>
</td>
</tr>
<tr>
<th align=left>CHECKOUT DT :</th>
<td>
<select name=cmbday>
<?php
$d=substr($v["r_chkoutdt"],8);
for($i=1;$i<=31;$i++)
{
if($i==$d)
{
echo "<option value='$i' selected>$i</option>";
}
else
{
echo "<option value='$i'>$i</option>";
}
}
?>
</select>
<select name=cmbmonth>
<?php
$m=substr($v["r_chkoutdt"],5,2);
for($i=1;$i<=12;$i++)
{
if($i==$m)
{
echo "<option value='$i' selected>$i</option>";
}
else
{
echo "<option value='$i'>$i</option>";
}
}
?>
</select>
<select name=cmbyear>
<?php
$y=substr($v["r_chkoutdt"],0,4);
for($i=2010;$i<=2020;$i++)
{
if($i==$y)
{
echo "<option value='$i' selected>$i</option>";
}
else
{
echo "<option value='$i'>$i</option>";
}
}
?>
</select>
</td>
</tr>
<tr>
<th align=left>NO OF ROOMS :</th>
<td><input type=text name=txtroom size=3 value="<?php echo $v['r_rooms'];?>"></td>
<th align=left>TYPE :</th>
<td colspan=3><input type=text name=txttype size=10 readonly onKeyPress="validtype()" value="<?php echo $v['r_type'];?>"></td>
</tr>
<tr>
<th align=left>FULL NAME :</th>
<td colspan=3><input type=text name=txtname size=50 value="<?php echo $v['r_name'];?>"></td>
</tr>
<tr>
<th align=left>EMAIL :</th>
<td colspan=3><input type=text name="email" size=50 readonly onKeyPress="validemail()" value="<?php echo $v['r_email'];?>"></td>
</tr>
<tr>
<th align=left>COMPANY :</th>
<td colspan=3><input type=text name=txtcompany size=50 onKeyPress="validcompany()" value="<?php echo $v['r_company'];?>"></td>
</tr>
<tr>
<th align=left>TELEPHONE :</th>
<td colspan=3><input type=text name=txtnumber size=15 onKeyPress="validnumber()" value="<?php echo $v['r_phone'];?>"></td>
</tr>
<tr>
<th align=left valign=top>ADDRESS :</th>
<td colspan=3><textarea name=txtaddress rows=5 cols=40><?php echo $v['r_address'];?></textarea></td>
</tr>
<tr>
<th align=left>SPECIAL REQUIREMENT IF ANY :</th>
<td colspan=3><textarea name=txtspanyreq rows=5 cols=40><?php echo $v['r_spanyreq'];?> </textarea></td>
</tr>
<tr>
<td align=center colspan=2><input type="submit" name="s2" value="submit"></td>
</tr>
</table>
<input type=hidden name=txtemail2 value="<?php $_POST['txtemail']?>">
</form>
<?php } ?>
</body>
</html>
<?php
$qupd=mysqli_query("update tariff set avroom=".$norm." where type='".$type."'");
$upd="update reservation set r_chkindt=$cid,r_chkoutdt=$cod,r_rooms=$norm,r_name=$name,r_email=$email,r_company=$comp,r_phone=$tele,r_address=$addr,r_spanyreq=$spreq where r_email=$emailn and r_chkindt=$cind";
$u=mysqli_query($upd);
echo "<br><font color=7c0000 size=5>THANK YOU FOR INTEREST IN THE HOTEL PARAS.</font>";
?>