Initial import of fitme3070.pt platform
Plain-PHP fleet platform with id.andmore.pt SSO. Wires shared/platform-tools as a submodule (platform_update, backups, git/migration tools) like the other platforms. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
commit
e68d357177
2330 files changed
+215968
No files matched your search
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
// Shared admin shell — close. Closes the main/content containers opened by header.php.
|
||||
?>
|
||||
</div><!-- /.p-3 / .p-md-4 -->
|
||||
</main>
|
||||
<?= script_tag('assets/vendor/bootstrap5/js/bootstrap.bundle.min.js') ?>
|
||||
<style>
|
||||
/* Console footer — subtle brand bar */
|
||||
main:after {
|
||||
content: ''; display: block; height: 4px;
|
||||
background: linear-gradient(90deg, var(--bo-accent, #C2D500), transparent);
|
||||
margin-top: 2rem;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
// Shared admin shell — open. Requires $user (from require_login/admin/staff/sysadmin)
|
||||
// and optionally $page_title for the <title> tag.
|
||||
if (!defined('ADMIN_SHELL_OPENED')) define('ADMIN_SHELL_OPENED', true);
|
||||
$page_title = $page_title ?? 'Painel';
|
||||
$user = $user ?? current_user() ?? ['name' => 'Visitante', 'role' => 'client'];
|
||||
$app_name = defined('APP_NAME') ? APP_NAME : 'FitMe 3070';
|
||||
?><!doctype html>
|
||||
<html lang="pt">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?= htmlspecialchars($page_title) ?> — <?= htmlspecialchars($app_name) ?></title>
|
||||
<link href="<?= base_url('assets/vendor/bootstrap5/css/bootstrap.min.css') ?>" rel="stylesheet">
|
||||
<link href="<?= base_url('assets/vendor/bootstrap-icons/bootstrap-icons.css') ?>" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bo-accent: #C2D500;
|
||||
--bo-accent-rgb: 194,213,0;
|
||||
--bo-dark: #0a0a0a;
|
||||
--bo-dark-2: #151515;
|
||||
--bo-surface: #eef0f4;
|
||||
}
|
||||
body { background: var(--bo-surface); font-size: .925rem; }
|
||||
.sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
|
||||
padding: 68px 0 0; width: 240px; background: var(--bo-dark); overflow-y: auto; }
|
||||
.sidebar .nav-link { color: rgba(255,255,255,.55); padding: .55rem 1.25rem; font-size: .875rem;
|
||||
border-left: 3px solid transparent; transition: all .2s; }
|
||||
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.06); border-left-color: rgba(255,255,255,.2); }
|
||||
.sidebar .nav-link.active { color: #fff; background: rgba(var(--bo-accent-rgb),.12); border-left-color: var(--bo-accent); }
|
||||
.sidebar .nav-link i { width: 20px; margin-right: .5rem; text-align: center; }
|
||||
.sidebar .sidebar-brand { position: fixed; top: 0; left: 0; width: 240px; padding: 1rem 1.25rem;
|
||||
color: #fff; font-weight: 700; font-size: 1.1rem; background: var(--bo-dark);
|
||||
z-index: 101; letter-spacing: .5px; border-bottom: 1px solid rgba(255,255,255,.06); }
|
||||
.sidebar .sidebar-brand i { color: var(--bo-accent); }
|
||||
.sidebar .sidebar-section { color: rgba(255,255,255,.3); font-size: .65rem; text-transform: uppercase;
|
||||
letter-spacing: 1.5px; padding: 1.25rem 1.25rem .35rem; }
|
||||
main { margin-left: 240px; padding-top: 68px; }
|
||||
.topbar { position: fixed; top: 0; left: 240px; right: 0; z-index: 99; height: 56px;
|
||||
background: #fff; border-bottom: 1px solid #e2e6ec; padding: 0 1.5rem;
|
||||
display: flex; align-items: center; justify-content: space-between; }
|
||||
.topbar .user-dropdown { display: flex; align-items: center; gap: .5rem; }
|
||||
.badge-role-sysadmin { background: var(--bo-accent); color: var(--bo-dark); }
|
||||
.badge-role-admin { background: var(--bo-accent); color: var(--bo-dark); opacity: .85; }
|
||||
.badge-role-staff { background: #6f42c1; }
|
||||
.badge-role-client { background: #adb5bd; color: #212529; }
|
||||
.btn-outline-primary { color: var(--bo-accent); border-color: var(--bo-accent); }
|
||||
.btn-outline-primary:hover { background: var(--bo-accent); border-color: var(--bo-accent); color: var(--bo-dark); }
|
||||
.btn-primary { background: var(--bo-accent); border-color: var(--bo-accent); color: var(--bo-dark); }
|
||||
.btn-primary:hover { background: #a8ba00; border-color: #a8ba00; color: var(--bo-dark); }
|
||||
.card { border: none; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
|
||||
a { color: #0a0a0a; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="sidebar">
|
||||
<div class="sidebar-brand"><i class="bi bi-lightning-charge-fill me-2"></i><?= htmlspecialchars($app_name) ?></div>
|
||||
<div class="sidebar-section">Principal</div>
|
||||
<ul class="nav flex-column">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link<?= ($_SERVER['SCRIPT_NAME'] ?? '') === '/views/admin/dashboard.php' ? ' active' : '' ?>"
|
||||
href="<?= base_url('views/admin/dashboard.php') ?>"><i class="bi bi-speedometer2"></i>Painel</a>
|
||||
</li>
|
||||
<?php if (is_staff()): ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?= base_url('/') ?>" target="_blank" rel="noopener"><i class="bi bi-box-arrow-up-right"></i>Site público</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<?php if (is_admin()): ?>
|
||||
<div class="sidebar-section">Gestão</div>
|
||||
<ul class="nav flex-column">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link<?= (strpos($_SERVER['SCRIPT_NAME'] ?? '', '/views/admin/team/') !== false) ? ' active' : '' ?>"
|
||||
href="<?= base_url('views/admin/team/index.php') ?>"><i class="bi bi-people-fill"></i>Equipa</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link<?= (strpos($_SERVER['SCRIPT_NAME'] ?? '', '/views/admin/modalidades/') !== false) ? ' active' : '' ?>"
|
||||
href="<?= base_url('views/admin/modalidades/index.php') ?>"><i class="bi bi-grid-3x3-gap-fill"></i>Modalidades</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link<?= (strpos($_SERVER['SCRIPT_NAME'] ?? '', '/views/admin/galerias/') !== false) ? ' active' : '' ?>"
|
||||
href="<?= base_url('views/admin/galerias/index.php') ?>"><i class="bi bi-images"></i>Galerias</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link<?= (strpos($_SERVER['SCRIPT_NAME'] ?? '', '/views/admin/work_hours/') !== false) ? ' active' : '' ?>"
|
||||
href="<?= base_url('views/admin/work_hours/index.php') ?>"><i class="bi bi-clock-fill"></i>Horário de Funcionamento</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link<?= (strpos($_SERVER['SCRIPT_NAME'] ?? '', '/views/admin/horario/') !== false) ? ' active' : '' ?>"
|
||||
href="<?= base_url('views/admin/horario/index.php') ?>"><i class="bi bi-calendar-week-fill"></i>Horário de Aulas</a>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (is_admin()): ?>
|
||||
<div class="sidebar-section">Utilizadores</div>
|
||||
<ul class="nav flex-column">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link<?= ($_SERVER['SCRIPT_NAME'] ?? '') === '/views/user/index.php' ? ' active' : '' ?>"
|
||||
href="<?= base_url('views/user/index.php') ?>"><i class="bi bi-person-badge"></i>Utilizadores</a>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (is_sysadmin()): ?>
|
||||
<div class="sidebar-section">Sistema</div>
|
||||
<ul class="nav flex-column">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link<?= ($_SERVER['SCRIPT_NAME'] ?? '') === '/views/sysadmin/system_settings.php' ? ' active' : '' ?>"
|
||||
href="<?= base_url('views/sysadmin/system_settings.php') ?>"><i class="bi bi-sliders"></i>Definições</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link<?= ($_SERVER['SCRIPT_NAME'] ?? '') === '/views/sysadmin/backups.php' ? ' active' : '' ?>"
|
||||
href="<?= base_url('views/sysadmin/backups.php') ?>"><i class="bi bi-database-fill-gear"></i>Backups</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link<?= ($_SERVER['SCRIPT_NAME'] ?? '') === '/views/sysadmin/platform_update.php' ? ' active' : '' ?>"
|
||||
href="<?= base_url('views/sysadmin/platform_update.php') ?>"><i class="bi bi-arrow-repeat"></i>Actualizações</a>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
<div class="topbar">
|
||||
<div></div>
|
||||
<div class="user-dropdown">
|
||||
<span class="badge rounded-pill badge-role-<?= htmlspecialchars($user['role']) ?>">
|
||||
<?= htmlspecialchars(role_label($user['role'])) ?>
|
||||
</span>
|
||||
<span><?= htmlspecialchars($user['name']) ?></span>
|
||||
<a href="<?= base_url('views/user/profile.php') ?>" class="btn btn-sm btn-outline-secondary"><i class="bi bi-person"></i></a>
|
||||
<a href="<?= base_url('views/auth/logout.php') ?>" class="btn btn-sm btn-outline-danger"><i class="bi bi-box-arrow-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-3 p-md-4">
|
||||
<?php
|
||||
// Show flash messages if any
|
||||
$flash = session()->getFlashdata('success');
|
||||
if ($flash): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<?= htmlspecialchars($flash) ?>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php $flash = session()->getFlashdata('error');
|
||||
if ($flash): ?>
|
||||
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||
<?= htmlspecialchars($flash) ?>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php $flash = session()->getFlashdata('warning');
|
||||
if ($flash): ?>
|
||||
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||
<?= htmlspecialchars($flash) ?>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
// Standalone top navbar — only outputs when header.php hasn't been included yet.
|
||||
// (system_settings.php includes both header.php + navbar.php, so this defers.)
|
||||
if (defined('ADMIN_SHELL_OPENED') && ADMIN_SHELL_OPENED) return;
|
||||
?>
|
||||
<link href="<?= base_url('assets/vendor/bootstrap5/css/bootstrap.min.css') ?>" rel="stylesheet">
|
||||
<link href="<?= base_url('assets/vendor/bootstrap-icons/bootstrap-icons.css') ?>" rel="stylesheet">
|
||||
<nav class="navbar navbar-expand navbar-dark px-3 mb-0" style="position:sticky;top:0;z-index:99;background:var(--bo-accent, #C2D500);">
|
||||
<a class="navbar-brand fw-bold text-dark" href="<?= base_url('views/admin/dashboard.php') ?>">
|
||||
<i class="bi bi-lightning-charge-fill me-2"></i><?= htmlspecialchars(defined('APP_NAME') ? APP_NAME : 'FitMe 3070') ?>
|
||||
</a>
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item">
|
||||
<span class="nav-link text-dark"><?= htmlspecialchars($user['name'] ?? '') ?></span>
|
||||
</li>
|
||||
<li class="nav-item"><a class="nav-link text-dark" href="<?= base_url('views/auth/logout.php') ?>"><i class="bi bi-box-arrow-right"></i></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
Reference in new issue
Block a user