public function __construct() { echo parent::htmlHeader('Login'); $heading = Heading::newHeading('h4', '<b>Welcome!</b> Sing in or sing up below.'); $content = parent::htmlAlertDiv('info', $heading); echo parent::htmlDiv($content, 8); // Form $hp_uniq = InputField::hiddenInputField('text', 'form'); $hp = InputField::hpInputField(); $username = InputField::newInputField('text', 'email', 'Email'); $password = InputField::newInputField('password', 'password', 'Password'); $captcha = InputField::captchaInputField(); $submit = Button::newButton('submit', 'btn-primary', 'Sing in'); $form = new Form('index.php?page=login', 'POST'); $form->addNewInput($hp_uniq); $form->addNewInput($hp); $form->addNewInput($username); $form->addNewInput($password); $form->addNewInput($captcha); $form->addNewInput($submit); $content = $form->getForm(); $content .= Paragraph::newParagraph('Not a member yet? Please sing up below!'); $content .= Link::newLink('Sing up', 'index.php?page=signup', '_self'); echo parent::htmlDiv($content, 4); echo parent::htmlFooter(); }
public function __construct() { echo parent::htmlHeader('Home'); $heading = parent::htmlAlertDiv('info', Heading::newHeading('h4', 'Sign up below')); echo parent::htmlDiv($heading, 8); $hp_uniq = InputField::hiddenInputField('text', 'form'); $hp = InputField::hpInputField(); $firstname = InputField::newInputField('text', 'fname', 'First name'); $lastname = InputField::newInputField('text', 'lname', 'Last name'); $email = InputField::newInputField('text', 'email', 'Email'); $password = InputField::newInputField('password', 'pass', 'Password'); $password2 = InputField::newInputField('password', 'pass2', 'Re-enter password'); $captcha = InputField::captchaInputField(); $submit = Button::newButton('submit', 'btn-primary', 'Register'); $form = new Form('index.php?page=signup', 'POST'); $form->addNewInput($hp_uniq); $form->addNewInput($hp); $form->addNewInput($firstname); $form->addNewInput($lastname); $form->addNewInput($email); $form->addNewInput($password); $form->addNewInput($password2); $form->addNewInput($captcha); $form->addNewInput($submit); $content = $form->getForm(); $content .= Link::newLink('Go Back', 'index.php', '_self'); echo parent::htmlDiv($content, 4); echo parent::htmlFooter(); }
public function __construct($basicInfo, $detailedInfo, $salesman = false) { echo parent::htmlHeader('Car Details'); $heading = Heading::newHeading('h4', 'Car details'); $content = parent::htmlAlertDiv('info', $heading); echo parent::htmlDiv($content, 8); $detailsList = Heading::newHeading('h4', 'Basic information:'); $detailsList .= ListHTML::carDetailsList($basicInfo); echo parent::htmlDiv($detailsList, 6); $detailedList = Heading::newHeading('h4', 'Detailed information:'); $detailedList .= ListHTML::carDetailedList($detailedInfo); echo parent::htmlDiv($detailedList, 6); // Display the form to edit a car if the user is logged in and the car belongs to the user if ($_SESSION['user_session'] && $salesman) { $cInfo = $basicInfo[0]; $hp = InputField::hiddenInputField('text', 'form'); $img_url = InputField::hiddenImageField($cInfo['Image']); $vin_number = InputField::newInputFieldEdit('text', 'vin', 'Vin Number', $cInfo['Vin'], true); $price = InputField::newInputFieldEdit('text', 'price', 'Price', $cInfo['Price'], false); $condition = InputField::newInputFieldEdit('text', 'condition', 'Condition', $cInfo['Condition'], false); $picture = InputField::newInputFieldEdit('file', 'file', 'File Input', 'Value', false); $edit = Button::newButtonEdit('submit', 'edit', 'btn-success', 'Edit'); $delete = Button::newButtonEdit('submit', 'delete', 'btn-danger', 'Delete'); $form = new Form('index.php?page=editcar', 'POST', false); $form->addNewInput($hp); $form->addNewInput($img_url); $form->addNewInput($vin_number); $form->addNewInput($price); $form->addNewInput($condition); $form->addNewInput($picture); $form->addNewInput($edit); $form->addNewInput($delete); $content = $form->getForm(); $collapsible = parent::collapsibleDiv('Edit or Delete', $content); $collapsible .= '<br /><br /><br /><br /><br /><br /><br /><br />'; echo parent::htmlDiv($collapsible, 6); } echo parent::htmlFooter(); }
public function __construct() { echo parent::htmlHeader('Add New Car'); $heading = Heading::newHeading('h4', 'Add a new car below'); $content = parent::htmlAlertDiv('info', $heading); echo parent::htmlDiv($content, 8); // Form $hp = InputField::hiddenInputField('text', 'form'); $vin_number = InputField::newInputField('text', 'vin', 'Vin Number'); $price = InputField::newInputField('text', 'price', 'Price'); $condition = InputField::newInputField('text', 'condition', 'Condition'); $picture = InputField::newInputField('file', 'file', 'File Input'); $submit = Button::newButton('submit', 'btn-primary', 'Submit'); $form = new Form('index.php?page=addcar', 'POST', false); $form->addNewInput($hp); $form->addNewInput($vin_number); $form->addNewInput($price); $form->addNewInput($condition); $form->addNewInput($picture); $form->addNewInput($submit); $content = $form->getForm(); echo parent::htmlDiv($content, 4); echo parent::htmlFooter(); }