79 lines
3.3 KiB
PHP
79 lines
3.3 KiB
PHP
<section class="page-header">
|
|
<div>
|
|
<p class="eyebrow">Tableau de bord</p>
|
|
<h1 class="page-title">Salut, <?php print Helpers::echapper($utilisateur["identifiant"]); ?></h1>
|
|
<p class="lead-text">Voici un aperçu de votre bibliothèque.</p>
|
|
</div>
|
|
<div class="page-actions">
|
|
<a href="/consoles/creer" class="btn btn-outline-neon">
|
|
<i class="mdi mdi-plus"></i> Console
|
|
</a>
|
|
<a href="/jeux/creer" class="btn btn-neon">
|
|
<i class="mdi mdi-plus"></i> Jeu
|
|
</a>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="stats-row">
|
|
<article class="stat-block">
|
|
<span class="stat-label">Consoles</span>
|
|
<strong class="stat-value"><?php print (int) $nombreConsoles; ?></strong>
|
|
</article>
|
|
<article class="stat-block">
|
|
<span class="stat-label">Jeux</span>
|
|
<strong class="stat-value"><?php print (int) $nombreJeux; ?></strong>
|
|
</article>
|
|
</section>
|
|
|
|
<section class="mt-5">
|
|
<div class="section-heading">
|
|
<h2>Derniers ajouts</h2>
|
|
<a href="/jeux" class="link-neon">Voir tous les jeux</a>
|
|
</div>
|
|
|
|
<?php if ($derniersJeux === []): ?>
|
|
<div class="empty-state">
|
|
<i class="mdi mdi-controller-classic-outline"></i>
|
|
<p>Aucun jeu pour le moment. Commencez par ajouter une console, puis un jeu.</p>
|
|
<a href="/jeux/creer" class="btn btn-neon">Ajouter un jeu</a>
|
|
</div>
|
|
<?php else: ?>
|
|
<div class="game-grid">
|
|
<?php foreach ($derniersJeux as $jeu): ?>
|
|
<?php
|
|
$consoleNom = "";
|
|
foreach ($consoles as $console)
|
|
{
|
|
if ($console["id"] === $jeu["consoleId"])
|
|
{
|
|
$consoleNom = $console["nom"];
|
|
break;
|
|
}
|
|
}
|
|
?>
|
|
<a class="game-card" href="/jeux/<?php print Helpers::echapper($jeu["id"]); ?>">
|
|
<img
|
|
src="<?php print Helpers::echapper(Helpers::urlJaquette($jeu["jaquette"] ?? null)); ?>"
|
|
alt="Jaquette de <?php print Helpers::echapper($jeu["titre"]); ?>"
|
|
loading="lazy"
|
|
>
|
|
<div class="game-card-body">
|
|
<h3><?php print Helpers::echapper($jeu["titre"]); ?></h3>
|
|
<p><?php print Helpers::echapper($consoleNom); ?></p>
|
|
<div class="game-card-badges">
|
|
<span class="badge-etat etat-<?php print Helpers::echapper($jeu["etat"]); ?>">
|
|
<?php print Helpers::echapper(Helpers::libelleEtat($jeu["etat"])); ?>
|
|
</span>
|
|
<?php foreach (Helpers::normaliserFormats($jeu["formats"] ?? []) as $format): ?>
|
|
<span class="badge-format format-<?php print Helpers::echapper($format); ?>">
|
|
<?php print Helpers::echapper(Helpers::libelleFormat($format)); ?>
|
|
</span>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</section>
|