From 8439ed9ba5b36fa382e32ea883a0877d6ec536c0 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Thu, 9 Jun 2011 16:56:39 -0700 Subject: Finished added prices. Added more buttons to the headers. Fixed the categories. --- htdocs/src/Category.inc.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'htdocs/src/Category.inc.php') diff --git a/htdocs/src/Category.inc.php b/htdocs/src/Category.inc.php index fdcd210..cfef06b 100644 --- a/htdocs/src/Category.inc.php +++ b/htdocs/src/Category.inc.php @@ -12,10 +12,16 @@ require_once "base.inc.php"; class Category { private $info; - + private $options = array('price' => false); public function __construct($info=null) { $this->info = $info; + + if (isset($this->info['options'])) { + foreach (split(',', $this->info['options']) as $op) { + $this->options[$op] = true; + } + } } public static function getCategories() { @@ -54,8 +60,7 @@ class Category { $row = $db->fetchAssocRow($query); if ($row) { - $category = new Category(); - $category->info = $row; + $category = new Category($row); return $category; @@ -85,7 +90,14 @@ class Category { public function getDescription() { return htmlspecialchars($this->info['description']); } + + public function getOption($name) { + return $this->options[$name]; + } + + public function setOption($value) { + $this->options[$name] = $value; + } } ?> - -- cgit v1.2.3