Example #1
0
 public function confirm_remove()
 {
     if (!isset($_SESSION['UserID'])) {
         redirect('Login/logout');
     }
     //Create new user and load its data
     $user = new User_model();
     if (!$user->loadPropertiesFromPrimaryKey($_SESSION['UserID'])) {
         redirect('Login/logout');
     }
     if (!$user->isProgramChair()) {
         redirect('Mainpage');
     }
     $tcourse = $this->input->post("transferCourseID");
     $t_course = new Student_transfer_course_model();
     $norm_course = new Course_model();
     //explode this, then load the data from pimary key, then load course from primary, then add equilvilent course
     $str_array = explode(",", $tcourse);
     $t_course->loadPropertiesFromPrimaryKey(intval($str_array[0]));
     $norm_course->loadPropertiesFromPrimaryKey(intval($str_array[1]));
     $t_course->removeEquivilentCourse($norm_course);
     redirect('Transfer_controller/viewIdMapping');
 }
Example #2
0
 /**
  * Summary of getAllTransferCourses
  * Get all of the student transfer course models associated with this user
  *
  * @return Array An array containing all the student transfer course models associated with this user model
  */
 public function getAllTransferCourses()
 {
     $models = array();
     if ($this->userID != null) {
         $this->db->select('StudentTransferCourseID');
         $this->db->from('StudentTransferCourses');
         $this->db->where('StudentUserID', $this->userID);
         $results = $this->db->get();
         if ($results->num_rows() > 0) {
             foreach ($results->result_array() as $row) {
                 $model = new Student_transfer_course_model();
                 if ($model->loadPropertiesFromPrimaryKey($row['StudentTransferCourseID'])) {
                     array_push($models, $model);
                 }
             }
         }
     }
     return $models;
 }