-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdashboard.php
More file actions
80 lines (64 loc) · 1.76 KB
/
dashboard.php
File metadata and controls
80 lines (64 loc) · 1.76 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
session_start();
require "./models/person.php";
require "./public/template/links.php";
require "./public/template/menu.php";
if ($_SESSION['person'] == null) {
echo "hello";
header("Location: index.php");
exit();
}
try {
$person = unserialize($_SESSION['person']);
} catch (Exception $e) {
// Handle unserialization errors gracefully
echo "Error: Unable to unserialize session data.";
exit();
}
if (isset($_POST['submit'])) {
session_destroy();
header("Location: index.php");
exit();
} elseif (isset($_POST['genre'])) {
header("Location: views/genre.php");
exit();
} elseif (isset($_POST['book'])) {
header("Location: views/book.php");
exit();
} elseif (isset($_POST["book_genre"])) {
header("Location: views/book_genre.php");
exit();
} elseif (isset($_POST["author"])) {
header("Location: views/author.php");
exit();
} elseif (isset($_POST["books"])) {
header("Location: views/books.php");
exit();
}
$title = "DashBoard";
$css = [
"./public/style/style.css",
"./public/style/menu.css"
];
$js = [
"./public/function/function.js"
];
?>
<!DOCTYPE html>
<html lang="en">
<?= headerTemplate($title, $css) ?>
<body>
<?= get_dash_menu($person->getFName()) ?>
<h1>DashBoard</h1>
<h1><?= $person->hello() ?></h1>
<form action="dashboard.php" method="post">
<button type="submit" name="book">book</button>
<button type="submit" name="books">books</button>
<button type="submit" name="genre">genre</button>
<button type="submit" name="author">author</button>
<button type="submit" name="book_genre">book genre</button>
<button type="submit" name="submit">sign out</button>
</form>
<?= getFunction($js) ?>
</body>
</html>