/**
  * Summary of getAllCourseSections
  * Get all of the course section models that are associated with this Academic Quarter model
  *
  * @return Array An array containing all of the course section models for this quarter
  */
 public function getAllCourseSections()
 {
     $models = array();
     if ($this->academicQuarterID != null) {
         $this->db->select('CourseSectionID');
         $this->db->where('AcademicQuarterID', $this->academicQuarterID);
         $results = $this->db->get('CourseSections');
         foreach ($results->result_array() as $row) {
             $model = new Course_section_model();
             if ($model->loadPropertiesFromPrimaryKey($row['CourseSectionID'])) {
                 array_push($models, $model);
             }
         }
     }
     return $models;
 }
    }
    $slotID = $currSlot->getCurriculumCourseSlotID();
    //Setup action for button next to currriculum slot info.
    if ($sectionID > 0) {
        $submitAction = site_url('User/prepareRemoveCourseSection/' . $sectionID);
    } else {
        $submitAction = site_url('User/prepareAddCourseSection/' . $slotID);
    }
    echo '<form action="' . $submitAction . '" method="POST">';
    echo '<input type="hidden" name="sID" value="' . $sID . '" />';
    echo '<tr><td><input type="submit"';
    if ($sectionID > 0) {
        echo 'value="Remove Course" /></tc></td>';
        $student = new User_model();
        $student->loadPropertiesFromPrimaryKey($sID);
        $section = new Course_section_model();
        $section->loadPropertiesFromPrimaryKey($sectionID);
        $quarterName = $section->getAcademicQuarter()->getName();
        $quarterYear = $section->getAcademicQuarter()->getYear();
        $grade = $student->getGradeForCourseSection($section);
        echo '<td>' . $currSlot->getName() . '</td>' . '<td>' . $quarterName . $quarterYear . '</td>' . '<td>' . $section->getSectionName() . '</td>' . '<td>' . $grade . '</td>';
    } else {
        echo 'value="   Add Course   " /></tc></td>';
        // Need Curriculum Slot
        echo '<td>' . $slotName . '</td>' . '<td>' . $unassigned . '</td>' . '<td>' . $unassigned . '</td>' . '<td>' . $unassigned . '</td>';
    }
    echo '</tr></form>';
}
?>
            </table>
            <br/>
 /**
  * Summary of removeCourseSection
  * Remove a course section from this advising form
  * 
  * @param Course_section_model $courseSection The course section to remove from this advising form
  */
 public function removeCourseSection($courseSection)
 {
     if ($this->advisingFormID != null && $courseSection->getCourseSectionID() != null) {
         $this->db->where('AdvisingFormID', $this->advisingFormID);
         $this->db->where('CourseSectionID', $courseSection->getCourseSectionID());
         $this->db->delete('AdvisingFormCourseSections');
         return $this->db->affected_rows() > 0;
     }
     return false;
 }
Beispiel #4
0
 /**
  * Summary of getAllCoursesTaken
  * Get all of the courses that have been taken by this user model
  * 
  * @return Array An array containing all of the course sections taken by this user model
  */
 public function getAllCoursesTaken()
 {
     $models = array();
     $this->db->select('CourseSectionID, Grade');
     $this->db->from('StudentCourseSections');
     $this->db->where('StudentUserID', $this->userID);
     $results = $this->db->get();
     if ($results->num_rows() > 0) {
         foreach ($results->result_array() as $row) {
             $courseSection = new Course_section_model();
             if ($courseSection->loadPropertiesFromPrimaryKey($row['CourseSectionID'])) {
                 array_push($models, array($courseSection, $row['Grade']));
             }
         }
     }
     return $models;
 }
Beispiel #5
0
 public function removeCourseSection()
 {
     $this->checkSec();
     $sID = $this->input->post('sID');
     $student = new User_model();
     $student->loadPropertiesFromPrimaryKey($sID);
     $section = new Course_section_model();
     $section->loadPropertiesFromPrimaryKey($this->input->post('sectionID'));
     $student->removeCourseSection($section);
     redirect('User/prepareAddCourses/' . $sID);
 }
 /**
  * Summary of getAllCourseSections
  * Get all of the course section models in the database
  * 
  * @return Array An array containing all of the course section models stored in the database
  */
 public static function getAllCourseSections()
 {
     $db = get_instance()->db;
     $models = array();
     $db->select('CourseSectionID');
     $db->from('CourseSections');
     $results = $db->get();
     foreach ($results->result_array() as $row) {
         $model = new Course_section_model();
         if ($model->loadPropertiesFromPrimaryKey($row['CourseSectionID'])) {
             array_push($models, $model);
         }
     }
     return $models;
 }