6
6
$this->load->model('user');
7
7
$this->load->model('admin/admin_model');
9
if(!$this->user->isLoggedIn() || $this->user->getUserType() != "Teacher") {
10
echo "You do not have access to this page.";
9
14
// NOTE: viewstudents is a deprecated model. Should eventually be replaced by a proper model
10
15
$this->load->model('viewstudents');
26
31
$this->load->view('viewStudentsBody', array('students' => $students));
29
public function index_old()
31
/* headData manages the <head>-tag and loads corresponding CSS.
32
* The views that are entered will load CSS with same name.
33
* Ex. test_header will load test_header.css
35
$this->load->library('session');
37
'cssFiles' => array('header', 'examplesMenu', 'examplesBody'),
38
'jsFiles' => array('header', 'examplesMenu', 'examplesBody', 'userControls')
40
$this->load->view('headTag', array('headTagData' => $headTagData));
42
$this->load->helper('form');
44
// Loading model to retrieve login data
34
public function editStudentDetails() {
45
35
$this->load->model('user');
47
'userType' => $this->user->getUserType(), // Loads different header for teacher/student
48
'userName' => $this->user->getUserName()
51
$this->load->view('header', $userInfo);
53
/* Loads used models */
54
$this->load->model('viewstudents');
56
// menuData loads items to the menu.
58
$allStudents = array();
60
/* Loads categorydata into array */
61
$query = $this->viewstudents->getStudents();
64
foreach ($query as $student)
66
array_push($allStudents, $student->userName);
36
if(!$this->input->post('username') || !$this->user->isLoggedIn()) {
37
echo "You do not have access to this page";
69
/*Menu for examples page showing categories */
70
$this->load->view('examplesMenu', array('titles' => $allTitles));
72
/* Loads body for examples page */
74
$this->load->view('viewStudentsBody', array('students' => $allStudents));
42
'name' => $this->input->post('name');
79
46
public function validate() {
80
47
//Load required library