rss layout now fully separated m/v/c
[dylansserver.git] / model / index.php
1 <?php
2
3 class index extends model {
4
5 public $exhibits = array();
6 public $projects = array();
7
8 public function __construct() {
9 parent::__construct();
10 $this->fetch_exhibits();
11 $this->fetch_projects();
12 }
13
14 public function display() {
15 require_once("view/index.php");
16 }
17
18 private function fetch_exhibits() {
19 $sql = "SELECT text FROM projects ORDER BY rank";
20 $result = $this->db->query($sql);
21 while ($entry = $result->fetch_object()) {
22 $this->exhibits[] = $entry->text;
23 }
24 }
25
26 private function fetch_projects() {
27 $sql = "SELECT title FROM projects ORDER BY rank";
28 $result = $this->db->query($sql);
29 while ($entry = $result->fetch_object()) {
30 $this->projects[] = $entry->title;
31 }
32 }
33
34 }
35
36 ?>