} else { if ($view == "contactView") { $smarty->assign('mainContent', $smarty->fetch("contact.tpl")); $smarty->assign('title', '..::ECE_E-Learning:contact'); } else { if ($view == "registerView") { go_homeforlogedin(); } else { if ($view == "userCourses") { $course = new Course(); $smarty->assign('courses', $course->displayAllCourse()); $smarty->assign('title', '..::ECE_E-Learning:userCouses'); $smarty->assign('mainContent', $smarty->fetch("userCourses.tpl")); } else { if ($view == "userEvaluation") { $smarty->assign('evalHome', $eval->goHome()); $smarty->assign('mainContent', $smarty->fetch("userEvaluation.tpl")); $smarty->assign('title', '..::ECE_E-Learning:userCourses'); } else { if ($view == "adminView") { //include_once 'adminmainpage.php'; if ($auth->isAdmin($auth->selectSessionData($id))) { //direct user to the admin main page header("Location:../usr/admin/?suid=" . $id . "token=" . $token . "&view=enable_disableUser"); } else { go_homeforlogedin(); } } else { go_homeforlogedin(); } }
$user_id = $_SESSION['user_id']; $qCount = htmlentities(htmlspecialchars($_POST["qCount"])); $qCat = htmlentities(htmlspecialchars($_POST["qCategory"])); $qStyle = htmlentities(htmlspecialchars($_POST["qStyle"])); $qTime = htmlentities(htmlspecialchars($_POST["qTime"])); $evaluation = new Evaluation(); //check if user has configured evaluation before if true, reset values, else configure new values //$evaluation->configureEValuation($user_id, $qCount, $qCat, $qStyle, $qTime); echo $evaluation->startEvaluation($user_id, $qCount, $qCat, $qStyle, $qTime); } if (isset($_POST["continueEval"])) { $evaluation = new Evaluation(); $user_id = $_SESSION['user_id']; $currentCount = htmlentities(htmlspecialchars($_POST["currentCount"])); $currentCatName = htmlentities(htmlspecialchars($_POST["currentCatName"])); $currentId = htmlentities(htmlspecialchars($_POST["currentqId"])); $currentTime = htmlentities(htmlspecialchars($_POST["currentTime"])); $option = htmlentities(htmlspecialchars($_POST["option"])); $correctAns = htmlentities(htmlspecialchars($_POST["correctAns"])); //initial $qCount = htmlentities(htmlspecialchars($_POST["qCount"])); $qCat = htmlentities(htmlspecialchars($_POST["qCat"])); $qStyle = htmlentities(htmlspecialchars($_POST["qStyle"])); $qTime = htmlentities(htmlspecialchars($_POST["qTime"])); $totalScore = htmlentities(htmlspecialchars($_POST["totalScore"])); echo $evaluation->continueEvaluation($user_id, $currentCount, $currentCatName, $currentId, $currentTime, $option, $correctAns, $qCount, $qCat, $qStyle, $qTime, $totalScore); } if (isset($_POST["evalHome"])) { $evaluation = new Evaluation(); echo $evaluation->goHome(); }