public function configureStudents() { $this->year = $this->getDefault('year'); $this->division_id = $this->getDefault('division_id'); $this->course_subject_id = $this->getDefault('course_subject_id') == '' || $this->getDefault('course_subject_id') === null ? null : $this->getDefault('course_subject_id'); $this->division = DivisionPeer::retrieveByPK($this->division_id); $this->course_subject = CourseSubjectPeer::retrieveByPK($this->course_subject_id); $this->career_school_year_id = $this->getDefault('career_school_year_id'); $this->configureDays(); $sf_user = sfContext::getInstance()->getUser(); $this->students = $this->getStudents(); foreach ($this->students as $student) { $name = 'student_name_' . $student->getId(); $this->setWidget($name, new mtWidgetFormPlain(array('object' => $student))); $this->setValidator($name, new sfValidatorPass()); $name = 'student_attendance_' . $student->getId() . '_' . $this->day; $this->setAbsenceWidget($name); $student_attendance = StudentAttendancePeer::retrieveByDateAndStudent($this->day, $student, $this->course_subject_id, $this->career_school_year_id); if (!is_null($student_attendance)) { $this->setAttendanceDefault($name, $student_attendance); } } }
?> <?php $period = CareerSchoolYearPeriodPeer::retrieveByDay($day, $division->getCourseType()); ?> <?php $clasz = is_null($period) ? '' : $student->getFreeClass($period, $course_subject, CareerSchoolYearPeer::retrieveByPk($career_school_year_id), $division); ?> <?php } ?> <?php } ?> <?php $student_attendance = StudentAttendancePeer::retrieveByDateAndStudent(date('Y-m-d', $day), $student, $course_subject_id, $career_school_year_id); ?> <?php if ($student_attendance) { ?> <?php $total = $total + $student_attendance->getValue(); ?> <?php if ($student_attendance->getStudentAttendanceJustification()) { $total_justificated = $total_justificated + $student_attendance->getValue(); } ?> <td class="<?php
if ($student_attendance && $student_attendance->getStudentAttendanceJustification()) { ?> <?php echo link_to(image_tag('sanction.png'), 'attendance_justification/show?id=' . $student_attendance->getStudentAttendanceJustificationId()); ?> <?php } ?> </td> <?php } ?> <?php $student_attendance = StudentAttendancePeer::retrieveByDateAndStudent($day, $student, $course_subject_id); ?> <td class="<?php $student_attendance ? $student_attendance->getStudentAttendanceJustification() and print 'attendance_justificated' : ''; ?> "> <?php echo $form['student_' . $student->getId()]->renderError(); ?> <?php echo $form['student_' . $student->getId()]->render(); ?> <?php echo $form['student_' . $student->getId() . '_attendance_id']->render(); ?> <?php