Example #1
0
function afficher_articles()
{
    $title = "Liste des Articles";
    if (isset($_GET['page'])) {
        $resultats = array();
        $nbr = Article::nombreArticle();
        $pages = (int) ($nbr / 10);
        $resultats = Article::getArticles($_GET['page'] * 10, 10);
        require "actions/afficher_articles.php";
    } else {
        $resultats = array();
        $nbr = Article::nombreArticle();
        $pages = (int) ($nbr / 10);
        $resultats = Article::getArticles(0, 10);
        require "actions/afficher_articles.php";
    }
}
Example #2
0
<aside id="droit">
  <video src="images/1.mp4" controls autoplay></video>
  <section>
    <div align="center">
      <h3>News</h3>
      <?php 
$resultats = array();
$nbr = Article::nombreArticle();
$resultats = Article::getArticles(0, 3);
foreach ($resultats as $article) {
    echo "<div>";
    $date = $article->get_date_publication();
    $date = strtotime($date);
    $date = date("d/m/Y", $date);
    $titre = $article->get_titre();
    $news_id = $article->get_news_id();
    echo "<p><span>{$date}</span><br/>";
    echo "<a href='index.php?action=afficher_article&news_id=" . $news_id . "'>";
    echo $titre;
    echo "</a>";
    echo "</p>";
    echo "</div>";
}
?>
       <h4 align="right"><a href="index.php?action=afficher_articles">Tous les News<a></h4>
      <br>
    </div>
  </section>
  <div id="button">
    <a href="inscription_newsletter.php">S’inscrire à la newsletter</a>
  </div>
Example #3
0
function lister_articler()
{
    $title = "Liste des Articles";
    include "includes/header.php";
    echo '<aside id="list_news">';
    if (isset($_GET['page'])) {
        $resultats = array();
        $nbr = Article::nombreArticle();
        $pages = (int) ($nbr / 10);
        $resultats = Article::getArticles($_GET['page'] * 10, 10);
        require "actions/lister_articler.php";
    } else {
        $resultats = array();
        $nbr = Article::nombreArticle();
        $pages = (int) ($nbr / 10);
        $resultats = Article::getArticles(0, 10);
        require "actions/lister_articler.php";
    }
    echo '</aside>';
    include "includes/footer.html";
}