2012-05-25 09:48:56 +00:00
< ? php
2012-06-21 20:45:27 +00:00
class AchObjective {
2012-05-25 09:48:56 +00:00
private $id ;
private $perk ;
private $condition ;
private $value ;
private $name ;
private $display ;
2012-05-27 19:08:28 +00:00
private $done ;
private $progress ;
2012-06-21 20:03:36 +00:00
private $meta_image ;
2012-05-27 19:08:28 +00:00
2012-05-31 13:15:36 +00:00
function AchObjective ( & $data ) {
global $DBc , $_USER ;
2012-05-25 09:48:56 +00:00
$this -> id = $data [ 'ao_id' ];
$this -> perk = $data [ 'ao_perk' ];
$this -> condition = $data [ 'ao_condition' ];
$this -> value = $data [ 'ao_value' ];
$this -> name = $data [ 'aol_name' ];
$this -> display = $data [ 'ao_display' ];
2012-05-27 19:08:28 +00:00
$this -> done = $data [ 'apo_date' ];
2012-06-21 20:03:36 +00:00
$this -> meta_image = $data [ 'aa_image' ];
2012-05-27 19:08:28 +00:00
$this -> progress = $this -> value ;
if ( ! $this -> isDone ()) {
2012-05-31 13:15:36 +00:00
$res = $DBc -> sqlQuery ( " SELECT count(*) as anz FROM ach_player_atom,ach_atom WHERE apa_atom=atom_id AND atom_objective=' " . $this -> id . " ' AND apa_player=' " . $_USER -> getId () . " ' " );
2012-05-27 19:08:28 +00:00
$this -> progress = $res [ 0 ][ 'anz' ];
}
2012-05-25 09:48:56 +00:00
}
2012-06-21 20:03:36 +00:00
function getMetaImage () {
return $this -> meta_image ;
}
2012-05-25 09:48:56 +00:00
function getID () {
return $this -> id ;
}
function getPerk () {
return $this -> perk ;
}
function getCondition () {
return $this -> condition ;
}
function getValue () {
return $this -> value ;
}
2012-05-27 19:08:28 +00:00
function getProgress () {
return $this -> progress ;
}
2012-05-25 09:48:56 +00:00
function getName () {
return $this -> name ;
}
function getDisplay () {
return $this -> display ;
}
2012-05-27 19:08:28 +00:00
function isDone () {
return ( $this -> done > 0 );
}
function getDone () {
return $this -> done ;
}
2012-05-25 09:48:56 +00:00
}
?>