-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmember-profile.php
159 lines (155 loc) · 4.24 KB
/
member-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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>ATI Kegalle - Your Profile</title>
<!-- Font Awesome -->
<link
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"
rel="stylesheet"
/>
<!-- Google Fonts -->
<link
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
rel="stylesheet"
/>
<!-- MDB -->
<link
href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.5.0/mdb.min.css"
rel="stylesheet"
/>
</head>
<body>
<?php
session_start();
if ( isset( $_SESSION[ "member" ] ) && $_SESSION[ "member" ] != "" ) {
require 'conn.php';
$sql = "SELECT * FROM `member` WHERE `MemUName`='" . $_SESSION[ "member" ] . "';";
$result = mysqli_query( $conn, $sql );
if ( mysqli_num_rows( $result ) > 0 ) {
$row = mysqli_fetch_assoc( $result );
$uname = $row[ 'MemUName' ];
$name = $row[ 'MemName' ];
$dob = $row[ 'MemDOB' ];
$add = $row[ 'MemAddress' ];
$dep = $row[ 'MemDept' ];
$des = $row[ 'MemDesig' ];
$age = $row[ 'MemAge' ];
$nic = $row[ 'MemNIC' ];
$gender = $row[ 'MemGender' ];
$phone = $row[ 'MemMobile' ];
$email = $row[ 'MemEmail' ];
} else {
header( "location:member-login-profile.php?status=fail" );
}
} else {
header( "location:member-login-profile.php" );
exit;
}
?>
<!-- Navbar -->
<?php require_once "assets/navbar.php"; ?>
<!-- Navbar -->
<br />
<!-- Content-->
<div class="container mb-5">
<div class="row">
<div class="col-12">
<h2 class="text-center">Your Profile</h2>
</div>
</div>
<br />
<div class="row">
<div class="col-12">
<table class="table">
<tbody>
<tr>
<th scope="row"></th>
<td>Name</td>
<td><p><?php echo($name) ?></p></td>
</tr>
<tr>
<th scope="row">2</th>
<td>User Name</td>
<td><p><?php echo($uname) ?></p></td>
</tr>
<tr>
<th scope="row"></th>
<td>Department</td>
<td><p><?php echo($dep) ?></p></td>
</tr>
<tr>
<th scope="row"></th>
<td>Designation</td>
<td><p><?php echo($des) ?></p></td>
</tr>
<tr>
<th scope="row"></th>
<td>NIC</td>
<td><p><?php echo($nic) ?></p></td>
</tr>
<tr>
<th scope="row"></th>
<td>Birthday</td>
<td><p><?php echo($dob) ?></p></td>
</tr>
<tr>
<th scope="row"></th>
<td>Age</td>
<td><p><?php echo($age) ?></p></td>
</tr>
<tr>
<th scope="row"></th>
<td>Address</td>
<td><p><?php echo($add)?></p></td>
</tr>
<tr>
<th scope="row"></th>
<td>Gender</td>
<td><p><?php echo($gender)?></p></td>
</tr>
<tr>
<th scope="row"></th>
<td>Mobile</td>
<td><p><?php echo($phone)?></p></td>
</tr>
<tr>
<th scope="row"></th>
<td>Email</td>
<td><p><?php echo($email)?></p></td>
</tr>
</tbody>
</table>
<div class="text-center pb-3">
<form action="member-profile.php" method="post">
<a href="member-edit.php">
<button type="button" class="btn btn-success">Edit Profile</button>
</a>
<button type="submit" style="background-color: red;" class="btn btn-success" name="logout">Logout</button>
</form>
<?php
if ( isset( $_POST[ 'logout' ] ) ) {
unset( $_SESSION );
session_destroy();
echo "<script> location.href='member-login-profile.php'; </script>";
}
?>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="footer text-center text-white fixed-bottom">
<div
class="text-center p-0"
style="background-color: rgba(0, 0, 0, 0.774)"
> Made with ❤️ by HNDIT 2019 batch. </div>
</footer>
<!-- MDB -->
<script
type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.5.0/mdb.min.js"
></script>
</body>
</html>