Changeset 4 for trunk/index.php
- Timestamp:
- Sep 10, 2018, 1:41:13 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/index.php
r3 r4 143 143 array('Name' => 'Distance', 'Title' => 'Distance'), 144 144 array('Name' => 'Money', 'Title' => 'Money'), 145 array('Name' => 'Rank', 'Title' => 'Rank'), 146 array('Name' => 'Time', 'Title' => 'Last change'), 145 147 ); 146 148 $Order = GetOrderTableHeader($TableColumns, 'Distance', 1); … … 149 151 $DbResult = $this->Database->select('Runner', '*, '. 150 152 '(SELECT RunnerStat.Distance FROM RunnerStat WHERE RunnerStat.Runner=Runner.Id ORDER BY Time DESC LIMIT 1) AS Distance'. 151 ', (SELECT RunnerStat.Money FROM RunnerStat WHERE RunnerStat.Runner=Runner.Id ORDER BY Time DESC LIMIT 1) AS Money', 153 ', (SELECT RunnerStat.Money FROM RunnerStat WHERE RunnerStat.Runner=Runner.Id ORDER BY Time DESC LIMIT 1) AS Money'. 154 ', (SELECT RunnerStat.Time FROM RunnerStat WHERE RunnerStat.Runner=Runner.Id ORDER BY Time DESC LIMIT 1) AS Time'. 155 ', (SELECT RunnerStat.Rank FROM RunnerStat WHERE RunnerStat.Runner=Runner.Id ORDER BY Time DESC LIMIT 1) AS Rank', 152 156 $Where.$Order['SQL'].$PageList['SQLLimit']); 153 157 while($MeetItem = $DbResult->fetch_assoc()) 154 158 { 155 159 $Output .= '<tr>'. 156 '<td> '.$MeetItem['Name'].'</td>'.160 '<td><a href="'.$this->Link('/runner/'.$MeetItem['Id'].'/').'">'.$MeetItem['Name'].'</a></td>'. 157 161 '<td>'.$Gender[$MeetItem['Gender']].'</td>'. 158 162 '<td>'.$MeetItem['Distance'].'</td>'. 159 163 '<td>'.$MeetItem['Money'].'</td>'. 164 '<td>'.$MeetItem['Rank'].'</td>'. 165 '<td>'.HumanDateTime(MysqlDateTimeToTime($MeetItem['Time'])).'</td>'. 166 '</tr>'; 167 } 168 $Output .= '</table>'; 169 $Output .= $PageList['Output']; 170 $Output .= '</div>'; 171 172 return($Output); 173 } 174 175 function ShowRunner() 176 { 177 $Output = ''; 178 179 $RunnerId = 1; 180 if ((count($this->PathItems) > 0) and ($this->PathItems[count($this->PathItems) - 1] != '')) 181 $RunnerId = $this->PathItems[count($this->PathItems) - 1]; 182 if (!is_numeric($RunnerId)) die('Runner id needs to be numeric'); 183 184 $DbResult = $this->Database->query('SELECT * FROM Runner WHERE Id='.$RunnerId); 185 $DbRow = $DbResult->fetch_assoc(); 186 $Output .= '<h4 style="text-align: center;">Runner '.$DbRow['Name'].'</h4></br>'; 187 188 189 $Where = 'Runner='.$RunnerId; 190 191 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `RunnerStat` WHERE '.$Where); 192 $DbRow = $DbResult->fetch_row(); 193 $PageList = GetPageList($DbRow[0]); 194 195 $Output .= '<div id="list_content">'; 196 $Output .= $PageList['Output']; 197 $TableColumns = array( 198 array('Name' => 'Time', 'Title' => 'Time'), 199 array('Name' => 'Distance', 'Title' => 'Distance'), 200 array('Name' => 'Money', 'Title' => 'Money'), 201 array('Name' => 'Rank', 'Title' => 'Rank'), 202 ); 203 $Order = GetOrderTableHeader($TableColumns, 'Time', 1); 204 $Output .= '<table class="WideTable">'; 205 $Output .= $Order['Output']; 206 $DbResult = $this->Database->select('RunnerStat', '*', 207 $Where.$Order['SQL'].$PageList['SQLLimit']); 208 while($MeetItem = $DbResult->fetch_assoc()) 209 { 210 $Output .= '<tr>'. 211 '<td>'.HumanDateTime(MysqlDateTimeToTime($MeetItem['Time'])).'</td>'. 212 '<td>'.$MeetItem['Distance'].'</td>'. 213 '<td>'.$MeetItem['Money'].'</td>'. 214 '<td>'.$MeetItem['Rank'].'</td>'. 160 215 '</tr>'; 161 216 } … … 204 259 { 205 260 if($this->PathItems[0] == 'team-update') $Output .= $this->ShowTeamUpdate(); 261 if($this->PathItems[0] == 'runner') $Output .= $this->ShowRunner(); 206 262 else $Output .= $this->ShowTeam(); 207 263 } else $Output .= $this->ShowTeam();
Note:
See TracChangeset
for help on using the changeset viewer.