mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
88 lines
2.5 KiB
PHP
88 lines
2.5 KiB
PHP
<?php
|
|
/**
|
|
* Thanks page for share-link submissions.
|
|
* Displays a centered confirmation with a link to create another thesis via the same link.
|
|
*/
|
|
require_once __DIR__ . '/../../config/bootstrap.php';
|
|
|
|
App::boot();
|
|
|
|
$thesisId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
|
|
|
if ($thesisId <= 0) {
|
|
http_response_code(400);
|
|
die('ID de TFE invalide.');
|
|
}
|
|
|
|
// Verify the thesis exists
|
|
$db = Database::getInstance();
|
|
$thesis = $db->getThesis($thesisId);
|
|
if (!$thesis) {
|
|
http_response_code(404);
|
|
die('TFE introuvable.');
|
|
}
|
|
|
|
// Get the share link slug from the referer path
|
|
$pathParts = explode('/', trim($_SERVER['REQUEST_URI'] ?? '', '/'));
|
|
$slug = count($pathParts) >= 2 ? $pathParts[0] : null;
|
|
|
|
$pageTitle = 'Merci — TFE enregistré';
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title><?= htmlspecialchars($pageTitle) ?></title>
|
|
<link rel="stylesheet" href="<?= App::assetV('/assets/css/system.css') ?>">
|
|
<style>
|
|
.thanks-center {
|
|
max-width: 600px;
|
|
margin: 4rem auto;
|
|
padding: 2rem;
|
|
text-align: center;
|
|
}
|
|
.thanks-center h1 {
|
|
margin-bottom: 0.5rem;
|
|
font-size: 2rem;
|
|
}
|
|
.thanks-center p {
|
|
font-size: 1.1rem;
|
|
color: #555;
|
|
margin: 1rem 0 2rem;
|
|
}
|
|
.thanks-center .thesis-title {
|
|
font-weight: bold;
|
|
font-size: 1.2rem;
|
|
color: #333;
|
|
margin-bottom: 2rem;
|
|
}
|
|
.thanks-center .btn-add-another {
|
|
display: inline-block;
|
|
padding: 0.75rem 2rem;
|
|
background: #333;
|
|
color: white;
|
|
text-decoration: none;
|
|
border-radius: 4px;
|
|
font-size: 1rem;
|
|
transition: background 0.2s;
|
|
}
|
|
.thanks-center .btn-add-another:hover {
|
|
background: #555;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="thanks-center">
|
|
<h1>✅ Merci !</h1>
|
|
<p>Votre TFE a bien été enregistré sur la plateforme.</p>
|
|
<?php if ($thesis): ?>
|
|
<div class="thesis-title"><?= htmlspecialchars($thesis['title']) ?> — <?= htmlspecialchars($thesis['authors'] ?? '') ?></div>
|
|
<?php endif; ?>
|
|
<?php if ($slug): ?>
|
|
<a href="/partage/<?= urlencode($slug) ?>" class="btn-add-another">+ Soumettre un autre TFE</a>
|
|
<?php endif; ?>
|
|
</div>
|
|
</body>
|
|
</html>
|