<table width='686' style='font-size:11px;' cellpadding='5px'> <tr> <td width='147' align='left' valign='top'>Academic Status: <span style='color:red;'> <?php echo Statuses::getStudentStatus($student->getEnrollmentInfos(), $sectionDetail->getyear(), $sectionDetail->getSemester()); ?> </span> </td> <td width='511' align='right' valign='top'><table width='509' border='1' cellpadding='5px' cellspacing='0' style='font-size:11px;'> <tr> <td width='124' align='left' valign='top'> </td> <td width='220' align='left' valign='top'>Credit Hours </td> <td width='170' align='right' valign='top'>Grade Point </td> <td width='170' align='right' valign='top'>GPA</td> </tr> <tr> <td align='left' valign='top'>Current Semester </td> <td align='left' valign='top'><?php echo Statuses::getSemesterCreditHours($student->getEnrollmentInfos(), $sectionDetail->getYear(), $sectionDetail->getSemester()); ?>
<table width='686' style='font-size:11px;'> <tr> <td colspan='2'> </td> </tr> <tr> <td width='311' align='left' valign='top'><?php echo $departmentName; ?> Department______________ </td> <td width='281' align='right' valign='top'>Date______________</td> </tr> <tr> <td align='left' valign='top'>Academic Status: <span style='color: red; font-weight:bold; '> <?php echo Statuses::getStudentStatus($enrollment); ?> </span> </td> <td align='right' valign='top'> </td> </tr> <tr> <td colspan='2' align='left' valign='top' style='font-size:11px;'> Note:- 1. This grade is invalid unless it bears the official seal of the college<br> 2. There must be no eraser </td> </tr> </table> <br /> <br /> <?php
public function executeDoPromotion(sfWebRequest $request) { ## find section detail $studentIdsArray = array(); $this->programSectionId = $request->getParameter('id'); $this->sectionDetail = Doctrine_Core::getTable('ProgramSection')->findOneById($this->programSectionId); $this->forward404Unless($this->sectionDetail); foreach ($this->sectionDetail->getEnrollmentInfos() as $enrollmentInfo) { if (!$enrollmentInfo->getLeftout()) { $studentIdsArray[] = $enrollmentInfo->getStudentId(); } } ##GET ALL students, in given sectionId, year and semester, with all enrollmentInfos $this->students = Doctrine_Core::getTable('Student')->getStudents($studentIdsArray, $this->sectionDetail); ## Get promotion information if available for existing class, $this->promotionInfo = Doctrine_Core::getTable('PromotionSetting')->getOnePromotionSetting($this->sectionDetail->getProgramId(), $this->sectionDetail->getYear(), $this->sectionDetail->getSemester()); $this->forward404Unless($this->promotionInfo); //$this->enrollmentsToCreate[] = Array(); ## Create section, $this->sectionToCreate = new ProgramSection(); $this->sectionToCreate->setProgramId($this->sectionDetail->getProgramId()); $this->sectionToCreate->setCenterId($this->sectionDetail->getCenterId()); $this->sectionToCreate->setAcademicCalendarId($this->sectionDetail->getAcademicCalendarId()); $academicYearToSave = ProgramSectionActions::getNextACYearForSection($this->promotionInfo->getCurrentYear(), $this->promotionInfo->getCurrentSemester(), $this->sectionDetail->getAcademicYear()); $this->sectionToCreate->setAcademicYear($academicYearToSave); $this->sectionToCreate->setYear($this->promotionInfo->getToYear()); $this->sectionToCreate->setSemester($this->promotionInfo->getToSemester()); $this->sectionToCreate->setSectionNumber($this->sectionDetail->getSectionNumber()); $this->sectionToCreate->setIsActivated(TRUE); $this->sectionToCreate->save(); $this->sectionDetail->setIsPromoted(TRUE); $this->sectionDetail->setIsActivated(FALSE); $this->sectionDetail->save(); foreach ($this->students as $student) { foreach ($student->getEnrollmentInfos() as $enrollmentObj) { if (!$enrollmentObj->getLeftout()) { $leftoutEnrollments = Doctrine_Core::getTable('EnrollmentInfo')->getLeftoutEnrollments($enrollmentObj); if (!is_null($leftoutEnrollments)) { foreach ($leftoutEnrollments as $loe) { ##modify existing $enrollment Module $enrollmentObj->setTotalChrs($enrollmentObj->getTotalChrs() + $loe->getTotalChrs()); $enrollmentObj->setTotalGradePoints($enrollmentObj->getTotalGradePoints() + $loe->getTotalGradePoints()); $enrollmentObj->setTotalRepeatedChrs($enrollmentObj->getTotalRepeatedChrs() + $loe->getTotalRepeatedChrs()); $enrollmentObj->setTotalRepeatedGradePoints($enrollmentObj->getTotalRepeatedGradePoints() + $loe->getTotalRepeatedGradePoints()); } } } } } foreach ($this->students as $student) { foreach ($student->getEnrollmentInfos() as $enrollment) { if (!$enrollment->getLeftout()) { ## get student status with given ENROLLMENT, $status = Statuses::getStudentStatus($student->getEnrollmentInfos(), $this->sectionDetail->getYear(), $this->sectionDetail->getSemester()); if ($status == 'PASS' || $status == 'WARNING') { $enrollmentsToCreate = new EnrollmentInfo(); $toAcademicYear = ProgramSectionActions::getNextACYearForSection($this->promotionInfo->getCurrentYear(), $this->promotionInfo->getCurrentSemester(), $this->sectionDetail->getAcademicYear()); if ($status == 'PASS') { $enrollment->setAcademicStatus(sfConfig::get('app_passing_status')); } if ($status == 'WARNING') { $enrollment->setAcademicStatus(sfConfig::get('app_warning_status')); } $enrollmentsToCreate->makeEnrollment($enrollment, $toAcademicYear, $this->promotionInfo->getToYear(), $this->promotionInfo->getToSemester(), $this->sectionToCreate->getId(), sfConfig::get('app_promotion_enrollment')); } else { if ($status == 'AD') { $enrollment->setAcademicStatus(sfConfig::get('app_ad_status')); } if ($status == 'ADR') { $enrollment->setAcademicStatus(sfConfig::get('app_adr_status')); $enrollment->setSemesterAction(sfConfig::get('app_dismissed_semester_action')); $enrollment->setLeftout(TRUE); } if ($status == 'WITHDRAWAL') { $enrollment->setAcademicStatus(sfConfig::get('app_withdrawal_status')); } if ($status == 'DROPOUT') { $enrollment->setAcademicStatus(sfConfig::get('app_dropout_status')); } $enrollment->setSemesterAction(sfConfig::get('app_dismissed_semester_action')); $enrollment->save(); } } } } $this->getUser()->setFlash('notice', 'Promotion was successfull'); $this->redirect('programsection/index'); }
public function executeDoPromotion(sfWebRequest $request) { ## find section detail $i = 1; $this->programSectionId = $request->getParameter('id'); $this->sectionDetail = Doctrine_Core::getTable('ProgramSection')->getOneProgramSectionById($this->programSectionId); $enrollments = Doctrine_Core::getTable('EnrollmentInfo')->getEnrollmentsBySectionId($this->programSectionId); ## Get promotion information if available for existing class, $this->promotionInfo = Doctrine_Core::getTable('PromotionSetting')->getOnePromotionSetting($this->sectionDetail->getProgramId(), $this->sectionDetail->getYear(), $this->sectionDetail->getSemester()); $this->forward404Unless($this->promotionInfo); //$this->enrollmentsToCreate[] = Array(); ## Create section, $this->sectionToCreate = new ProgramSection(); $this->sectionToCreate->setProgramId($this->sectionDetail->getProgramId()); $this->sectionToCreate->setCenterId($this->sectionDetail->getCenterId()); $this->sectionToCreate->setAcademicCalendarId($this->sectionDetail->getAcademicCalendarId()); $academicYearToSave = ProgramSectionActions::getNextACYearForSection($this->sectionDetail->getYear(), $this->sectionDetail->getSemester(), $this->sectionDetail->getAcademicYear()); $this->sectionToCreate->setAcademicYear($academicYearToSave); $this->sectionToCreate->setYear($this->promotionInfo->getToYear()); $this->sectionToCreate->setSemester($this->promotionInfo->getToSemester()); $this->sectionToCreate->setSectionNumber($this->sectionDetail->getSectionNumber()); $this->sectionToCreate->setIsActivated(TRUE); $this->sectionToCreate->save(); $this->sectionDetail->setIsPromoted(TRUE); //$this->sectionDetail->setIsActivated(TRUE); $this->sectionDetail->save(); foreach ($enrollments as $enrollment) { ## get student status with given ENROLLMENT, $status = Statuses::getStudentStatus($enrollment); if ($status == 'PASS' || $status == 'WARNING') { $this->enrollmentsToCreate = new EnrollmentInfo(); $this->enrollmentsToCreate->setStudentId($enrollment->getStudentId()); $this->enrollmentsToCreate->setAcademicYear($this->promotionInfo->getToAcademicYear()); $this->enrollmentsToCreate->setYear($this->promotionInfo->getToYear()); $this->enrollmentsToCreate->setSemester($this->promotionInfo->getToSemester()); $this->enrollmentsToCreate->setSectionId($this->sectionToCreate->getId()); $this->enrollmentsToCreate->setProgramId($enrollment->getProgramId()); $this->enrollmentsToCreate->setTotalChrs($enrollment->getTotalChrs()); $this->enrollmentsToCreate->setTotalGradePoints($enrollment->getTotalGradePoints()); $this->enrollmentsToCreate->setTotalRepeatedChrs($enrollment->getTotalRepeatedChrs()); $this->enrollmentsToCreate->setTotalRepeatedGradePoints($enrollment->getTotalRepeatedGradePoints()); $this->enrollmentsToCreate->setPreviousChrs($enrollment->getSemesterChrs()); $this->enrollmentsToCreate->setPreviousGradePoints($enrollment->getSemesterGradePoints()); $this->enrollmentsToCreate->setPreviousRepeatedChrs($enrollment->getSemesterRepeatedChrs()); $this->enrollmentsToCreate->setPreviousRepeatedGradePoints($enrollment->getSemesterRepeatedGradePoints()); $this->enrollmentsToCreate->save(); $studentIds[] = $enrollment->getStudentId(); $this->enrollmentCount = $i; $i++; } } $this->getUser()->setFlash('notice', 'Promotion was successfull'); $this->redirect('programsection/index'); }
?> </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; ?> <?php } ?>