prepare('SELECT id, title, icon, items, position FROM skills ORDER BY position ASC, id ASC'); $stmt->execute(); return $stmt->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { return []; } } // Fonction qui permet de récupérer une catégorie de compétences par id (pour la modification dans le panel Admin) function recupererSkillParId($id) { global $dbh; try { $stmt = $dbh->prepare('SELECT id, title, icon, items, position FROM skills WHERE id = :id'); $stmt->bindValue(':id', $id, PDO::PARAM_INT); $stmt->execute(); return $stmt->fetch(PDO::FETCH_ASSOC); } catch (PDOException $e) { return false; } } // Fonction interne qui affiche une carte de compétences (utilisée par la page publique et le panel admin) // Les items sont stockés un par ligne, au format "classes-icone|Texte" (icône optionnelle) function afficherSkillCard($skill, $admin = false) { $id = (int) $skill['id']; $titre = htmlspecialchars($skill['title']); $icone = htmlspecialchars(!empty($skill['icon']) ? $skill['icon'] : 'fa-solid fa-star'); echo '
Les compétences seront bientôt disponibles.
'; return; } echo '