private static function gps($arguments) { $allData = array(); $allData['profiles'] = ProfilesDB::getAllProfiles(); $allData['gps'] = GPSDataDB::getAllGPSData(); GPSView::show($allData); }
public function testGetAllMemberProfilesWithNullParameter() { $profiles = ProfilesDB::getAllProfiles(null); $this->assertNotEmpty($profiles, 'It should return a non-empty array when null input is provided'); foreach ($profiles as $profile) { $this->assertInstanceOf('Profile', $profile, 'It should return an array of Profile objects when null input is provided'); $this->assertCount(0, $profile->getErrors(), 'It should return an array of Profile objects without errors when null input is provided'); $this->assertEquals(0, $profile->getErrorCount(), 'It should return an array of Profile objects with an error count of 0 when null input is provided'); } }
public static function run() { $profiles = ProfilesDB::getAllProfiles(); $accounts = AccountsDB::getAllAccounts(); echo "<!DOCTYPE html><html><style type=\"text/css\">a { font-size: 1.3em; }</style><head></head><body>"; ?> Other Views: <a href="/BankingSystem/view/login">Login View</a> | <a href="/BankingSystem/view/gps">GPS View</a> <?php echo "<h1>BankSystem profile list</h1>"; echo "<table>"; echo "<thead>"; echo "<tr><th>ProfilID</th><th>AccountID</th><th>Email</th> <th>Password</th><th>isLoggedIn</th><th>isEmployee</th><th>isPasswordChanged</th></tr>"; echo "</thead>"; echo "<tbody>"; foreach ($profiles as $profile) { echo '<tr>'; echo '<td>' . $profile->getProfileID() . '</td>'; echo '<td>' . $profile->getAccountID() . '</td>'; echo '<td>' . $profile->getEmail() . '</td>'; echo '<td>' . $profile->getPassword() . '</td>'; echo '<td>' . $profile->isLoggedIn() . '</td>'; echo '<td>' . $profile->isEmployee() . '</td>'; echo '<td>' . $profile->isPasswordChanged() . '</td>'; echo '</tr>'; $personalAccounts = AccountsDB::getAccountsBy('bankID', $profile->getAccountID()); if (!empty($personalAccounts)) { echo "<tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td>\r\n\t\t\t\t <th>Account Id</th>\r\n\t\t\t\t <th>SSN</th>\r\n\t\t\t\t <th>First Name</th>\r\n\t\t\t\t <th>Last Name</th>\r\n\t\t\t\t <th>Balance</th>\r\n\t\t\t\t </tr>"; foreach ($personalAccounts as $acc) { if (!is_null($acc)) { // print_r('<br>'.$acc); echo '<tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td>'; echo '<td> ' . $acc->getAccountID() . '</td>'; echo '<td> ' . $acc->getSSN() . '</td>'; echo '<td> ' . $acc->getFirstName() . '</td>'; echo '<td> ' . $acc->getLastName() . '</td>'; echo '<td> ' . $acc->getBalance() . '</td>'; echo '</tr>'; } } } } echo "</tbody>"; echo "</table>"; echo "<br><br>"; echo "<h1>BankSystem Account list</h1>"; echo "<table>"; echo "<thead>"; echo "<tr><td></td><th>Account Id</th><td></td><th>First Name</th><th>Last Name</th><th>Balance</th><th>SSN</th></tr>"; echo "</thead>"; echo "<tbody>"; foreach ($accounts as $acc) { echo '<tr><td></td>'; echo '<td>' . $acc->getAccountID() . '</td><td></td>'; echo '<td>' . $acc->getFirstName() . '</td>'; echo '<td>' . $acc->getLastName() . '</td>'; echo '<td>' . $acc->getBalance() . '</td>'; echo '<td>' . $acc->getSSN() . '</td>'; echo '</tr>'; } echo "</tbody>"; echo "</table>"; echo "</body></html>"; }