Esempio n. 1
0
 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(VCounselingPeer::ID, $pks, Criteria::IN);
         $objs = VCounselingPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Esempio n. 2
0
 public function getVCounselingsJoinClassGroup($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseVCounselingPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collVCounselings === null) {
         if ($this->isNew()) {
             $this->collVCounselings = array();
         } else {
             $criteria->add(VCounselingPeer::EMPLOYEE_ID, $this->getId());
             $this->collVCounselings = VCounselingPeer::doSelectJoinClassGroup($criteria, $con);
         }
     } else {
         $criteria->add(VCounselingPeer::EMPLOYEE_ID, $this->getId());
         if (!isset($this->lastVCounselingCriteria) || !$this->lastVCounselingCriteria->equals($criteria)) {
             $this->collVCounselings = VCounselingPeer::doSelectJoinClassGroup($criteria, $con);
         }
     }
     $this->lastVCounselingCriteria = $criteria;
     return $this->collVCounselings;
 }
Esempio n. 3
0
 public function executeShow()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $group = $this->getContext()->getUser()->getAttribute('group', null, 'bo');
     if ($group == 'lector') {
         $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
         $employee = EmployeePeer::retrieveByPK($employee_id);
         if ($employee->getStaffTypeId() == 13 || $employee->getStaffTypeId() == 14) {
             $this->can_add == 0;
             $this->can_edit == 0;
             $this->can_remove == 0;
         }
         $this->employee = $employee;
     } else {
         $c = new Criteria();
         $c->add(JobPeer::CODE, $this->getModuleName());
         $job = JobPeer::doSelectOne($c);
         $acl = AclPeer::retrieveByPK($group_id, $job->getId());
         if (!$acl) {
             $this->forward('default', 'error404');
         }
     }
     $counseling = VCounselingPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($counseling);
     $this->subtitle = $counseling->toString() . ' - id:' . $counseling->getId();
     $actions = array(array('name' => 'back', 'url' => 'student_finance/list', 'color' => 'black'));
     $this->actions = $actions;
     $this->counseling = $counseling;
     $c = new Criteria();
     $c->add(StudentPeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $c->add(StudentPeer::STATUS, Student::STATUS_GRADUATE, Criteria::NOT_EQUAL);
     $this->sortStudent($c);
     if ($this->getRequest()->hasParameter('filters')) {
         $filters = $this->getRequestParameter('filters');
         if ($filters == 'clear') {
             $this->filters = null;
         } else {
             $defined_filter = false;
             foreach ($filters as $f) {
                 if (is_array($f)) {
                     if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
                         $defined_filter = true;
                         break;
                     }
                 } else {
                     if ($f != null && $f != '') {
                         $defined_filter = true;
                         break;
                     }
                 }
             }
             if ($defined_filter) {
                 $this->filters = $filters;
                 $this->filterStudent($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'student');
     $pager = new sfPropelPager('Student', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student'));
     $this->getUser()->setAttribute('page', $page, 'student');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions2 = array(array('name' => 'filter', 'color' => 'white'));
     $actions2 = array(array('name' => 'filter', 'color' => 'white'));
     $filter_string = "";
     if ($this->filters) {
         foreach ($this->filters as $key => $val) {
             $filter_string .= "&filters[{$key}]={$val}";
         }
         $filter_string = preg_replace('/^&/', '', $filter_string);
     }
     $this->actions2 = $actions2;
 }
Esempio n. 4
0
 public function executeGetAssignedCounselorByAccal()
 {
     $accal_id = $this->getRequestParameter('academic_calendar_id');
     $accal = AcademicCalendarPeer::retrieveByPK($accal_id);
     $array = array();
     if ($accal) {
         $c = new Criteria();
         $c->add(VCounselingPeer::ACADEMIC_CALENDAR_ID, $accal_id);
         $objs = VCounselingPeer::doSelect($c);
         if ($this->getRequestParameter('include_blank') == 'true') {
             $array[] = '';
         }
         foreach ($objs as $o) {
             $array[$o->getId()] = $o->toStringEmployee() . ' # ' . $o->getClassGroup()->toString() . ' # ' . $o->getStudentCount();
         }
     }
     $this->content = $array;
     $this->setTemplate('buildOptions');
 }
Esempio n. 5
0
        ?>
						</td>
                        
                        			<!-- Rata-rata Kelas -->
						<?php 
        $cm = new Criteria();
        $cm->add(StudentRaportPeer::SUBJECT_CURR_ID, $student_score->getSubjectCurrId());
        $cm->add(StudentRaportPeer::CLASS_GROUP_ID, $student_score->getClassGroupId());
        $cm->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
        $cm->add(StudentRaportPeer::GRADE_SPEC_ID, 16);
        $raports = StudentRaportPeer::doSelect($cm);
        $total_score = 0;
        foreach ($raports as $c) {
            $total_score += $c->getGrade();
        }
        $count = VCounselingPeer::retrieveByPK($counseling->getId());
        $student_count = $count->getStudentCount();
        $x = $total_score / $student_count;
        ?>
						<td align="center" style="text-align:center;" class="first"><?php 
        echo $total_score ? round($x) : '-';
        ?>
</td>                           
					</tr>
				<?php 
    }
    ?>
			<?php 
}
?>
			</tbody>
Esempio n. 6
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = VCounselingPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setEmployeeId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setAcademicCalendarId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setClassGroupId($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setStudentCount($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setClassTypeId($arr[$keys[5]]);
     }
 }
Esempio n. 7
0
 public function executeShowByEmployee()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $counseling = VCounselingPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($counseling);
     $this->subtitle = $counseling->toString() . ' - id:' . $counseling->getId();
     $actions = array(array('name' => 'back', 'url' => 'counseling_menu/listAbsence?employee_id=' . $employee_id, 'color' => 'black'));
     $this->actions = $actions;
     $this->counseling = $counseling;
     $c = new Criteria();
     $c->add(VStudentActivePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $c->addJoin(StudentPeer::ID, VStudentActivePeer::ID);
     $this->sortStudent($c);
     if ($this->getRequest()->hasParameter('filters')) {
         $filters = $this->getRequestParameter('filters');
         if ($filters == 'clear') {
             $this->filters = null;
         } else {
             $defined_filter = false;
             foreach ($filters as $f) {
                 if (is_array($f)) {
                     if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
                         $defined_filter = true;
                         break;
                     }
                 } else {
                     if ($f != null && $f != '') {
                         $defined_filter = true;
                         break;
                     }
                 }
             }
             if ($defined_filter) {
                 $this->filters = $filters;
                 $this->filterStudent($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'student');
     $pager = new sfPropelPager('Student', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student'));
     $this->getUser()->setAttribute('page', $page, 'student');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions2 = array(array('name' => 'filter', 'color' => 'white'));
     $this->actions2 = $actions2;
 }