public function executeDeleteExemptedCourse(sfWebRequest $request) { $canBeDeleted = FALSE; $programSectionId = $request->getParameter('sectionId'); $studentId = $request->getParameter('studentId'); $studentExemptionId = $request->getParameter('exemptionId'); $this->student = Doctrine_Core::getTable('Student')->findOneById($studentId); $this->forward404Unless($this->student); foreach ($this->student->getEnrollmentInfos() as $enrollment) { if (SemesterActions::isEnrolled($enrollment) && EnrollmentActions::isAdmission($enrollment) || SemesterActions::isEnrolled($enrollment) && EnrollmentActions::isTransfer($enrollment)) { $canBeDeleted = TRUE; } } if ($canBeDeleted) { foreach ($this->student->getStudentExemptions() as $exemption) { if ($exemption->getId() == $studentExemptionId) { $exemption->delete(); } //$exemption->save(); } $auditlog = new AuditLog(); $auditlog->addNewLogInfo($this->getUser()->getAttribute('userId'), 'Deleted Students Exempted Course!'); $this->getUser()->setFlash('notice', 'Student Information and Enrollment Detail Successfully Deleted!'); $this->redirect('transfer/sectiondetail/?id=' . $programSectionId); } else { $this->getUser()->setFlash('error', 'Student is already registered - Exempted Course Cannot Be Deleted'); $this->redirect('transfer/sectiondetail/?id=' . $programSectionId); } }
public function getEnrollmentStatus() { if ($this->getSemesterAction() == SemesterActions::enrolled() && $this->getEnrollmentAction() == EnrollmentActions::admission() && is_null($this->getSectionId())) { return "Admitted"; } elseif ($this->getSemesterAction() == SemesterActions::enrolled() && $this->getEnrollmentAction() == EnrollmentActions::admission() && $this->getSectionId() != '') { return "Enrolled"; } elseif ($this->getSemesterAction() == SemesterActions::enrolled() && $this->getEnrollmentAction() == EnrollmentActions::promotion() && $this->getSectionId() != '') { return "Enrolled"; } elseif ($this->getSemesterAction() == SemesterActions::enrolled() && $this->getEnrollmentAction() == EnrollmentActions::readmission() && $this->getSectionId() != '') { return "Enrolled"; } elseif ($this->getSemesterAction() == SemesterActions::enrolled() && $this->getEnrollmentAction() == EnrollmentActions::transfer() && $this->getSectionId() != '') { return "Enrolled"; } elseif ($this->getSemesterAction() == SemesterActions::enrolled() && $this->getEnrollmentAction() == EnrollmentActions::clearance() && $this->getSectionId() != '') { return "Enrolled"; } elseif ($this->getSemesterAction() == SemesterActions::enrolled() && $this->getEnrollmentAction() == EnrollmentActions::add() && $this->getSectionId() != '') { return "Enrolled"; } elseif ($this->getSemesterAction() == SemesterActions::registered() && $this->getEnrollmentAction() == EnrollmentActions::admission()) { return "Registered"; } elseif ($this->getSemesterAction() == SemesterActions::registered() && $this->getEnrollmentAction() == EnrollmentActions::promotion()) { return "Registered"; } elseif ($this->getSemesterAction() == SemesterActions::registered() && $this->getEnrollmentAction() == EnrollmentActions::readmission()) { return "Registered"; } elseif ($this->getSemesterAction() == SemesterActions::registered() && $this->getEnrollmentAction() == EnrollmentActions::transfer()) { return "Registered"; } elseif ($this->getSemesterAction() == SemesterActions::registered() && $this->getEnrollmentAction() == EnrollmentActions::clearance()) { return "Registered"; } elseif ($this->getSemesterAction() == SemesterActions::registered() && $this->getEnrollmentAction() == EnrollmentActions::add()) { return "Registered"; } elseif ($this->getSemesterAction() == SemesterActions::promoted() && $this->getEnrollmentAction() == EnrollmentActions::admission()) { return "Promoted"; } elseif ($this->getSemesterAction() == SemesterActions::promoted() && $this->getEnrollmentAction() == EnrollmentActions::promotion()) { return "Promoted"; } elseif ($this->getSemesterAction() == SemesterActions::promoted() && $this->getEnrollmentAction() == EnrollmentActions::readmission()) { return "Promoted"; } elseif ($this->getSemesterAction() == SemesterActions::promoted() && $this->getEnrollmentAction() == EnrollmentActions::transfer()) { return "Promoted"; } elseif ($this->getSemesterAction() == SemesterActions::promoted() && $this->getEnrollmentAction() == EnrollmentActions::clearance()) { return "Promoted"; } elseif ($this->getSemesterAction() == SemesterActions::promoted() && $this->getEnrollmentAction() == EnrollmentActions::add()) { return "Promoted"; } elseif ($this->getSemesterAction() == SemesterActions::withdrawn() && $this->getEnrollmentAction() == EnrollmentActions::admission()) { return "Withdrawn"; } elseif ($this->getSemesterAction() == SemesterActions::withdrawn() && $this->getEnrollmentAction() == EnrollmentActions::promotion()) { return "Withdrawn"; } elseif ($this->getSemesterAction() == SemesterActions::withdrawn() && $this->getEnrollmentAction() == EnrollmentActions::readmission()) { return "Withdrawn"; } elseif ($this->getSemesterAction() == SemesterActions::withdrawn() && $this->getEnrollmentAction() == EnrollmentActions::transfer()) { return "Withdrawn"; } elseif ($this->getSemesterAction() == SemesterActions::withdrawn() && $this->getEnrollmentAction() == EnrollmentActions::clearance()) { return "Withdrawn"; } elseif ($this->getSemesterAction() == SemesterActions::withdrawn() && $this->getEnrollmentAction() == EnrollmentActions::add()) { return "Withdrawn"; } elseif ($this->getSemesterAction() == SemesterActions::under() && $this->getEnrollmentAction() == EnrollmentActions::admission()) { return "Under"; } elseif ($this->getSemesterAction() == SemesterActions::under() && $this->getEnrollmentAction() == EnrollmentActions::promotion()) { return "Under"; } elseif ($this->getSemesterAction() == SemesterActions::under() && $this->getEnrollmentAction() == EnrollmentActions::readmission()) { return "Under"; } elseif ($this->getSemesterAction() == SemesterActions::under() && $this->getEnrollmentAction() == EnrollmentActions::transfer()) { return "Under"; } elseif ($this->getSemesterAction() == SemesterActions::under() && $this->getEnrollmentAction() == EnrollmentActions::clearance()) { return "Under"; } elseif ($this->getSemesterAction() == SemesterActions::under() && $this->getEnrollmentAction() == EnrollmentActions::add()) { return "Under"; } elseif ($this->getSemesterAction() == SemesterActions::dismissed() && $this->getEnrollmentAction() == EnrollmentActions::admission()) { return "Dismissed"; } elseif ($this->getSemesterAction() == SemesterActions::dismissed() && $this->getEnrollmentAction() == EnrollmentActions::promotion()) { return "Dismissed"; } elseif ($this->getSemesterAction() == SemesterActions::dismissed() && $this->getEnrollmentAction() == EnrollmentActions::readmission()) { return "Dismissed"; } elseif ($this->getSemesterAction() == SemesterActions::dismissed() && $this->getEnrollmentAction() == EnrollmentActions::transfer()) { return "Dismissed"; } elseif ($this->getSemesterAction() == SemesterActions::dismissed() && $this->getEnrollmentAction() == EnrollmentActions::clearance()) { return "Dismissed"; } elseif ($this->getSemesterAction() == SemesterActions::dismissed() && $this->getEnrollmentAction() == EnrollmentActions::add()) { return "Dismissed"; } elseif ($this->getSemesterAction() == SemesterActions::dropout() && $this->getEnrollmentAction() == EnrollmentActions::admission()) { return "Dropout"; } elseif ($this->getSemesterAction() == SemesterActions::dropout() && $this->getEnrollmentAction() == EnrollmentActions::promotion()) { return "Dropout"; } elseif ($this->getSemesterAction() == SemesterActions::dropout() && $this->getEnrollmentAction() == EnrollmentActions::readmission()) { return "Dropout"; } elseif ($this->getSemesterAction() == SemesterActions::dropout() && $this->getEnrollmentAction() == EnrollmentActions::transfer()) { return "Dropout"; } elseif ($this->getSemesterAction() == SemesterActions::dropout() && $this->getEnrollmentAction() == EnrollmentActions::clearance()) { return "Dropout"; } elseif ($this->getSemesterAction() == SemesterActions::dropout() && $this->getEnrollmentAction() == EnrollmentActions::add()) { return "Dropout"; } elseif ($this->getSemesterAction() == SemesterActions::transferred() && $this->getEnrollmentAction() == EnrollmentActions::admission()) { return "Transfered"; } elseif ($this->getSemesterAction() == SemesterActions::transferred() && $this->getEnrollmentAction() == EnrollmentActions::promotion()) { return "Transfered"; } elseif ($this->getSemesterAction() == SemesterActions::transferred() && $this->getEnrollmentAction() == EnrollmentActions::readmission()) { return "Transfered"; } elseif ($this->getSemesterAction() == SemesterActions::transferred() && $this->getEnrollmentAction() == EnrollmentActions::transfer()) { return "Transfered"; } elseif ($this->getSemesterAction() == SemesterActions::transferred() && $this->getEnrollmentAction() == EnrollmentActions::clearance()) { return "Transfered"; } elseif ($this->getSemesterAction() == SemesterActions::transferred() && $this->getEnrollmentAction() == EnrollmentActions::add()) { return "Transfered"; } else { return "Not Known"; } }