</tr>
            <tr><td colspan="3" height="30px"></td></tr>
            <tr>
                    <td></td>
                    <td style="text-align: left; font-size: 10px; font-weight: bold;">
                    <?php 
$c = new Criteria();
$c->add(EmployeePeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId());
$c->add(EmployeePeer::STAFF_TYPE_ID, 14);
$employee = EmployeePeer::doSelectOne($c);
echo $employee->getName() ? $employee->getName() : '-';
?>
                    </td>
                    <td style="text-align: left; font-size: 10px; font-weight: bold;">
                    <?php 
$cb = new Criteria();
$cb->add(CounselingTutorPeer::COUNSELING_ID, $counseling->getId());
$cb->addAscendingOrderByColumn(CounselingTutorPeer::ID);
$counseling_tutor = CounselingTutorPeer::doSelect($cb);
$tutors = array();
foreach ($counseling_tutor as $cr) {
    $tutors[] = $cr->getEmployee() ? $cr->getEmployee()->getName() : '';
}
echo join(",&nbsp;", $tutors);
?>
                    </td>
            </tr>
    </table>

    </center>
 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(CounselingTutorPeer::ID, $pks, Criteria::IN);
         $objs = CounselingTutorPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
示例#3
0
 public function getCounselingTutors($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseCounselingTutorPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collCounselingTutors === null) {
         if ($this->isNew()) {
             $this->collCounselingTutors = array();
         } else {
             $criteria->add(CounselingTutorPeer::EMPLOYEE_ID, $this->getId());
             CounselingTutorPeer::addSelectColumns($criteria);
             $this->collCounselingTutors = CounselingTutorPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(CounselingTutorPeer::EMPLOYEE_ID, $this->getId());
             CounselingTutorPeer::addSelectColumns($criteria);
             if (!isset($this->lastCounselingTutorCriteria) || !$this->lastCounselingTutorCriteria->equals($criteria)) {
                 $this->collCounselingTutors = CounselingTutorPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastCounselingTutorCriteria = $criteria;
     return $this->collCounselingTutors;
 }
示例#4
0
 public function executeAbsent()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $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');
     }
     $this->can_add = $acl->getAddPriv() == 1;
     $this->can_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $counseling = CounselingPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($counseling);
     $actions = array(array('name' => 'Simpan', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     $this->subtitle = $counseling->getAcademicCalendar()->toString() . ' - ' . $counseling->getClassGroup()->toString() . ' - id:' . $counseling->getId();
     $this->type = 'edit';
     $this->title = 'Penentuan Peserta Kelas';
     $this->counseling = $counseling;
     $this->actions = $actions;
     $actions2 = array(array('name' => '<span>Perwalian / Manajemen Kelas</span>', 'url' => 'counselor_new/list', 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>1. Data Akademik</span>', 'url' => 'counselor_new/lector?id=' . $counseling->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>2. Penentuan Wali Kelas</span>', 'url' => 'counselor_new/lector?id=' . $counseling->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>3. Penentuan Peserta Kelas</span>', 'url' => 'counselor_new/student?id=' . $counseling->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>4. Penentuan Urutan Absensi Kelas</span>', 'url' => 'counselor_new/absent?id=' . $counseling->getId(), 'color' => 'sun', 'type' => 'direct'));
     $this->actions2 = $actions2;
     $c = new Criteria();
     $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendar()->getChildB()->getId());
     $c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID);
     $c->addAscendingOrderByColumn(StudentPeer::NAME);
     $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;
     $cl = new Criteria();
     $cl->add(AcademicCalendarPeer::PARENT, $counseling->getAcademicCalendarId());
     $cl->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $cl->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $stu_accals = StudentAccalPeer::doSelect($cl);
     $stu_status = array();
     foreach ($stu_accals as $stu_accal) {
         $stu_status[$stu_accal->getAcademicCalendarId() . '#' . $stu_accal->getStudentId()] == $stu_accal->getStatus();
     }
     $this->stu_status = $stu_status;
     $cm = new Criteria();
     $cm->add(CounselingTutorPeer::COUNSELING_ID, $counseling->getId());
     $this->counsel_tutors = CounselingTutorPeer::doSelect($cm);
 }