X-Git-Url: https://disinclined.org/git/?a=blobdiff_plain;f=model%2Findex.php;fp=model%2Findex.php;h=f649eccc0a1b1cc184c8170a056c7aed0b51fc05;hb=1ac68c035e2a264ab00baab323fca3b2772b6cbe;hp=dc8f6b3437a2fd8feb6e4a6e5b9da7d13c6c18b1;hpb=a99ed12dc9a0d7d02721fa6b781b47116b976e3b;p=dylansserver.git diff --git a/model/index.php b/model/index.php index dc8f6b3..f649ecc 100644 --- a/model/index.php +++ b/model/index.php @@ -2,25 +2,32 @@ class index extends model { + public $exhibits = array(); + public $projects = array(); + + public function __construct() { + parent::__construct(); + $this->fetch_exhibits(); + $this->fetch_projects(); + } + public function display() { require_once("view/index.php"); } - public function display_exhibits() { - echo "
"; + private function fetch_exhibits() { $sql = "SELECT text FROM projects ORDER BY rank"; $result = $this->db->query($sql); while ($entry = $result->fetch_object()) { - echo $entry->text; + $this->exhibits[] = $entry->text; } - echo "
"; } - public function list_projects() { + private function fetch_projects() { $sql = "SELECT title FROM projects ORDER BY rank"; $result = $this->db->query($sql); while ($entry = $result->fetch_object()) { - echo "
  • $entry->title
  • "; + $this->projects[] = $entry->title; } }