Example #1
0
function modifier_article()
{
    $title = "Modifier Article";
    include "includes/header.php";
    echo '<aside id="list_news">';
    if (isset($_POST['modifier_article'])) {
        if (!($article = Article::getArticle((int) $_POST['news_id']))) {
            header("Location: administrateur.php?erreur=articleNonTrouve");
            return;
        }
        $article = new Article($_POST);
        $article->modifier();
        header("Location: administrateur.php?statue=Ok");
    } elseif (isset($_POST['annuler'])) {
        header("Location: administrateur.php");
    } else {
        $article = Article::getArticle((int) $_GET['news_id']);
        $news_id = $article->get_news_id();
        $titre = $article->get_titre();
        $contenu = $article->get_contenu();
        $resume = $article->get_resume();
        require "actions/modifier_article.php";
    }
    echo '</aside>';
    include "includes/footer.html";
}