View.php
1.36 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
<?php
final class View
{
public static function header(string $title): void
{
?><!doctype html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= htmlspecialchars($title, ENT_QUOTES) ?> - Gestão de Alunos Lab. Informática</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/style.css">
</head>
<body>
<div class="topbar">
<strong>Gestão de Alunos Lab. Informática</strong>
<nav>
<span><?= htmlspecialchars(Auth::currentName() ?? '', ENT_QUOTES) ?></span>
<a href="dashboard">Alunos</a>
<?php if (Auth::isAdmin()): ?>
<a href="admins">Administradores</a>
<a href="auditoria">Auditoria</a>
<a href="settings">Configurações</a>
<?php endif; ?>
<a href="logout">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);
}
}