-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
324 lines (293 loc) · 15 KB
/
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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
<?php
session_start();
if(isset($_SESSION['login_email']))
{
$conn_id=5;
require 'connect.php';
$sql = "SELECT * FROM user_details WHERE email = '$_SESSION[login_email]'";
$result = $conn->query($sql);
$count = mysqli_num_rows($result);
$pass="";
if($count > 0)
{
while($row = $result->fetch_assoc())
{
$id = $row["id"];
$user_id = $row["user_id"];
$email = $row["email"];
$mobile = $row["mobile"];
$password = $row["password"];
$first_name = $row["first_name"];
$last_name = $row["last_name"];
$address = $row["address"];
$city_id = $row["city"];
$state_id = $row["state"];
$college_name = $row["college_name"];
}
}
$num = strlen($password);
for($i=1;$i<=$num;$i++)
{
$pass = $pass."•";
}
$sql = "SELECT * FROM states WHERE id = '$state_id'";
$result = $conn->query($sql);
$count = mysqli_num_rows($result);
if($count > 0)
{
while($row = $result->fetch_assoc())
{
$state = $row["state"];
}
}
$sql = "SELECT * FROM cities WHERE city_id = '$city_id'";
$result = $conn->query($sql);
$count = mysqli_num_rows($result);
if($count > 0)
{
while($row = $result->fetch_assoc())
{
$city = $row["city_name"];
}
}
}
else
{
header("location: index.php");
}
?>
<style>
.user_profile .personal_wrap
{
background-color: #fce4ec;
border-radius: 10px;
padding-top: 50px;
padding-bottom: 50px;
}
.user_profile .personal_wrap .row:not(last)
{
padding-bottom: 25px;
}
.user_profile .account_info_wrap
{
background-color: #e8eaf6;
border-radius: 10px;
padding-top: 50px;
padding-bottom: 50px;
}
.user_profile .account_info_wrap .row:not(last)
{
padding-bottom: 25px;
}
.user_profile .settings_wrap
{
background-color: #dcedc8;
border-radius: 10px;
padding-top: 50px;
padding-bottom: 50px;
}
.user_profile .settings_wrap .row:not(last)
{
padding-bottom: 25px;
}
.user_profile .heading
{
font-weight:600;
font-size: 22px;
}
.user_profile .text
{
font-size: 20px;
}
.user_profile .edit_btn
{
text-decoration: none;
color: #757575;
transition: 0.7s;
}
.user_profile .edit_btn:hover
{
color:#000;
}
</style>
<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.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<!--GOOGLE FONTS-->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Playfair+Display:400,400i,700,700i,900,900i&display=swap" rel="stylesheet">
<!--MAIN CSS-->
<link rel="stylesheet" href="css/main.css">
<!--ICON & TITLE-->
<link rel="icon" href="assets/icon.png">
<title>Books Online</title>
<!--FONTAWESOME-->
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
</head>
<body>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<!--NAVBAR-->
<?php include 'header.php'; ?>
<section class="user_profile" style="margin-top:125px; margin-bottom:75px;">
<div class="container">
<div class="row">
<div class="col-3" id="vert_tab">
<div class="nav flex-column nav-pills" id="navigation" role="tablist" aria-orientation="vertical">
<a class="nav-link active" id="v-pills-personal-tab" data-toggle="pill" href="#v-pills-personal" role="tab" aria-controls="v-pills-personal" aria-selected="true">Personal Information</a>
<a class="nav-link" id="v-pills-account-tab" data-toggle="pill" href="#v-pills-account" role="tab" aria-controls="v-pills-account" aria-selected="false">Account Information</a>
<a class="nav-link" id="v-pills-orders-tab" data-toggle="pill" href="#v-pills-orders" role="tab" aria-controls="v-pills-orders" aria-selected="false">Orders</a>
<a class="nav-link" id="v-pills-settings-tab" data-toggle="pill" href="#v-pills-settings" role="tab" aria-controls="v-pills-settings" aria-selected="false">Settings</a>
</div>
</div>
<div class="col-9" id="vert_content">
<div class="tab-content" id="v-pills-tabContent">
<div class="tab-pane fade show active" id="v-pills-personal" role="tabpanel" aria-labelledby="v-pills-personal-tab">
<div class="row personal_wrap">
<div class="col-md-10 mx-auto">
<div class="row">
<div class="col-md-12" style="display:flex; justify-content:flex-end; align-items:center;">
<a class="edit_btn" href="#"><span style="margin-right:10px;"><i class="fa fa-pencil"></i></span>Edit Personal Info</a>
</div>
</div>
<div class="row">
<div class="col-md-6">
<p class="heading">First Name</p>
<p class="text"><?php echo $first_name; ?></p>
</div>
<div class="col-md-6">
<p class="heading">Last Name</p>
<p class="text"><?php echo $last_name; ?></p>
</div>
</div>
<div class="row">
<div class="col-md-6">
<p class="heading">Address</p>
<p class="text"><?php echo $address; ?></p>
</div>
<div class="col-md-6">
<p class="heading">State</p>
<p class="text"><?php echo $state; ?></p>
</div>
</div>
<div class="row last">
<div class="col-md-6">
<p class="heading">District</p>
<p class="text"><?php echo $city; ?></p>
</div>
<div class="col-md-6">
<p class="heading">College Name</p>
<p class="text"><?php echo $college_name; ?></p>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="v-pills-account" role="tabpanel" aria-labelledby="v-pills-account-tab">
<div class="row account_info_wrap">
<div class="col-md-10 mx-auto">
<div class="row">
<div class="col-md-12" style="display:flex; justify-content:flex-end; align-items:center;">
<a class="edit_btn" href="#"><span style="margin-right:10px;"><i class="fa fa-pencil"></i></span>Edit Account Info</a>
</div>
</div>
<div class="row">
<div class="col-md-6">
<p class="heading">Email Address</p>
<p class="text"><?php echo $email; ?></p>
</div>
<div class="col-md-6">
<p class="heading">Mobile Number</p>
<p class="text"><?php echo $mobile; ?></p>
</div>
</div>
<div class="row">
<div class="col-md-6">
<p class="heading">User ID</p>
<p class="text"><?php echo $user_id; ?></p>
</div>
<div class="col-md-6">
<p class="heading">Password</p>
<p class="text"><?php echo $pass; ?></p>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="v-pills-orders" role="tabpanel" aria-labelledby="v-pills-orders-tab">...</div>
<div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab">
<div class="row settings_wrap">
<div class="col-md-10 mx-auto">
<div class="row">
<div class="col-md-6">
<p class="heading">Password</p>
<button type="button" class="btn btn-primary">Change Account Password</button>
</div>
<div class="col-md-6">
<p class="heading">Delete My Account</p>
<button type="button" class="btn btn-danger">Delete Account</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function myFunction(x) {
if (x.matches) { // If media query matches
var tab = document.getElementById("vert_tab");
var navigation = document.getElementById("navigation");
if (tab.classList.contains("col-3"))
{
tab.classList.remove("col-3");
navigation.classList.remove("flex-column");
}
var content = document.getElementById("vert_content");
if (content.classList.contains("col-9"))
{
content.classList.remove("col-9");
content.classList.add("col-12");
}
}
else {
var tab = document.getElementById("vert_tab");
var navigation = document.getElementById("navigation");
if (tab.classList.contains("col-3"))
{
}
else
{
tab.classList.add("col-3");
navigation.classList.add("flex-column");
}
var content = document.getElementById("vert_content");
if (content.classList.contains("col-12"))
{
content.classList.remove("col-12");
content.classList.add("col-9");
}
else
{
content.classList.add("col-9");
}
}
}
var x = window.matchMedia("(max-width: 767px)")
myFunction(x) // Call listener function at run time
x.addListener(myFunction) // Attach listener function on state changes
</script>
</section>
<!--FOOTER-->
<?php include 'footer.php'; ?>
</body>
</html>