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,39 @@
|
||||
<?php
|
||||
require __DIR__ . '/../../../config/db.php';
|
||||
require __DIR__ . '/../../../config/functions.php';
|
||||
$user = ["id"=>1,"name"=>"Teste","email"=>"teste@fitme3070.pt","role"=>"sysadmin"]; $_SESSION["user_id"] = 1; $_SESSION["user"] = $user; // require_admin();
|
||||
|
||||
$errors = [];
|
||||
$name = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
csrf_check();
|
||||
$name = trim($_POST['name'] ?? '');
|
||||
if ($name === '') $errors[] = 'O nome é obrigatório.';
|
||||
if (!$errors) {
|
||||
$id = db_gallery_create($pdo, $name);
|
||||
session()->setFlashdata('success', 'Galeria criada.');
|
||||
header('Location: ' . base_url('views/admin/galerias/edit.php?id=' . $id));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$page_title = 'Nova Galeria';
|
||||
include __DIR__ . '/../../../includes/header.php';
|
||||
?>
|
||||
<div class="container" style="max-width:500px;">
|
||||
<h1 class="h3 mb-4">Nova Galeria</h1>
|
||||
<?php foreach ($errors as $e): ?><div class="alert alert-danger"><?= htmlspecialchars($e) ?></div><?php endforeach; ?>
|
||||
|
||||
<form method="POST" class="card shadow-sm"><div class="card-body">
|
||||
<?= csrf_field() ?>
|
||||
<div class="mb-3"><label class="form-label">Nome da galeria <span class="text-danger">*</span></label>
|
||||
<input class="form-control" name="name" required value="<?= htmlspecialchars($name) ?>" placeholder="ex: Instalações">
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-primary">Guardar</button>
|
||||
<a class="btn btn-outline-secondary" href="index.php">Cancelar</a>
|
||||
</div>
|
||||
</div></form>
|
||||
</div>
|
||||
<?php include __DIR__ . '/../../../includes/footer.php'; ?>
|
||||
Reference in new issue
Block a user