Changeset 660
- Timestamp:
- 09/25/08 19:02:38 (5 years ago)
- Location:
- racing.league
- Files:
-
- 3 added
- 7 modified
-
files/acp (added)
-
files/acp/install_racingLeague.php (added)
-
files/lib/form/RacingLeaguePointsForm.class.php (modified) (1 diff)
-
files/lib/form/RacingLeagueResultsForm.class.php (modified) (8 diffs)
-
files/lib/form/RacingLeagueSaisonChoiseForm.class.php (modified) (1 diff)
-
files/lib/form/RacingLeagueTeamsForm.class.php (modified) (1 diff)
-
files/lib/form/RacingLeagueUserToTeamForm.class.php (modified) (6 diffs)
-
package.xml (modified) (2 diffs)
-
templates/racingLeagueNoActiveRaces.tpl (added)
-
templates/racingLeagueResults.tpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
racing.league/files/lib/form/RacingLeaguePointsForm.class.php
r656 r660 37 37 if (isset($_REQUEST["new"])) $this->new = intval($_REQUEST["new"]); 38 38 if (isset($_REQUEST["edit"])) $this->edit = intval($_REQUEST["edit"]); 39 if (isset($_REQUEST["pointsID"])) $this->pointsID = intval($_REQUEST["pointsID"]); 40 39 if (isset($_REQUEST["pointsID"])) $this->pointsID = intval($_REQUEST["pointsID"]); 41 40 } 42 41 -
racing.league/files/lib/form/RacingLeagueResultsForm.class.php
r656 r660 24 24 public $places = array(); 25 25 public $race = array(); 26 public $raceID = 0; 26 public $raceID = 0; 27 public $racename = ''; 27 28 28 29 public $redirect = 'RacingLeagueResults'; … … 38 39 if (isset($_REQUEST["edit"])) $this->edit = intval($_REQUEST["edit"]); 39 40 if (isset($_REQUEST["resultsID"])) $this->resultsID = intval($_REQUEST["resultsID"]); 40 if (isset($_REQUEST["raceID"])) $this->raceID = intval($_REQUEST["raceID"]); 41 41 if (isset($_REQUEST["raceID"])) $this->raceID = intval($_REQUEST["raceID"]); 42 42 } 43 43 … … 48 48 parent::readFormParameters(); 49 49 50 var_dump($_POST["result"]);51 50 if (isset($_POST["result"])) $this->result = $_POST["result"]; 52 51 } … … 86 85 $this->race[] = $row; 87 86 $this->raceID = $row["raceID"]; 87 $this->racename = $row["racename"]; 88 88 } 89 89 90 90 91 91 if (!$this->race) { 92 header("Location: index.php?form=RacingLeagueRaces".SID_ARG_2ND_NOT_ENCODED); 93 exit; 92 $sql = "SELECT * 93 FROM wcf".WCF_N."_racing_races 94 WHERE saisonID = '".$this->activeSaisonID."' 95 AND drived = '1' 96 ORDER BY raceNo ASC 97 LIMIT 1"; 98 $res = 0; 99 $res = WCF::getDB()->sendQuery($sql); 100 101 if ($res == 0) { 102 103 WCF::getTPL()->append('userMessages', WCF::getTPL()->fetch('racingLeagueNoActiveRaces')); 104 } 105 else { 106 header("Location: index.php?form=RacingLeagueRaces".SID_ARG_2ND_NOT_ENCODED); 107 exit; 108 } 94 109 } 95 110 … … 109 124 if ($this->new == 1 && $this->activeSaisonID != 0 && $this->groupID != 0) { 110 125 111 // Hier werden alle verfà Œgbaren PlÀtze ermittelt112 $sql = "SELECT *126 // Hier werden alle verfÃŒgbaren PlÀtze ermittelt 127 $sql = "SELECT place, points 113 128 FROM wcf".WCF_N."_racing_points 114 129 WHERE saisonID = '".$this->activeSaisonID."' 115 ORDER BY place asc";130 ORDER BY place ASC"; 116 131 117 132 $res = WCF::getDB()->sendQuery($sql); … … 124 139 header("Location: index.php?form=RacingLeaguePoints".SID_ARG_2ND_NOT_ENCODED); 125 140 exit; 126 } 141 } 127 142 } 128 143 … … 164 179 165 180 // Hier wird ein neues Ergebnis gespeichert 166 if ($this->result && $this->activeSaisonID != 0 && $this->new == 1 && $this->edit == 1) { 167 168 $sql = "INSERT INTO wcf".WCF_N."_racing_results (saisonID, resultID, userID, place, points) 169 VALUES ('".escapeString($this->activeSaisonID)."', '', '".escapeString($this->result["userID"])."', '', '".escapeString($this->result["points"])."') 170 "; 171 $res = WCF::getDB()->sendQuery($sql); 172 173 $row = 0; 174 $row = WCF::getDB()->getAffectedRows($res); 175 $this->new = 0; 176 if ($row > 0) { 177 WCF::getTPL()->append('userMessages', WCF::getTPL()->fetch('racingLeagueNewSuccess')); 178 } 179 else { 180 WCF::getTPL()->append('userMessages', WCF::getTPL()->fetch('racingLeagueNewError')); 181 } 181 if ($this->result && $this->activeSaisonID != 0 && $this->new == 1 && $this->raceID > 0) { 182 183 foreach ($this->places AS $place) { 184 185 186 $sql = "INSERT INTO wcf".WCF_N."_racing_results 187 SET saisonID = '".escapeString($this->activeSaisonID)."', 188 SET resultID = '', 189 SET raceID = '".escapeString($this->raceID)."', 190 SET userID = '".escapeString($this->result[$this->places["place"]][1])."', 191 SET place = '".escapeString($place["place"])."', 192 SET points = '".escapeString($place["points"])."' 193 "; 194 WCF::getDB()->sendQuery($sql); 195 196 } 197 198 199 200 // Hier wird das Rennen auf gefahren gestellt. 201 $sql = "UPDATE wcf".WCF_N."_racing_races 202 SET drived = '1' 203 WHERE raceID = '".$this->raceID."' 204 "; 205 // WCF::getDB()->sendQuery($sql); 182 206 } 183 207 … … 220 244 'places' => $this->places, 221 245 'race' => $this->race, 222 'raceID' => $this->raceID, 246 'raceID' => $this->raceID, 247 'racename' => $this->racename, 223 248 224 249 'redirect' => $this->redirect -
racing.league/files/lib/form/RacingLeagueSaisonChoiseForm.class.php
r656 r660 4 4 5 5 /** 6 * Seite zum Wà ÆÃ€hlen, welche Saison zum Editieren aktiviert werden soll.6 * Seite zum WÀhlen, welche Saison zum Editieren aktiviert werden soll. 7 7 * 8 8 * @author Markus Gerdelmann -
racing.league/files/lib/form/RacingLeagueTeamsForm.class.php
r656 r660 73 73 parent::readData(); 74 74 75 // Hier wird ein Team geladen das editiert werden soll76 if ($this->edit == 1) {75 // Hier wird ein Team geladen das editiert werden soll 76 if ($this->edit == 1) { 77 77 78 $sql = "SELECT * 79 FROM wcf".WCF_N."_racing_teams 80 WHERE teamID = '".$this->teamID."' 81 "; 78 $sql = "SELECT * 79 FROM wcf".WCF_N."_racing_teams 80 WHERE teamID = '".$this->teamID."' 81 "; 82 $res = WCF::getDB()->sendQuery($sql); 82 83 83 $res = WCF::getDB()->sendQuery($sql); 84 85 while ($row = WCF::getDB()->fetchArray($res)) { 86 $this->teamname = $row["teamname"]; 87 } 84 while ($row = WCF::getDB()->fetchArray($res)) { 85 $this->teamname = $row["teamname"]; 88 86 } 87 } 89 88 } 90 89 -
racing.league/files/lib/form/RacingLeagueUserToTeamForm.class.php
r652 r660 4 4 5 5 /** 6 * Seite fÃŒr die Zuweisung der User an ein Team.6 * Seite fÃŒr die Zuweisung der Fahrer an ein Team. 7 7 * 8 8 * @author Markus Gerdelmann … … 66 66 parent::readData(); 67 67 68 if ($this->newUser == 1 && $this->userID > 0 && $this->activ SaisonID > 0) {69 // Hier wird der Username geladen fà Œr die Teamzuweisung68 if ($this->newUser == 1 && $this->userID > 0 && $this->activeSaisonID > 0) { 69 // Hier wird der Username geladen fÃÂŒr die Teamzuweisung 70 70 $sql = "SELECT userID, username 71 71 FROM wcf".WCF_N."_user … … 78 78 } 79 79 80 if ($this->activ SaisonID > 0) {80 if ($this->activeSaisonID > 0) { 81 81 82 82 // Hier wird die aktive Benutzergruppe ermittelt 83 83 $sql = "SELECT * 84 84 FROM wcf".WCF_N."_racing_group 85 WHERE saisonID = '".$this->activ SaisonID."'85 WHERE saisonID = '".$this->activeSaisonID."' 86 86 "; 87 87 $res = WCF::getDB()->sendQuery($sql); … … 109 109 WHERE `a`.`userID` = `c`.`userID` 110 110 AND `b`.`groupID` = '".$this->groupID."' 111 AND `b`.saisonID = '".$this->activ SaisonID."'112 AND `c`.saisonID = '".$this->activ SaisonID."'111 AND `b`.saisonID = '".$this->activeSaisonID."' 112 AND `c`.saisonID = '".$this->activeSaisonID."' 113 113 ORDER BY `a`.`username` ASC"; 114 114 … … 126 126 ON (`b`.`groupID` = '".$this->groupID."') 127 127 WHERE `a`.`groupID` = `b`.`groupID` 128 AND `b`.`saisonID` = '".$this->activ SaisonID."'128 AND `b`.`saisonID` = '".$this->activeSaisonID."' 129 129 "; 130 130 … … 172 172 173 173 // Hier wird einem Fahrer ein Team zugewiesen und gespeichert 174 if ($this->newUser == 1 && $this->userID > 0 && $this->activ SaisonID > 0) {174 if ($this->newUser == 1 && $this->userID > 0 && $this->activeSaisonID > 0) { 175 175 176 176 $sql = "INSERT INTO wcf".WCF_N."_racing_user_to_team 177 177 (saisonID, usertoteamID ,teamID, userID) 178 VALUES ('".escapeString($this->activ SaisonID)."', '', '".escapeString($this->team)."', '".escapeString($this->userID)."')178 VALUES ('".escapeString($this->activeSaisonID)."', '', '".escapeString($this->team)."', '".escapeString($this->userID)."') 179 179 "; 180 180 -
racing.league/package.xml
r656 r660 12 12 <packagedescription language="de-informal"><![CDATA[Mit diesem PlugIn werden PunktestÀnde einer laufenden Racing-Liga dargestellt.]]></packagedescription> 13 13 <version>1.0.0 BETA 1</version> 14 <date>2008-09- 30</date>14 <date>2008-09-11</date> 15 15 <plugin>com.woltlab.wcf</plugin> 16 16 <isunique>1</isunique> … … 38 38 <options>options.xml</options> 39 39 <sql>install.sql</sql> 40 <script>acp/install_racingLeague.php</script> 40 41 <!--<eventlistener>eventlistener.xml</eventlistener> 41 42 <userprofilemenu>userprofilemenu.xml</userprofilemenu> -
racing.league/templates/racingLeagueResults.tpl
r656 r660 43 43 <p class="description">{lang}wcf.racing.league.results.newResult.description{/lang}</p> 44 44 <br /> 45 45 {$racename} 46 46 <div class="formElement{if $errorField == 'place'} formError{/if}"> 47 47 <div class="formFieldLabel">
