Ejemplo n.º 1
0
 private function generateShiftReports($career_school_years, $shift)
 {
     $shift_reports_by_career = array();
     foreach ($career_school_years as $csy) {
         $shift_reports = array();
         if ($shift == "") {
             foreach (ShiftPeer::doSelect(new Criteria()) as $s) {
                 $title = 'Estudiantes inscriptos en divisiones del turno ' . strtolower($s);
                 $filters = array('shift' => $s->getId(), 'career_school_year' => $csy->getId());
                 $shift_reports[] = $this->generateReportArray($title, $s->countStudentsInDivisions(DivisionStudentPeer::doSelectForCareerSchoolYearAndShift($csy, $s)), $filters);
             }
         } else {
             $title = 'Estudiantes inscriptos en divisiones del turno ' . strtolower(ShiftPeer::retrieveByPK($shift));
             $filters = array('shift' => ShiftPeer::retrieveByPK($shift)->getId(), 'career_school_year' => $csy->getId());
             $shift_reports[] = $this->generateReportArray($title, ShiftPeer::retrieveByPK($shift)->countStudentsInDivisions(DivisionStudentPeer::doSelectForCareerSchoolYearAndShift($csy, ShiftPeer::retrieveByPK($shift))), $filters);
         }
         $title = 'Estudiantes sin inscripciones en alguna división';
         $shift_reports[] = $this->generateReportArray($title, StudentCareerSchoolYearPeer::countStudentsNotInAnyDivisionForCareerSchoolYear($csy), null);
         $shift_reports_by_career['Carrera: ' . $csy->getCareer()->getCareerName()] = $shift_reports;
     }
     return $shift_reports_by_career;
 }