- Timestamp:
- Apr 14, 2020, 11:06:28 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r1 r6 6 6 // and system will need database update. 7 7 8 $Revision = 1;9 $DatabaseRevision = 1;10 $ReleaseTime = strtotime('20 16-08-03');8 $Revision = 6; 9 $DatabaseRevision = 6; 10 $ReleaseTime = strtotime('2020-04-14'); -
trunk/Modules/Ride/Ride.php
r5 r6 1 1 <?php 2 3 include_once(dirname(__FILE__).'/RideModel.php'); 2 4 3 5 class ModuleRide extends AppModule … … 71 73 `Sequence` int(11) NOT NULL, 72 74 `Price` int(11) NOT NULL, 75 `PassengerCount` int(11) NOT NULL, 73 76 PRIMARY KEY (`Id`), 74 77 KEY `Ride` (`Ride`) … … 83 86 `RideStopFrom` int(11) NOT NULL, 84 87 `RideStopTo` int(11) NOT NULL, 85 `PassengerCount` int(11) NOT NULL,86 88 PRIMARY KEY (`Id`), 87 89 KEY `User` (`User`), … … 125 127 { 126 128 129 } 130 131 function InsertSampleData() 132 { 133 $Cities = array('Praha', 'Brno', 'Ostrava', 'Olomouc', 'Liberec', 'Plzeň', 134 'Humpolec', 'Zlín', 'Přerov', 'České Budějovice', 'Jihlava', 'Ústí nad Labem', 135 'Hradec Králové', 'Pardubice', 'Mohelnice', 'Břeclav', 'Znojmo', 'Semily', 136 'Tábor', 'Opava', 'Karviná', 'Pelhřimov', 'Osoblaha', 'Broumov', 'Jirkov', 137 'Aš', 'Kutná Hora', 'Kolín', 'Strakonice', 'Tachov', 'Domažlice', 'Beroun', 138 'Most', 'Chomutov', 'Mělník', 'Mladá Boleslav', 'Svitavy', 'Šumperk', 139 'Litomyšl', 'Chrudim', 'Blansko', 'Hodonín', 'Rosice', 'Uherský Brod', 140 'Vsetín', 'Nový Jičín', 'Prostějov', 'Vyškov', 'Mohelnice', 'Ústí nad Orlicí'); 141 142 for($I = 0; $I < 100; $I++) 143 { 144 $Stops = array_fill(0, random(5), ''); 145 for($J = 0; $J < count($Stops); $J++) 146 $Stops[$J] = $Cities[random(count($Cities))]; 147 148 $Ride = new Ride(); 149 $StartTime = time() - random(60*60*24*365); 150 $StopCount = random(5); 151 $Ride->Add($Stops, $StartTime, $SeatCount); 152 } 127 153 } 128 154 … … 389 415 ); 390 416 417 $ret = array(); 391 418 foreach($bit as $k => $v) 392 419 if($v > 0)$ret[] = $v . $k; … … 401 428 if (!array_key_exists('step', $_GET)) 402 429 { 403 $Output = '<form method="get" action="'.$this->System->Link('/nova-jizda/').'">'. 430 $Output = '<script> 431 function insertAfter(referenceNode, newNode) 432 { 433 referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); 434 } 435 436 function add_before(name) 437 { 438 var objTo = document.getElementById(name) 439 var divtest = document.createElement("div"); 440 divtest.innerHTML = \'<tr><td>Zastávka:</td><td><input type="text" name="ridestop1"/></td></tr>\'; 441 442 objTo.parentNode.insertBefore(divtest, objTo.childNodes[0]) 443 } 444 445 function add_after(name) 446 { 447 var objTo = document.getElementById(name) 448 var divtest = document.createElement("div"); 449 divtest.innerHTML = \'<tr><td>Zastávka:</td><td><input type="text" name="ridestop1"/></td></tr>\'; 450 451 insertAfter(objTo, divtest) 452 } 453 </script>'. 454 '<form method="get" action="'.$this->System->Link('/nova-jizda/').'">'. 404 455 '<table>'. 456 '<tr><td colspan="2"><strong>Trasa:</strong></td></tr>'. 457 405 458 '<tr><td>Počátek:</td><td><input type="text" name="from"/></td></tr>'. 459 '<tr><td>Zastávka:</td><td><input type="text" name="middle"/></td></tr>'. 406 460 '<tr><td>Konec:</td><td><input type="text" name="to"/></td></tr>'. 461 462 '<tr><td colspan="2"><br><strong>Parametry jízdy:</strong></td></tr>'. 407 463 '<tr><td>Čas odjezdu:</td><td><input type="text" name="time-from"/></td></tr>'. 408 464 '<tr><td>Počet míst pro cestující:</td><td><input type="text" name="seats"/></td></tr>'. -
trunk/Modules/User/UserModel.php
r5 r6 119 119 { 120 120 $this->Database->delete('UserOnline', 'Id='.$DbRow['Id']); 121 if($DbRow['User'] != null) $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'Logout'); 121 if(($DbRow['User'] != null) and $this->System->ModuleManager->ModulePresent('Log')) 122 $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'Logout'); 122 123 } 123 124 //$this->LoadPermission($this->User['Role']); … … 174 175 175 176 $Result = USER_REGISTRATED; 176 if( array_key_exists('Log', $this->System->ModuleManager->Modules))177 if($this->System->ModuleManager->ModulePresent('Log')) 177 178 $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'NewRegistration', $Login); 178 179 } … … 194 195 $this->Database->update('User', 'Id='.$Row['Id'], array('Locked' => 0)); 195 196 $Output = USER_REGISTRATION_CONFIRMED; 196 $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'RegisterConfirm', 'Login='. 197 $Row['Login'].', Id='.$Row['Id']); 197 if($this->System->ModuleManager->ModulePresent('Log')) 198 $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'RegisterConfirm', 'Login='. 199 $Row['Login'].', Id='.$Row['Id']); 198 200 } else $Output = PASSWORDS_UNMATCHED; 199 201 } else $Output = USER_NOT_FOUND; … … 242 244 $SID = session_id(); 243 245 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('User' => null)); 244 if( array_key_exists('Log', $this->System->ModuleManager->Modules))246 if($this->System->ModuleManager->ModulePresent('Log')) 245 247 $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'Logout', $this->User['Login']); 246 248 $this->Check(); … … 397 399 398 400 $Output = USER_PASSWORD_RECOVERY_SUCCESS; 399 $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'PasswordRecoveryRequest', 'Login='.$Login.',Email='.$Email); 401 if($this->System->ModuleManager->ModulePresent('Log')) 402 $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'PasswordRecoveryRequest', 'Login='.$Login.',Email='.$Email); 400 403 } else $Output = USER_PASSWORD_RECOVERY_FAIL; 401 404 return($Output); … … 415 418 $this->Database->update('User', 'Id='.$Row['Id'], array('Password' => $PasswordHash->Hash($NewPassword, $Salt), 416 419 'Salt' => $Salt, 'Locked' => 0)); 417 $Output = USER_PASSWORD_RECOVERY_CONFIRMED;418 $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'PasswordRecoveryConfirm', 'Login='.$Row['Login']);420 if($this->System->ModuleManager->ModulePresent('Log')) 421 $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'PasswordRecoveryConfirm', 'Login='.$Row['Login']); 419 422 } else $Output = PASSWORDS_UNMATCHED; 420 423 } else $Output = USER_NOT_FOUND;
Note:
See TracChangeset
for help on using the changeset viewer.