public function __construct($cars = '', $amountOfPages = '', $page_no = '') { echo parent::htmlHeader('Home'); if (!empty($cars)) { $heading = Heading::newHeading('h4', 'Cars for sale'); $content = parent::htmlAlertDiv('info', $heading); echo parent::htmlDiv($content, 8); $carsTable = Table::displayCarsTable($cars); echo parent::htmlDiv($carsTable, 10); if ($amountOfPages > 1) { $paging = Paging::getPagingLinks($amountOfPages); if (isset($page_no) && !empty($page_no)) { $paging .= '<br /><b>Page:</b> ' . $page_no; } echo parent::htmlDiv($paging, 2); } } else { $heading = Heading::newHeading('h4', 'There are currently no cars for sale'); $content = parent::htmlAlertDiv('danger', $heading); echo parent::htmlDiv($content, 8); } echo parent::htmlFooter(); }
public function __construct($loginAttempts = '', $userInformation = '', $usersCars = '') { echo parent::htmlHeader('Profile Information'); $heading = Heading::newHeading('h4', 'Profile information'); $content = parent::htmlAlertDiv('info', $heading); echo parent::htmlDiv($content, 8); // Display users cars if he/she has added any if (!empty($usersCars)) { $content = Heading::newHeading('h4', 'Cars added by this user:'******'h4', 'Basic user information:'); $content .= ListHTML::databaseList($userInformation); $well = parent::htmlWell($content); echo parent::htmlDiv($well, 6); // Display the login attemps if user is logged in if (isset($_SESSION['user_session']) && !empty($_SESSION['user_session']) && !empty($loginAttempts)) { $content = Heading::newHeading('h4', 'Login attempts:'); $content .= Table::userLoginHistory($loginAttempts); echo parent::htmlDiv($content, 6); } echo parent::htmlFooter(); }