Changeset 660

Show
Ignore:
Timestamp:
09/25/08 19:02:38 (5 years ago)
Author:
MDMAN
Message:

racing.league modified

Location:
racing.league
Files:
3 added
7 modified

Legend:

Unmodified
Added
Removed
  • racing.league/files/lib/form/RacingLeaguePointsForm.class.php

    r656 r660  
    3737                if (isset($_REQUEST["new"]))            $this->new = intval($_REQUEST["new"]); 
    3838                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"]);                 
    4140        } 
    4241         
  • racing.league/files/lib/form/RacingLeagueResultsForm.class.php

    r656 r660  
    2424        public $places = array(); 
    2525        public $race = array(); 
    26         public $raceID = 0;              
     26        public $raceID = 0; 
     27        public $racename = '';   
    2728 
    2829        public $redirect = 'RacingLeagueResults'; 
     
    3839                if (isset($_REQUEST["edit"]))           $this->edit = intval($_REQUEST["edit"]); 
    3940                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"]);             
    4242        } 
    4343         
     
    4848                parent::readFormParameters(); 
    4949                 
    50                 var_dump($_POST["result"]); 
    5150                if (isset($_POST["result"]))    $this->result = $_POST["result"];                
    5251        } 
     
    8685                                $this->race[] = $row; 
    8786                                $this->raceID = $row["raceID"]; 
     87                                $this->racename = $row["racename"]; 
    8888                        } 
    8989                         
    9090                         
    9191                        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                                } 
    94109                        } 
    95110                         
     
    109124                if ($this->new == 1 && $this->activeSaisonID != 0 && $this->groupID != 0) { 
    110125 
    111                         // Hier werden alle verfÌgbaren PlÀtze ermittelt 
    112                         $sql = "SELECT * 
     126                        // Hier werden alle verfÃŒgbaren PlÀtze ermittelt 
     127                        $sql = "SELECT place, points 
    113128                                        FROM wcf".WCF_N."_racing_points 
    114129                                        WHERE saisonID = '".$this->activeSaisonID."' 
    115                                         ORDER BY place asc"; 
     130                                        ORDER BY place ASC"; 
    116131 
    117132                        $res = WCF::getDB()->sendQuery($sql); 
     
    124139                                header("Location: index.php?form=RacingLeaguePoints".SID_ARG_2ND_NOT_ENCODED); 
    125140                                exit; 
    126                         }                        
     141                        }        
    127142                } 
    128143 
     
    164179                 
    165180                // 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); 
    182206                } 
    183207 
     
    220244                        'places' => $this->places, 
    221245                        'race' => $this->race, 
    222                         'raceID' => $this->raceID,                       
     246                        'raceID' => $this->raceID, 
     247                        'racename' => $this->racename,                   
    223248                                                 
    224249                        'redirect' => $this->redirect 
  • racing.league/files/lib/form/RacingLeagueSaisonChoiseForm.class.php

    r656 r660  
    44 
    55/** 
    6  * Seite zum WÀhlen, welche Saison zum Editieren aktiviert werden soll. 
     6 * Seite zum WÀhlen, welche Saison zum Editieren aktiviert werden soll. 
    77 *  
    88 * @author      Markus Gerdelmann 
  • racing.league/files/lib/form/RacingLeagueTeamsForm.class.php

    r656 r660  
    7373                parent::readData(); 
    7474 
    75                         // Hier wird ein Team geladen das editiert werden soll 
    76                         if ($this->edit == 1) { 
     75                // Hier wird ein Team geladen das editiert werden soll 
     76                if ($this->edit == 1) { 
    7777 
    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); 
    8283                 
    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"]; 
    8886                        } 
     87                } 
    8988        } 
    9089         
  • racing.league/files/lib/form/RacingLeagueUserToTeamForm.class.php

    r652 r660  
    44 
    55/** 
    6  * Seite fÃŒr die Zuweisung der User an ein Team. 
     6 * Seite fÃŒr die Zuweisung der Fahrer an ein Team. 
    77 *  
    88 * @author      Markus Gerdelmann 
     
    6666                parent::readData(); 
    6767 
    68                 if ($this->newUser == 1 && $this->userID > 0 && $this->activSaisonID > 0) { 
    69                         // Hier wird der Username geladen fÃŒr die Teamzuweisung 
     68                if ($this->newUser == 1 && $this->userID > 0 && $this->activeSaisonID > 0) { 
     69                        // Hier wird der Username geladen fÌr die Teamzuweisung 
    7070                        $sql = "SELECT userID, username  
    7171                                        FROM wcf".WCF_N."_user 
     
    7878                } 
    7979 
    80                 if ($this->activSaisonID > 0) { 
     80                if ($this->activeSaisonID > 0) { 
    8181         
    8282                        // Hier wird die aktive Benutzergruppe ermittelt 
    8383                        $sql = "SELECT * 
    8484                                        FROM wcf".WCF_N."_racing_group 
    85                                         WHERE saisonID = '".$this->activSaisonID."' 
     85                                        WHERE saisonID = '".$this->activeSaisonID."' 
    8686                                        "; 
    8787                        $res = WCF::getDB()->sendQuery($sql); 
     
    109109                                                WHERE   `a`.`userID` = `c`.`userID` 
    110110                                                AND             `b`.`groupID` = '".$this->groupID."' 
    111                                                 AND             `b`.saisonID = '".$this->activSaisonID."' 
    112                                                 AND             `c`.saisonID = '".$this->activSaisonID."' 
     111                                                AND             `b`.saisonID = '".$this->activeSaisonID."' 
     112                                                AND             `c`.saisonID = '".$this->activeSaisonID."' 
    113113                                                ORDER BY `a`.`username` ASC"; 
    114114 
     
    126126                                                ON              (`b`.`groupID` = '".$this->groupID."') 
    127127                                                WHERE `a`.`groupID` = `b`.`groupID` 
    128                                                 AND `b`.`saisonID` = '".$this->activSaisonID."' 
     128                                                AND `b`.`saisonID` = '".$this->activeSaisonID."' 
    129129                                                "; 
    130130 
     
    172172 
    173173                // Hier wird einem Fahrer ein Team zugewiesen und gespeichert 
    174                 if ($this->newUser == 1 && $this->userID > 0 && $this->activSaisonID > 0) { 
     174                if ($this->newUser == 1 && $this->userID > 0 && $this->activeSaisonID > 0) { 
    175175 
    176176                        $sql = "INSERT INTO wcf".WCF_N."_racing_user_to_team 
    177177                                        (saisonID, usertoteamID ,teamID, userID)  
    178                                         VALUES ('".escapeString($this->activSaisonID)."', '', '".escapeString($this->team)."', '".escapeString($this->userID)."') 
     178                                        VALUES ('".escapeString($this->activeSaisonID)."', '', '".escapeString($this->team)."', '".escapeString($this->userID)."') 
    179179                                        "; 
    180180 
  • racing.league/package.xml

    r656 r660  
    1212                <packagedescription language="de-informal"><![CDATA[Mit diesem PlugIn werden PunktestÀnde einer laufenden Racing-Liga dargestellt.]]></packagedescription> 
    1313                <version>1.0.0 BETA 1</version> 
    14                 <date>2008-09-30</date> 
     14                <date>2008-09-11</date> 
    1515                <plugin>com.woltlab.wcf</plugin> 
    1616                <isunique>1</isunique> 
     
    3838                <options>options.xml</options> 
    3939                <sql>install.sql</sql> 
     40                <script>acp/install_racingLeague.php</script> 
    4041                <!--<eventlistener>eventlistener.xml</eventlistener> 
    4142                <userprofilemenu>userprofilemenu.xml</userprofilemenu> 
  • racing.league/templates/racingLeagueResults.tpl

    r656 r660  
    4343                        <p class="description">{lang}wcf.racing.league.results.newResult.description{/lang}</p>                                          
    4444                <br /> 
    45  
     45                        {$racename} 
    4646                        <div class="formElement{if $errorField == 'place'} formError{/if}"> 
    4747                                <div class="formFieldLabel">