This repository has been archived by the owner on Feb 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtourguide.php
300 lines (250 loc) · 12 KB
/
tourguide.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
297
298
299
300
<?php
$pageTitle = 'tourguide';
include 'header.php';
$search = null;
$num = null;
if (isset($_POST['search']))
{
$search = $_POST['search'];
$sqlquery = "SELECT *
FROM tour_guide
WHERE area LIKE '%$search%' ";
try {
$returnval = $dbcon->query($sqlquery); ///PDO Statement
$divisionstable = $returnval->fetchAll();
} catch (PDOException $ex) {
echo $ex;
}
$num = mysqli_num_rows($sqlquery);
}
elseif (isset($_GET['areaname']))
{
$search = $_GET['areaname'];
$sqlquery = "SELECT *
FROM tour_guide
WHERE area LIKE '$search' ";
try {
$returnval = $dbcon->query($sqlquery); ///PDO Statement
$divisionstable = $returnval->fetchAll();
} catch (PDOException $ex) {
echo $ex;
}
$num = mysqli_num_rows($returnval);
}
else
{
$sqlquery = "SELECT * FROM `tour_guide` WHERE 1 ";
try {
$returnval = $dbcon->query($sqlquery); ///PDO Statement
$divisionstable = $returnval->fetchAll();
} catch (PDOException $ex) {
echo $ex;
}
$num = mysqli_num_rows($returnval);
}
if(isset($_POST['id']))
{
$t_id= $_POST['id'];
$sqlquery= "DELETE FROM `tour_guide` WHERE id LIKE '$t_id'";
if($con->query($query1) === TRUE)
{
?>
<script>alert("Remove Successfully!!!") </script>
<?php
header("Location:add_remove_tourguide.php");
}
else
{
?>
<script>alert("Remove Failed??") </script>
<?php
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<link rel="stylesheet" href="css/style.css" />
<title>Ghure Ashi</title>
</head>
<body>
<!-- Navbar started -->
<?php
include("navbar.php");
?>
<!-- Navbar end -->
<!-- login modal start -->
<!-- Button trigger modal -->
<!--login Modal -->
<div class="modal fade" id="logineModal" tabindex="-1" role="dialog" aria-labelledby="logineModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="logineModalLabel">Log In</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form method="post" action=LogSign.php>
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input name="emaill" id="emaill" type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp"
placeholder="Enter email" />
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone
else.</small>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input name="passl" id="passl" type="password" class="form-control" id="exampleInputPassword1"
placeholder="Password" />
</div>
<button type="submit" class="btn btn-primary" name="submitl" id="submitl">Submit</button>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!-- login modal end -->
<!-- sign up modal -->
<div class="modal fade" id="signupModal" tabindex="-1" role="dialog" aria-labelledby="signupModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="signupModalLabel">Sign up</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form method="post" action="LogSign.php">
<div class="form-group">
<label for="username" >Username</label>
<input name="name" id="name" type="text" class="form-control" id="username" aria-describedby="usernameHelp"
placeholder="Enter Username" />
</div>
<div class="form-group">
<label for="exampleInputEmail1" >Email address</label>
<input name="email" id="email" type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp"
placeholder="Enter email" />
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone
else.</small>
</div>
<div class="form-group">
<label for="exampleInputPassword1" >Password</label>
<input name="pass" id="pass" type="password" class="form-control" id="exampleInputPassword1"
placeholder="Password" />
</div>
<div class="form-group">
<label for="contactno" >Contact No.</label>
<input name="contact" id="contact" type="text" class="form-control" id="contactno" aria-describedby="contactnoHelp"
placeholder="Enter Your Contact Number" />
</div>
<div class="form-group">
<label for="address" >Address</label>
<input name="address" id="address" type="text" class="form-control" id="contactno" aria-describedby="contactnoHelp"
placeholder="Enter Your Contact Number" />
</div>
<fieldset class="form-group">
<div class="row">
<legend class="col-form-label col-sm-2 pt-0" >Gender</legend>
<div class="col-sm-10">
<div class="form-check">
<input class="form-check-input" type="radio" name="gridRadios" id="gridRadios1"
value="option1" checked />
<label class="form-check-label" for="gridRadios1">
Male
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="gridRadios" id="gridRadios2"
value="option2" />
<label class="form-check-label" for="gridRadios2">
Female
</label>
</div>
</div>
</div>
</fieldset>
<button type="submit" class="btn btn-primary" name="submit" id="submit">Submit</button>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!-- sign up modal end -->
<!-- show search result -->
<div class="container">
<form class="form-horizontal mx-3 my-3" method="post" action=" ">
<?php
if(isset($_SESSION['Aemail'])){
?>
<div class="form-group">
<h4 class="mt-4">Enter an Area:</h4>
<input type="text" name="search" class="form-control" id="email" placeholder="Enter an Area"/>
</div>
<button type="submit" class="btn btn-primary">Search</button>
<a href="write_tourguide.php" class="btn btn-primary mb-5 mt-1 float-right" aria-label="Search" name="wb" id="wb"><strong>Add new Tourguide</strong></a><br><br>
<?php } ?>
<br>
</form>
</div>
<?php
if($num == 0)
{?>
<div class="container my-5">
<div class="text-center" style="margin: 150px;">
<h2 class="featurette-heading">Sorry No Tour Guide Found. </h2>
</div>
</div>
<?php
}
else{
while($details = mysqli_fetch_array($queryfire))
{?>
<!-- show search result -->
<div class="container my-5">
<div class="row featurette d-flex justify-content-center align-items-center">
<div class="col-md-7 order-md-1">
<form action="add_remove_tourguide.php" class="mb-3" method="post">
<h2 class="featurette-heading">ID: <?php echo $details['id'] ?> </h2>
<h4><span class="text-muted">Name: <?php echo $details['name'] ?></span></h4>
<p class="lead">Area: <?php echo $details['area'] ?></p>
<p class="lead">NID : <?php echo $details['NID'] ?></p>
<p class="lead">Contact: <?php echo $details['contact'] ?></p>
<p class="lead">Hire Rate: <?php echo $details['hire_rate'] ?></p>
<input type="hidden" name="id" value="<?php echo $details['id']?>">
<button type="submit" class="btn btn-primary mb-2 mt-3 mr-2" name="Remove">Remove</button>
</form>
</div>
<div class="col-md-5 order-md-2">
<?php echo '<img class="bd-placeholder-img bd-placeholder-img-lg featurette-image img-fluid mx-auto" width="500"
height="500" src="data:image/jpeg;base64,'.base64_encode( $details['image'] ).'"alt="" style="border:5px solid black"/>';?>
</div>
</div>
</div>
<!-- show search result end -->
<?php }
}
?>
<?php include 'footer.php'; ?>