-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsearch.php
259 lines (231 loc) · 9.63 KB
/
search.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
<html lang="en">
<head>
<title>Accomodation Finder</title> <!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<style>
body{
background-image: url("assets/images/4.jpg");
}
</style>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
</head>
<body class="text-white">
<nav class="navbar navbar-toggleable-md navbar-inverse fixed-top bg-inverse">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#"><h1>Accomodation Finder</h1></a>
<div class="collapse navbar-collapse" id="navbarCollapse">
<form class="form-inline mt-2 mt-md-0 mr-auto">
</form>
<ul class="navbar-nav " style="margin-right:10%">
<li class="nav-item">
<a class="nav-link" href="index.html"><h4>Home</h4><span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="#"><h4>Search</h4><span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="form.html"><h4>Registration</h4><span class="sr-only">(current)</span></a>
</li>
</ul>
</div>
</nav>
<br /><br /><br/>
</br/>
<div class="container">
<form action = "submit2.php" method = "post">
<div class="row">
<h3>Fill this form according to your requirements :</h3>
</div>
<hr />
<div class="row">
<div class="col-lg-6 offset-lg-3 col-md-8 offset-md-2 col-sm-10 offset-sm-1 col-xs-10 offset-xs-1">
<div class="form-group">
<span for="name">Select locality :</span>
<select name="locality" onchange="getValue(this.value)" class="form-control">
<option value="">choose</option>
<?php
include 'dbconnect.php';
$q = "SELECT * FROM area";
$results=$conn -> query($q);
//loop
while($row = mysqli_fetch_array($results))
{
?><option value="<?php echo $row['locality']; ?>"> <?php echo $row['locality'];?></option>
<?php }?>
?>
</select>
</div>
<div class="form-group">
<div class="row">
<div class="col-sm-6">
<label class="radio-inline">
PG : <input type="radio" name="hostel" value = '0'/>
</label>
</div>
<div class="col-sm-6">
<label class="radio-inline">
Hostel : <input type="radio" name="hostel" value = '1'/>
</label>
</div>
</div>
</div>
<div class="form-group">
<span for="type">Hostel/PG Type :</span>
<br />
<select name = "type" class="form-control">
<option value="Girls">Only Girls</option>
<option value="Boys">Only Boys</option>
<option value="Both">No Constraints</option>
</select>
</div>
<div class="form-group">
<label>Mess :</label>
<div class="row">
<div class="col-sm-6">
<label class="radio-inline">
veg : <input type="radio" name="veg" value= '1'/>
</label>
</div>
<div class="col-sm-6">
<label class="radio-inline">
non-veg : <input type="radio" name="veg" value = '0'/>
</label>
</div>
</div>
</div>
<div class="form-group">
<label>Fees less than :</label>
<input type="number" name="lessfees" class="form-control"/>
</div>
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" name="ac" type="checkbox" value="1"> : AC
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" name="bathroom" type="checkbox" value="1"> : Attached Bathroom
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" name="wifi" type="checkbox" value="1"> : wifi
</label>
</div>
</div>
</div>
<hr />
<hr />
<div class="row">
<div class="col-xs-12 offset-lg-6 offset-md-6 offset-sm-6 offset-xs-6">
<div >
<button type="submit" class="btn btn-primary" id="sub">Submit</button>
</div>
</div>
</div>
</form>
</div>
<hr />
<br />
<br />
<hr />
<div class="container">
<form method="post" action="submit3.php">
<div class="row">
<h3>Get details About :</h3>
</div>
<hr />
<div class="row">
<div class="col-lg-6 offset-lg-3 col-md-8 offset-md-2 col-sm-10 offset-sm-1 col-xs-10 offset-xs-1">
<div class="form-group">
<span for="hostel">Get details of a particular Hostel :</span>
<select name="hostel" class="form-control">
<option value="">choose</option>
<?php
include 'dbconnect.php';
$q = "SELECT * FROM Hostel";
$results=$conn -> query($q);
//loop
while($row = mysqli_fetch_array($results))
{
?><option value="<?php echo $row['H_name']; ?>"> <?php echo $row['H_name'];?></option>
<?php }?>
?>
</select>
</div>
<hr />
<hr />
<div class="row">
<div class="col-xs-12 offset-lg-6 offset-md-6 offset-sm-6 offset-xs-6">
<div >
<button type="submit" class="btn btn-primary" id="sub">Submit</button>
</div>
</div>
</div>
</div>
</div>
</form>
<form method="post" action="submit4.php">
<div class="row">
<div class="col-lg-6 offset-lg-3 col-md-8 offset-md-2 col-sm-10 offset-sm-1 col-xs-10 offset-xs-1">
<div class="form-group">
<span for="locality">Get details of all the hostels in a particular area :</span>
<select name="locality" class="form-control">
<option value="">choose</option>
<?php
include 'dbconnect.php';
$q = "SELECT * FROM area";
$results=$conn -> query($q);
//loop
while($row = mysqli_fetch_array($results))
{
?><option value="<?php echo $row['locality']; ?>"> <?php echo $row['locality'];?></option>
<?php }?>
?>
</select>
</div>
<hr />
<hr />
<div class="row">
<div class="col-xs-12 offset-lg-6 offset-md-6 offset-sm-6 offset-xs-6">
<div >
<button type="submit" class="btn btn-primary" id="sub">Submit</button>
</div>
</div>
</div>
</div>
</div>
</form>
<hr />
<hr />
<form method="post" action="submit5.php">
<div class="row">
<div class="col-lg-6 offset-lg-3 col-md-8 offset-md-2 col-sm-10 offset-sm-1 col-xs-10 offset-xs-1">
<div class="form-group">
<span >Details of number of hostels and pgs in different areas :</span>
</div>
<div class="row">
<div class="col-xs-12 offset-lg-6 offset-md-6 offset-sm-6 offset-xs-6">
<div >
<button type="submit" class="btn btn-primary" id="sub">Click here</button>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<script>
function getValue(sel){
console.log(sel);
}
</script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
</body>
</html>