I see, at this moment the promocode is not set up in a way to handle multiple users yet. However, you can make it happen by editing these:
PHP Code:
public function __construct($code = ""){
// Fetch the database info into object property
$stmt = $GLOBALS['adopts']->select("promocodes", array(), "code ='{$code}'");
if($row = $stmt->fetchObject()){
// loop through the anonymous object created to assign properties
foreach($row as $key => $val){
// Assign properties to our promocode instance
$this->$key = $val;
}
}
else $this->message = "Promocode does not exist...<br>";
}
change to:
PHP Code:
public function __construct($code = ""){
// Fetch the database info into object property
$stmt = $GLOBALS['adopts']->select("promocodes", array(), "code ='{$code}'");
if($row = $stmt->fetchObject()){
// loop through the anonymous object created to assign properties
foreach($row as $key => $val){
// Assign properties to our promocode instance
$this->$key = $val;
}
if(empty($this->user)) $this->user = $GLOBALS['loggedinname'];
}
else $this->message = "Promocode does not exist...<br>";
}