-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathuser_profile.php
305 lines (239 loc) · 7.88 KB
/
user_profile.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
301
302
303
304
305
<?php
session_start();
include_once 'dbconnect.php';
// it will never let you open index(login) page if session is set
if ( isset( $_SESSION[ 'user' ] ) == "" ) {
header( "Location: index.php" );
exit;
}
$e = $_SESSION['user'];
$res = mysql_query( "SELECT fname,email,addr,phone FROM bus_users WHERE id= $e" );
$row = mysql_fetch_array( $res );
$count = mysql_num_rows( $res );
if ( $count = 1 ) {
$a1 = $row['fname'];
$a2 = $row['email'];
$a3 = $row['addr'];
$a4 = $row['phone'];
} else {
echo 'error';
}
//for password change
if ( isset( $_POST[ 'update' ] ) ){
// clean user inputs to prevent sql injections
$pass = trim( $_POST[ 'changepass' ] );
$password= md5($pass);
$ex = $_SESSION[ 'user' ];
$query = "UPDATE bus_users
SET password = '$password'
WHERE id = $ex";
$res = mysql_query( $query );
if ( $res ) {
echo '<script type="text/javascript">alert("Password Successfully changed");</script>';
} else {
echo '<script type="text/javascript">alert("some error");</script>';
}
}
?>
<!DOCTYPE html>
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Buskaro | One stop bus booking website</title>
<meta name="description" content="Worthy a Bootstrap-based, Responsive HTML5 Template">
<meta name="author" content="htmlcoder.me">
<!-- Mobile Meta -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Favicon -->
<link rel="shortcut icon" href="images/favicon.ico">
<!-- Web Fonts -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700,300&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Raleway:700,400,300' rel='stylesheet' type='text/css'>
<!-- Bootstrap core CSS -->
<link href="bootstrap/css/bootstrap.css" rel="stylesheet">
<!-- Font Awesome CSS -->
<link href="fonts/font-awesome/css/font-awesome.css" rel="stylesheet">
<!-- Plugins -->
<link href="css/animations.css" rel="stylesheet">
<!-- Worthy core CSS file -->
<link href="css/style.css" rel="stylesheet">
<!-- Custom css -->
<link href="css/custom.css" rel="stylesheet">
<link href="css/myStyles.css" rel="stylesheet">
<style>
html{
height:100%;
}
.box {
width: 400px;
height: 60px;
-moz-border-radius: 30px;
-webkit-border-radius: 30px;
border-radius: 30px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
background-image: -moz-linear-gradient(90deg, #dfdfdf 0%, #e9e9e9 100%);
background-image: -o-linear-gradient(90deg, #dfdfdf 0%, #e9e9e9 100%);
background-image: -webkit-linear-gradient(90deg, #dfdfdf 0%, #e9e9e9 100%);
background-image: linear-gradient(90deg, #dfdfdf 0%, #e9e9e9 100%);
position: relative;
top: 120px;
display: table-cell;
vertical-align: middle;
text-align: center;
}
p {
color: #999;
display: inline;
position: absolute;
bottom: 13px;
left: 20px;
margin-left: 150px;
margin-top: 40px;
padding-top: 50px;
}
.user {
color: #000;
}
#btm{
border:2px solid;
border-radius: 25px;
}
@media
only screen and (max-width: 760px),
(min-device-width: 768px) and (max-device-width: 1024px) {
/* Force table to not be like tables anymore */
table, thead, tbody, th, td, tr {
display: block;
}
/* Hide table headers (but not display: none;, for accessibility) */
tr { border: 1px solid #ccc; }
td {
/* Behave like a "row" */
border: none;
border-bottom: 1px solid #eee;
position: relative;
padding-left: 50%;
}
td:before {
/* Now like a table header */
position: absolute;
/* Top/left values mimic padding */
top: 6px;
left: 6px;
width: 45%;
padding-right: 10px;
white-space: nowrap;
}
#lastcol{
display: none;
}
}
</style>
<script>
$('#myModal').modal('show');
</script>
</head>
<body class="no-trans">
<!-- scrollToTop -->
<!-- ================ -->
<div class="scrollToTop"><i class="icon-up-open-big"></i></div>
<?php include 'include/headertype5.php'; ?>
<center>
<div class="box" style="margin-top: 200px;">
<p >Hi, <span class="user"><?= $a1;?></span></p>
</div>
</center>
<center>
<div class="container">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xs-offset-0 col-sm-offset-0 col-md-offset-3 col-lg-offset-3 toppad" style="margin-top: 150px;">
<div class="panel panel-info">
<br>
<div class="panel-body" >
<!-- <div class="col-md-2 col-lg-2 col-xs-12 "> </div>-->
<div class=" col-md-12 col-lg-12 col-xs-12" >
<table class="table" >
<tbody>
<tr>
<td>Address: </td>
<td><?= $a3;?></td>
</tr>
<tr>
<td>Email Id: </td>
<td><?= $a2;?></td>
</tr>
<tr>
<td>Phone Number:</td>
<td><?= $a4;?></td>
</tr>
<tr>
<td><button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal" id="btm">Change Password</button></td>
<td id="lastcol"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</center>
<?php include 'include/subfooter.php' ?>
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Change Password</h4>
</div>
<div class="modal-body">
<div class="col-sm-4">
Reset Password:
</div>
<form method="post"> <div class="col-sm-8">
<input type="password" required name="changepass">
</div>
<br>
<br>
<div class="col-sm-4">
Confirm Password:
</div>
<div class="col-sm-8">
<input type="password" required name="confipass">
</div>
</div>
<br>
<br>
<div class="modal-footer">
<input type="submit" value="update" class="btn btn-info btn-round" id="registerButtonService" name="update">
<button type="button" class="btn btn-danger" data-dismiss="modal" id="btm">Close</button>
</form>
</div>
</div>
</div>
</div>
<!-- JavaScript files placed at the end of the document so the pages load faster
================================================== -->
<!-- Jquery and Bootstap core js files -->
<script type="text/javascript" src="plugins/jquery.min.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
<!-- Modernizr javascript -->
<script type="text/javascript" src="plugins/modernizr.js"></script>
<!-- Isotope javascript -->
<script type="text/javascript" src="plugins/isotope/isotope.pkgd.min.js"></script>
<!-- Backstretch javascript -->
<script type="text/javascript" src="plugins/jquery.backstretch.min.js"></script>
<!-- Appear javascript -->
<script type="text/javascript" src="plugins/jquery.appear.js"></script>
<!-- Initialization of Plugins -->
<script type="text/javascript" src="js/template.js"></script>
<!-- Custom Scripts -->
<script type="text/javascript" src="js/custom.js"></script>
</body>
</html>