Ejemplo n.º 1
0
 public function formToRegisterNewDiscipline()
 {
     $this->load->model('course_model');
     $courses = $this->course_model->getAllCourses();
     if ($courses !== FALSE) {
         foreach ($courses as $course) {
             $coursesResult[$course['id_course']] = $course['course_name'];
         }
     } else {
         $coursesResult = FALSE;
     }
     loadTemplateSafelyByPermission("discipline", "discipline/register_discipline", array('courses' => $coursesResult));
 }
Ejemplo n.º 2
0
 public function secretary_courseSyllabus()
 {
     $semester = new Semester();
     $currentSemester = $semester->getCurrentSemester();
     // Get the current user id
     $logged_user_data = $this->session->userdata("current_user");
     $currentUser = $logged_user_data['user']['id'];
     // Get the courses of the secretary
     $course = new Course();
     $courses = $course->getCoursesOfSecretary($currentUser);
     if ($courses !== FALSE) {
         $syllabus = new Syllabus();
         $coursesSyllabus = array();
         foreach ($courses as $course) {
             $coursesSyllabus[$course['course_name']] = $syllabus->getCourseSyllabus($course['id_course']);
         }
     } else {
         $coursesSyllabus = FALSE;
     }
     $data = array('current_semester' => $currentSemester, 'courses' => $courses, 'syllabus' => $coursesSyllabus);
     loadTemplateSafelyByPermission(PermissionConstants::COURSE_SYLLABUS_PERMISSION, 'usuario/secretary_course_syllabus', $data);
 }
Ejemplo n.º 3
0
 public function registerNewProgram()
 {
     define("COORDINATOR_GROUP", "coordenador");
     $group = new Module();
     $foundGroup = $group->getGroupByName(COORDINATOR_GROUP);
     if ($foundGroup !== FALSE) {
         $user = new Usuario();
         $users = $user->getUsersOfGroup($foundGroup['id_group']);
         if ($users !== FALSE) {
             $usersForCoordinator = array();
             foreach ($users as $user) {
                 $usersForCoordinator[$user['id']] = $user['name'];
             }
         } else {
             $usersForCoordinator = FALSE;
         }
     } else {
         $usersForCoordinator = FALSE;
     }
     $data = array('users' => $usersForCoordinator);
     loadTemplateSafelyByPermission('cursos', "program/new_program", $data);
 }
Ejemplo n.º 4
0
 public function displayMastermindStudents()
 {
     $session = $this->session->userdata("current_user");
     $this->load->model('semester_model');
     $currentSemester = $this->semester_model->getCurrentSemester();
     $this->load->model('mastermind_model');
     $students = $this->mastermind_model->getStutentsByIdMastermind($session['user']['id']);
     $studentsRequests = $this->getStudentsRequests($students, $currentSemester['id_semester']);
     $requestData = array('requests' => $studentsRequests, 'idMastermind' => $session['user']['id']);
     loadTemplateSafelyByPermission("mastermind", 'mastermind/display_mastermind_students', $requestData);
 }
Ejemplo n.º 5
0
 /**
  * Function to load the page of a course that will be updated
  * @param int $id
  */
 public function formToEditCourse($courseId)
 {
     $this->load->model('course_model');
     $course = $this->course_model->getCourseById($courseId);
     $user = new Usuario();
     $userToBeSecretaries = $user->getUsersToBeSecretaries();
     if ($userToBeSecretaries !== FALSE) {
         foreach ($userToBeSecretaries as $user) {
             $formUserSecretary[$user['id']] = $user['name'];
         }
     } else {
         $formUserSecretary = FALSE;
     }
     $course_controller = new Course();
     $secretaryRegistered = $course_controller->getCourseSecrecretary($course['id_course']);
     $course_types = $this->db->get('course_type')->result_array();
     foreach ($course_types as $ct) {
         $formCourseType[$ct['id']] = $ct['description'];
     }
     $originalCourseType = $this->course_model->getCourseTypeByCourseId($courseId);
     $originalCourseTypeId = $originalCourseType['id'];
     $program = new Program();
     $registeredPrograms = $program->getAllPrograms();
     if ($registeredPrograms !== FALSE) {
         foreach ($registeredPrograms as $currentProgram) {
             $registeredProgramsForm[$currentProgram['id_program']] = $currentProgram['program_name'];
         }
     }
     $data = array('course' => $course, 'formUserSecretary' => $formUserSecretary, 'secretary_registered' => $secretaryRegistered, 'form_course_types' => $formCourseType, 'original_course_type' => $originalCourseTypeId, 'registeredPrograms' => $registeredProgramsForm);
     loadTemplateSafelyByPermission("cursos", 'course/update_course', $data);
 }