public function executeDownloadDocument(sfWebRequest $request) { $student_disciplinary_sanction = StudentDisciplinarySanctionPeer::retrieveByPK($request->getParameter('id')); if ($student_disciplinary_sanction && $student_disciplinary_sanction->getDocument()) { $filePath = $student_disciplinary_sanction->getDocumentFullPath(); $response = $this->getResponse(); $response->setHttpHeader('Pragma', ''); $response->setHttpHeader('Cache-Control', ''); $data = file_get_contents($filePath); $file_exploded = explode('.', $student_disciplinary_sanction->getDocument()); $file_extension = end($file_exploded); if ($file_extension == 'pdf') { $response->setHttpHeader('Content-Type', 'application/pdf'); } else { if ($file_extension == 'jpg') { $content_type = 'jpeg'; } else { $content_type = $file_extension; } $response->setHttpHeader('Content-Type', 'image/' . $content_type); } $response->setHttpHeader('Content-Disposition', "attachment; filename=\"" . $student_disciplinary_sanction->getDocument() . "\""); $response->setContent($data); } return sfView::NONE; }
public function canBeDeleted(PropelPDO $con = null) { $criteria = new Criteria(); $criteria->add(StudentDisciplinarySanctionPeer::DISCIPLINARY_SANCTION_TYPE_ID, $this->getId()); return !StudentDisciplinarySanctionPeer::doCount($criteria); }
</th> <th><?php echo __('1°B'); ?> </th> <th><?php echo __('2°B'); ?> </th> </tr> <tr> <?php foreach ($periods as $period) { ?> <td><?php echo StudentDisciplinarySanctionPeer::countStudentDisciplinarySanctionsForPeriod($student, $division->getSchoolYear(), $period); ?> </td> <?php } ?> </tr> </table> </div> <?php } ?> </div> <?php include_partial('signature_boxes');
?> </tbody> <tfoot> <tr> <td colspan ="6" class="report-total">Total anual: <span class="big-total"><?php echo $student->countStudentDisciplinarySanctionsForSchoolYear($division->getSchoolYear()); ?> </span></td> </tr> <tr> <td colspan ="6" class="report-total">Total en <?php echo $student->getCareerSchoolYearsNames(); ?> : <span class="big-total"><?php echo StudentDisciplinarySanctionPeer::countTotalValueForStudent($student); ?> </span></td> </tr> </tfoot> </table> </div> </div> <div style="clear:both"></div> <br> <div class="colsright"> <div class="rowfirm_responsible"> <div class="titletable"><?php echo __('Responsible signature'); ?>
public function countStudentDisciplinarySanctionsForSchoolYear($school_year = null) { return StudentDisciplinarySanctionPeer::countStudentDisciplinarySanctionsForPeriod($this, $school_year); }
echo $student_disciplinary_sanction->getSanctionType(); ?> </td> <td><?php echo $student_disciplinary_sanction->getValue(); ?> </td> </tr> <?php } ?> </tbody> <tfoot> <tr> <td class="report-total" colspan ="4" class="total">Total: <?php echo StudentDisciplinarySanctionPeer::countStudentDisciplinarySanctionsForSchoolYearAndStudent($student); ?> </td> </tr> </tfoot> </table> <?php } else { ?> <span class="report-notice"><?php echo __("Student doesn't have any disciplinary sanctions."); ?> </span> <?php }
private function generateGeneralReports($career_school_years) { $student_reports_by_career = array(); $filters = array('school_year' => $this->school_year->getId()); $student_reports = array($this->generateReportArray('Estudiantes matriculados', $this->school_year->countSchoolYearStudents(null, false), $filters)); if (!is_null($last_year_school_year = SchoolYearPeer::retrieveLastYearSchoolYear($this->school_year))) { $total = bcsub($this->school_year->countSchoolYearStudents(null, true), $last_year_school_year->countSchoolYearStudents(), 0); $filters['is_entrant'] = true; $student_reports[] = $this->generateReportArray('Ingresantes con respecto al año lectivo anterior', $total, $filters); } $filters = array('school_year' => $this->school_year->getId(), 'has_disciplinary_sanctions' => true); $disciplinary_sanctions = StudentDisciplinarySanctionPeer::countStudentDisciplinarySanctionsForSchoolYear($this->school_year); $student_reports[] = $this->generateReportArray('Estudiantes con sanciones disciplinarias', $disciplinary_sanctions, $filters); $student_reports_by_career['For school year'] = $student_reports; foreach ($career_school_years as $csy) { $student_reports = array(); $filters = array('career_school_year' => $csy->getId()); $student_reports[] = $this->generateReportArray('Estudiantes inscriptos', $csy->countStudentCareerSchoolYears(null, true), $filters); //Total no inscriptos en la carrera $not_inscripted_in_csy = $csy->countNotMatriculatedStudents(); if ($not_inscripted_in_csy < 0) { $not_inscripted_in_csy = 0; } $student_reports[] = $this->generateReportArray('Estudiantes no inscriptos', $not_inscripted_in_csy, null); //Total graduated students for career $filters['is_graduated'] = true; $student_reports[] = $this->generateReportArray('Estudiantes graduados', CareerStudentPeer::doCountGraduatedForCareerSchoolYear($csy), $filters); $student_reports_by_career['Carrera: ' . $csy->getCareer()->getCareerName()] = $student_reports; } return $student_reports_by_career; }