-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanager_dashboard.php
More file actions
57 lines (57 loc) · 1.91 KB
/
Copy pathmanager_dashboard.php
File metadata and controls
57 lines (57 loc) · 1.91 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
54
55
56
57
<?php
session_start();
$manager = $_SESSION['user']['role'] ;
if (!isset($_SESSION['user']) || $manager !== 'Manager') {
header('Location: login.php');
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Manager Dashboard</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<?php include 'header.php'; ?>
<main>
<?php include 'sidebar.php';?>
<section>
<h2>Manager Dashboard</h2>
<section class="projects-list">
<h3>All Projects</h3>
<?php
require 'db.php.inc';
$stmt = $pdo->query("SELECT project_id, title, customer_name, start_date, end_date FROM projects");
$projects = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<table>
<thead>
<tr>
<th>Project ID</th>
<th>Title</th>
<th>Customer</th>
<th>Start Date</th>
<th>End Date</th>
</tr>
</thead>
<tbody>
<?php foreach ($projects as $project): ?>
<tr>
<td><?= $project['project_id'] ?></td>
<td><?= $project['title'] ?></td>
<td><?= $project['customer_name'] ?></td>
<td><?= $project['start_date'] ?></td>
<td><?= $project['end_date'] ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</section>
</section>
</main>
<?php include 'footer.php'; ?>
</body>
</html>