View.php
999 Bytes
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
<?php
final class View
{
public static function header(string $title): void
{
?><!doctype html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<title><?= htmlspecialchars($title, ENT_QUOTES) ?> - LabInfo</title>
<link rel="stylesheet" href="assets/style.css">
</head>
<body>
<div class="topbar">
<strong>Gestão de Alunos (AD)</strong>
<nav>
<span><?= htmlspecialchars(Auth::currentName() ?? '', ENT_QUOTES) ?></span>
<a href="dashboard.php">Alunos</a>
<?php if (Auth::isAdmin()): ?>
<a href="admins.php">Administradores</a>
<a href="settings.php">Configurações</a>
<?php endif; ?>
<a href="logout.php">Sair</a>
</nav>
</div>
<div class="container">
<?php
}
public static function footer(): void
{
?>
</div>
</body>
</html>
<?php
}
public static function escape(?string $value): string
{
return htmlspecialchars($value ?? '', ENT_QUOTES);
}
}