Example #1
0
       		</td>
    	</tr>
    	<tr>
       		<td style="vertical-align:top;"><label><?php 
echo __('Jadwal');
?>
</label></td>
       		<td style="text-align:center; vertical-align:top;">:</td>
	   	<td style="vertical-align:top;">
       			<p class="detail" style="font-weight: bold;">
       			<?php 
$c = new Criteria();
$c->add(CourseScheduleDetailPeer::COURSE_SCHEDULE_ID, $course_schedule->getId());
$c->addDescendingOrderByColumn(CourseScheduleDetailPeer::ID);
$cs_details = CourseScheduleDetailPeer::doSelect($c);
$course_details = CourseScheduleDetailPeer::doCount($c);
if ($course_details < 1) {
    echo '-';
} else {
    foreach ($cs_details as $detail) {
        echo '&middot;' . $detail->getDayString() . ' - ' . $detail->getLocation()->toString() . ' <br> <font style="color: #017FC0;">(' . $detail->getClassSession()->getBegin() . ' - ' . $detail->getClassSession()->getEnd() . ')</font><br>';
    }
}
?>
       			</p>
       		</td>
    	</tr>
</tbody>
</table>
</td></tr></table></td>
        echo __('Class group');
        ?>
</th>
                                                                </tr>
                                                            </thead>
                                                            <tbody>
                                                                <?php 
        $i = 0;
        foreach ($pager->getResults() as $course) {
            ?>
                                                                <?php 
            $c = new Criteria();
            $c->add(CourseScheduleDetailPeer::DAY, $cs_schedule->getDay());
            $c->add(CourseScheduleDetailPeer::ID, $course->getId());
            $c_scheds = CourseScheduleDetailPeer::doSelect($c);
            $sched_count = CourseScheduleDetailPeer::doCount($c);
            ?>
                                                                <?php 
            $j = 0;
            foreach ($c_scheds as $c_sched) {
                ?>
                                                                        <tr class="list<?php 
                ++$j;
                if ($j % 2 == 0) {
                    echo ' even';
                }
                ?>
">
                                                                            <td class='first'><?php 
                echo $c_sched->getClassSession() ? $c_sched->getClassSession()->getBegin() : '-';
                ?>
Example #3
0
 public function executeEdit()
 {
     $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;
     $course_schedule = CourseSchedulePeer::retrieveByPK($this->getRequestParameter('id'));
     $this->forward404Unless($course_schedule);
     $this->subtitle = $course_schedule->getClassGroup()->getName() . ' - ' . $course_schedule->getSubjectCurr()->getSubject()->getName() . ' (id:' . $course_schedule->getId() . ')';
     $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     if ($acl->getRemovePriv()) {
         array_push($actions, array('name' => 'delete', 'url' => 'course_sched/delete?id=' . $course_schedule->getId(), 'color' => 'red'));
     }
     array_push($actions, array('name' => 'cancel', 'url' => 'course_sched/list', 'color' => 'black'));
     $this->type = 'edit';
     $this->course_schedule = $course_schedule;
     $this->actions = $actions;
     $curr = CurriculumPeer::retrieveByPK($course_schedule->getSubjectCurr()->getCurriculumId());
     $this->curr = $curr;
     $subject_curriculums = $curr->getSubjectCurrs();
     $subject_ids = array();
     foreach ($subject_curriculums as $subject_curriculum) {
         $subject_ids[$subject_curriculum->getId()] = $subject_curriculum->getSubject()->getName();
     }
     $this->subject_ids = $subject_ids;
     $this->subject_currs = $subject_ids;
     $this->selected_subject_curr = $course_schedule->getSubjectCurr()->getSubjectId();
     $subject_id = $course_schedule->getSubjectCurr()->getSubjectId();
     $c = new Criteria();
     $c->add(CourseScheduleTutorPeer::COURSE_SCHEDULE_ID, $course_schedule->getId());
     $c->addJoin(CourseScheduleTutorPeer::EMPLOYEE_ID, TeachingCompetencyPeer::EMPLOYEE_ID);
     $c->addJoin(TeachingCompetencyPeer::EMPLOYEE_ID, EmployeePeer::ID);
     $objs = EmployeePeer::doSelect($c);
     $employee_ids = array();
     foreach ($objs as $o) {
         $employee_ids[] = $o->getId();
     }
     $c = new Criteria();
     $c->add(TeachingCompetencyPeer::SUBJECT_ID, $subject_id, Criteria::IN);
     $c->add(TeachingCompetencyPeer::EMPLOYEE_ID, $employee_ids, Criteria::NOT_IN);
     $c->addJoin(TeachingCompetencyPeer::EMPLOYEE_ID, EmployeePeer::ID);
     $c->addAscendingOrderByColumn(EmployeePeer::NAME);
     $lectors = EmployeePeer::doSelect($c);
     $this->lectors = $lectors;
     $cw = new Criteria();
     $cw->add(CourseScheduleDetailPeer::COURSE_SCHEDULE_ID, $course_schedule->getId());
     $cw->addAscendingOrderByColumn(CourseScheduleDetailPeer::DAY);
     $rows = CourseScheduleDetailPeer::doSelect($cw);
     $row_count = CourseScheduleDetailPeer::doCount($cw);
     $actions3 = array();
     array_unshift($actions3, array('name' => 'add', 'url' => 'course_sched/createSchedule?id=' . $course_schedule->getId(), 'color' => 'black'));
     $this->actions3 = $actions3;
     $this->rows = $rows;
     $this->row_count = $row_count;
 }
Example #4
0
 public function countCourseScheduleDetails($criteria = null, $distinct = false, $con = null)
 {
     include_once 'lib/model/om/BaseCourseScheduleDetailPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     $criteria->add(CourseScheduleDetailPeer::CLASS_SESSION_ID, $this->getId());
     return CourseScheduleDetailPeer::doCount($criteria, $distinct, $con);
 }
Example #5
0
                            <?php 
if ($pager->getNbResults() < 1) {
    ?>
                                    <tr class="list"><td colspan="100"><div class="no_record"><?php 
    echo __('No record found');
    ?>
</div></td></tr>
                            <?php 
} else {
    ?>
                                    <?php 
    $i = 0;
    foreach ($pager->getResults() as $course_schedule) {
        $c = new Criteria();
        $c->add(CourseScheduleDetailPeer::COURSE_SCHEDULE_ID, $course_schedule->getId());
        $course_schedule->child = CourseScheduleDetailPeer::doCount($c);
        ?>
                                            <tr id='cs_<?php 
        echo $course_schedule->getId();
        ?>
' class="list<?php 
        ++$i;
        if ($i % 2 == 0) {
            echo ' even';
        }
        ?>
">
                                                    <td id='cs_<?php 
        echo $course_schedule->getId();
        ?>
_expand' style="vertical-align: middle; text-align: center;">