public function executeShow(sfWebRequest $request) { $this->showEdit = FALSE; $this->showPrintGradeReport = FALSE; $this->showDelete = FALSE; $this->student = Doctrine_Core::getTable('Student')->findOneById($request->getParameter('id')); $this->forward404Unless($this->student); if (SemesterActions::checkModifyStudentProfile($this->student)) { $this->showEdit = TRUE; $this->showDelete = TRUE; } }
public static function checkModifyStudentProfile($studentObj = null) { if (!is_null($studentObj)) { $canBeModified = TRUE; foreach ($studentObj->getEnrollmentInfos() as $enrollment) { if (SemesterActions::isRegistered($enrollment) || SemesterActions::isPromoted($enrollment) || SemesterActions::isWithdrawn($enrollment) || SemesterActions::isUnder($enrollment) || SemesterActions::isDismissed($enrollment) || SemesterActions::isDropout($enrollment) || SemesterActions::isGraduated($enrollment)) { $canBeModified = FALSE; } } return $canBeModified; } else { return FALSE; } }
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); } }
?> </td> <td> <?php echo $enrollment->getYear(); ?> </td> <td> <?php echo $enrollment->getSemester(); ?> </td> <td> <?php echo $enrollment->getCGPA(); ?> </td> <td> <?php echo SemesterActions::getSemesterAction($enrollment); ?> </td> <td> <?php echo Statuses::getStudentStatus($student->getEnrollmentInfos(), $enrollment->getYear(), $enrollment->getSemester(), $enrollment->getSectionId()); ?> </td> <?php if ($enrollment->getAcademicStatus() == sfConfig::get('app_adr_status') || $enrollment->getAcademicStatus() == sfConfig::get('app_withdrawal_status')) { ?> <?php $showReadmissionForm = TRUE; ?> <?php $sEnrollment = $enrollment; ?>
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"; } }