- Timestamp:
- Sep 9, 2016, 10:17:39 PM (8 years ago)
- Location:
- trunk/Modules
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Ride/Ride.php
r4 r5 19 19 $this->System->RegisterPage('nova-jizda', 'PageNewRide'); 20 20 $this->System->RegisterPage('jizda', 'PageRideDetail'); 21 $this->System->RegisterPage('jizdy', 'PageRideList'); 21 22 $this->System->RegisterPageBarItem('TopLeft', 'Logo', array($this, 'ShowLogo')); 22 23 } … … 129 130 { 130 131 $Output = '<img src="" width="200" height="50" alt="Logo"/> '. 131 '<a href="'.$this->System->Link('/ hledat/').'">Hledat jízdu</a> nebo '.132 '<a href="'.$this->System->Link('/jizdy/').'">Hledat jízdu</a> nebo '. 132 133 '<a href="'.$this->System->Link('/nova-jizda/').'">Nabídnout jízdu</a>'; 133 134 return($Output); … … 228 229 } 229 230 230 $Output .= '<tr><th>Zastávka / Čas</th><th >Řidič</th>';231 $Output .= '<tr><th>Zastávka / Čas</th><th style="width: 80px">Řidič</th>'; 231 232 for ($I = 0; $I < $DbRow['SeatCount']; $I++) 232 $Output .= '<th >Cestující</th>';233 $Output .= '<th style="width: 80px">Cestující</th>'; 233 234 $Output .= '</tr>'; 234 235 foreach($Track as $Index => $TrackItem) … … 288 289 if(array_key_exists('to', $_GET)) $PlaceTo = $_GET['to']; 289 290 else $PlaceTo = ''; 290 $Output = '<table style="width: 100%"><tr><td>'. 291 '<form style="display: inline;" method="get" action="'.$this->System->Link('/').'">'. 291 if(array_key_exists('time', $_GET)) $Time = $_GET['time']; 292 else $Time = ''; 293 $Output = '<table style="width: 100%; margin-top: 100px; margin-bottom: 100px;"><tr><td style="text-align: center">'. 294 '<div><h3>Vyhledat jízdu</h3>'. 295 '<form style="display: inline;" method="get" action="'.$this->System->Link('/jizdy/').'">'. 292 296 'Odkud: <input type="text" name="from" value="'.$PlaceFrom.'"/> '. 293 297 'Kam: <input type="text" name="to" value="'.$PlaceTo.'"/> '. 298 'Čas: <input type="text" name="time" value="'.$Time.'"/> '. 294 299 '<input type="submit" value="Hledat"/>'. 295 '</form></td><td><a href="'.$this->System->Link('/nova-jizda/').'">Nová jízda</a></td></tr></table>'; 300 '</form></div></td></tr></table>'; 301 return($Output); 302 } 303 } 304 305 class PageRideList extends Page 306 { 307 function Show() 308 { 309 if(array_key_exists('from', $_GET)) $PlaceFrom = $_GET['from']; 310 else $PlaceFrom = ''; 311 if(array_key_exists('to', $_GET)) $PlaceTo = $_GET['to']; 312 else $PlaceTo = ''; 313 if(array_key_exists('time', $_GET)) $Time = $_GET['time']; 314 else $Time = ''; 315 $Output = '<table style="width: 100%"><tr><td style="text-align: center;">'. 316 '<form style="display: inline;" method="get" action="'.$this->System->Link('/').'">'. 317 'Odkud: <input type="text" name="from" value="'.$PlaceFrom.'"/> '. 318 'Kam: <input type="text" name="to" value="'.$PlaceTo.'"/> '. 319 'Čas: <input type="text" name="time" value="'.$Time.'"/> '. 320 '<input type="submit" value="Hledat"/>'. 321 '</form></td></tr></table>'; 296 322 if (array_key_exists('from', $_GET) and array_key_exists('to', $_GET)) { 297 323 $Output .= $this->ShowRides($_GET['from'], $_GET['to']); … … 304 330 $Output = '<h3>Jízdy:</h3>'; 305 331 $Output .= '<table>'; 306 $Query = 'SELECT Ride.Id, Ride.SeatCount, (SELECT Name FROM User WHERE User.Id=Ride.Driver) AS DriverName, '.332 $Query = 'SELECT Ride.Id, Ride.SeatCount, User.Name AS DriverName, User.BirthDate, '. 307 333 'CONCAT(CarManufacturer.Name, " ", CarModel.Name) AS CarName '; 308 334 if((trim($PlaceFrom) != '') and (trim($PlaceTo != ''))) … … 317 343 'LEFT JOIN Car ON Car.Id = Ride.Car '. 318 344 'LEFT JOIN CarModel ON CarModel.Id = Car.Model '. 319 'LEFT JOIN CarManufacturer ON CarManufacturer.Id = CarModel.Manufacturer '; 345 'LEFT JOIN CarManufacturer ON CarManufacturer.Id = CarModel.Manufacturer '. 346 'LEFT JOIN User ON User.Id=Ride.Driver '; 320 347 if((trim($PlaceFrom) != '') and (trim($PlaceTo != ''))) 321 348 $Query .= 'JOIN RideStop AS RideStopFrom ON (RideStopFrom.Ride = Ride.Id) AND (RideStopFrom.Place LIKE "%'.$PlaceFrom.'%") '. … … 335 362 } 336 363 337 $Output .= '<tr><td>Řidič:</td><td>'.$DbRow['DriverName'].'</td>'. 364 if ($DbRow['BirthDate'] != '') $Age = ' ('.round((time() - MysqlDateToTime($DbRow['BirthDate'])) / (3600*24*364.25)).' let)'; 365 else $Age = ''; 366 $Output .= '<tr><td>Řidič:</td><td>'.$DbRow['DriverName'].$Age.'</td>'. 338 367 '<td colspan="4"><a href="'.$this->System->Link('/jizda/?id='.$DbRow['Id'].'&from='.$PlaceFrom.'&to='.$PlaceTo).'">Ukázat</a></td></tr>'. 339 368 '<tr><td>Trasa:</td><td>'.implode(' → ', $Stops).'</td></tr>'. -
trunk/Modules/User/User.php
r1 r5 30 30 '`Salt` varchar(255) NOT NULL,'. 31 31 '`Email` varchar(128) NOT NULL DEFAULT "",'. 32 '`BirthDate` date NULL,'. 32 33 '`LastIpAddress` varchar(16) NOT NULL DEFAULT "",'. 33 34 '`LastLoginTime` datetime NULL,'. -
trunk/Modules/User/UserModel.php
r1 r5 174 174 175 175 $Result = USER_REGISTRATED; 176 $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'NewRegistration', $Login); 176 if(array_key_exists('Log', $this->System->ModuleManager->Modules)) 177 $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'NewRegistration', $Login); 177 178 } 178 179 }
Note:
See TracChangeset
for help on using the changeset viewer.