disinclined.org
/
git
/
dylansserver.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use htmlspecialchars to escape authorname
[dylansserver.git]
/
model
/
index.php
diff --git
a/model/index.php
b/model/index.php
index
dc8f6b3
..
f649ecc
100644
(file)
--- a/
model/index.php
+++ b/
model/index.php
@@
-2,25
+2,32
@@
class index extends model {
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() {
require_once("view/index.php");
}
- public function display_exhibits() {
- echo "<div id='exhibit'>";
+ private function fetch_exhibits() {
$sql = "SELECT text FROM projects ORDER BY rank";
$result = $this->db->query($sql);
while ($entry = $result->fetch_object()) {
$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 "</div>";
}
}
- p
ublic function list
_projects() {
+ p
rivate function fetch
_projects() {
$sql = "SELECT title FROM projects ORDER BY rank";
$result = $this->db->query($sql);
while ($entry = $result->fetch_object()) {
$sql = "SELECT title FROM projects ORDER BY rank";
$result = $this->db->query($sql);
while ($entry = $result->fetch_object()) {
-
echo "<li><a class='tab' href='$entry->title'>$entry->title</a></li>"
;
+
$this->projects[] = $entry->title
;
}
}
}
}