Exemple #1
0
 private function generateShiftDivisionReports($career_school_years, $shift, $division)
 {
     $shift_division_reports_by_career = array();
     if ($division != "") {
         $division = DivisionPeer::retrieveByPK($division);
     }
     foreach ($career_school_years as $csy) {
         $shift_division_reports = array();
         if ($shift == "") {
             foreach (ShiftPeer::doSelect(new Criteria()) as $s) {
                 $filters = array('shift' => $s->getId(), 'career_school_year' => $csy->getId());
                 if ($division == "") {
                     foreach (DivisionStudentPeer::doSelectForCareerSchoolYearAndShift($csy, $s) as $d) {
                         $title = 'Estudiantes en el turno ' . strtolower($s) . ', división ' . $d;
                         $filters['division'] = $d->getId();
                         $shift_division_reports[] = $this->generateReportArray($title, DivisionStudentPeer::doCountForCareerSchoolYearShiftAndDivision($csy, $s, $d), $filters);
                     }
                 } else {
                     $title = 'Estudiantes en el turno ' . strtolower($s) . ', división ' . $division;
                     $filters = array('shift' => $s->getId(), 'division' => $division->getId(), 'career_school_year' => $csy->getId());
                     $shift_division_reports[] = $this->generateReportArray($title, DivisionStudentPeer::doCountForCareerSchoolYearShiftAndDivision($csy, $s, $division), $filters);
                 }
             }
         } else {
             $title = 'Estudiantes en el turno ' . strtolower(ShiftPeer::retrieveByPK($shift)) . ', división ' . $division;
             $filters = array('shift' => ShiftPeer::retrieveByPK($shift)->getId(), 'division' => $division->getId(), 'school_year' => $csy->getSchoolYearId(), 'career_school_year' => $csy->getId());
             $shift_division_reports[] = $this->generateReportArray($title, DivisionStudentPeer::doCountForCareerSchoolYearShiftAndDivision($csy, ShiftPeer::retrieveByPK($shift), $division), $filters);
         }
         $shift_division_reports_by_career['Carrera: ' . $csy->getCareer()->getCareerName()] = $shift_division_reports;
     }
     return $shift_division_reports_by_career;
 }