khanat-opennel-code/code/web/app/app_achievements_admin/class/CSRPerk_class.php
SirCotare 7d976a22ad #1470 admin tool workprint; menu admin almost complete; wip!!
--HG--
branch : gsoc2012-achievements
2012-06-25 15:04:51 +02:00

28 lines
No EOL
623 B
PHP

<?php
class CSRPerk extends AchPerk implements CSR {
function CSRPerk(&$data) {
parent::__construct($data);
}
function grant($pid) {
global $DBc;
$DBc->sqlQuery("INSERT INTO ach_player_perk (app_perk,app_player,app_date) VALUES ('".$this->getID()."','".$pid."','".time()."')");
foreach($this->nodes as $elem) {
$elem->grant();
}
}
function deny($pid) {
global $DBc;
$DBc->sqlQuery("DELETE FROM ach_player_perk WHERE app_perk='".$this->getID()."' AND app_player='".$pid."'");
foreach($this->nodes as $elem) {
$elem->deny($pid);
}
}
}
?>