public static function singleGoal($url_parts) { //method returns what templates to load and some twig variables for index.html and the templates to read. // compares what userID you have and returns goals connected to that userID //gives singlegoal method an content id from GET and the userID from session and puts what it returns in 'singleGoal' require_once 'Goals.model.php'; $goalsMdl = new GoalsModel(); $id = $url_parts[0]; $data = array('templates' => array('header.html', 'menu.html', 'singleGoal.html', 'footer.html'), 'userID' => $_SESSION['userID'], 'userLevel' => $_SESSION['userLevel'], 'singleGoal' => $goalsMdl->showSingleGoal($id, $_SESSION['userID'])); return $data; }
public static function view($url_parts) { //method returns what templates to load and some twig variables for index.html and the templates to read. require_once 'Content.model.php'; require_once 'Goals.model.php'; $contentMdl = new ContentModel(); $goalsMdl = new GoalsModel(); $id = $url_parts[0]; $data = array('templates' => array('header.html', 'menu.html', 'searchForm.html', 'singleContent.html', 'footer.html'), 'goals' => $goalsMdl->viewGoals($_SESSION['userID']), 'article' => $contentMdl->viewSingleContent($id), 'userLevel' => $_SESSION['userLevel'], 'user' => $_SESSION['username'], 'userID' => $_SESSION['userID'], 'viewRating' => $contentMdl->viewRating()); return $data; }
public static function profile() { require_once 'Goals.model.php'; require_once 'Using.model.php'; $goalsMdl = new GoalsModel(); $usingMdl = new UsingModel(); if ($_SESSION['userLevel'] == "Premium") { $data = array('templates' => array('header.html', 'menu.html', 'admin.html', 'goals.html', 'viewArticleUses.html', 'footer.html'), 'goals' => $goalsMdl->viewGoals($_SESSION['userID']), 'viewArticleUses' => $usingMdl->viewArticleUses($_SESSION['userID']), 'userID' => $_SESSION['userID'], 'user' => $_SESSION['username'], 'userLevel' => $_SESSION['userLevel']); } elseif ($_SESSION['userLevel'] == "Free") { $data = array('templates' => array('header.html', 'menu.html', 'admin.html', 'footer.html'), 'userID' => $_SESSION['userID'], 'user' => $_SESSION['username'], 'userLevel' => $_SESSION['userLevel']); } return $data; }