?> <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 $score_rule) { $c = new Criteria(); $c->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $score_rule->getAcademicCalendarId()); $c->add(ScoreRulePeer::CURRICULUM_ID, $score_rule->getCurriculumId()); $c->add(ScoreRulePeer::TYPE, $score_rule->getTypeRule()); $score_rule->child = ScoreRulePeer::doCount($c); ?> <tr id='cs_<?php echo $score_rule->getId(); ?> ' class="list<?php ++$i; if ($i % 2 == 0) { echo ' even'; } ?> "> <td id='cs_<?php echo $score_rule->getId(); ?> _expand' style="vertical-align: middle; text-align: center;">
public function executePreview() { $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; #Copy dari $class1 = $this->getRequestParameter('class1'); $accal1 = $this->getRequestParameter('accal1'); #Copy ke $class2 = $this->getRequestParameter('class2'); $accal2 = $this->getRequestParameter('accal2'); $c = new Criteria(); $c->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $accal1); $c->add(ScoreRulePeer::CLASS_GROUP_ID, $class1); $score_rules = ScoreRulePeer::doSelect($c); $counts = ScoreRulePeer::doCount($c); $actions = array(array('name' => 'copy', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'cancel', 'url' => 'course_sched/copy', 'color' => 'black')); $this->subtitle = ''; $this->type = 'copy'; $this->score_rules = $score_rules; $this->counts = $counts; $this->actions = $actions; $this->class1 = $class1; $this->accal1 = $accal1; $this->class2 = $class2; $this->accal2 = $accal2; $rpp = $this->getRequestParameter('max_per_page', 999); $pager = new sfPropelPager('ScoreRule', $rpp); $pager->setCriteria($c); $pager->setPage($this->getRequestParameter('page', 1)); $pager->init(); $this->pager = $pager; }
public function countScoreRules($criteria = null, $distinct = false, $con = null) { include_once 'lib/model/om/BaseScoreRulePeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } $criteria->add(ScoreRulePeer::CLASS_GROUP_ID, $this->getId()); return ScoreRulePeer::doCount($criteria, $distinct, $con); }