root/de.inside.Gewinnspiel/files/lib/acp/action/GewinnspielDeleteAction.class.php @ 661

Revision 661, 1.3 kB (checked in by Tatzelwurm, 5 years ago)

New try, need help optimising/cleaning code.

  • Property svn:mime-type set to text/plain
  • Property svn:executable set to *
Line 
1<?php
2require_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
13class 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?>
Note: See TracBrowser for help on using the browser.