RewriteRule (.*) http://www.homertonball.com [L]
RewriteRule index.php - [QSA,L]
-RewriteRule (.*) https://www.srcf.ucam.org/hmb/secure/index.php?page=$1 [QSA,L]
+RewriteRule (.*) /hmb/secure/index.php?page=$1 [QSA,L]
AuthType Ucam-WebAuth
Require valid-user
class Page {
public function logic($template){
-
+
}
}
class Theme {
public function display($template){
-
+
}
class Config {
private $data;
-
+
public function __construct($data){
$this->data = $data;
}
return $this->left;
}
+ public static function Get($id){
+ $query = 'SELECT `id`,`name`,`price` FROM `type` WHERE id = ?';
+ $stmt = Ticketing::Get()->database()->prepare($query);
+ $stmt->bind_param('i', $id);
+ $stmt->execute();
+ $stmt->bind_result($id, $name, $price);
+ $type = null;
+ if($stmt->fetch()){
+ $type = new Type($id, $name, $price);
+ }
+ $stmt->close();
+ return $type;
+
+ }
+
public static function Get_All(){
$query = 'SELECT `id`,`name`,`price` FROM `type`';
$stmt = Ticketing::Get()->database()->prepare($query);
return '';
}
}
-
+
private $type;
public function type(){
$template->types[$type->id()] = array(
'name' => $type->name(),
'price' => $type->price(),
- 'tickets_left' => $type->left()
+ 'tickets_left' => $type->left(),
+ 'url' => $system->url('add', $type->id())
);
}
- $template->add = $system->url('add');
-
-
$system->database()->commit();
} catch (Exception $e){
<div id="index">
<?php if(count($this->previous) > 0){ ?>
<div id="previous">
- <h1>Previous Orders</h1>
+ <h2>Previous Orders</h1>
</div>
<?php } ?>
+<?php if(count($this->current) > 0){ ?>
<div id="current">
- <h1>Current Order</h1>
-
+ <h2>Current Order</h2>
+ <?php print_r($this); ?>
+</div>
+<?php } ?>
+<div id="add">
+ <ul>
+ <?php foreach($this->types as $type){ ?>
+ <li><p><?php if($type['tickets_left']){ ?><a href="<?php echo $type['url']; ?>"><?php } ?><?php echo $type['name']; ?> Ticket<?php if($type['tickets_left']){ ?></a><?php } ?></p><p>£<?php echo $type['price']; ?></p><p><?php echo $type['description']; ?></p><? if(!$type['tickets_left']){ ?><p> SOLD OUT </p><? } ?></li>
+ <?php } ?>
+ </ul>
</div>
</div>
<?php
- echo '<pre>'; print_r($this); echo '</pre>';
}
}
<html>
<head>
<title>Homerton May Ball 2011 Ticketing - <?php echo $template->title(); ?></title>
+ <style>
+ body {
+ background: #781416;
+ }
+ </style>
</head>
<body>
+<h1>Homerton May Ball 2011 Ticketing System</h1>
<div class="content">
<?php $template->display(); ?>
</div>