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;
 }
Exemple #2
0
 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;
 }
Exemple #3
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = VAcaCostElsePeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setCode($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setAmount($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setPayerTypeId($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setAcademicCalendarId($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setAcademicCostComponentId($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setAcademicProcessId($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setBankAccountId($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setClassGroupId($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setDescription($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setPayerCode($arr[$keys[10]]);
     }
 }
Exemple #4
0
 public function getVAcaCostElsesJoinClassGroup($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());
             $this->collVAcaCostElses = VAcaCostElsePeer::doSelectJoinClassGroup($criteria, $con);
         }
     } else {
         $criteria->add(VAcaCostElsePeer::PAYER_TYPE_ID, $this->getId());
         if (!isset($this->lastVAcaCostElseCriteria) || !$this->lastVAcaCostElseCriteria->equals($criteria)) {
             $this->collVAcaCostElses = VAcaCostElsePeer::doSelectJoinClassGroup($criteria, $con);
         }
     }
     $this->lastVAcaCostElseCriteria = $criteria;
     return $this->collVAcaCostElses;
 }