mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
Fixed multiple issues in admin panel: 1. CSS path: modern-normalize.css → modern-normalize.min.css (File is actually named .min.css) 2. Icon path: assets/icon.svg → /assets/admin_favicon.svg (Was relative, now absolute; correct filename) 3. Navigation: /admin/list.php → /admin/ (list.php was renamed to index.php) 4. Short PHP tags: <? → <?php (Better compatibility, some servers don't enable short_open_tag) 5. Quirks mode warning was due to CSS not loading, not DOCTYPE (DOCTYPE was already present) Files modified: - public/admin/inc/head.php (main fixes) - public/admin/index.php (short tags) - public/admin/add.php (short tags) - public/admin/import.php (short tags) Need to redeploy for production: just deploy
299 lines
9.0 KiB
PHP
299 lines
9.0 KiB
PHP
<?php
|
|
// Bootstrap application
|
|
require_once __DIR__ . "/../../config/bootstrap.php";
|
|
|
|
// Configure error reporting
|
|
ini_set('display_errors', 0);
|
|
ini_set('log_errors', 1);
|
|
ini_set('error_log', 'error.log');
|
|
|
|
require __DIR__ . '/../../lib/Database.php';
|
|
|
|
// Security: Validate thesis ID parameter
|
|
$thesisId = null;
|
|
$thesis = null;
|
|
$files = [];
|
|
$error = null;
|
|
|
|
if (isset($_GET['id'])) {
|
|
$thesisId = filter_var($_GET['id'], FILTER_VALIDATE_INT);
|
|
|
|
if ($thesisId !== false && $thesisId > 0) {
|
|
try {
|
|
$db = new Database();
|
|
$pdo = $db->getPDO();
|
|
|
|
// Get thesis data
|
|
$thesis = $db->getThesis($thesisId);
|
|
|
|
if (!$thesis) {
|
|
$error = "TFE non trouvé.";
|
|
} else {
|
|
// Get associated files
|
|
$stmt = $pdo->prepare("
|
|
SELECT file_type, file_name, file_size, mime_type, uploaded_at
|
|
FROM thesis_files
|
|
WHERE thesis_id = ?
|
|
ORDER BY file_type, uploaded_at
|
|
");
|
|
$stmt->execute([$thesisId]);
|
|
$files = $stmt->fetchAll();
|
|
}
|
|
} catch (Exception $e) {
|
|
error_log("Error loading thesis: " . $e->getMessage());
|
|
$error = "Erreur lors de la lecture des données.";
|
|
}
|
|
} else {
|
|
error_log("Invalid thesis ID: " . $_GET['id']);
|
|
$error = "Identifiant invalide.";
|
|
}
|
|
} else {
|
|
$error = "Aucun identifiant spécifié.";
|
|
}
|
|
|
|
// Helper function to format file size
|
|
function formatFileSize($bytes) {
|
|
if ($bytes >= 1073741824) {
|
|
return number_format($bytes / 1073741824, 2) . ' GB';
|
|
} elseif ($bytes >= 1048576) {
|
|
return number_format($bytes / 1048576, 2) . ' MB';
|
|
} elseif ($bytes >= 1024) {
|
|
return number_format($bytes / 1024, 2) . ' KB';
|
|
} else {
|
|
return $bytes . ' bytes';
|
|
}
|
|
}
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Merci - Post-ERG</title>
|
|
<link rel="stylesheet" href="assets/normalize.css">
|
|
<link rel="stylesheet" href="assets/simple.css">
|
|
<link rel="stylesheet" href="assets/posterg.css">
|
|
<link rel="shortcut icon" href="assets/icon.svg" type="image/svg">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>Merci</h1>
|
|
<?php if ($thesis): ?>
|
|
<nav style="margin-top: 1rem;">
|
|
<a href="list.php">Liste des TFE</a> |
|
|
<a href="edit.php?id=<?php echo $thesisId; ?>">✏️ Modifier ce TFE</a>
|
|
</nav>
|
|
<?php endif; ?>
|
|
</header>
|
|
|
|
<main>
|
|
<?php if ($error): ?>
|
|
<div class="error">
|
|
<p>⚠️ <?php echo htmlspecialchars($error); ?></p>
|
|
<p><a href="index.php">Retour au formulaire</a></p>
|
|
</div>
|
|
|
|
<?php elseif ($thesis): ?>
|
|
<p>d'avoir soumis votre TFE. Les informations ont été enregistrées et sont en attente de traitement.</p>
|
|
|
|
<div class="thesis-info">
|
|
<h2>Récapitulatif de votre soumission</h2>
|
|
|
|
<h3>Informations de base</h3>
|
|
<dl>
|
|
<dt>Identifiant:</dt>
|
|
<dd><strong><?php echo htmlspecialchars($thesis['identifier']); ?></strong></dd>
|
|
|
|
<dt>Titre:</dt>
|
|
<dd><?php echo htmlspecialchars($thesis['title']); ?></dd>
|
|
|
|
<?php if ($thesis['subtitle']): ?>
|
|
<dt>Sous-titre:</dt>
|
|
<dd><?php echo htmlspecialchars($thesis['subtitle']); ?></dd>
|
|
<?php endif; ?>
|
|
|
|
<dt>Auteur·ice(s):</dt>
|
|
<dd><?php echo htmlspecialchars($thesis['authors']); ?></dd>
|
|
|
|
<dt>Année:</dt>
|
|
<dd><?php echo htmlspecialchars($thesis['year']); ?></dd>
|
|
</dl>
|
|
|
|
<h3>Détails académiques</h3>
|
|
<dl>
|
|
<dt>Orientation:</dt>
|
|
<dd><?php echo htmlspecialchars($thesis['orientation'] ?? 'Non spécifié'); ?></dd>
|
|
|
|
<dt>Atelier Pratique:</dt>
|
|
<dd><?php echo htmlspecialchars($thesis['ap_program'] ?? 'Non spécifié'); ?></dd>
|
|
|
|
<dt>Finalité:</dt>
|
|
<dd><?php echo htmlspecialchars($thesis['finality_type'] ?? 'Non spécifié'); ?></dd>
|
|
|
|
<?php if ($thesis['supervisors']): ?>
|
|
<dt>Promoteur·ice(s):</dt>
|
|
<dd><?php echo htmlspecialchars($thesis['supervisors']); ?></dd>
|
|
<?php endif; ?>
|
|
</dl>
|
|
|
|
<h3>Contenu</h3>
|
|
<dl>
|
|
<?php if ($thesis['synopsis']): ?>
|
|
<dt>Synopsis:</dt>
|
|
<dd><?php echo nl2br(htmlspecialchars($thesis['synopsis'])); ?></dd>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($thesis['languages']): ?>
|
|
<dt>Langue(s):</dt>
|
|
<dd><?php echo htmlspecialchars($thesis['languages']); ?></dd>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($thesis['formats']): ?>
|
|
<dt>Format(s):</dt>
|
|
<dd><?php echo htmlspecialchars($thesis['formats']); ?></dd>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($thesis['keywords']): ?>
|
|
<dt>Mots-clés:</dt>
|
|
<dd><?php echo htmlspecialchars($thesis['keywords']); ?></dd>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($thesis['file_size_info']): ?>
|
|
<dt>Durée/Taille:</dt>
|
|
<dd><?php echo htmlspecialchars($thesis['file_size_info']); ?></dd>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($thesis['baiu_link']): ?>
|
|
<dt>Lien:</dt>
|
|
<dd><a href="<?php echo htmlspecialchars($thesis['baiu_link']); ?>" target="_blank" rel="noopener">
|
|
<?php echo htmlspecialchars($thesis['baiu_link']); ?>
|
|
</a></dd>
|
|
<?php endif; ?>
|
|
</dl>
|
|
|
|
<?php if (!empty($files)): ?>
|
|
<h3>Fichiers téléversés</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Nom du fichier</th>
|
|
<th>Taille</th>
|
|
<th>Date</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($files as $file): ?>
|
|
<tr>
|
|
<td><?php echo htmlspecialchars($file['file_type']); ?></td>
|
|
<td><?php echo htmlspecialchars($file['file_name']); ?></td>
|
|
<td><?php echo formatFileSize($file['file_size']); ?></td>
|
|
<td><?php echo date('d/m/Y H:i', strtotime($file['uploaded_at'])); ?></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
<?php endif; ?>
|
|
|
|
<h3>Statut de publication</h3>
|
|
<p><strong>⏳ En attente</strong> - Votre TFE ne sera publié qu'après la soutenance et l'ajout éventuel d'une note contextuelle par le jury.</p>
|
|
|
|
<p class="submitted-date">
|
|
Soumis le <?php echo date('d/m/Y à H:i', strtotime($thesis['submitted_at'])); ?>
|
|
</p>
|
|
</div>
|
|
|
|
<p><a href="index.php">Soumettre un autre TFE</a></p>
|
|
|
|
<?php else: ?>
|
|
<p>Aucune donnée à afficher.</p>
|
|
<p><a href="index.php">Retour au formulaire</a></p>
|
|
<?php endif; ?>
|
|
</main>
|
|
|
|
<footer>
|
|
<p>Formulaire Post-ERG</p>
|
|
</footer>
|
|
</body>
|
|
</html>
|
|
|
|
<style>
|
|
.thesis-info {
|
|
background: #f5f5f5;
|
|
padding: 2rem;
|
|
border-radius: 8px;
|
|
margin: 2rem 0;
|
|
}
|
|
|
|
.thesis-info h2 {
|
|
margin-top: 0;
|
|
border-bottom: 2px solid #333;
|
|
padding-bottom: 0.5rem;
|
|
}
|
|
|
|
.thesis-info h3 {
|
|
margin-top: 2rem;
|
|
margin-bottom: 1rem;
|
|
color: #555;
|
|
}
|
|
|
|
.thesis-info dl {
|
|
display: grid;
|
|
grid-template-columns: 200px 1fr;
|
|
gap: 0.5rem 1rem;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.thesis-info dt {
|
|
font-weight: bold;
|
|
color: #666;
|
|
}
|
|
|
|
.thesis-info dd {
|
|
margin: 0;
|
|
}
|
|
|
|
.thesis-info table {
|
|
width: 100%;
|
|
margin-top: 1rem;
|
|
}
|
|
|
|
.thesis-info table th {
|
|
text-align: left;
|
|
background: #ddd;
|
|
padding: 0.5rem;
|
|
}
|
|
|
|
.thesis-info table td {
|
|
padding: 0.5rem;
|
|
border-bottom: 1px solid #ddd;
|
|
}
|
|
|
|
.submitted-date {
|
|
margin-top: 2rem;
|
|
font-style: italic;
|
|
color: #666;
|
|
}
|
|
|
|
.error {
|
|
background: #fee;
|
|
border: 2px solid #c00;
|
|
padding: 1.5rem;
|
|
border-radius: 8px;
|
|
color: #c00;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.thesis-info dl {
|
|
grid-template-columns: 1fr;
|
|
gap: 0.25rem;
|
|
}
|
|
|
|
.thesis-info dt {
|
|
margin-top: 1rem;
|
|
}
|
|
}
|
|
</style>
|