-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_profile.php
60 lines (57 loc) · 2.67 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
<?php
include 'config.php';
session_start();
if(!isset($_SESSION['user_id']) && $_SESSION['user_role'] != 'user') {
header("Location: " . $hostname);
}
include 'header.php'; ?>
<div id="user_profile-content">
<div class="container">
<div class="row">
<div class="col-md-offset-3 col-md-6">
<h2 class="section-head">My Profile</h2>
<?php
$user_id = $_SESSION["user_id"];
$db = new Database();
$db->select('user','*',null,"user_id = '{$user_id}'",null,null);
$result = $db->getResult();
if (count($result) > 0) {
$table = '<table>';
foreach($result as $row) { ?>
<table class="table table-bordered table-responsive">
<tr>
<td><b>First Name :</b></td>
<td><?php echo $row["f_name"]; ?></td>
</tr>
<tr>
<td><b>Last Name :</b></td>
<td><?php echo $row["l_name"]; ?></td>
</tr>
<tr>
<td><b>Username :</b></td>
<td><?php echo $row["username"]; ?></td>
</tr>
<tr>
<td><b>Mobile :</b></td>
<td><?php echo $row["mobile"]; ?></td>
</tr>
<tr>
<td><b>Address :</b></td>
<td><?php echo $row["address"]; ?></td>
</tr>
<tr>
<td><b>City :</b></td>
<td><?php echo $row["city"]; ?></td>
</tr>
</table>
<?php }
}
?>
<a class="modify-btn btn" href="edit_user.php?user=<?php echo $_SESSION['user_id']; ?>">Modify Details</a>
<a class="modify-btn btn" href="change_password.php">Change Password</a>
</div>
</div>
</div>
</div>
<?php include 'footer.php';
?>