Пример #1
0
 public function index()
 {
     session_start();
     $newsStuff = new NewsStuff();
     $stuff = $newsStuff->getNews(NULL, 0, 100);
     $data['newsStuff'] = $stuff;
     $data['activeLink'] = 1;
     $this->load->view('main_top', $data);
     $this->load->view('news', $data);
     $this->load->view('main_footer');
 }
Пример #2
0
if (isset($_SESSION['basketStuff'])) {
    $userInfo = $_SESSION['basketStuff']->getUserInfo();
    if (!($userInfo == NULL) && $userInfo->isAdmin == 1) {
        echo "<input type='image' name='del' class='buttons' src='/images/admin_delete.png' />";
    }
}
?>
            
        <!-- <input type="image" name="btnEdit" class="buttons" src="/images/admin_edit.png" align="right"/> -->
        <?php 
if (isset($_POST['del_x'])) {
    unset($_POST['del_x']);
    $id = intval($_POST['newsId']);
    $newsStuff = new NewsStuff();
    $newsStuff->removeNews($id);
    $stuff = $newsStuff->getNews(NULL, 0, 100);
    /*$data['newsStuff']=$stuff;*/
    header("Location: /index.php/news/");
}
/*  if (isset($_POST['btnEdit_x'])){
         unset($_POST['btnEdit_x']);
         $id = intval($_POST['newsId']);
    }*/
?>
    </form>
    <!-- end_admin -->
    
    <h1> <?php 
echo $new->title;
?>
</h1>