mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-07 03:29:19 +02:00
admin: unify templates, dynamic navigation, and PHP cleanup
This commit is contained in:
@@ -275,20 +275,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) {
|
||||
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
|
||||
}
|
||||
?>
|
||||
// <title>Import CSV - Post-ERG</title>
|
||||
// <header>
|
||||
// <h1>Import CSV - Post-ERG</h1>
|
||||
// <nav>
|
||||
// <a href="index.php">← Nouveau TFE</a> |
|
||||
// <a href="list.php">📋 Liste des TFE</a>
|
||||
// </nav>
|
||||
// </header>
|
||||
<?php require_once __DIR__ . '/inc/head.php'; ?>
|
||||
|
||||
<main>
|
||||
<main>
|
||||
<h2>Importer des TFE depuis un fichier CSV</h2>
|
||||
|
||||
<?php if (!empty($errors)): ?>
|
||||
<div style="background: #fee; border: 2px solid #c00; padding: 1rem; margin-bottom: 1rem; border-radius: 4px; color: #c00;">
|
||||
<div class="alert-error">
|
||||
<strong>⚠️ Erreurs:</strong>
|
||||
<ul>
|
||||
<?php foreach ($errors as $error): ?>
|
||||
@@ -299,7 +292,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) {
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($message): ?>
|
||||
<div style="background: #efe; border: 2px solid #0a0; padding: 1rem; margin-bottom: 1rem; border-radius: 4px; color: #0a0;">
|
||||
<div class="alert-success">
|
||||
<strong>✓ <?php echo htmlspecialchars($message); ?></strong>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -327,8 +320,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) {
|
||||
|
||||
<?php if (!empty($importResults)): ?>
|
||||
<h3>Résultats de l'import</h3>
|
||||
<div style="background: #f5f5f5; padding: 1rem; border-radius: 4px; max-height: 400px; overflow-y: auto;">
|
||||
<pre style="margin: 0; font-size: 0.9em;"><?php
|
||||
<div class="info-message">
|
||||
<pre><?php
|
||||
foreach ($importResults as $result) {
|
||||
echo htmlspecialchars($result) . "\n";
|
||||
}
|
||||
@@ -352,4 +345,4 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) {
|
||||
<p>Voir: <code>../db/Database_TFE_test.csv</code></p>
|
||||
</main>
|
||||
|
||||
<?php include "inc/footer.php" ?>
|
||||
<?php require_once __DIR__ . "/inc/footer.php"; ?>
|
||||
Reference in New Issue
Block a user