Example #1
0
 public static function getStudentStatus($studentEnrollments = null, $year = null, $semester = null, $sectionId = null)
 {
     if (is_null($studentEnrollments) || is_null($year) || is_null($semester)) {
         return 'Cannot Determine Status1';
     }
     if (is_null($sectionId)) {
         foreach ($studentEnrollments as $enrollment) {
             $sectionId = $enrollment->getSectionId();
         }
     }
     if (!Doctrine_Core::getTable('SectionCourseOffering')->checkIfGradeSubmittedBySectionId($sectionId)) {
         return 'Cannot determine status2';
     }
     if (!($year == 1 && $semester == 1)) {
         if (is_null(Statuses::getPreviousSGPA($studentEnrollments, $year, $semester))) {
             return 'Cannot Determine CGPA';
         } else {
             $pgpa = Statuses::getCGPA($studentEnrollments, $year, $semester);
         }
     }
     if (is_null(Statuses::getGPA($studentEnrollments, $year, $semester))) {
         return 'Cannot Determine GPA';
     } else {
         $sgpa = Statuses::getGPA($studentEnrollments, $year, $semester);
     }
     if (is_null(Statuses::getCGPA($studentEnrollments, $year, $semester))) {
         return 'Cannot Determine CGPA';
     } else {
         $cgpa = Statuses::getCGPA($studentEnrollments, $year, $semester);
     }
     ##checkIfDropout -
     /*if(Statuses::checkIfDropout($studentEnrollments, $year, $semester))
       {
           return 'DROPOUT';           
       }
       
       ##checkIfWithdraw
       if(Statuses::checkIfWithdraw($studentEnrollments, $year, $semester))
       {
           return 'WITHDRAWN'; 
       }
        * 
        */
     if (Statuses::checkIfAcademicDismissal($studentEnrollments, $sgpa, $cgpa, $year, $semester)) {
         if (Statuses::checkIfAcademicDismissalWithReadmission($studentEnrollments, $sgpa, $cgpa, $year, $semester)) {
             return "ADR";
         } else {
             return "AD";
         }
     }
     if (Statuses::checkIfWarning($studentEnrollments, $sgpa, $cgpa, $year, $semester)) {
         return "WARNING";
     }
     if (Statuses::checkIfPass($studentEnrollments, $sgpa, $cgpa, $year, $semester)) {
         return "PASS";
     }
 }