-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathprofile.php
More file actions
53 lines (49 loc) · 1.32 KB
/
profile.php
File metadata and controls
53 lines (49 loc) · 1.32 KB
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
<?php
session_start();
if (isset($_SESSION['role']) && isset($_SESSION['id']) && $_SESSION['role'] == "employee") {
include "DB_connection.php";
include "app/Model/User.php";
$user = get_user_by_id($conn, $_SESSION['id']);
?>
<!DOCTYPE html>
<html>
<head>
<title>Profile</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<input type="checkbox" id="checkbox">
<?php include "inc/header.php" ?>
<div class="body">
<?php include "inc/nav.php" ?>
<section class="section-1">
<h4 class="title">Profile <a href="edit_profile.php">Edit Profile</a></h4>
<table class="main-table" style="max-width: 300px;">
<tr>
<td>Full Name</td>
<td><?=$user['full_name']?></td>
</tr>
<tr>
<td>User name</td>
<td><?=$user['username']?></td>
</tr>
<tr>
<td>Joined At</td>
<td><?=$user['created_at']?></td>
</tr>
</table>
</section>
</div>
<script type="text/javascript">
var active = document.querySelector("#navList li:nth-child(3)");
active.classList.add("active");
</script>
</body>
</html>
<?php }else{
$em = "First login";
header("Location: login.php?error=$em");
exit();
}
?>