コード例 #1
0
ファイル: HomePage.php プロジェクト: evvels2131/is218
 public function __construct($array = '')
 {
     // Get header
     echo parent::getHeader('Home');
     if (!empty($array)) {
         $content = parent::htmlAlertDiv('warning', Heading::newHeading('h5', 'Cars Stored in Session'));
         echo parent::htmlDiv($content, 8);
         $content = Table::generateTable($array);
         echo parent::htmlDiv($content, 6);
     } else {
         $content = parent::htmlAlertDiv('danger', Heading::newHeading('h5', 'No cars stored in session to be
       displayed.'));
         $content .= parent::htmlAlertDiv('info', Heading::newHeading('h5', 'Add a new car
       by clicking the <strong>"Add New Car"</strong> link above.'));
         echo parent::htmlDiv($content, 8);
     }
     // Get footer
     echo parent::getFooter();
 }
コード例 #2
0
ファイル: HomePageView.php プロジェクト: evvels2131/is218
 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();
 }
コード例 #3
0
ファイル: ProfilePageView.php プロジェクト: evvels2131/is218
 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();
 }