Exemple #1
0
 /**
  * This method joins the preceptor indicated with the corresponing students.
  *
  * @return $criteria
  */
 public static function joinWithStudents(Criteria $c, $user_id, $return_ids = false)
 {
     $c1 = new Criteria();
     $c1->add(PersonPeer::USER_ID, $user_id);
     $c1->addJoin(PersonalPeer::PERSON_ID, PersonPeer::ID);
     $c1->addJoin(PersonalPeer::ID, DivisionPreceptorPeer::PRECEPTOR_ID);
     $c1->addJoin(DivisionPreceptorPeer::DIVISION_ID, DivisionStudentPeer::DIVISION_ID);
     $c1->clearSelectColumns();
     $c1->addSelectColumn(DivisionStudentPeer::STUDENT_ID);
     $c1->setDistinct();
     $stmt = DivisionStudentPeer::doSelectStmt($c1);
     $division_in = $stmt->fetchAll(PDO::FETCH_COLUMN);
     $c2 = new Criteria();
     self::joinWithCourse($c2, $user_id);
     $c2->addJoin(CourseSubjectPeer::COURSE_ID, CoursePeer::ID);
     $c2->addJoin(CourseSubjectPeer::ID, CourseSubjectStudentPeer::COURSE_SUBJECT_ID);
     $c2->clearSelectColumns();
     $c2->addSelectColumn(CourseSubjectStudentPeer::STUDENT_ID);
     $c2->setDistinct();
     $stmt = DivisionStudentPeer::doSelectStmt($c2);
     $course_in = $stmt->fetchAll(PDO::FETCH_COLUMN);
     $in = array_merge($course_in, $division_in);
     if ($return_ids) {
         return $in;
     }
     $c->add(StudentPeer::ID, $in, Criteria::IN);
     $c->setDistinct();
 }
 public static function countStudentsNotInAnyDivisionForCareerSchoolYear($career_school_year, PropelPDO $con = null)
 {
     $c = new Criteria();
     $c->setDistinct();
     $c->add(self::CAREER_SCHOOL_YEAR_ID, $career_school_year->getId());
     foreach (ShiftPeer::doSelect(new Criteria()) as $shift) {
         $ids = $shift->getStudentIdsFromDivisions(DivisionStudentPeer::doSelectDivisionsForCareerSchoolYearAndShift($career_school_year, $shift));
         $c->addAnd(self::STUDENT_ID, $ids, Criteria::NOT_IN);
     }
     return self::doCount($c, $con);
 }
Exemple #3
0
 public function getDivisionStudent($student_id)
 {
     $c = new Criteria();
     $c->add(DivisionStudentPeer::STUDENT_ID, $student_id);
     $c->add(DivisionStudentPeer::DIVISION_ID, $this->getId());
     return DivisionStudentPeer::doSelectOne($c);
 }
    ?>
 </td>
            <td><?php 
    echo $student;
    ?>
 </td>
            <td><?php 
    echo $student->getPerson()->getStudent()->getFolioNumber();
    ?>
 </td>
            <td><?php 
    echo $student->getPerson()->getIdentificationNumber();
    ?>
 </td>
            <?php 
    $division = DivisionStudentPeer::retrieveDivisionsForStudentAndYear($student, $examination_repproved_subject->getCareerSubject()->getYear());
    ?>
            <td><?php 
    echo implode(', ', $division);
    ?>
 </td>
            <?php 
    $sers = $examination_repproved_subject->getExaminationNoteForStudent($student);
    ?>
            <td><?php 
    echo $sers->getDate('d/m/Y');
    ?>
 </td>
            <?php 
    if ($sers->getIsAbsent()) {
        ?>
Exemple #5
0
 private function generateYearShiftDivisionReports($career_school_years, $year, $shift, $division)
 {
     $year_shift_division_reports_by_career = array();
     foreach ($career_school_years as $csy) {
         $reports = array();
         if ($division != "") {
             $division = DivisionPeer::retrieveByPK($division);
         }
         if ($shift == "") {
             foreach (ShiftPeer::doSelect(new Criteria()) as $s) {
                 $filters = array('shift' => $s->getId(), 'career_school_year' => $csy->getId());
                 if ($year == "") {
                     for ($y = 1; $y <= $csy->getCareer()->getQuantityYears(); $y++) {
                         $filters['year'] = $y;
                         if ($division == "") {
                             foreach (DivisionStudentPeer::doSelectForCareerSchoolYearShiftAndYear($csy, $s, $y) as $d) {
                                 $filters['division'] = $d->getId();
                                 $title = 'Estudiantes en el turno ' . strtolower($s) . ', año N°' . $y . ' de la carrera y división ' . $d;
                                 $reports[] = $this->generateReportArray($title, DivisionStudentPeer::doCountForCareerSchoolYearShiftYearAndDivision($csy, $s, $y, $d), $filters);
                             }
                         } else {
                             $filters['division'] = $division->getId();
                             $title = 'Estudiantes en el turno ' . strtolower($s) . ', año N°' . ' ' . $y . ' ' . ' de la carrera y división ' . ' ' . $division;
                             $reports[] = $this->generateReportArray($title, DivisionStudentPeer::doCountForCareerSchoolYearShiftYearAndDivision($csy, $s, $y, $division), $filters);
                         }
                     }
                 } else {
                     $filters['year'] = $year;
                     if ($division == "") {
                         foreach (DivisionStudentPeer::doSelectForCareerSchoolYearShiftAndYear($csy, $s, $year) as $d) {
                             $filters['division'] = $d->getId();
                             $title = 'Estudiantes en el turno ' . strtolower($s) . ', año N°' . $year . ' de la carrera y división ' . $d;
                             $reports[] = $this->generateReportArray($title, DivisionStudentPeer::doCountForCareerSchoolYearShiftYearAndDivision($csy, $s, $year, $d), $filters);
                         }
                     } else {
                         $filters['division'] = $division->getId();
                         $title = 'Estudiantes en el turno ' . strtolower($s) . ', año N°' . $year . ' de la carrera y división ' . $division;
                         $reports[] = $this->generateReportArray($title, DivisionStudentPeer::doCountForCareerSchoolYearShiftYearAndDivision($csy, $s, $year, $division), $filters);
                     }
                 }
             }
         } else {
             $shift = ShiftPeer::retrieveByPK($shift);
             $filters = array('shift' => $shift->getId(), 'year' => $year, 'division' => $division->getId(), 'career_school_year' => $csy->getId());
             $title = 'Estudiantes en el turno ' . strtolower($shift) . ', año N°' . $year . ' de la carrera y división ' . $division;
             $reports[] = $this->generateReportArray($title, DivisionStudentPeer::doCountForCareerSchoolYearShiftYearAndDivision($csy, $shift, $year, $division), $filters);
         }
         $year_shift_division_reports_by_career['Carrera: ' . $csy->getCareer()->getCareerName()] = $reports;
     }
     return $year_shift_division_reports_by_career;
 }