forked from students-alumni-cell-iitkgp/sac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
acco-travel-form.php
296 lines (282 loc) · 12.7 KB
/
acco-travel-form.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
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<?php
require 'connection.php';
session_start();
$email=$_SESSION['email'];
$query1=" SELECT * FROM travel WHERE email= '$email' ";
$query3=" SELECT * FROM accommodation WHERE email= '$email' ";
$query_run1=$connection->query($query1);
$query_run2=$connection->query($query3);
if (($query_run1)&&($query_run2)) {
if(($query_run1->num_rows > 0)&&($query_run2->num_rows > 0)){
$query2 = mysqli_fetch_assoc($query_run1);
$query4 = mysqli_fetch_assoc($query_run2);
}
}
?>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<div class="container-fluid">
<form action="acco-travel-form-continue.php" method="post" style="text-align: left;">
<h3> Travel Details </h3>
<div class="input-field col s12">
Arrival Date
<!-- <select name="arrDate" required value="<?php //echo @$query2['arrivaldate']; ?>">
<option >11th January 2018</option>
<option >12th January 2018</option>
<option >13th January 2018</option>
<option >14th January 2018</option>
</select>
-->
<!-- New code to remove the errors -->
<select name="arrDate" required >
<option value="10th January 2019" <?php if( @$query2['arrivaldate'] == "10th January 2019") echo 'selected = "selected"';?>>10th January 2019</option>
<option value="11th January 2019" <?php if( @$query2['arrivaldate'] == "11th January 2019") echo 'selected = "selected"';?> >11th January 2019</option>
<option value="12th January 2019" <?php if( @$query2['arrivaldate'] == "12th January 2019") echo 'selected = "selected"';?>>12th January 2019</option>
<option value="13th January 2019" <?php if( @$query2['arrivaldate'] == "13th January 2019") echo 'selected = "selected"';?>>13th January 2019</option>
</select>
<!-- <label></label>
--></div><br>
<div class="col s12">
Arrival Time
<input type="time" name="arrTime" value="<?php echo @$query2['arrivaltime']; ?>" required>
</div>
<div class="input-field col s12">
Arrival Station/Airport
<input id="last_name" type="text" class="validate" name="arrSt" value="<?php echo @$query2['arrivalstation']; ?>">
</div>
<div class="input-field col s12" style="display: none;">
Train/Flight Name
<input id="last_name" type="text" class="validate" name="trainName" value="<?php echo @$query2['trainname']; ?>">
</div>
<div class="input-field col s12">
Train/Flight Number
<input id="last_name" type="text" class="validate" name="trainNo" value="<?php echo @$query2['trainno']; ?>">
</div>
<div class="input-field col s12" style="display: none;">
Number of Accompanying Persons
<input id="last_name" type="number" class="validate" name="accNo" value="<?php echo @$query2['accompanyno']; ?>">
</div>
<div class="input-field col s12" >
Your Secondary Phone Number
<input id="last_name" type="number" class="validate" name="secPhone" value="<?php echo @$query2['secondaryphone']; ?>" >
</div>
<div >
Do you require a cab from Kolkata to IIT Kharagpur?
<!-- <select name="iscab" onchange="checkCab(this)" value="<?php //echo @$query2['cabreq']; ?>">
<option>No</option>
<option>Yes</option>
</select>
-->
<select name="iscab" onchange="checkCab(this)" >
<option value="No" <?php if( @$query2['cabreq'] == "No") echo 'selected = "selected"';?>>No</option>
<option value="Yes" <?php if( @$query2['cabreq'] == "Yes") echo 'selected = "selected"';?>>Yes</option>
</select>
</div>
<div style="display:none; margin-left:5%" id="ifcab">
If Cab is required:<br>
<div class="input-field col s12">
Pickup Destination
<input id="last_name" type="text" class="validate" name="cabWhere" value="<?php echo @$query2['cabfrom']; ?>">
</div>
Pickup Date
<input type="date" name="cabDate" value="<?php echo @$query2['departdate']; ?>">
Pickup Time
<input type="time" name="cabWhen" value="<?php echo @$query2['cabat']; ?>">
<div class="input-field col s12">
Total Number of People travelling in cab
<input id="last_name" type="number" class="validate" name="cabPpl" value="<?php echo @$query2['cabpeople']; ?>">
</div>
Cab Preference
<!--
<select name="acabPref" value="<?php // echo @$query2['arrivalcabpref']; ?>" >
<option>Swift dezire</option>
<option>Scorpio</option>
<option>Honda City</option>
<option>Indigo</option>
</select>
-->
<select name="acabPref" >
<option value="Swift dezire" <?php if( @$query2['arrivalcabpref'] == "Swift dezire") echo 'selected = "selected"';?>> Swift dezire </option>
<option value="Scorpio" <?php if( @$query2['arrivalcabpref'] == "Scorpio") echo 'selected = "selected"';?>> Scorpio </option>
<option value="Honda City " <?php if( @$query2['arrivalcabpref'] == "Honda City ") echo 'selected = "selected"';?>> Honda City </option>
<option value="Indigo" <?php if( @$query2['arrivalcabpref'] == "Indigo") echo 'selected = "selected"';?>> Indigo </option>
</select>
</div>
<br>
<div >
Departure Date
<!--
<select name="depDate" required value="<?php //echo @$query2['departdate']; ?>">
<option>13th January 2018</option>
<option>14th January 2018</option>
<option>15th January 2018</option>
<option>16th January 2018</option>
</select>
-->
<select name="depDate" required >
<option value="13th January 2018" <?php if( @$query2['departdate'] == "13th January 2018") echo 'selected = "selected"';?> >13th January 2019</option>
<option value="14th January 2018" <?php if( @$query2['departdate'] == "14th January 2018") echo 'selected = "selected"';?>>14th January 2019</option>
<option value="15th January 2018" <?php if( @$query2['departdate'] == "15th January 2018") echo 'selected = "selected"';?>>15th January 2019</option>
<option value="16th January 2018" <?php if( @$query2['departdate'] == "16th January 2018") echo 'selected = "selected"';?>>16th January 2019</option>
</select>
</div><br>
<div >
On Departure, Do you require a cab to Kolkata?
<!--
<select name="iscab2" onchange="checkCab2(this)" value="<?php //echo @$query2['depcabreq']; ?>">
<option>No</option>
<option>Yes</option>
</select>
-->
<select name="iscab2" onchange="checkCab2(this)" >
<option value="No" <?php if( @$query2['depcabreq'] == "No") echo 'selected = "selected"';?>>No</option>
<option value="Yes" <?php if( @$query2['depcabreq'] == "Yes") echo 'selected = "selected"';?>>Yes</option>
</select>
</div>
<div style="display:none; margin-left:5%" id="ifcab2">
If Cab is required<br>
<div >
Departure Time
<input type="time" placeholder="Arrival Time" name="depTime" value="<?php echo @$query2['departtime']; ?>">
</div>
<div class="input-field col s12">
Departure Station/Airport
<input id="last_name" type="text" class="validate" name="depSt" value="<?php echo @$query2['departstation']; ?>">
</div>
Cab Preference
<!--
<select name="dcabPref" value="<?php //echo @$query2['depcabpref']; ?>">
<option>Swift dezire</option>
<option>Scorpio</option>
<option>Honda City</option>
<option>Indigo</option>
</select>
-->
<select name="dcabPref" >
<option value="Swift dezire" <?php if( @$query2['depcabpref'] == "Swift dezire") echo 'selected = "selected"';?>> Swift dezire </option>
<option value="Scorpio" <?php if( @$query2['depcabpref'] == "Scorpio") echo 'selected = "selected"';?>> Scorpio </option>
<option value="Honda City " <?php if( @$query2['depcabpref'] == "Honda City ") echo 'selected = "selected"';?>> Honda City </option>
<option value="Indigo" <?php if( @$query2['depcabpref'] == "Indigo") echo 'selected = "selected"';?>> Indigo </option>
</select>
</div>
<h3> Accommodation Details </h3>
<div >
Number of Accompanying Person
<!--
<select name="accNo2" onchange="checkAcc(this)" value="<?php //echo @$query4['accompanyno']; ?>">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
</select>
-->
<select name="accNo2" onchange="checkAcc(this)" >
<option value="0" <?php if( @$query2['accompanyno'] == "0") echo 'selected = "selected"';?>>0</option>
<option value="1" <?php if( @$query2['accompanyno'] == "1") echo 'selected = "selected"';?>>1</option>
<option value="2" <?php if( @$query2['accompanyno'] == "2") echo 'selected = "selected"';?>>2</option>
<option value="3" <?php if( @$query2['accompanyno'] == "3") echo 'selected = "selected"';?>>3</option>
</select>
</div>
<div style="display:none; margin-left:5%" id="ifacc1" >
Accompanying Persons<br>
1.<br>
<div class="input-field col s12">
Name of Person
<input id="last_name" type="text" class="validate" name="accName1" value="<?php echo @$query4['accname1']; ?>">
</div>
<div class="input-field col s12">
Relationship with the Person
<input id="last_name" type="text" class="validate" name="accRel1" value="<?php echo @$query4['accrel1']; ?>">
</div>
<div class="input-field col s12">Age
<input id="last_name" type="number" class="validate" name="accAge1" value="<?php echo @$query4['accage1']; ?>">
</div>
</div>
<div style="display:none; margin-left:5%" id="ifacc2" >
2.<br>
<div class="input-field col s12">
Name of Person
<input id="last_name" type="text" class="validate" name="accName2" value="<?php echo @$query4['accname2']; ?>">
</div>
<div class="input-field col s12">
Relationship with the Person
<input id="last_name" type="text" class="validate" name="accRel2" value="<?php echo @$query4['accrel2']; ?>">
</div>
<div class="input-field col s12">Age
<input id="last_name" type="number" class="validate" name="accAge2" value="<?php echo @$query4['accage2']; ?>">
</div>
</div>
<div style="display:none; margin-left:5%" id="ifacc3" >
3.<br>
<div class="input-field col s12">
Name of Person
<input id="last_name" type="text" class="validate" name="accName3" value="<?php echo @$query4['accname3']; ?>">
</div>
<div class="input-field col s12">
Relationship with the Person
<input id="last_name" type="text" class="validate" name="accRel3" value="<?php echo @$query4['accrel3']; ?>">
</div>
<div class="input-field col s12">Age
<input id="last_name" type="number" class="validate" name="accAge3" value="<?php echo @$query4['accage3']; ?>">
</div>
</div>
<div style="margin-top:20px;">
Preferred Alumni You Want to Share the room/take adjacent room with:<br>
<div class="input-field col s12">
Name of Person
<input id="last_name" type="text" class="validate" name="prefName" value="<?php echo @$query4['prefname']; ?>">
</div>
<div class="input-field col s12">
Year of Graduation of Preferred Person:
<input id="last_name" type="number" class="validate" name="prefYear" value="<?php echo @$query4['prefyear']; ?>">
</div>
<div class="input-field col s12">
Department of the person
<input id="last_name" type="text" class="validate" name="prefDep" value="<?php echo @$query4['prefdep']; ?>">
</div>
<div class="input-field col s12">
Hall of the person
<input id="last_name" type="text" class="validate" name="prefHall" value="<?php echo @$query4['prefhall']; ?>">
</div>
</div>
<div class="fixed-action-btn" style="bottom: 25px; right:100px;" id="cancel">
<a class="btn-floating btn-large waves-effect waves-light btn tooltipped" data-position="top" data-delay="50" data-tooltip="Cancel" name="button" id="backlobby" onclick="closeNav()" >
<i class="large material-icons" style="position: relative;right: 32px;bottom: 7px;" >clear</i></a>
</div>
<button type="submit" class="btn cyan waves-effect waves-light right" name="button">SUBMIT </button>
</form>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('select').material_select();
});
$(document).ready(function(){
$('.tooltipped').tooltip({delay: 50});
});
function checkCab(x) {
if(x.options[x.selectedIndex].text=="Yes") {
document.getElementById("ifcab").style.display="block";
}
else {
document.getElementById("ifcab").style.display="none";
}
}
function checkCab2(x) {
if(x.options[x.selectedIndex].text=="Yes") {
document.getElementById("ifcab2").style.display="block";
}
else {
document.getElementById("ifcab2").style.display="none";
}
}
function checkAcc(x) {
var n=x.options[x.selectedIndex].text;
var y= new Array("ifacc1","ifacc2","ifacc3");
var i;
for(i=0;i<n;i++) {
document.getElementById(y[i]).style.display="block";
}
for(i=n;i<3;i++) {
document.getElementById(y[i]).style.display="none";
}
}
</script>