public static function doFilter() { $criteria = new Criteria(); $criteria->add(AcademicCostComponentPeer::ID, 11, Criteria::NOT_IN); $criteria->add(AcademicCostComponentPeer::ID, 13, Criteria::NOT_IN); $criteria->add(AcademicCostComponentPeer::ID, 14, Criteria::NOT_IN); $criteria->add(AcademicCostComponentPeer::ID, 15, Criteria::NOT_IN); return AcademicCostComponentPeer::doSelect($criteria); }
public function getAcademicCostComponent($con = null) { include_once 'lib/model/om/BaseAcademicCostComponentPeer.php'; if ($this->aAcademicCostComponent === null && $this->academic_cost_component_id !== null) { $this->aAcademicCostComponent = AcademicCostComponentPeer::retrieveByPK($this->academic_cost_component_id, $con); } return $this->aAcademicCostComponent; }
public static function doSelectJoinAllExceptBankAccount(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } VAcademicCostTaPeer::addSelectColumns($c); $startcol2 = VAcademicCostTaPeer::NUM_COLUMNS - VAcademicCostTaPeer::NUM_LAZY_LOAD_COLUMNS + 1; AcademicCalendarPeer::addSelectColumns($c); $startcol3 = $startcol2 + AcademicCalendarPeer::NUM_COLUMNS; AcademicCostComponentPeer::addSelectColumns($c); $startcol4 = $startcol3 + AcademicCostComponentPeer::NUM_COLUMNS; AcademicProcessPeer::addSelectColumns($c); $startcol5 = $startcol4 + AcademicProcessPeer::NUM_COLUMNS; $c->addJoin(VAcademicCostTaPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID); $c->addJoin(VAcademicCostTaPeer::ACADEMIC_COST_COMPONENT_ID, AcademicCostComponentPeer::ID); $c->addJoin(VAcademicCostTaPeer::ACADEMIC_PROCESS_ID, AcademicProcessPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = VAcademicCostTaPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = AcademicCalendarPeer::getOMClass(); $cls = Propel::import($omClass); $obj2 = new $cls(); $obj2->hydrate($rs, $startcol2); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj2 = $temp_obj1->getAcademicCalendar(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addVAcademicCostTa($obj1); break; } } if ($newObject) { $obj2->initVAcademicCostTas(); $obj2->addVAcademicCostTa($obj1); } $omClass = AcademicCostComponentPeer::getOMClass(); $cls = Propel::import($omClass); $obj3 = new $cls(); $obj3->hydrate($rs, $startcol3); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj3 = $temp_obj1->getAcademicCostComponent(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addVAcademicCostTa($obj1); break; } } if ($newObject) { $obj3->initVAcademicCostTas(); $obj3->addVAcademicCostTa($obj1); } $omClass = AcademicProcessPeer::getOMClass(); $cls = Propel::import($omClass); $obj4 = new $cls(); $obj4->hydrate($rs, $startcol4); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj4 = $temp_obj1->getAcademicProcess(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addVAcademicCostTa($obj1); break; } } if ($newObject) { $obj4->initVAcademicCostTas(); $obj4->addVAcademicCostTa($obj1); } $results[] = $obj1; } return $results; }
public function filterStudent($c, $filters) { $filters_key = array_keys($filters); foreach ($filters_key as $key) { $value = $filters[$key]; if ($value == '' || $value == null) { continue; } if ($key == 'DEPARTMENT_ID') { $c->addJoin(AcademicCalendarPeer::ID, StudentPeer::ACADEMIC_CALENDAR_ID); $c->addJoin(DepartmentPeer::ID, AcademicCalendarPeer::DEPARTMENT_ID); $column = DepartmentPeer::getTableMap()->getColumn('ID'); } elseif ($key == 'CLASS_NAME') { $c->addJoin(ClassGroupPeer::ID, StudentPeer::CLASS_GROUP_ID); $column = ClassGroupPeer::getTableMap()->getColumn('NAME'); } elseif ($key == 'ACADEMIC_COST_COMPONENT_ID') { $c->addJoin(PaymentJournalPeer::PAYER, StudentPeer::ID); $c->addJoin(AcademicCostPeer::ID, PaymentJournalPeer::ACADEMIC_COST_ID); $c->addJoin(AcademicCostComponentPeer::ID, AcademicCostPeer::ACADEMIC_COST_COMPONENT_ID); $column = AcademicCostComponentPeer::getTableMap()->getColumn('ID'); } elseif ($key == 'PAID_AT') { $c->addJoin(PaymentJournalPeer::PAYER, StudentPeer::ID); $column = PaymentJournalPeer::getTableMap()->getColumn('PAID_AT'); } elseif ($key == 'STATUS') { $c->addJoin(PaymentJournalPeer::PAYER, StudentPeer::ID); $column = PaymentJournalPeer::getTableMap()->getColumn('STATUS'); } elseif ($key == 'PAYMENT_MODEL_ID') { $c->addJoin(PaymentJournalPeer::PAYER, StudentPeer::ID); $c->addJoin(PaymentModelPeer::ID, PaymentJournalPeer::PAYMENT_MODEL_ID); $column = PaymentModelPeer::getTableMap()->getColumn('ID'); } else { $column = StudentPeer::getTableMap()->getColumn($key); } $name = $column->getFullyQualifiedName(); $creoleType = $column->getCreoleType(); if ($creoleType == CreoleTypes::TIMESTAMP) { $c->add($name, $value, Criteria::EQUAL); } else { if ($creoleType == CreoleTypes::DATE) { $c->add($name, $value, Criteria::EQUAL); } else { if ($creoleType == CreoleTypes::INTEGER) { if ($name == StudentPeer::CLASS_GROUP_ID) { $cg = ClassGroupPeer::retrieveByPK($value); $c->add($name, $cg->getChildRecurs(), Criteria::IN); } else { $c->add($name, $value, Criteria::EQUAL); } } else { if ($creoleType == CreoleTypes::VARCHAR || $creoleType == CreoleTypes::CHAR) { $c->add($name, "%{$value}%", Criteria::LIKE); } } } } } }
public static function doSelectJoinAllExceptAcademicCalendar(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } VSppPeer::addSelectColumns($c); $startcol2 = VSppPeer::NUM_COLUMNS - VSppPeer::NUM_LAZY_LOAD_COLUMNS + 1; StudentPeer::addSelectColumns($c); $startcol3 = $startcol2 + StudentPeer::NUM_COLUMNS; AcademicCostPeer::addSelectColumns($c); $startcol4 = $startcol3 + AcademicCostPeer::NUM_COLUMNS; UserPeer::addSelectColumns($c); $startcol5 = $startcol4 + UserPeer::NUM_COLUMNS; AcademicProcessPeer::addSelectColumns($c); $startcol6 = $startcol5 + AcademicProcessPeer::NUM_COLUMNS; PaymentModelPeer::addSelectColumns($c); $startcol7 = $startcol6 + PaymentModelPeer::NUM_COLUMNS; TransactionStatusPeer::addSelectColumns($c); $startcol8 = $startcol7 + TransactionStatusPeer::NUM_COLUMNS; AcademicCostComponentPeer::addSelectColumns($c); $startcol9 = $startcol8 + AcademicCostComponentPeer::NUM_COLUMNS; $c->addJoin(VSppPeer::STUDENT_ID, StudentPeer::ID); $c->addJoin(VSppPeer::ACADEMIC_COST_ID, AcademicCostPeer::ID); $c->addJoin(VSppPeer::USER_ID, UserPeer::ID); $c->addJoin(VSppPeer::ACADEMIC_PROCESS_ID, AcademicProcessPeer::ID); $c->addJoin(VSppPeer::PAYMENT_MODEL_ID, PaymentModelPeer::ID); $c->addJoin(VSppPeer::TRANSACTION_STATUS_ID, TransactionStatusPeer::ID); $c->addJoin(VSppPeer::ACADEMIC_COST_COMPONENT_ID, AcademicCostComponentPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = VSppPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = StudentPeer::getOMClass(); $cls = Propel::import($omClass); $obj2 = new $cls(); $obj2->hydrate($rs, $startcol2); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj2 = $temp_obj1->getStudent(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addVSpp($obj1); break; } } if ($newObject) { $obj2->initVSpps(); $obj2->addVSpp($obj1); } $omClass = AcademicCostPeer::getOMClass(); $cls = Propel::import($omClass); $obj3 = new $cls(); $obj3->hydrate($rs, $startcol3); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj3 = $temp_obj1->getAcademicCost(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addVSpp($obj1); break; } } if ($newObject) { $obj3->initVSpps(); $obj3->addVSpp($obj1); } $omClass = UserPeer::getOMClass(); $cls = Propel::import($omClass); $obj4 = new $cls(); $obj4->hydrate($rs, $startcol4); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj4 = $temp_obj1->getUser(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addVSpp($obj1); break; } } if ($newObject) { $obj4->initVSpps(); $obj4->addVSpp($obj1); } $omClass = AcademicProcessPeer::getOMClass(); $cls = Propel::import($omClass); $obj5 = new $cls(); $obj5->hydrate($rs, $startcol5); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj5 = $temp_obj1->getAcademicProcess(); if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) { $newObject = false; $temp_obj5->addVSpp($obj1); break; } } if ($newObject) { $obj5->initVSpps(); $obj5->addVSpp($obj1); } $omClass = PaymentModelPeer::getOMClass(); $cls = Propel::import($omClass); $obj6 = new $cls(); $obj6->hydrate($rs, $startcol6); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj6 = $temp_obj1->getPaymentModel(); if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) { $newObject = false; $temp_obj6->addVSpp($obj1); break; } } if ($newObject) { $obj6->initVSpps(); $obj6->addVSpp($obj1); } $omClass = TransactionStatusPeer::getOMClass(); $cls = Propel::import($omClass); $obj7 = new $cls(); $obj7->hydrate($rs, $startcol7); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj7 = $temp_obj1->getTransactionStatus(); if ($temp_obj7->getPrimaryKey() === $obj7->getPrimaryKey()) { $newObject = false; $temp_obj7->addVSpp($obj1); break; } } if ($newObject) { $obj7->initVSpps(); $obj7->addVSpp($obj1); } $omClass = AcademicCostComponentPeer::getOMClass(); $cls = Propel::import($omClass); $obj8 = new $cls(); $obj8->hydrate($rs, $startcol8); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj8 = $temp_obj1->getAcademicCostComponent(); if ($temp_obj8->getPrimaryKey() === $obj8->getPrimaryKey()) { $newObject = false; $temp_obj8->addVSpp($obj1); break; } } if ($newObject) { $obj8->initVSpps(); $obj8->addVSpp($obj1); } $results[] = $obj1; } return $results; }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = AcademicCostComponentPeer::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->setName($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setUnit($arr[$keys[3]]); } }
public function executeDelete() { $academic_cost_component = AcademicCostComponentPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($academic_cost_component); $ref_error = 0; foreach ($academic_cost_component->getRefCountMethods() as $ref) { $method = "count" . $ref['affix']; $count = $academic_cost_component->{$method}(); if ($count > 0) { ++$ref_error; $this->getRequest()->setError('academic_cost_component/delete/' . sfInflector::camelize($ref['table']), $count); } } if ($ref_error > 0) { $this->getRequest()->setError('academic_cost_component/delete', '_ERR_DELETE_ (' . $academic_cost_component->toString() . ' - id:' . $academic_cost_component->getId() . ')'); } else { $academic_cost_component->delete(); } return $this->forward('academic_cost_component', 'list'); }
public static function doSelectJoinAllExceptNgApplicantCategory(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } NgRegPeriodRulePeer::addSelectColumns($c); $startcol2 = NgRegPeriodRulePeer::NUM_COLUMNS - NgRegPeriodRulePeer::NUM_LAZY_LOAD_COLUMNS + 1; NgRegPeriodPeer::addSelectColumns($c); $startcol3 = $startcol2 + NgRegPeriodPeer::NUM_COLUMNS; AcademicCostComponentPeer::addSelectColumns($c); $startcol4 = $startcol3 + AcademicCostComponentPeer::NUM_COLUMNS; JobTypePeer::addSelectColumns($c); $startcol5 = $startcol4 + JobTypePeer::NUM_COLUMNS; $c->addJoin(NgRegPeriodRulePeer::NG_REG_PERIOD_ID, NgRegPeriodPeer::ID); $c->addJoin(NgRegPeriodRulePeer::ACADEMIC_COST_COMPONENT_ID, AcademicCostComponentPeer::ID); $c->addJoin(NgRegPeriodRulePeer::JOB_TYPE_ID, JobTypePeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = NgRegPeriodRulePeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = NgRegPeriodPeer::getOMClass(); $cls = Propel::import($omClass); $obj2 = new $cls(); $obj2->hydrate($rs, $startcol2); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj2 = $temp_obj1->getNgRegPeriod(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addNgRegPeriodRule($obj1); break; } } if ($newObject) { $obj2->initNgRegPeriodRules(); $obj2->addNgRegPeriodRule($obj1); } $omClass = AcademicCostComponentPeer::getOMClass(); $cls = Propel::import($omClass); $obj3 = new $cls(); $obj3->hydrate($rs, $startcol3); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj3 = $temp_obj1->getAcademicCostComponent(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addNgRegPeriodRule($obj1); break; } } if ($newObject) { $obj3->initNgRegPeriodRules(); $obj3->addNgRegPeriodRule($obj1); } $omClass = JobTypePeer::getOMClass(); $cls = Propel::import($omClass); $obj4 = new $cls(); $obj4->hydrate($rs, $startcol4); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj4 = $temp_obj1->getJobType(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addNgRegPeriodRule($obj1); break; } } if ($newObject) { $obj4->initNgRegPeriodRules(); $obj4->addNgRegPeriodRule($obj1); } $results[] = $obj1; } return $results; }
public function executeListDetail() { $cost_id = $this->getRequestParameter('academic_cost_component_id'); $user_id = $this->getRequestParameter('user_id'); $paid_at = $this->getRequestParameter('paid_at'); $academic_cost_component = AcademicCostComponentPeer::retrieveByPK($cost_id); $this->forward404Unless($academic_cost_component); $user = UserPeer::retrieveByPK($user_id); $this->forward404Unless($user); $tanggal = substr($paid_at, 8, 2); $bln = substr($paid_at, 5, 2); $tahun = substr($paid_at, 0, 4); $title = MonthPeer::retrieveByPK($bln); $this->forward404Unless($title); $c = new Criteria(); $c->add(VInfaqPaymentPeer::USER_ID, $user_id); $c->add(VInfaqPaymentPeer::PAID_AT, $paid_at); $c->add(VInfaqPaymentPeer::ACADEMIC_COST_COMPONENT_ID, $academic_cost_component->getId()); $this->sortPayment($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filterPayment($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', 50, 'pay_history')); $this->getUser()->setAttribute('max_per_page', $rpp, 'pay_history'); $pager = new sfPropelPager('VInfaqPayment', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'pay_history')); $this->getUser()->setAttribute('page', $page, 'pay_history'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { if ($key == 'PAID_AT') { $filter_string .= "&filters[{$key}][from]=" . $val['from']; $filter_string .= "&filters[{$key}][to]=" . $val['to']; } else { if ($val != '' && $val != null) { $filter_string .= "&filters[{$key}]={$val}"; } } } $filter_string = preg_replace('/^&/', '', $filter_string); } array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "history_applicant/listDetailAsCSV?{$filter_string}&academic_cost_component_id=" . $cost_id . "&user_id=" . $user_id . "&paid_at=" . $paid_at, 'color' => 'white', 'type' => 'direct')); array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "history_applicant/listDetailAsPDF?{$filter_string}&academic_cost_component_id=" . $cost_id . "&user_id=" . $user_id . "&paid_at=" . $paid_at, 'color' => 'white', 'type' => 'direct')); $this->actions = $actions; $this->tanggal = $tanggal; $this->bln = $bln; $this->tahun = $tahun; $this->cost_id = $cost_id; $this->user_id = $user_id; $this->paid_at = $paid_at; if ($user) { $this->subtitle = $academic_cost_component->toString() . ' - ' . $user->getLogin() . ' (' . $tanggal . ' ' . $title->getName() . ' ' . $tahun . ')'; } else { $this->subtitle = $academic_cost_component->toString() . ' (' . $tanggal . ' ' . $title->getName() . ' ' . $tahun . ')'; } }
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(AcademicCostComponentPeer::ID, $pks, Criteria::IN); $objs = AcademicCostComponentPeer::doSelect($criteria, $con); } return $objs; }