EX1/Framework_T02_Ex01.zip classlib/.htaccess deny from all classlib/baseClasses/.htaccess deny from all classlib/baseClasses/Controller.php userLoggedIn=$loggedInState;...

1 answer below »
all information is on the assignment sheet


EX1/Framework_T02_Ex01.zip classlib/.htaccess deny from all classlib/baseClasses/.htaccess deny from all classlib/baseClasses/Controller.php userLoggedIn=$loggedInState; $this->controllerType=$controllerType; } //end METHOD - constructor //METHOD: getPageContent() /** * * @param Model $contentMod Content Model * @param Model $navMod Navigation Model * @return Array $data array * */ protected function getPageContent($contentMod,$navMod) { //get the content from the navigation model - put into the $data array for the view: $data['menuNav'] = $navMod->getMenuNav(); // an array of menu items and associated URLS //get the content from the page content model - put into the $data array for the view: $data['pageTitle'] = $contentMod->getPageTitle(); $data['pageHeading'] = $contentMod->getPageHeading(); $data['panelHead_1'] = $contentMod->getPanelHead_1(); // A string containing the LHS panel heading/title $data['panelHead_2'] = $contentMod->getPanelHead_2(); $data['panelHead_3'] = $contentMod->getPanelHead_3(); // A string containing the RHS panel heading/title $data['panelContent_1'] = $contentMod->getPanelContent_1(); // A string intended of the Left Hand Side of the page $data['panelContent_2'] = $contentMod->getPanelContent_2(); // A string intended of the Left Hand Side of the page $data['panelContent_3'] = $contentMod->getPanelContent_3(); // A string intended of the Right Hand Side of the page return $data; } //END METHOD: getPageContent() //METHOD: debug() public function debug() { //Diagnostics/debug information - dump the application variables if DEBUG mode is on echo ''; echo '
'; //outer DIV green blue echo '

'.strtoupper($this->controllerType).' Controller Class - Debug information


'; //SECTION 1 echo '
'; //light blue echo '

'.strtoupper($this->controllerType).' Controller (CLASS) properties

'; echo '

User Logged in Status:

'; if ($this->userLoggedIn) { echo 'User Logged In state is TRUE ($loggedin) '; } else { echo 'User Logged In state is FALSE ($loggedin) '; } echo '

$postArray Values (user input - values entered in any form)

'; echo '
';                 var_dump($this->postArray);                 echo '
'; echo ' '; echo '

$getArray Values (user input - page selected)

'; echo '
';                 var_dump($this->getArray);                 echo '
'; echo ' '; echo '

$data Array Values (Array of Values passed to view)

'; echo '
';                 var_dump($this->viewData);                 echo '
'; echo ' '; echo '
'; //SECTION 2 echo '
'; //light blue echo '

Controller - Class Objects

'; echo '
';                 foreach($this->controllerObjects as $object){$object->getDiagnosticInfo();}                 echo '
'; echo '
'; echo '
'; //END outer DIV echo ''; } //END METHOD: debug() } //end CLASS classlib/baseClasses/Model.php loggedin=$user->getLoggedInState(); $this->user=$user; $this->modelType=$modelType; } //end METHOD - constructor public function getDiagnosticInfo(){ echo '
'; //outer DIV echo '

'.strtoupper($this->modelType).' (MODEL CLASS) properties

'; echo ''; echo ''; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo '














































PROPERTYVALUE
pageTitle".$this->pageTitle."
pageHeading".$this->pageHeading."
panelHead_1$this->panelHead_1
panelContent_1$this->panelContent_1
panelHead_2$this->panelHead_2
panelContent_2$this->panelContent_2
panelHead_3$this->panelHead_3
panelContent_3$this->panelContent_3


'; echo '



'; echo '
'; }//END METHOD: getDiagnosticInfo() } //end CLASS classlib/baseClasses/TableEntity.php
Answered 1 days AfterMar 10, 2021

Answer To: EX1/Framework_T02_Ex01.zip classlib/.htaccess deny from all classlib/baseClasses/.htaccess deny from...

Sanghamitra answered on Mar 12 2021
134 Votes
Topic 02 Ex01 ANSWER SHEET
FIRST, ENTER YOUR NAME AND ID HERE THEN SAVE THIS DOCUMENT ON YOUR PC – SAVE REGULARLY!!
NAME:
ID:
TASK 1.1 & TASK 1.2
Log in as a MANAGER to the web application. Then:-
Paste a screenshot of the of the HOME page HERE :
Select ‘My Account’ Menu option. Then - Paste a screenshot of the ‘My Account’ page HERE:
Select ‘View Account’ Menu option. Then - Paste a screenshot of the ‘View Account’ page HERE:
Select ‘Edit Account’ Menu option. Then - Paste a screenshot of the ‘Edit Account’ page HERE:
Select ‘Change Password’ Menu option. Then - Paste a screenshot of the ‘Change Password’ page HERE :
TASK 2.1, 2.2 &2.3
Log in as a MANAGER to the
web application. Then:-
Select ‘My Account’ Menu option. Then - Paste a screenshot of the ‘My Account’ page HERE:
Select ‘View Account’ Menu option. Then - Paste a screenshot of the ‘View Account’ page HERE:
Select ‘Edit Account’ Menu option. Then - Paste a screenshot of the ‘Edit Account’ page HERE:
Select ‘Change Password’ Menu option. Then - Paste a screenshot of the ‘Change Password’ page HERE :
TASK 3
Log in as a MANAGER to the web application. Then:-
Select ‘My Account’ Menu option. Then - Paste a screenshot of the ‘My Account’ page HERE :
FINAL CODE
Paste full ManagerController.php class code below this line:
/**
* Class: Controller for Manager user
*
* @author gerry.guinane
*
*/
class ManagerController extends Controller {
//CLASS properties
protected $postArray; //a copy of the content of the $_POST superglobal array
protected $getArray; //a copy of the content of the $_GET superglobal array
protected $viewData; //an array containing page content generated using models
protected $controllerObjects; //an array containing models used by the controller
protected $user; //session object
protected $db;
protected $pageTitle;
//CLASS methods
//METHOD: constructor
function __construct($user,$db) {
parent::__construct('ManagerController',$user->getLoggedinState());

//initialise all the class properties
$this->postArray = array();
$this->getArray = array();
$this->viewData=array();
$this->controllerObjects=array();
$this->user=$user;
$this->db=$db;
$this->pageTitle='FRAMEWORK';
}
//END METHOD: constructor
//METHOD: run()
public function run() { // run the controller
$this->getUserInputs();
$this->updateView();
}
//END METHOD: run()
//METHOD: getUserInputs()
public function getUserInputs() { // get user input
//
//This method is the main interface between the user and the controller.
//
//Get the $_GET array values
$this->getArray = filter_input_array(INPUT_GET) ; //used for PAGE navigation

//Get the $_POST array values
$this->postArray = filter_input_array(INPUT_POST); //used for form data entry and buttons

}
//END METHOD: getUserInputs()
//METHOD: updateView()
public function updateView() { //update the VIEW based on the users page selection
if (isset($this->getArray['pageID'])) { //check if a page id is contained in the URL
switch ($this->getArray['pageID']) {
case "home":
//create objects to generate view content
$contentModel = new ManagerHome($this->user, $this->pageTitle, strtoupper($this->getArray['pageID']));
$navigationModel = new NavigationManager($this->user, $this->getArray['pageID']);
array_push($this->controllerObjects,$contentModel,$navigationModel);
$data = $this->getPageContent($contentModel,$navigationModel); //get the page content from the models
$this->viewData = $data; //put the content array into a class property for diagnostic purpose
//update the view
include_once 'views/view_navbar_2_panel.php'; //load the view
break;

case "menuItem1":
//create objects to generate view content
$contentModel = new UnderConstruction($this->user, $this->db, $this->postArray,$this->pageTitle, strtoupper($this->getArray['pageID']), $this->getArray['pageID']);
$navigationModel = new NavigationManager($this->user, $this->getArray['pageID']);
array_push($this->controllerObjects,$contentModel,$navigationModel);
$data = $this->getPageContent($contentModel,$navigationModel); //get the page content from the models
$this->viewData = $data; //put the content array into a class property for diagnostic purpose
//update the view
include_once 'views/view_navbar_2_panel.php'; //load the view
break;
case "viewManAccount":
//create objects to generate view content
$contentModel = new ManagerManageAccount($this->user, $this->db, $this->postArray,$this->pageTitle, strtoupper($this->getArray['pageID']), $this->getArray['pageID']);
$navigationModel = new NavigationManager($this->user, $this->getArray['pageID']);
array_push($this->controllerObjects,$contentModel,$navigationModel);
$data = $this->getPageContent($contentModel,$navigationModel); //get the page content from the models
$this->viewData = $data; //put the content array into a class property for diagnostic purpose
//update the view
include_once 'views/view_navbar_1_panel.php'; //load the view
break;
case "editManAccount":
//create objects to generate view content
$contentModel = new ManagerManageAccount($this->user, $this->db, $this->postArray,$this->pageTitle, strtoupper($this->getArray['pageID']), $this->getArray['pageID']);
$navigationModel = new NavigationManager($this->user, $this->getArray['pageID']);
array_push($this->controllerObjects,$contentModel,$navigationModel);
$data = $this->getPageContent($contentModel,$navigationModel); //get the page content from the models
$this->viewData = $data; //put the content array into a class property for diagnostic purpose
//update the view
include_once 'views/view_navbar_2_panel.php'; //load the view ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here