Ajout d'une selection a la page home.php + Système de badge (non fini mais fonctionnel)
This commit is contained in:
+22
-2
@@ -14,7 +14,7 @@ function listeXP() {
|
||||
// Essayer
|
||||
try {
|
||||
// Requête SQL qui récupère titre, type, tags, description, durée, image_url
|
||||
$stmt = $dbh->prepare('SELECT id, title, xptype, tags, description, duration, image_url FROM experiences ORDER BY id DESC');
|
||||
$stmt = $dbh->prepare('SELECT id, title, status, xptype, tags, description, duration, image_url FROM experiences ORDER BY id DESC');
|
||||
// Execution de la requête SQL
|
||||
$stmt->execute();
|
||||
// Retourne toutes les données collectés dans un ARRAY
|
||||
@@ -31,7 +31,8 @@ function recupererXPParId($id) {
|
||||
|
||||
try {
|
||||
// Préparation de la requête préparée
|
||||
$stmt = $dbh->prepare('SELECT id, title, xptype, tags, description, duration, image_url FROM experiences WHERE id = :id');
|
||||
$stmt = $dbh->prepare('SELECT id, title, status, xptype, tags, description, duration, image_url FROM experiences WHERE id = :id');
|
||||
|
||||
$stmt->bindValue(':id', $id, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
return $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
@@ -62,6 +63,7 @@ function afficherXP() {
|
||||
$description = nl2br(htmlspecialchars($experience['description']));
|
||||
$duration = htmlspecialchars($experience['duration']);
|
||||
$image = htmlspecialchars($experience['image_url']);
|
||||
$status = htmlspecialchars($experience['status'] ?? '');
|
||||
$tags = [];
|
||||
|
||||
|
||||
@@ -78,6 +80,11 @@ function afficherXP() {
|
||||
if (!empty($image)) {
|
||||
echo '<div class="project-banner">';
|
||||
echo '<img src="' . $image . '" alt="Image de l experience ' . $titre . '">';
|
||||
|
||||
if (!empty($status)) {
|
||||
echo '<div class="project-state">' . $status . '</div>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
@@ -85,6 +92,7 @@ function afficherXP() {
|
||||
// Ajout de la class project-content et du titre
|
||||
echo '<div class="project-content">';
|
||||
echo '<h2>' . $titre . '</h2>';
|
||||
|
||||
echo '<p><strong>Type :</strong> ' . $xptype . '</p>';
|
||||
echo '<p><strong>Durée :</strong> ' . $duration . '</p>';
|
||||
|
||||
@@ -123,6 +131,7 @@ function afficherXPAdmin() {
|
||||
$xptype = htmlspecialchars($experience['xptype']);
|
||||
$description = nl2br(htmlspecialchars($experience['description']));
|
||||
$duration = htmlspecialchars($experience['duration']);
|
||||
$status = htmlspecialchars($experience['status'] ?? '');
|
||||
$image = htmlspecialchars($experience['image_url']);
|
||||
$tags = [];
|
||||
|
||||
@@ -135,11 +144,22 @@ function afficherXPAdmin() {
|
||||
if (!empty($image)) {
|
||||
echo '<div class="project-banner">';
|
||||
echo '<img src="' . $image . '" alt="Image de l experience ' . $titre . '">';
|
||||
|
||||
if (!empty($status)) {
|
||||
echo '<div class="project-state">' . $status . '</div>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '<div class="project-content">';
|
||||
echo '<h2>' . $titre . '</h2>';
|
||||
|
||||
// Si le status n'est pas vide alors on l'affiche
|
||||
if (!empty($status)) {
|
||||
echo '<div class="project-state">' . $status . '</div>';
|
||||
}
|
||||
|
||||
echo '<p><strong>Type :</strong> ' . $xptype . '</p>';
|
||||
echo '<p><strong>Durée :</strong> ' . $duration . '</p>';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user