feat: contactos editáveis, equipa com título/aptidões, mensalidades e reviews Google

- Contactos: nova página no backoffice (fitme3070_info) e 964 201 137 como
  telefone principal; o telefone secundário só aparece quando existe.
- Equipa: título, aptidões/funções e formações; o cartão mostra foto, nome e
  título e abre um cartão horizontal de detalhe (hover no desktop, toque no
  telemóvel) sem mexer na grelha.
- Mensalidades: cartões editáveis com um destaque, modal de inscrição que
  guarda o pedido (RGPD + estado + campos reservados para o CRM) e avisa o
  ginásio por e-mail; lista de pedidos com estados, notas e CSV.
- Reviews Google via Places API (New), filtradas por classificação mínima e
  em cache configurável; página de configuração com pesquisa do Place ID.
- Assets com ?v=<mtime>: site/assets é servido com cache imutável de 1 ano.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andreandClaude Opus 5.5 committed 2026-09-24 14:58:57 +01:00
1 parent 8a494d59a5
commit f95c9ebc52
27 files changed
+2063 -16

No files matched your search

+70
View File
@@ -0,0 +1,70 @@
<?php
require __DIR__ . '/../../../config/db.php';
require __DIR__ . '/../../../config/functions.php';
$user = require_admin();
// Delete / restore are POST + CSRF (csrf_check() only guards POST).
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
csrf_check();
if (isset($_POST['delete'])) {
db_memberships_delete($pdo, (int) $_POST['delete']);
session()->setFlashdata('success', 'Mensalidade apagada.');
} elseif (isset($_POST['restore'])) {
db_memberships_restore($pdo, (int) $_POST['restore']);
session()->setFlashdata('success', 'Mensalidade restaurada.');
}
header('Location: ' . base_url('views/admin/memberships/index.php'));
exit;
}
$items = db_memberships_list($pdo, true);
$new_leads = db_membership_leads_count_new($pdo);
$page_title = 'Mensalidades';
include __DIR__ . '/../../../includes/header.php';
?>
<div class="container">
<div class="d-flex justify-content-between align-items-center flex-wrap gap-2 mb-4">
<h1 class="h3 mb-0">Mensalidades</h1>
<div class="d-flex gap-2">
<a class="btn btn-outline-primary" href="<?= base_url('views/admin/memberships/leads.php') ?>">
<i class="bi bi-inbox me-1"></i>Pedidos de inscrição<?php if ($new_leads): ?> <span class="badge bg-danger"><?= $new_leads ?></span><?php endif; ?>
</a>
<a class="btn btn-primary" href="<?= base_url('views/admin/memberships/create.php') ?>"><i class="bi bi-plus-lg me-1"></i>Adicionar</a>
</div>
</div>
<div class="card shadow-sm"><div class="card-body p-0">
<form method="POST" class="mb-0"><?= csrf_field() ?>
<table class="table table-hover align-middle mb-0">
<thead class="table-light"><tr>
<th>Nome</th><th>Preço</th><th>Estado</th><th>Ordem</th><th style="width:120px">Ações</th>
</tr></thead>
<tbody>
<?php if (!$items): ?>
<tr><td colspan="5" class="text-center text-muted py-4">Nenhuma mensalidade.</td></tr>
<?php else: foreach ($items as $m): $deleted = $m['deleted_at'] !== null; ?>
<tr class="<?= $deleted ? 'text-muted' : '' ?>">
<td><strong><?= htmlspecialchars($m['name']) ?></strong>
<?php if ($m['is_featured']): ?><span class="badge bg-warning text-dark ms-1"><i class="bi bi-star-fill"></i> Destaque</span><?php endif; ?>
<?php if ($m['subtitle'] !== ''): ?><div class="small text-muted"><?= htmlspecialchars($m['subtitle']) ?></div><?php endif; ?></td>
<td class="text-nowrap"><?= htmlspecialchars(membership_price_label($m)) ?> <span class="small text-muted"><?= htmlspecialchars($m['price_suffix']) ?></span></td>
<td><?php if ($deleted): ?><span class="badge bg-secondary">Apagada</span>
<?php elseif ($m['is_active']): ?><span class="badge bg-success">Visível</span>
<?php else: ?><span class="badge bg-light text-dark border">Oculta</span><?php endif; ?></td>
<td><?= (int) $m['item_order'] ?></td>
<td class="text-nowrap">
<?php if ($deleted): ?>
<button class="btn btn-sm btn-outline-info" name="restore" value="<?= (int) $m['id'] ?>">Restaurar</button>
<?php else: ?>
<a class="btn btn-sm btn-outline-primary" href="edit.php?id=<?= (int) $m['id'] ?>"><i class="bi bi-pencil"></i></a>
<button class="btn btn-sm btn-outline-danger" name="delete" value="<?= (int) $m['id'] ?>" onclick="return confirm('Apagar esta mensalidade?')"><i class="bi bi-trash"></i></button>
<?php endif; ?>
</td>
</tr>
<?php endforeach; endif; ?>
</tbody>
</table>
</form>
</div></div>
</div>
<?php include __DIR__ . '/../../../includes/footer.php';