-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharts.php
49 lines (42 loc) · 1.59 KB
/
charts.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
<?php
// charts.php
include 'access.php'; // Include for session management and access control
// Start the session
session_start();
// Check if the user is logged in and has admin privileges
if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'admin') {
// Redirect to login page or display an error message
header("Location: demo.php?block=1");
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard - Metrics</title>
<link rel="stylesheet" href="charts.css"> <!-- Link to the CSS file -->
</head>
<body>
<div class="container">
<h1>Admin Dashboard - Metrics</h1>
<form id="filterForm">
<!-- Removed the Chart Type selection -->
<label for="startDate">Start Date:</label>
<input type="date" id="startDate" name="startDate">
<label for="endDate">End Date:</label>
<input type="date" id="endDate" name="endDate">
<button type="submit">Update Chart</button>
</form>
<div id="chart-container">
<canvas id="myChart"></canvas>
</div>
<div class="button-container">
<button onclick="window.location.href = 'admin.php';" class="action-button">GO BACK</button>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="charts.js"></script> <!-- Link to the JavaScript file -->
</body>
</html>