-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.php
91 lines (91 loc) · 3.47 KB
/
dashboard.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
<?php
session_start();
// if (!isset($_SESSION['user_id'])) {
// header('Location: /crud_add_pdf_project/index.php');
// }
// IF THE USER IS NOT LOGGED IN HE/SHE IS REDIRECTED TO INDEX.PHP
if (!isset($_SESSION['user_id'])) {
echo '<script>
Swal.fire({
icon: "error",
title: "You session has expired or you are not logged in.",
showConfirmButton: false,
timer: 2000
}).then(function() {
window.location.href = "/crud_add_pdf_project/login.php";
});
</script>';
header("Location: /crud_add_pdf_project/index.php");
// exit();
}
?>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<title>Home Page / Dashboard | PentaTech-IT-Solutions</title>
<link rel="stylesheet" href="assets/css/style3.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.min.css" rel="stylesheet">
<style>
.input-box {
width: 100% !important;
}
.user-details {
flex-direction: column;
justify-content: center;
align-items: center;
}
</style>
</head>
<body>
<?php if(!isset($_SESSION['user_id'])):
header('Location: /crud_add_pdf_project/index.php'); ?>
<?php else: ?>
<div class="dashboard-container">
<header>
<div class="title">Welcome to PentaTech IT-Solutions - Team Members Dashboard</div>
<div class="header-div">
<button onclick="window.location.href='/crud_add_pdf_project/teams.php'" class="dash-btn">Teams table</button>
<button onclick="window.location.href='/crud_add_pdf_project/member_form.php'" class="dash-btn">Add Member</button>
<button onclick="window.location.href='/crud_add_pdf_project/pdf_member_list.php'" class="dash-btn" target="_blank">PDF Member List</button>
<p><a href="./logout.php" style="font-size: 1.3rem;">Logout</a></p>
</div>
</header>
<div class="table-container" style="text-align: center;">
<table id="membersTable" class="display">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Position</th>
<th>Department</th>
<th>About</th>
<th>Image</th>
<th>Actions</th>
</tr>
</thead>
<!-- INSERT THE DATATABLE CONTROL TO DISPLAY THE MEMBERS LIST -->
<tbody>
<?php include 'members_list.php'; ?>
</tbody>
</table>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script>
<script>
// CONFIGURE THE DATATABLE PAGING LINKS
$(document).ready(function() {
$('#members-table').DataTable({
"dom": '<"bottom"flp><"clear">',
"paging": true,
"searching": true,
"ordering": true,
"pageLength": 5
});
});
</script>
</div>
<?php endif; ?>
</body>
</html>