Example #1
0
 public function __construct($session_array = '', $car_id = '')
 {
     // Header
     echo parent::getHeader('Car Details');
     // Get the proper car from the session array
     $car = $session_array[$car_id['id']];
     $heading = Heading::newHeading('h5', 'Car Details');
     $content = parent::htmlAlertDiv('warning', $heading);
     echo parent::htmlDiv($content, 8);
     // Display information about the car
     foreach ($car as $attribute => $value) {
         $clean = HTML::cleanAttribute($attribute);
         if ($clean == 'Image') {
             $image = Heading::newHeading('h2', 'Image');
             if (!empty($value)) {
                 $image .= '<img src="' . $value . '" alt="image" class="img-thumbnail">';
             } else {
                 $image .= Heading::newHeading('h4', 'Not Available');
             }
         } else {
             if ($clean == 'Guid') {
                 continue;
             } else {
                 $ctn .= '<b>' . $clean . '</b>: ' . $value . '<br />';
             }
         }
     }
     $ctn .= Link::newLink('<br />Go Back', 'index.php', '_self');
     $well = parent::htmlWell('lg', $ctn);
     echo parent::htmlDiv($image, 6);
     echo parent::htmlDiv($well, 6);
     // Footer
     echo parent::getFooter();
 }
Example #2
0
 public function __construct($notifications = '', $type = '')
 {
     echo parent::htmlHeader('Notifications');
     $heading = parent::htmlAlertDiv($type, Heading::newHeading('h4', '<b>Results</b>'));
     echo parent::htmlDiv($heading, 8);
     $well = parent::htmlWell($notifications);
     echo parent::htmlDiv($well, 6);
     echo parent::htmlFooter();
 }
Example #3
0
 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();
 }