public static function goals() { //method returns what templates to load and some twig variables for index.html and the templates to read. require_once 'Goals.model.php'; $goalsMdl = new GoalsModel(); $data = array('templates' => array('header.html', 'menu.html', 'goals.html', 'footer.html'), 'goals' => $goalsMdl->viewGoals($_SESSION['userID']), 'userID' => $_SESSION['userID'], 'userLevel' => $_SESSION['userLevel']); 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; }