Alpha V0.9
This commit is contained in:
parent
6c082f267d
commit
2c4e1bc5b5
137
admin.php
137
admin.php
@ -59,12 +59,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['
|
||||
}
|
||||
}
|
||||
|
||||
$orbital_enabled = isset($_POST["orbital_control_enabled"]) ? 1 : 0;
|
||||
$terrestrial_enabled = isset($_POST["terrestrial_control_enabled"]) ? 1 : 0;
|
||||
|
||||
if ($id > 0) {
|
||||
$stmt = $db->prepare("UPDATE celestial_object_types SET name = ?, slug = ?, icon = ?, description = ?, image_url = ? WHERE id = ?");
|
||||
$stmt->execute([$name, $slug, $icon, $description, $image_url, $id]);
|
||||
$stmt = $db->prepare("UPDATE celestial_object_types SET name = ?, slug = ?, icon = ?, description = ?, image_url = ?, orbital_control_enabled = ?, terrestrial_control_enabled = ? WHERE id = ?");
|
||||
$stmt->execute([$name, $slug, $icon, $description, $image_url, $orbital_enabled, $terrestrial_enabled, $id]);
|
||||
} else {
|
||||
$stmt = $db->prepare("INSERT INTO celestial_object_types (name, slug, icon, description, image_url) VALUES (?, ?, ?, ?, ?)");
|
||||
$stmt->execute([$name, $slug, $icon, $description, $image_url]);
|
||||
$stmt = $db->prepare("INSERT INTO celestial_object_types (name, slug, icon, description, image_url, orbital_control_enabled, terrestrial_control_enabled) VALUES (?, ?, ?, ?, ?, ?, ?)");
|
||||
$stmt->execute([$name, $slug, $icon, $description, $image_url, $orbital_enabled, $terrestrial_enabled]);
|
||||
$id = $db->lastInsertId();
|
||||
}
|
||||
|
||||
@ -319,6 +322,32 @@ if (isset($_GET['delete_lootbox'])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
// Handle Project Log CRUD
|
||||
if ($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["action"]) && $_POST["action"] === "upsert_project_log") {
|
||||
$id = (int)$_POST["id"];
|
||||
$version = $_POST["version"];
|
||||
$title = $_POST["title"];
|
||||
$content_log = $_POST["content"];
|
||||
|
||||
if ($id > 0) {
|
||||
$stmt = $db->prepare("UPDATE project_logs SET version = ?, title = ?, content = ? WHERE id = ?");
|
||||
$stmt->execute([$version, $title, $content_log, $id]);
|
||||
} else {
|
||||
$stmt = $db->prepare("INSERT INTO project_logs (version, title, content) VALUES (?, ?, ?)");
|
||||
$stmt->execute([$version, $title, $content_log]);
|
||||
}
|
||||
header("Location: admin.php?tab=project_logs&success=1");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_GET["delete_project_log"])) {
|
||||
$id = (int)$_GET["delete_project_log"];
|
||||
$db->prepare("DELETE FROM project_logs WHERE id = ?")->execute([$id]);
|
||||
header("Location: admin.php?tab=project_logs&success=1");
|
||||
exit;
|
||||
}
|
||||
|
||||
// --- DATA FETCHING ---
|
||||
$users_list = [];
|
||||
$objects_list = [];
|
||||
@ -328,6 +357,7 @@ $modifiers_list = [];
|
||||
$factions_list = [];
|
||||
$resources_list = [];
|
||||
$lootboxes_list = [];
|
||||
$project_logs_list = [];
|
||||
|
||||
if ($tab === 'users') {
|
||||
$users_list = $db->query("SELECT id, username, email, role FROM users ORDER BY username ASC")->fetchAll();
|
||||
@ -356,6 +386,8 @@ if ($tab === 'users') {
|
||||
unset($f);
|
||||
} elseif ($tab === 'resources') {
|
||||
$resources_list = $db->query("SELECT * FROM game_resources ORDER BY name ASC")->fetchAll();
|
||||
} elseif ($tab === 'project_logs') {
|
||||
$project_logs_list = $db->query("SELECT * FROM project_logs ORDER BY created_at DESC")->fetchAll();
|
||||
} elseif ($tab === 'lootboxes') {
|
||||
$lootboxes_list = $db->query("SELECT * FROM lootboxes ORDER BY name ASC")->fetchAll();
|
||||
$resources_list = $db->query("SELECT name, slug FROM game_resources ORDER BY name ASC")->fetchAll();
|
||||
@ -369,6 +401,8 @@ if ($tab === 'users') {
|
||||
$lb['items'] = $stmt_i->fetchAll();
|
||||
}
|
||||
unset($lb);
|
||||
} elseif ($tab === "project_logs") {
|
||||
$project_logs_list = $db->query("SELECT * FROM project_logs ORDER BY created_at DESC")->fetchAll();
|
||||
}
|
||||
|
||||
?>
|
||||
@ -436,7 +470,7 @@ if ($tab === 'users') {
|
||||
<div style="display: flex; align-items: center; gap: 20px;">
|
||||
<h2 style="margin: 0; color: #bf616a;"><i class="fa-solid fa-shield-halved"></i> CONSOLE ADMIN</h2>
|
||||
<nav class="nav-links">
|
||||
<a href="index.php"><i class="fa-solid fa-eye"></i> Vue Joueur</a>
|
||||
<a href="project_log.php"><i class="fa-solid fa-clipboard-list"></i> Journal</a> <a href="index.php"><i class="fa-solid fa-eye"></i> Vue Joueur</a>
|
||||
<a href="gm_console.php"><i class="fa-solid fa-headset"></i> Console MJ</a>
|
||||
</nav>
|
||||
</div>
|
||||
@ -458,6 +492,7 @@ if ($tab === 'users') {
|
||||
<a href="?tab=settlement_types" class="tab-link <?php echo $tab === 'settlement_types' ? 'active' : ''; ?>"><i class="fa-solid fa-city"></i> Types d'Établissements</a>
|
||||
<a href="?tab=factions" class="tab-link <?php echo $tab === 'factions' ? 'active' : ''; ?>"><i class="fa-solid fa-flag"></i> Factions</a>
|
||||
<a href="?tab=resources" class="tab-link <?php echo $tab === 'resources' ? 'active' : ''; ?>"><i class="fa-solid fa-gem"></i> Ressources</a>
|
||||
<a href="?tab=project_logs" class="tab-link <?php echo $tab === "project_logs" ? "active" : ""; ?>"><i class="fa-solid fa-clipboard-list"></i> Journal de Bord</a>
|
||||
<a href="?tab=lootboxes" class="tab-link <?php echo $tab === 'lootboxes' ? 'active' : ''; ?>"><i class="fa-solid fa-box-open"></i> Lootboxes</a>
|
||||
</div>
|
||||
|
||||
@ -520,6 +555,17 @@ if ($tab === 'users') {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; gap: 20px; margin-bottom: 15px; background: rgba(0,0,0,0.2); padding: 10px; border-radius: 4px; border: 1px solid #334155;">
|
||||
<div style="flex: 1; display: flex; align-items: center; gap: 10px;">
|
||||
<input type="checkbox" name="orbital_control_enabled" id="obj_orbital_enabled" checked style="width: auto;">
|
||||
<label for="obj_orbital_enabled" style="margin-bottom: 0; cursor: pointer;">Contrôle Orbital activé</label>
|
||||
</div>
|
||||
<div style="flex: 1; display: flex; align-items: center; gap: 10px;">
|
||||
<input type="checkbox" name="terrestrial_control_enabled" id="obj_terrestrial_enabled" checked style="width: auto;">
|
||||
<label for="obj_terrestrial_enabled" style="margin-bottom: 0; cursor: pointer;">Contrôle Terrestre activé</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; gap: 20px;">
|
||||
<div style="flex: 1;">
|
||||
<label style="font-size: 12px; color: #8c92a3;">Bonus / Malus attribués</label>
|
||||
@ -546,7 +592,7 @@ if ($tab === 'users') {
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<thead><tr><th>Visuel</th><th>Nom</th><th>Bonus/Malus</th><th>Slug</th><th>Actions</th></tr></thead>
|
||||
<thead><tr><th>Visuel</th><th>Nom</th><th>Contrôles</th><th>Bonus/Malus</th><th>Slug</th><th>Actions</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($objects_list as $o): ?>
|
||||
<tr>
|
||||
@ -558,6 +604,16 @@ if ($tab === 'users') {
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><strong><?php echo htmlspecialchars($o['name']); ?></strong></td>
|
||||
<td style="text-align: center;">
|
||||
<div style="display: flex; flex-direction: column; gap: 4px; align-items: center;">
|
||||
<span style="font-size: 10px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 4px; background: <?php echo $o['orbital_control_enabled'] ? 'rgba(163, 190, 140, 0.2)' : 'rgba(191, 97, 106, 0.2)'; ?>; color: <?php echo $o['orbital_control_enabled'] ? '#a3be8c' : '#bf616a'; ?>; border: 1px solid <?php echo $o['orbital_control_enabled'] ? '#a3be8c' : '#bf616a'; ?>; width: 90px; justify-content: center;">
|
||||
<i class="fa-solid <?php echo $o['orbital_control_enabled'] ? 'fa-check' : 'fa-xmark'; ?>"></i> ORBITAL
|
||||
</span>
|
||||
<span style="font-size: 10px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 4px; background: <?php echo $o['terrestrial_control_enabled'] ? 'rgba(163, 190, 140, 0.2)' : 'rgba(191, 97, 106, 0.2)'; ?>; color: <?php echo $o['terrestrial_control_enabled'] ? '#a3be8c' : '#bf616a'; ?>; border: 1px solid <?php echo $o['terrestrial_control_enabled'] ? '#a3be8c' : '#bf616a'; ?>; width: 90px; justify-content: center;">
|
||||
<i class="fa-solid <?php echo $o['terrestrial_control_enabled'] ? 'fa-check' : 'fa-xmark'; ?>"></i> TERRESTRE
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$stmt = $db->prepare("SELECT m.name, m.type FROM modifiers m JOIN celestial_object_type_modifiers cotm ON m.id = cotm.modifier_id WHERE cotm.celestial_object_type_id = ?");
|
||||
@ -850,6 +906,17 @@ if ($tab === 'users') {
|
||||
<input type="file" name="image" accept="image/*">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; gap: 20px; margin-bottom: 15px; background: rgba(0,0,0,0.2); padding: 10px; border-radius: 4px; border: 1px solid #334155;">
|
||||
<div style="flex: 1; display: flex; align-items: center; gap: 10px;">
|
||||
<input type="checkbox" name="orbital_control_enabled" id="obj_orbital_enabled" checked style="width: auto;">
|
||||
<label for="obj_orbital_enabled" style="margin-bottom: 0; cursor: pointer;">Contrôle Orbital activé</label>
|
||||
</div>
|
||||
<div style="flex: 1; display: flex; align-items: center; gap: 10px;">
|
||||
<input type="checkbox" name="terrestrial_control_enabled" id="obj_terrestrial_enabled" checked style="width: auto;">
|
||||
<label for="obj_terrestrial_enabled" style="margin-bottom: 0; cursor: pointer;">Contrôle Terrestre activé</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Description</label>
|
||||
<textarea name="description" id="res_desc" rows="2"></textarea>
|
||||
@ -897,7 +964,61 @@ if ($tab === 'users') {
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php elseif ($tab === 'lootboxes'): ?>
|
||||
|
||||
<?php elseif ($tab === 'project_logs'): ?>
|
||||
<h3 style="color: #88c0d0;">Journal de Bord (Versions)</h3>
|
||||
<div class="form-card">
|
||||
<h4>Ajouter / Modifier une Version</h4>
|
||||
<form method="POST" id="logForm">
|
||||
<input type="hidden" name="action" value="upsert_project_log">
|
||||
<input type="hidden" name="id" id="log_id" value="0">
|
||||
<div style="display: flex; gap: 20px;">
|
||||
<div class="form-group" style="flex: 1;">
|
||||
<label>Version</label>
|
||||
<input type="text" name="version" id="log_version" required placeholder="Ex: 1.0.1">
|
||||
</div>
|
||||
<div class="form-group" style="flex: 3;">
|
||||
<label>Titre</label>
|
||||
<input type="text" name="title" id="log_title" required placeholder="Ex: Mise à jour majeure">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Contenu / Description des changements</label>
|
||||
<textarea name="content" id="log_content" rows="5" required placeholder="Détaillez les changements..."></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-add">ENREGISTRER LA VERSION</button>
|
||||
<button type="button" class="btn" style="background: #4c566a; color: #fff;" onclick="resetLogForm()">ANNULER</button>
|
||||
</form>
|
||||
</div>
|
||||
<table>
|
||||
<thead><tr><th>Version</th><th>Titre</th><th>Date</th><th>Actions</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($project_logs_list as $log): ?>
|
||||
<tr>
|
||||
<td><span class="version-badge" style="background:#88c0d0; color:#000; padding:2px 8px; border-radius:10px; font-weight:bold;">v<?php echo htmlspecialchars($log['version']); ?></span></td>
|
||||
<td><strong><?php echo htmlspecialchars($log['title']); ?></strong></td>
|
||||
<td style="font-size:12px; color:#8c92a3;"><?php echo date('d/m/Y H:i', strtotime($log['created_at'])); ?></td>
|
||||
<td>
|
||||
<button class="btn btn-ok" onclick='editLog(<?php echo htmlspecialchars(json_encode($log)); ?>)'>ÉDITER</button>
|
||||
<a href="?tab=project_logs&delete_project_log=<?php echo $log['id']; ?>" class="btn btn-del" onclick="return confirm('Supprimer cette version ?')">SUPPR</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<script>
|
||||
function editLog(log) {
|
||||
document.getElementById('log_id').value = log.id;
|
||||
document.getElementById('log_version').value = log.version;
|
||||
document.getElementById('log_title').value = log.title;
|
||||
document.getElementById('log_content').value = log.content;
|
||||
}
|
||||
function resetLogForm() {
|
||||
document.getElementById('log_id').value = 0;
|
||||
document.getElementById('logForm').reset();
|
||||
}
|
||||
</script>
|
||||
<?php elseif ($tab === 'lootboxes'): ?>
|
||||
<h3 style="color: #88c0d0;">Système de Lootboxes</h3>
|
||||
<div class="form-card">
|
||||
<h4>Créer / Modifier une Lootbox</h4>
|
||||
@ -1030,6 +1151,8 @@ if ($tab === 'users') {
|
||||
document.getElementById('obj_slug').value = data.slug;
|
||||
document.getElementById('obj_icon').value = data.icon;
|
||||
document.getElementById('obj_desc').value = data.description;
|
||||
document.getElementById('obj_orbital_enabled').checked = data.orbital_control_enabled == 1;
|
||||
document.getElementById('obj_terrestrial_enabled').checked = data.terrestrial_control_enabled == 1;
|
||||
document.querySelectorAll('.modifier-checkbox').forEach(cb => cb.checked = false);
|
||||
if (data.modifier_ids) {
|
||||
data.modifier_ids.forEach(mid => {
|
||||
|
||||
BIN
assets/pasted-20260225-191424-09452e8a.png
Normal file
BIN
assets/pasted-20260225-191424-09452e8a.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 223 KiB |
27
db/migrate_project_logs.php
Normal file
27
db/migrate_project_logs.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/config.php';
|
||||
$db = db();
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE IF NOT EXISTS project_logs (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
version VARCHAR(50) NOT NULL,
|
||||
title VARCHAR(255) NOT NULL,
|
||||
content TEXT NOT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
";
|
||||
|
||||
try {
|
||||
$db->exec($sql);
|
||||
echo "Table 'project_logs' created successfully.\n";
|
||||
|
||||
// Insert initial version
|
||||
$stmt = $db->prepare("INSERT INTO project_logs (version, title, content) VALUES (?, ?, ?)");
|
||||
$stmt->execute(['1.0.0', 'Initial Release', 'Welcome to the project log. This is the first version of the galaxy management system.']);
|
||||
echo "Initial log entry inserted.\n";
|
||||
|
||||
} catch (PDOException $e) {
|
||||
echo "Error creating table: " . $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
@ -22,6 +22,7 @@ $is_admin = ($current_user['role'] === 'admin');
|
||||
|
||||
// Fetch Dynamic Types, Statuses, Settlement Types, and Factions
|
||||
$object_types_db = $db->query("SELECT * FROM celestial_object_types ORDER BY name ASC")->fetchAll(PDO::FETCH_ASSOC);
|
||||
$object_types_map = []; foreach($object_types_db as $ot) { $object_types_map[$ot["slug"]] = $ot; }
|
||||
$statuses_db = $db->query("SELECT * FROM celestial_object_statuses ORDER BY id ASC")->fetchAll(PDO::FETCH_ASSOC);
|
||||
$settlement_types_db = $db->query("SELECT * FROM settlement_types ORDER BY name ASC")->fetchAll(PDO::FETCH_ASSOC);
|
||||
$factions_db = $db->query("SELECT * FROM factions ORDER BY name ASC")->fetchAll(PDO::FETCH_ASSOC);
|
||||
@ -416,7 +417,7 @@ function getStatusColor($status, $type, $statuses_map, $object_types_map) {
|
||||
<div style="display: flex; align-items: center; gap: 20px;">
|
||||
<h2 style="margin: 0; color: #ebcb8b;"><i class="fa-solid fa-headset"></i> CONSOLE MJ</h2>
|
||||
<nav style="display: flex; gap: 20px;">
|
||||
<a href="index.php" style="color: #88c0d0; text-decoration: none; font-size: 14px; font-weight: bold;"><i class="fa-solid fa-eye"></i> Vue Joueur</a>
|
||||
<a href="project_log.php" style="color: #ebcb8b; text-decoration: none; font-size: 14px; font-weight: bold;"><i class="fa-solid fa-clipboard-list"></i> Journal</a> <a href="index.php" style="color: #88c0d0; text-decoration: none; font-size: 14px; font-weight: bold;"><i class="fa-solid fa-eye"></i> Vue Joueur</a>
|
||||
<?php if ($is_admin): ?>
|
||||
<a href="admin.php" style="color: #bf616a; text-decoration: none; font-size: 14px; font-weight: bold;"><i class="fa-solid fa-shield-halved"></i> Console Admin</a>
|
||||
<?php endif; ?>
|
||||
@ -524,7 +525,7 @@ function getStatusColor($status, $type, $statuses_map, $object_types_map) {
|
||||
</div>
|
||||
<div class="form-group" style="flex: 1;">
|
||||
<label>Type d'objet</label>
|
||||
<select name="type" id="form_type">
|
||||
<select name="type" id="form_type" onchange="updateControlToggles()">
|
||||
<option value="empty">VIDE (Suppr)</option>
|
||||
<?php foreach($object_types_db as $ot): ?>
|
||||
<option value="<?php echo $ot['slug']; ?>"><?php echo $ot['name']; ?> (<?php echo $ot['slug']; ?>)</option>
|
||||
@ -544,14 +545,14 @@ function getStatusColor($status, $type, $statuses_map, $object_types_map) {
|
||||
</div>
|
||||
|
||||
<!-- Orbital Faction Control Section -->
|
||||
<div style="background: rgba(0,0,0,0.1); padding: 15px; border-radius: 6px; border: 1px solid #334155; margin-bottom: 20px;">
|
||||
<div id="orbitalSectionWrapper" style="background: rgba(0,0,0,0.1); padding: 15px; border-radius: 6px; border: 1px solid #334155; margin-bottom: 20px;">
|
||||
<label style="font-size: 11px; color: #88c0d0; font-weight: bold; display: block; margin-bottom: 15px; text-align: center; border-bottom: 1px solid #334155; padding-bottom: 8px;">CONTRÔLE ORBITAL PAR FACTION (%)</label>
|
||||
<div id="orbitalControlContainer" class="control-bars">
|
||||
<!-- Orbital sliders injected by JS -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="background: rgba(0,0,0,0.1); padding: 15px; border-radius: 6px; border: 1px solid #334155; margin-bottom: 20px;">
|
||||
<div id="terrestrialSectionWrapper" style="background: rgba(0,0,0,0.1); padding: 15px; border-radius: 6px; border: 1px solid #334155; margin-bottom: 20px;">
|
||||
<label style="font-size: 11px; color: #88c0d0; font-weight: bold; display: block; margin-bottom: 15px; text-align: center; border-bottom: 1px solid #334155; padding-bottom: 8px;">ÉTABLISSEMENTS & PROGRESSIONS</label>
|
||||
<div id="settlementsContainer">
|
||||
<!-- Settlements will be injected here -->
|
||||
@ -598,6 +599,7 @@ function getStatusColor($status, $type, $statuses_map, $object_types_map) {
|
||||
<script>
|
||||
let settlementIndex = 0;
|
||||
const settlementTypes = <?php echo json_encode($settlement_types_db); ?>;
|
||||
const typesMap = <?php echo json_encode($object_types_map); ?>;
|
||||
const allFactions = <?php echo json_encode($factions_db); ?>;
|
||||
const AUCUN_ID = 1; // ID for "Aucune" faction
|
||||
|
||||
@ -751,6 +753,21 @@ function getStatusColor($status, $type, $statuses_map, $object_types_map) {
|
||||
});
|
||||
}
|
||||
|
||||
function updateControlToggles() {
|
||||
const type = document.getElementById('form_type').value;
|
||||
const typeInfo = typesMap[type] || { orbital_control_enabled: 0, terrestrial_control_enabled: 0 };
|
||||
|
||||
const orbWrapper = document.getElementById('orbitalSectionWrapper');
|
||||
const terrWrapper = document.getElementById('terrestrialSectionWrapper');
|
||||
|
||||
orbWrapper.style.display = (typeInfo.orbital_control_enabled == 1) ? 'block' : 'none';
|
||||
terrWrapper.style.display = (typeInfo.terrestrial_control_enabled == 1) ? 'block' : 'none';
|
||||
|
||||
// Disable inputs in hidden sections to prevent them from being submitted
|
||||
orbWrapper.querySelectorAll('input, select, textarea').forEach(el => el.disabled = (typeInfo.orbital_control_enabled != 1));
|
||||
terrWrapper.querySelectorAll('input, select, textarea, button:not(.btn-cancel):not(.btn-save)').forEach(el => el.disabled = (typeInfo.terrestrial_control_enabled != 1));
|
||||
}
|
||||
|
||||
function editSlot(num, data) {
|
||||
document.getElementById('form_slot_num').value = num;
|
||||
document.getElementById('form_slot_id').value = data ? data.id : 0;
|
||||
@ -778,6 +795,7 @@ function getStatusColor($status, $type, $statuses_map, $object_types_map) {
|
||||
document.getElementById('settlementsContainer').innerHTML = '';
|
||||
}
|
||||
|
||||
updateControlToggles();
|
||||
document.getElementById('editModal').style.display = 'flex';
|
||||
}
|
||||
|
||||
|
||||
@ -413,11 +413,11 @@ function getStatusColor($status, $statuses_map) {
|
||||
<div class="user-auth-bar">
|
||||
<?php if (isset($_SESSION['user_id'])): ?>
|
||||
<span>Bienvenue, <span class="username">@<?php echo htmlspecialchars($_SESSION['username']); ?></span></span>
|
||||
<a href="profile.php"><i class="fa-solid fa-user-gear"></i> Profil</a>
|
||||
<a href="project_log.php"><i class="fa-solid fa-clipboard-list"></i> Journal</a> <a href="profile.php"><i class="fa-solid fa-user-gear"></i> Profil</a>
|
||||
<a href="auth.php?logout=1" style="color: #bf616a;"><i class="fa-solid fa-right-from-bracket"></i> Déconnexion</a>
|
||||
<?php else: ?>
|
||||
<a href="auth.php?page=login"><i class="fa-solid fa-right-to-bracket"></i> Connexion</a>
|
||||
<a href="auth.php?page=register"><i class="fa-solid fa-user-plus"></i> S'inscrire</a>
|
||||
<a href='project_log.php'><i class='fa-solid fa-clipboard-list'></i> Journal</a> <a href="auth.php?page=register"><i class="fa-solid fa-user-plus"></i> S'inscrire</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="resource-container">
|
||||
@ -696,7 +696,7 @@ function getStatusColor($status, $statuses_map) {
|
||||
orbitalBar.innerHTML = '';
|
||||
orbitalLegend.innerHTML = '';
|
||||
|
||||
if (data.orbital_controls && Object.keys(data.orbital_controls).length > 0) {
|
||||
if (typeInfo.orbital_control_enabled == 1 && data.orbital_controls && Object.keys(data.orbital_controls).length > 0) {
|
||||
document.getElementById('m-orbital-section').style.display = 'block';
|
||||
renderMultiBar(data.orbital_controls, orbitalBar, orbitalLegend);
|
||||
} else {
|
||||
@ -707,7 +707,7 @@ function getStatusColor($status, $statuses_map) {
|
||||
const citiesContainer = document.getElementById('m-cities-container');
|
||||
citiesContainer.innerHTML = '';
|
||||
|
||||
if (data.cities && data.cities.length > 0) {
|
||||
if (typeInfo.terrestrial_control_enabled == 1 && data.cities && data.cities.length > 0) {
|
||||
document.getElementById('m-cities-section').style.display = 'block';
|
||||
data.cities.forEach(city => {
|
||||
const card = document.createElement('div');
|
||||
|
||||
163
project_log.php
Normal file
163
project_log.php
Normal file
@ -0,0 +1,163 @@
|
||||
<?php
|
||||
require_once 'db/config.php';
|
||||
session_start();
|
||||
$db = db();
|
||||
|
||||
$logs = $db->query("SELECT * FROM project_logs ORDER BY created_at DESC")->fetchAll(PDO::FETCH_ASSOC);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Journal du Projet - Galaxy Manager</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Rajdhani:wght@300;500;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bg-color: #2e3440;
|
||||
--panel-bg: rgba(46, 52, 64, 0.9);
|
||||
--text-color: #eceff4;
|
||||
--accent-color: #88c0d0;
|
||||
--accent-glow: rgba(136, 192, 208, 0.4);
|
||||
--border-color: #4c566a;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Rajdhani', sans-serif;
|
||||
background: #1a1c23 url('https://www.transparenttextures.com/patterns/stardust.png');
|
||||
color: var(--text-color);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
header {
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
border-bottom: 2px solid var(--accent-color);
|
||||
box-shadow: 0 0 15px var(--accent-glow);
|
||||
}
|
||||
|
||||
header h1 {
|
||||
margin: 0;
|
||||
font-family: 'Orbitron', sans-serif;
|
||||
letter-spacing: 3px;
|
||||
color: var(--accent-color);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 40px auto;
|
||||
padding: 0 20px;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.log-entry {
|
||||
background: var(--panel-bg);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 8px;
|
||||
padding: 25px;
|
||||
margin-bottom: 30px;
|
||||
box-shadow: 0 4px 15px rgba(0,0,0,0.3);
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
|
||||
.log-entry:hover {
|
||||
transform: translateY(-3px);
|
||||
border-color: var(--accent-color);
|
||||
}
|
||||
|
||||
.log-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.version-badge {
|
||||
background: var(--accent-color);
|
||||
color: #2e3440;
|
||||
padding: 4px 12px;
|
||||
border-radius: 20px;
|
||||
font-weight: bold;
|
||||
font-family: 'Orbitron', sans-serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.log-date {
|
||||
color: #81a1c1;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.log-title {
|
||||
font-size: 22px;
|
||||
color: #fff;
|
||||
margin: 0 0 10px 0;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.log-content {
|
||||
line-height: 1.6;
|
||||
color: #d8dee9;
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
display: inline-block;
|
||||
margin-bottom: 20px;
|
||||
color: var(--accent-color);
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
transition: 0.2s;
|
||||
}
|
||||
|
||||
.back-btn:hover {
|
||||
color: #fff;
|
||||
text-shadow: 0 0 5px var(--accent-color);
|
||||
}
|
||||
|
||||
footer {
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
font-size: 12px;
|
||||
color: #4c566a;
|
||||
background: rgba(0,0,0,0.4);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Journal de Bord du Projet</h1>
|
||||
</header>
|
||||
|
||||
<div class="container">
|
||||
<a href="index.php" class="back-btn"><i class="fa-solid fa-arrow-left"></i> Retour au Secteur</a>
|
||||
|
||||
<?php if (empty($logs)): ?>
|
||||
<div class="log-entry">
|
||||
<p>Aucun log disponible pour le moment.</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php foreach ($logs as $log): ?>
|
||||
<div class="log-entry">
|
||||
<div class="log-header">
|
||||
<span class="version-badge">v<?php echo htmlspecialchars($log['version']); ?></span>
|
||||
<span class="log-date"><?php echo date('d/m/Y H:i', strtotime($log['created_at'])); ?></span>
|
||||
</div>
|
||||
<h2 class="log-title"><?php echo htmlspecialchars($log['title']); ?></h2>
|
||||
<div class="log-content"><?php echo nl2br(htmlspecialchars($log['content'])); ?></div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
© <?php echo date('Y'); ?> Galaxy Manager Project. Tous droits réservés.
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user