diff --git a/html/user.php b/html/user.php index da8d8405..f4df4488 100644 --- a/html/user.php +++ b/html/user.php @@ -107,52 +107,51 @@ if($resultat) {
- -
-
- prepare("SELECT ID, titre, date, auteur, image, resume FROM articles WHERE (titre LIKE :search OR ID LIKE :search OR auteur LIKE :search) AND classification <= :accreditation AND auteur = :user_id ORDER BY date DESC"); - $req->bindParam(":search", $search); - $req->bindParam(":accreditation", $_SESSION['accreditation']); - $req->bindParam(":user_id", $user_id); - $req->execute(); - $resultat = $req->fetchAll(PDO::FETCH_ASSOC); - echo "
"; +
+ prepare("SELECT ID, titre, date, auteur, image, resume FROM articles WHERE (titre LIKE :search OR ID LIKE :search OR auteur LIKE :search) AND classification <= :accreditation AND auteur = :user_id ORDER BY date DESC"); + $req->bindParam(":search", $search); + $req->bindParam(":accreditation", $_SESSION['accreditation']); + $req->bindParam(":user_id", $user_id); + $req->execute(); + $resultat = $req->fetchAll(PDO::FETCH_ASSOC); + echo "
"; - if ($resultat) { - foreach($resultat as $row) { - $date = strtotime($row['date']); - echo '
'; - echo '
'; - echo ''; - echo '
'; - echo '
'; - echo '
n° ' . $row['ID'] . ' | ' . date('d/m/Y', $date) . ' | '. $row['auteur'] . '
'; - echo ''; - echo '
' . $row['titre'] . '
'; - echo '
'; - echo '
' . $row['resume'] . '
'; - echo '
'; - echo '
'; + if ($resultat) { + foreach($resultat as $row) { + $date = strtotime($row['date']); + echo '
'; + echo '
'; + echo ''; + echo '
'; + echo '
'; + echo '
n° ' . $row['ID'] . ' | ' . date('d/m/Y', $date) . ' | '. $row['auteur'] . '
'; + echo ''; + echo '
' . $row['titre'] . '
'; + echo '
'; + echo '
' . $row['resume'] . '
'; + echo '
'; + echo '
'; + } + } else { + echo "L'utilisateur n'a pas publié d'articles"; } - } else { - echo "L'utilisateur n'a pas publié d'articles"; - } - ?> + ?> +