114 lines
2.9 KiB
PHP
114 lines
2.9 KiB
PHP
<?php
|
|
require_once 'includes/session.php';
|
|
require_once 'db/config.php';
|
|
|
|
$pdo = db();
|
|
$stmt = $pdo->query('SELECT * FROM macro_areas ORDER BY nome ASC');
|
|
$macro_areas = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
$total = count($macro_areas);
|
|
$active = 0;
|
|
$archived = 0;
|
|
|
|
foreach ($macro_areas as $area) {
|
|
if ($area['ativo']) {
|
|
$active++;
|
|
} else {
|
|
$archived++;
|
|
}
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="pt-BR">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Lista de Macro Áreas</title>
|
|
<style>
|
|
body {
|
|
font-family: sans-serif;
|
|
color: #333;
|
|
}
|
|
table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin-top: 20px;
|
|
}
|
|
th, td {
|
|
border: 1px solid #ddd;
|
|
padding: 8px;
|
|
text-align: left;
|
|
}
|
|
th {
|
|
background-color: #f2f2f2;
|
|
}
|
|
h1 {
|
|
font-size: 24px;
|
|
}
|
|
.header {
|
|
margin-bottom: 20px;
|
|
font-size: 12px;
|
|
color: #666;
|
|
}
|
|
.summary {
|
|
margin-top: 20px;
|
|
font-size: 14px;
|
|
}
|
|
@page {
|
|
margin: 10mm;
|
|
}
|
|
@media print {
|
|
body {
|
|
margin: 0;
|
|
}
|
|
.no-print {
|
|
display: none;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div style="text-align: center; margin-bottom: 20px;">
|
|
<img src="assets/pasted-20251029-150345-2b427067.png" alt="Logotipo Galilei" style="max-width: 150px; height: auto;">
|
|
</div>
|
|
<h1>Lista de Macro Áreas</h1>
|
|
<div class="header">
|
|
Gerado em: <?php echo date('d/m/Y H:i:s'); ?>
|
|
</div>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>#</th>
|
|
<th>Nome</th>
|
|
<th>Descrição</th>
|
|
<th>Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php $count = 1; foreach ($macro_areas as $area): ?>
|
|
<tr>
|
|
<td><?php echo $count++; ?></td>
|
|
<td><strong><?php echo htmlspecialchars($area['nome']); ?></strong></td>
|
|
<td><?php echo htmlspecialchars($area['descricao']); ?></td>
|
|
<td><?php echo $area['ativo'] ? 'Ativo' : 'Arquivado'; ?></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
<?php if (empty($macro_areas)): ?>
|
|
<tr>
|
|
<td colspan="4" style="text-align: center;">Nenhuma macro área encontrada.</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
|
|
<div class="summary">
|
|
<p>
|
|
<strong>Total de Macro Áreas:</strong> <?php echo $total; ?> |
|
|
<strong>Ativas:</strong> <?php echo $active; ?> |
|
|
<strong>Arquivadas:</strong> <?php echo $archived; ?>
|
|
</p>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|