| 1 | <?php |
|---|
| 2 | require_once(WCF_DIR.'lib/action/AbstractAction.class.php'); |
|---|
| 3 | |
|---|
| 4 | /** |
|---|
| 5 | * Gewinnspiel Admin Control Panel. |
|---|
| 6 | * Löschen eines Gewinnspiels. |
|---|
| 7 | * |
|---|
| 8 | * @author Robert "Tatzelwurm" Hempel |
|---|
| 9 | * @copyright 2007 INSIDE das Hörspiel |
|---|
| 10 | * @package de.inside.Gewinnspiel |
|---|
| 11 | */ |
|---|
| 12 | |
|---|
| 13 | class GewinnspielDeleteAction extends AbstractAction { |
|---|
| 14 | public $gwspID = 0; |
|---|
| 15 | |
|---|
| 16 | /** |
|---|
| 17 | * @see Action::readParameters() |
|---|
| 18 | */ |
|---|
| 19 | public function readParameters() { |
|---|
| 20 | parent::readParameters(); |
|---|
| 21 | |
|---|
| 22 | if (isset($_REQUEST['gwspID'])) $this->gwspID = intval($_REQUEST['gwspID']); |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | /** |
|---|
| 26 | * @see Action::execute() |
|---|
| 27 | */ |
|---|
| 28 | public function execute() { |
|---|
| 29 | parent::execute(); |
|---|
| 30 | |
|---|
| 31 | // delete game |
|---|
| 32 | $sql = "DELETE FROM gwsp".GWSP_N."_game |
|---|
| 33 | WHERE gwsID = ".$this->gwspID; |
|---|
| 34 | WCF::getDB()->sendQuery($sql); |
|---|
| 35 | $sql = "DELETE FROM gwsp".GWSP_N."_options |
|---|
| 36 | WHERE gwsID = ".$this->gwspID; |
|---|
| 37 | WCF::getDB()->sendQuery($sql); |
|---|
| 38 | $sql = "DELETE FROM gwsp".GWSP_N."_spiel |
|---|
| 39 | WHERE gwsID = ".$this->gwspID; |
|---|
| 40 | WCF::getDB()->sendQuery($sql); |
|---|
| 41 | // reset cache |
|---|
| 42 | GWSPACP::getCache()->clear(GWSP_DIR.'cache/', 'competition.games-'.PACKAGE_ID.'.php'); |
|---|
| 43 | GWSPACP::getCache()->clear(GWSP_DIR.'cache/', 'competition.user-'.PACKAGE_ID.'.php'); |
|---|
| 44 | // forward to list page |
|---|
| 45 | header('Location: index.php?page=GewinnspielList&deletedgwsID='.$this->gwspID.'&packageID='.PACKAGE_ID.SID_ARG_2ND_NOT_ENCODED); |
|---|
| 46 | exit; |
|---|
| 47 | } |
|---|
| 48 | } |
|---|
| 49 | ?> |
|---|