Ejemplo n.º 1
0
 public function executeGetScore()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $academic_calendar_id = $this->getRequestParameter('academic_calendar_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id);
     $this->forward404Unless($academic_calendar);
     $counseling_id = $this->getRequestParameter('counseling_id');
     $counseling = CounselingPeer::retrieveByPK($counseling_id);
     $this->forward404Unless($counseling);
     $student_id = $this->getRequestParameter('student_id');
     $student = StudentPeer::retrieveByPK($student_id);
     $this->forward404Unless($student);
     $c = new Criteria();
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'counseling_spec'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'counseling_spec');
     $pager = new sfPropelPager('CounselingSpec', $rpp);
     $pager->setPeerMethod('doSelectOrdered');
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'counseling_spec'));
     $this->getUser()->setAttribute('page', $page, 'counseling_spec');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $cem = new Criteria();
     $cem->add(StudentAccalPeer::STUDENT_ID, $student->getId());
     $cem->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $cem->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $cem->add(StudentAccalPeer::STATUS, 1);
     $stu_acc = StudentAccalPeer::doSelectOne($cem);
     $this->stu_acc = $stu_acc;
     $cr = new Criteria();
     $cr->add(CounselingRaportPeer::STUDENT_ACCAL_ID, $stu_acc->getId());
     $student_couns = CounselingRaportPeer::doSelect($cr);
     $stu_coun = array();
     foreach ($student_couns as $student_coun) {
         $stu_coun[$student_coun->getCounselingSpecId()] = $student_coun->getGrade();
     }
     $this->stu_coun = $stu_coun;
     $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     $this->actions = $actions;
     $this->academic_calendar = $academic_calendar;
     $this->employee_id = $employee_id;
     $this->employee = $employee;
     $this->counseling = $counseling;
     $this->student = $student;
 }
Ejemplo n.º 2
0
 public static function retrieveByPK($id, $student_accal_id, $subject_curr_id, $counseling_spec_id, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $criteria = new Criteria();
     $criteria->add(CounselingRaportPeer::ID, $id);
     $criteria->add(CounselingRaportPeer::STUDENT_ACCAL_ID, $student_accal_id);
     $criteria->add(CounselingRaportPeer::SUBJECT_CURR_ID, $subject_curr_id);
     $criteria->add(CounselingRaportPeer::COUNSELING_SPEC_ID, $counseling_spec_id);
     $v = CounselingRaportPeer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }
Ejemplo n.º 3
0
 public function getCounselingRaports($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseCounselingRaportPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collCounselingRaports === null) {
         if ($this->isNew()) {
             $this->collCounselingRaports = array();
         } else {
             $criteria->add(CounselingRaportPeer::COUNSELING_SPEC_ID, $this->getId());
             CounselingRaportPeer::addSelectColumns($criteria);
             $this->collCounselingRaports = CounselingRaportPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(CounselingRaportPeer::COUNSELING_SPEC_ID, $this->getId());
             CounselingRaportPeer::addSelectColumns($criteria);
             if (!isset($this->lastCounselingRaportCriteria) || !$this->lastCounselingRaportCriteria->equals($criteria)) {
                 $this->collCounselingRaports = CounselingRaportPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastCounselingRaportCriteria = $criteria;
     return $this->collCounselingRaports;
 }
Ejemplo n.º 4
0
<?php

use_helper('Number', 'myHelper');
foreach ($students as $student) {
    $student_detail = $student->getStudentDetail();
    echo include_partial('global/printCover');
    $cem = new Criteria();
    $cem->add(StudentAccalPeer::STUDENT_ID, $student->getId());
    $cem->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
    $cem->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
    $cem->add(StudentAccalPeer::STATUS, 1);
    $stu_acc = StudentAccalPeer::doSelectOne($cem);
    $cr = new Criteria();
    $cr->add(CounselingRaportPeer::STUDENT_ACCAL_ID, $stu_acc->getId());
    $student_couns = CounselingRaportPeer::doSelect($cr);
    $stu_coun = array();
    foreach ($student_couns as $student_coun) {
        $stu_coun[$student_coun->getCounselingSpecId()] = $student_coun->getGrade();
    }
    ?>

            <table border="0" width="100%" style="page-break-after: always;">
                <tr>
                    <td colspan="2" width="100%" align="left" valign="top" <?php 
    if ($score_rule->getImage() != 1) {
        echo 'height="30px"';
    }
    ?>
>
                        <?php 
    if ($score_rule->getImage() == 1) {