}
+ public function title(){
+ return 'Review Orders';
+ }
+
+}
+
+class Theme {
+
+ public function display($template){
+
+
+ }
+
}
class Config {
}
+class Type {
+
+ private $id;
+ private $name;
+ private $price;
+
+ public function __construct($id, $name, $price){
+ $this->id = $id;
+ $this->name = $name;
+ $this->price = $price;
+ }
+
+ public function id(){
+ if(!isset($this->id)){
+ throw new Exception('Invalid Operation');
+ }
+ return $this->id;
+ }
+
+ public static function Get_All(){
+ $query = 'SELECT `id`,`name`,`price` FROM `type`';
+ $stmt = Ticketing::Get()->database()->prepare($query);
+ $stmt->execute();
+ $stmt->bind_result($id, $name, $price);
+ $types = array();
+ while($stmt->fetch()){
+ $types[$id] = new Type($id, $name, $price);
+ }
+ $stmt->close();
+ return $types;
+ }
+
+}
+
class Order {
private $id;
return $this->template;
}
+ private $theme;
+
+ public function theme(){
+ if(!isset($this->theme)){
+ require_once('theme.php');
+ $this->theme = new Theme_Impl();
+ }
+ return $this->theme;
+ }
+
public function run(){
try {
$this->page()->logic($this->template());
- $this->template()->display();
+ $this->theme()->display($this->template());
} catch(Exception $e){
header('Content-type: text/plain'); print_r($e); exit;
}
}
+ public function url(){
+ $args = func_get_args();
+ return $this->config()->get('base') . implode('/', $args);
+ }
+
}
Ticketing::Get()->run();
}
+ // Do we have any tickets left?
+
+ $types = Type::Get_All();
+
+ $template->types = array();
+
+ foreach($types as $type){
+ $template->types[$type->id()] == array(
+ 'name' => $type->name(),
+ 'tickets_left' => $type->left()
+ );
+ }
+
+ $templates->add = $system->url('add');
+
$system->database()->commit();
class Template_Index extends Template {
+ public function display(){
+?>
+<div id="index">
+<?php if(count($this->previous) > 0){ ?>
+<div id="previous">
+ <h1>Previous Orders</h1>
+
+</div>
+<?php } ?>
+<div id="current">
+ <h1>Current Order</h1>
+
+</div>
+</div>
+<?php
+ }
}