$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/> <button type="button">
/** * Summary of getAlternateCourseSections * Get all the alternate course sections for this advising form * * @return Array An array containing all course sections that are alternate in this advising form */ public function getAlternateCourseSections() { $models = array(); if ($this->advisingFormID != null) { $this->db->select('CourseSectionID'); $this->db->from('AdvisingFormCourseSections'); $this->db->where('AdvisingFormID', $this->advisingFormID); $this->db->where('AdvisingFormCourseSectionStateID', self::COURSE_SECTION_STATE_ALTERNATE); $results = $this->db->get(); foreach ($results->result_array() as $row) { $model = new Course_section_model(); if ($model->loadPropertiesFromPrimaryKey($row['CourseSectionID'])) { array_push($models, $model); } } } return $models; }
/** * 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; }
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; }
/** * 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; }