public function executeListUnpaid() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $group = $this->getContext()->getUser()->getAttribute('group', 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_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $class_id = $this->getRequestParameter('class_group_id'); $class_group = ClassGroupPeer::retrieveByPK($class_id); $this->forward404Unless($class_group); $accal_id = $this->getRequestParameter('accal_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id); $this->forward404Unless($academic_calendar); $user_id = $this->getRequestParameter('user_id'); $month = $this->getRequestParameter('month'); $cr = new Criteria(); #$cr->add(VMonthlyPaymentPeer::USER_ID, $user_id); $cr->add(VMonthlyPaymentPeer::MONTH, $month); $cr->add(VMonthlyPaymentPeer::CLASS_GROUP_ID, $class_group->getId()); $cr->add(VMonthlyPaymentPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $payments = VMonthlyPaymentPeer::doSelect($cr); $student_ids = array(); foreach ($payments as $payment) { $student_ids[] = $payment->getStudentId(); } $c = new Criteria(); $c->add(AcademicCalendarPeer::COURSE_MODEL, 'B', Criteria::IN); $c->add(AcademicCalendarPeer::PARENT, $academic_calendar->getId(), Criteria::IN); $c->addJoin(StudentAccalPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID); $c->add(StudentAccalPeer::STUDENT_ID, $student_ids, Criteria::NOT_IN); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $class_group->getId(), Criteria::IN); #$c = new Criteria(); #$c->add(VStudentActivePeer::ID, $student_ids, Criteria::NOT_IN); #$c->add(VStudentActivePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); #$c->add(VStudentActivePeer::CLASS_GROUP_ID, $class_group->getId(), Criteria::IN); $this->sortStudentAccal($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->filterStudentAccal($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student'); $pager = new sfPropelPager('StudentAccal', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student')); $this->getUser()->setAttribute('page', $page, 'student'); $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) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } $this->actions = $actions; $this->class_group = $class_group; $this->academic_calendar = $academic_calendar; $this->user_id = $user_id; $this->month = $month; $this->subtitle = $academic_calendar->toString() . ' # ' . $class_group->toString(); $actions2 = array(array('name' => '<span>Daftar Murid</span>', 'url' => 'history_spp/listStudent?class_group_id=' . $class_group->getId() . '&accal_id=' . $academic_calendar->getId() . '&user_id=' . $user_id . '&month=' . $month, 'color' => 'sky')); array_unshift($actions2, array('name' => '<span>Status Pembayaran SPP</span>', 'url' => 'history_spp/listStatus', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Sudah Bayar SPP</span>', 'url' => 'history_spp/listPaid?class_group_id=' . $class_group->getId() . '&accal_id=' . $academic_calendar->getId() . '&user_id=' . $user_id . '&month=' . $month, 'color' => 'sky')); array_push($actions2, array('name' => '<span>Belum Bayar SPP</span>', 'url' => 'history_spp/listUnpaid?class_group_id=' . $class_group->getId() . '&accal_id=' . $academic_calendar->getId() . '&user_id=' . $user_id . '&month=' . $month, 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; }
public function getVMonthlyPayments($criteria = null, $con = null) { include_once 'lib/model/om/BaseVMonthlyPaymentPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collVMonthlyPayments === null) { if ($this->isNew()) { $this->collVMonthlyPayments = array(); } else { $criteria->add(VMonthlyPaymentPeer::ACADEMIC_COST_ID, $this->getId()); VMonthlyPaymentPeer::addSelectColumns($criteria); $this->collVMonthlyPayments = VMonthlyPaymentPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(VMonthlyPaymentPeer::ACADEMIC_COST_ID, $this->getId()); VMonthlyPaymentPeer::addSelectColumns($criteria); if (!isset($this->lastVMonthlyPaymentCriteria) || !$this->lastVMonthlyPaymentCriteria->equals($criteria)) { $this->collVMonthlyPayments = VMonthlyPaymentPeer::doSelect($criteria, $con); } } } $this->lastVMonthlyPaymentCriteria = $criteria; return $this->collVMonthlyPayments; }
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(VMonthlyPaymentPeer::ID, $pks, Criteria::IN); $objs = VMonthlyPaymentPeer::doSelect($criteria, $con); } return $objs; }