Example #1
0
} else {
    if (isset($_REQUEST['published'])) {
        $_REQUEST['published'] = true;
    } else {
        $_REQUEST['published'] = false;
    }
    if (isset($_REQUEST['onhome'])) {
        $_REQUEST['onhome'] = true;
    } else {
        $_REQUEST['onhome'] = false;
    }
    $article = new article();
    $article->setContent($_REQUEST['title_1'], $_REQUEST['content_1'], $_REQUEST['title_2'], $_REQUEST['content_2'], $_REQUEST['title_3'], $_REQUEST['content_3'], $_REQUEST['title_4'], $_REQUEST['content_4'], $_REQUEST['title_5'], $_REQUEST['content_5'], $_REQUEST['title_6'], $_REQUEST['content_6'], $_REQUEST['code']);
    $article->setUserId($account['name']);
    $article->setCategory($_REQUEST['category']);
    $article->setDate();
    $article->setDateUpdate();
    $article->setPublished($_REQUEST['published']);
    $article->setonHome($_REQUEST['onhome']);
    if ($article->insert()) {
        print 'sucess';
        $id = $mysqli->insert_id;
        ?>
			<div class="separator30"></div>

			<span id="label">Lista de ficheiros</span>
			<?php 
        print returnFilesList($id, 'article');
        ?>

			<div class="separator30"></div>