|
Revision 749, 1.4 kB
(checked in by MDMAN, 4 years ago)
|
|
new Version 1.0.0 beta 4 for racing.league
|
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | require_once(WCF_DIR.'lib/action/AbstractAction.class.php'); |
|---|
| 3 | |
|---|
| 4 | /** |
|---|
| 5 | * Löscht eine Strafe |
|---|
| 6 | * |
|---|
| 7 | * @author Markus Gerdelmann |
|---|
| 8 | * @copyright 2007/2008 MDMAN |
|---|
| 9 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
|---|
| 10 | * @package de.mdman.racing.league |
|---|
| 11 | */ |
|---|
| 12 | |
|---|
| 13 | class RacingLeagueDeletePunishAction extends AbstractAction { |
|---|
| 14 | |
|---|
| 15 | public $punishID = 0; |
|---|
| 16 | |
|---|
| 17 | public function execute() { |
|---|
| 18 | parent::execute(); |
|---|
| 19 | |
|---|
| 20 | if (isset($_REQUEST["punishID"])) $this->punishID = intval($_REQUEST["punishID"]); |
|---|
| 21 | |
|---|
| 22 | // hier wird eine Strafe gelöscht |
|---|
| 23 | if ($this->punishID > 0) { |
|---|
| 24 | $sql = "DELETE FROM `wcf".WCF_N."_racing_punish` |
|---|
| 25 | WHERE `punishID` = '".escapeString($this->punishID)."' |
|---|
| 26 | "; |
|---|
| 27 | $res = WCF::getDB()->sendQuery($sql); |
|---|
| 28 | $row = WCF::getDB()->getAffectedRows($res); |
|---|
| 29 | |
|---|
| 30 | $sql = "DELETE FROM `wcf".WCF_N."_racing_punish_to_team` |
|---|
| 31 | WHERE `punishID` = '".escapeString($this->punishID)."' |
|---|
| 32 | "; |
|---|
| 33 | $res = WCF::getDB()->sendQuery($sql); |
|---|
| 34 | |
|---|
| 35 | if ($row > 0) { |
|---|
| 36 | WCF::getTPL()->append('userMessages', WCF::getTPL()->fetch('racingLeagueDeleteSuccess')); |
|---|
| 37 | } |
|---|
| 38 | else { |
|---|
| 39 | WCF::getTPL()->append('userMessages', WCF::getTPL()->fetch('racingLeagueDeleteError')); |
|---|
| 40 | } |
|---|
| 41 | } |
|---|
| 42 | |
|---|
| 43 | $this->executed(); |
|---|
| 44 | |
|---|
| 45 | HeaderUtil::redirect('index.php?form=RacingLeaguePunish'.SID_ARG_2ND_NOT_ENCODED); |
|---|
| 46 | exit; |
|---|
| 47 | } |
|---|
| 48 | } |
|---|
| 49 | ?> |
|---|