public function executeEditLastElse() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, 'student_type'); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id')); $this->forward404Unless($student); $payment_student = PaymentJournalPeer::retrieveByPK($this->getRequestParameter('id')); $this->forward404Unless($payment_student); $cr = new Criteria(); $cr->add(StudentTypePeer::STUDENT_ID, $student->getId()); $stu_type = StudentTypePeer::doSelectOne($cr); $this->academic_costs = array(); $c = new Criteria(); $cton1 = $c->getNewCriterion(VAcaCostElsePeer::ACADEMIC_CALENDAR_ID, $student->getAcademicCalendar()->getChildRecurs(), Criteria::IN); $cton2 = $c->getNewCriterion(VAcaCostElsePeer::CLASS_GROUP_ID, $student->getClassGroup()->getParentRecurs(), Criteria::IN); $cton3 = $c->getNewCriterion(VAcaCostElsePeer::PAYER_TYPE_ID, $stu_type->getPayerTypeId(), Criteria::IN); $cton4 = $c->getNewCriterion(VAcaCostElsePeer::PAYER_TYPE_ID, $stu_type->getPayerType()->getParent(), Criteria::IN); $cton5 = $c->getNewCriterion(VAcaCostElsePeer::PAYER_CODE, $stu_type->getPayerType()->getCode(), Criteria::IN); $cton4->addOr($cton5); $cton3->addOr($cton4); $cton2->addAnd($cton3); $cton1->addAnd($cton2); $c->add($cton1); $costs = VAcaCostElsePeer::doSelect($c); foreach ($costs as $cost) { $academic_costs[$cost->getId()] = $cost->getAcademicCostComponent()->toString(); } $this->academic_costs = $academic_costs; $this->payment_student = $payment_student; $this->type = 'edit'; $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' => 'student_payment/deleteElse?id=' . $payment_student->getId() . '&student_id=' . $student->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'student_payment/listElse?student_id=' . $student->getId(), 'color' => 'black')); $this->actions = $actions; $actions2 = array(array('name' => '<span>Daftar Murid</span>', 'url' => 'student_type/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Pembayaran SPP</span>', 'url' => 'student_payment/listSpp?student_id=' . $student->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Pembayaran Lain-lain</span>', 'url' => 'student_payment/listElse?student_id=' . $student->getId(), 'color' => 'sun', 'type' => 'direct')); array_push($actions2, array('name' => '<span>Histori Pembayaran</span>', 'url' => 'student_payment/listHistory?student_id=' . $student->getId(), 'color' => 'sky')); $this->actions2 = $actions2; $this->subtitle = $payment_student->toString(); $this->student = $student; }
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(VAcaCostElsePeer::ID, $pks, Criteria::IN); $objs = VAcaCostElsePeer::doSelect($criteria, $con); } return $objs; }
public function getVAcaCostElses($criteria = null, $con = null) { include_once 'lib/model/om/BaseVAcaCostElsePeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collVAcaCostElses === null) { if ($this->isNew()) { $this->collVAcaCostElses = array(); } else { $criteria->add(VAcaCostElsePeer::PAYER_TYPE_ID, $this->getId()); VAcaCostElsePeer::addSelectColumns($criteria); $this->collVAcaCostElses = VAcaCostElsePeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(VAcaCostElsePeer::PAYER_TYPE_ID, $this->getId()); VAcaCostElsePeer::addSelectColumns($criteria); if (!isset($this->lastVAcaCostElseCriteria) || !$this->lastVAcaCostElseCriteria->equals($criteria)) { $this->collVAcaCostElses = VAcaCostElsePeer::doSelect($criteria, $con); } } } $this->lastVAcaCostElseCriteria = $criteria; return $this->collVAcaCostElses; }