Ejemplo n.º 1
0
 public function executeListSpp()
 {
     $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);
     $cr = new Criteria();
     $cr->add(StudentTypePeer::STUDENT_ID, $student->getId());
     $stu_type = StudentTypePeer::doSelectOne($cr);
     $c = new Criteria();
     $cton1 = $c->getNewCriterion(VAcaCostPeer::ACADEMIC_CALENDAR_ID, $student->getAcademicCalendar()->getChildRecurs(), Criteria::IN);
     $cton2 = $c->getNewCriterion(VAcaCostPeer::CLASS_GROUP_ID, $student->getClassGroup()->getParentRecurs(), Criteria::IN);
     $cton3 = $c->getNewCriterion(VAcaCostPeer::PAYER_CODE, $stu_type->getPayerType()->getCode(), Criteria::IN);
     $cton4 = $c->getNewCriterion(VAcaCostPeer::ACADEMIC_COST_COMPONENT_ID, 13, Criteria::IN);
     $cton3->addAnd($cton4);
     $cton2->addAnd($cton3);
     $cton1->addAnd($cton2);
     $c->add($cton1);
     $ac_cost = VAcaCostPeer::doSelectOne($c);
     $this->forward404Unless($ac_cost);
     $this->payment_student = new PaymentJournal();
     $actions = array(array('name' => 'bayar', 'type' => 'image', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     array_unshift($actions, array('name' => 'return', 'url' => 'student_type/list', 'color' => 'black'));
     $this->actions = $actions;
     $cr = new Criteria();
     $cr->addAscendingOrderByColumn(MonthPeer::ID);
     $this->months = MonthPeer::doSelect($cr);
     $actions3 = array(array('name' => 'filter', 'color' => 'white'));
     $this->actions3 = $actions3;
     $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' => 'sun', 'type' => 'direct'));
     array_push($actions2, array('name' => '<span>Pembayaran Lain-lain</span>', 'url' => 'student_payment/listElse?student_id=' . $student->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Histori Pembayaran</span>', 'url' => 'student_payment/listHistory?student_id=' . $student->getId(), 'color' => 'sky'));
     $this->actions2 = $actions2;
     $this->ac_cost = $ac_cost;
     $this->subtitle = $student->toString();
     $this->student = $student;
 }
Ejemplo n.º 2
0
 public function executeListAbsent()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $counseling_id = $this->getRequestParameter('counseling_id');
     $counseling = CounselingPeer::retrieveByPK($counseling_id);
     $this->forward404Unless($counseling);
     $accal_id = $this->getRequestParameter('accal_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $month_id = $this->getRequestParameter('month_id');
     $title = MonthPeer::retrieveByPK($month_id);
     $this->forward404Unless($title);
     $c = new Criteria();
     $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID);
     $c->add(StudentPeer::STATUS, Student::STATUS_ACTIVE, Criteria::EQUAL);
     $this->sortStudent($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->filterStudent($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('Student', $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();
     $filter_string = "";
     if ($this->filters) {
         foreach ($this->filters as $key => $val) {
             $filter_string .= "&filters[{$key}]={$val}";
         }
         $filter_string = preg_replace('/^&/', '', $filter_string);
     }
     array_unshift($actions, array('name' => 'Print Excel', 'url' => "counseling_sd/listAbsentAsCSV?accal_id=" . $academic_calendar->getId() . "&counseling_id=" . $counseling_id . "&{$filter_string}&month_id=" . $month_id, 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => 'Print PDF', 'url' => "counseling_sd/listAbsentAsPDF?accal_id=" . $academic_calendar->getId() . "&counseling_id=" . $counseling_id . "&{$filter_string}&month_id=" . $month_id, 'color' => 'black', 'type' => 'direct'));
     $this->actions = $actions;
     $bln1 = substr($academic_calendar->getStart(), 5, 2);
     $bln2 = substr($academic_calendar->getEnd(), 5, 2);
     $cw = new Criteria();
     $cton1 = $cw->getNewCriterion(MonthPeer::ID, $bln1, Criteria::GREATER_EQUAL);
     $cton2 = $cw->getNewCriterion(MonthPeer::ID, $bln2, Criteria::LESS_EQUAL);
     $cton1->addAnd($cton2);
     $cw->add($cton1);
     $months = MonthPeer::doSelect($cw);
     $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'counseling_sd/list?academic_calendar_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     foreach ($months as $month) {
         if ($month->getId() == $title->getId()) {
             array_push($actions2, array('name' => '<span>' . $month->getName() . '</span>', 'url' => 'counseling_sd/listAbsent?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId() . '&month_id=' . $month->getId(), 'color' => 'sky', 'type' => 'direct'));
         } else {
             array_push($actions2, array('name' => '<span>' . $month->getName() . '</span>', 'url' => 'counseling_sd/listAbsent?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId() . '&month_id=' . $month->getId(), 'color' => 'sun'));
         }
     }
     $this->actions2 = $actions2;
     $this->counseling = $counseling;
     $this->title = $title;
     $this->month = $title;
     $this->judul = $title->getName();
     $this->tahun = $academic_calendar->getYear();
     $this->subtitle = 'Recapt Absent ' . $title->getName() . ' - ' . $academic_calendar->getYear() . ' # ' . $counseling->getClassGroup()->toString();
     $this->employee_id = $employee_id;
     $this->academic_calendar = $academic_calendar;
     $this->jumHari = cal_days_in_month(CAL_GREGORIAN, $title->getMonth(), $academic_calendar->getYear());
 }
Ejemplo n.º 3
0
 public static function doSelectJoinAllExceptAcademicCalendar(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     AccalPeriodPeer::addSelectColumns($c);
     $startcol2 = AccalPeriodPeer::NUM_COLUMNS - AccalPeriodPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     MonthPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + MonthPeer::NUM_COLUMNS;
     $c->addJoin(AccalPeriodPeer::MONTH_ID, MonthPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = AccalPeriodPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = MonthPeer::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->getMonth();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addAccalPeriod($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initAccalPeriods();
             $obj2->addAccalPeriod($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Ejemplo n.º 4
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = MonthPeer::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->setMonth($arr[$keys[3]]);
     }
 }
Ejemplo n.º 5
0
 public function executeCreate()
 {
     $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;
     $this->payment_student = new PaymentJournal();
     $class_options = array();
     $c = new Criteria();
     $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     $c->add(VClassPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
     $c->addAscendingOrderByColumn(VClassPeer::NAME);
     $accals = VClassPeer::doSelect($c);
     foreach ($accals as $accal) {
         $class_options[$accal->getId()] = $accal->toString();
     }
     $this->class_options = $class_options;
     $this->actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'cancel', 'url' => 'payment_student/list', 'color' => 'black'));
     $this->subtitle = '';
     $this->type = 'add';
     $dept = sfContext::getInstance()->getUser()->getAttribute('department', null, 'bo');
     $depts = $dept->getChildRecurs(array());
     $this->academic_costs = array();
     $c = new Criteria();
     $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $depts, Criteria::IN);
     $c->addJoin(AcademicCalendarPeer::ID, VAcademicCostPeer::ACADEMIC_CALENDAR_ID);
     $costs = VAcademicCostPeer::doSelect($c);
     foreach ($costs as $cost) {
         $academic_costs[$cost->getId()] = $cost->toStringCap();
     }
     $this->academic_costs = $academic_costs;
     $this->students = array();
     $this->selected_student = '';
     $cr = new Criteria();
     $cr->addAscendingOrderByColumn(MonthPeer::ID);
     $this->months = MonthPeer::doSelect($cr);
     $actions2 = array(array('name' => 'filter', 'color' => 'white'));
     $this->actions2 = $actions2;
 }
Ejemplo n.º 6
0
 public function getMonth($con = null)
 {
     include_once 'lib/model/om/BaseMonthPeer.php';
     if ($this->aMonth === null && $this->month_id !== null) {
         $this->aMonth = MonthPeer::retrieveByPK($this->month_id, $con);
     }
     return $this->aMonth;
 }
Ejemplo n.º 7
0
 public function executeListAbsence()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $course_id = $this->getRequestParameter('course_id');
     $course_schedule = CourseSchedulePeer::retrieveByPK($course_id);
     $this->forward404Unless($course_schedule);
     $accal_id = $this->getRequestParameter('accal_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $month_id = $this->getRequestParameter('month_id');
     $title = MonthPeer::retrieveByPK($month_id);
     $this->forward404Unless($title);
     $c = new Criteria();
     $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
     $c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID);
     $c->add(StudentPeer::STATUS, 2, Criteria::NOT_EQUAL);
     $c->add(StudentPeer::STATUS, 3, Criteria::NOT_EQUAL);
     $c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME);
     $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('Student', $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_unshift($actions, array('name' => 'Print Excel', 'url' => "course/listAbsenceAsCSV?accal_id=" . $academic_calendar->getId() . "&course_id=" . $course_schedule->getId() . "&month_id=" . $month_id, 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => 'Print PDF', 'url' => "course/listAbsenceAsPDF?accal_id=" . $academic_calendar->getId() . "&course_id=" . $course_schedule->getId() . "&month_id=" . $month_id, 'color' => 'black', 'type' => 'direct'));
     $this->actions = $actions;
     $bln1 = substr($academic_calendar->getStart(), 5, 2);
     $bln2 = substr($academic_calendar->getEnd(), 5, 2);
     $cw = new Criteria();
     $cton1 = $cw->getNewCriterion(MonthPeer::ID, $bln1, Criteria::GREATER_EQUAL);
     $cton2 = $cw->getNewCriterion(MonthPeer::ID, $bln2, Criteria::LESS_EQUAL);
     $cton1->addAnd($cton2);
     $cw->add($cton1);
     $months = MonthPeer::doSelect($cw);
     if ($course_schedule->getAcademicCalendar()->getCourseModel() == 'A') {
         $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'course/listScore', 'color' => 'sun'));
     } else {
         $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'course/listScore2', 'color' => 'sun'));
     }
     foreach ($months as $month) {
         if ($month->getId() == $title->getId()) {
             array_push($actions2, array('name' => '<span>' . $month->getName() . '</span>', 'url' => 'course/listAbsence?accal_id=' . $academic_calendar->getId() . '&course_id=' . $course_schedule->getId() . "&month_id=" . $month->getId(), 'color' => 'sky', 'type' => 'direct'));
         } else {
             array_push($actions2, array('name' => '<span>' . $month->getName() . '</span>', 'url' => 'course/listAbsence?accal_id=' . $academic_calendar->getId() . '&course_id=' . $course_schedule->getId() . "&month_id=" . $month->getId(), 'color' => 'sun'));
         }
     }
     $this->actions2 = $actions2;
     $this->course_schedule = $course_schedule;
     $this->title = $title;
     $this->month = $title;
     $this->judul = $title->getName();
     $this->tahun = $academic_calendar->getYear();
     $this->subtitle = 'Absensi Bulan ' . $title->getName() . ' - ' . $academic_calendar->getYear() . ' # ' . $course_schedule->getClassGroup()->toString();
     $this->employee_id = $employee_id;
     $this->academic_calendar = $academic_calendar;
     $this->jumHari = cal_days_in_month(CAL_GREGORIAN, $title->getMonth(), $academic_calendar->getYear());
 }
Ejemplo n.º 8
0
 public function executePrintAbsenceXLS()
 {
     $academic_calendar_id = $this->getRequestParameter('academic_calendar_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id);
     $this->forward404Unless($academic_calendar);
     $department_id = $this->getRequestParameter('department_id');
     $department = DepartmentPeer::retrieveByPK($department_id);
     $this->forward404Unless($department);
     $month_id = $this->getRequestParameter('month_id');
     $month = MonthPeer::retrieveByPK($month_id);
     $this->forward404Unless($month);
     $tgl_absen1 = $this->getRequestParameter('tgl_absen1');
     $tgl_absen2 = $this->getRequestParameter('tgl_absen2');
     $time = $this->getRequestParameter('time');
     $time2 = $this->getRequestParameter('time2');
     $tgl_cetak = $this->getRequestParameter('tgl_cetak');
     $cr = new Criteria();
     $cr->add(TempTablePeer::COUNSELING_ID, $academic_calendar->getId());
     $cr->add(TempTablePeer::STUDENT_ID, $department->getId());
     $cr->add(TempTablePeer::TIME, $time);
     $cr->addJoin(EmployeePeer::ID, TempTablePeer::EMPLOYEE_ID);
     $cr->addAscendingOrderByColumn(EmployeePeer::ID);
     $employees = EmployeePeer::doSelect($cr);
     $this->academic_calendar = $academic_calendar;
     $this->department = $department;
     $this->time = $time;
     $this->time2 = $time2;
     $this->tgl_cetak = $tgl_cetak;
     $this->tgl_absen1 = $tgl_absen1;
     $this->tgl_absen2 = $tgl_absen2;
     $this->employees = $employees;
     $this->month = $month;
     $cli = new Criteria();
     $cli->add(EmployeeRegulationPeer::REGULATION_TYPE, EmployeeRegulation::ABSENCE);
     $employ_regulations = EmployeeRegulationPeer::doSelect($cli);
     $groups = array();
     $types = array();
     $alls = array();
     foreach ($employ_regulations as $emp_reg) {
         $groups[$emp_reg->getAcademicCalendarId() . '#' . $emp_reg->getGroups()] = $emp_reg->getId();
         $types[$emp_reg->getAcademicCalendarId() . '#' . $emp_reg->getStaffTypeId()] = $emp_reg->getId();
         $alls[$emp_reg->getAcademicCalendarId() . '#' . $emp_reg->getStaffTypeId() . '#' . $emp_reg->getGroups()] = $emp_reg->getId();
     }
     $this->employ_regulations = $employ_regulations;
     $this->alls = $alls;
     $this->groups = $groups;
     $this->types = $types;
     $this->setLayout(false);
     $this->getResponse()->setHttpHeader('Content-Type', 'application/vnd-ms-excel');
     $this->getResponse()->setHttpHeader('Content-Disposition', 'attachment; filename="' . $this->getModuleName() . '.xls"');
 }
Ejemplo n.º 9
0
 public function executeListDetail()
 {
     $class_id = $this->getRequestParameter('class_group_id');
     $user_id = $this->getRequestParameter('user_id');
     $paid_at = $this->getRequestParameter('paid_at');
     $paid = $this->getRequestParameter('paid');
     $accal_id = $this->getRequestParameter('accal_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $class_group = ClassGroupPeer::retrieveByPK($class_id);
     $this->forward404Unless($class_group);
     $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(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::CLASS_GROUP_ID, $class_id, Criteria::IN);
     $c->addJoin(VSppPeer::STUDENT_ID, StudentAccalPeer::STUDENT_ID);
     $c->add(VSppPeer::USER_ID, $user_id);
     $c->add(VSppPeer::PAID_AT, $paid_at);
     $c->add(VSppPeer::PAID, $paid);
     $this->sort($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->filter($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', 10, 'pay_history'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'pay_history');
     $pager = new sfPropelPager('VSpp', $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_spp/listDetailAsCSV?{$filter_string}&class_group_id=" . $class_id . "&user_id=" . $user_id . "&paid_at=" . $paid_at . "&paid=" . $paid . "&accal_id=" . $accal_id, 'color' => 'white', 'type' => 'direct'));
     array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "history_spp/listDetailAsPDF?{$filter_string}&class_group_id=" . $class_id . "&user_id=" . $user_id . "&paid_at=" . $paid_at . "&paid=" . $paid . "&accal_id=" . $accal_id, 'color' => 'white', 'type' => 'direct'));
     $this->actions = $actions;
     $this->tanggal = $tanggal;
     $this->bln = $bln;
     $this->tahun = $tahun;
     $this->class_id = $class_id;
     $this->accal_id = $accal_id;
     $this->user_id = $user_id;
     $this->paid_at = $paid_at;
     $this->paid = $paid;
     if ($user) {
         $this->subtitle = $class_group->toString() . ' - ' . $user->getLogin() . ' (' . $tanggal . ' ' . $title->getName() . ' ' . $tahun . ')';
     } else {
         $this->subtitle = $class_group->toString() . ' (' . $tanggal . ' ' . $title->getName() . ' ' . $tahun . ')';
     }
 }
Ejemplo n.º 10
0
 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 . ')';
     }
 }
Ejemplo n.º 11
0
 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(MonthPeer::ID, $pks, Criteria::IN);
         $objs = MonthPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Ejemplo n.º 12
0
 public function executeListAbsenceByEmployee()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, 'counseling_menu/listAbsence');
     $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;
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $counseling_id = $this->getRequestParameter('counseling_id');
     $counseling = CounselingPeer::retrieveByPK($counseling_id);
     $this->forward404Unless($counseling);
     $accal_id = $this->getRequestParameter('accal_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $month_id = $this->getRequestParameter('month_id');
     $title = MonthPeer::retrieveByPK($month_id);
     $this->forward404Unless($title);
     $c = new Criteria();
     $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $c->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID);
     $c->addJoin(StudentPeer::ID, VStudentActivePeer::ID);
     $c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME);
     $this->sortStudent($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->filterStudent($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('Student', $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);
     }
     array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "counseling_menu/listAbsenceByEmployeeAsCSV?accal_id=" . $academic_calendar->getId() . "&counseling_id=" . $counseling_id . "&{$filter_string}&month_id=" . $month_id, 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "counseling_menu/listAbsenceByEmployeeAsPDF?accal_id=" . $academic_calendar->getId() . "&counseling_id=" . $counseling_id . "&{$filter_string}&month_id=" . $month_id, 'color' => 'black', 'type' => 'direct'));
     $this->actions = $actions;
     $bln1 = substr($academic_calendar->getStart(), 5, 2);
     $bln2 = substr($academic_calendar->getEnd(), 5, 2);
     $cw = new Criteria();
     $cton1 = $cw->getNewCriterion(MonthPeer::ID, $bln1, Criteria::GREATER_EQUAL);
     $cton2 = $cw->getNewCriterion(MonthPeer::ID, $bln2, Criteria::LESS_EQUAL);
     $cton1->addAnd($cton2);
     $cw->add($cton1);
     $months = MonthPeer::doSelect($cw);
     $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'counseling_menu/listAbsence', 'color' => 'sun'));
     foreach ($months as $month) {
         if ($month->getId() == $title->getId()) {
             array_push($actions2, array('name' => '<span>' . $month->getName() . '</span>', 'url' => 'counseling_menu/listAbsenceByEmployee?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId() . '&month_id=' . $month->getId(), 'color' => 'sky', 'type' => 'direct'));
         } else {
             array_push($actions2, array('name' => '<span>' . $month->getName() . '</span>', 'url' => 'counseling_menu/listAbsenceByEmployee?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId() . '&month_id=' . $month->getId(), 'color' => 'sun'));
         }
     }
     $this->actions2 = $actions2;
     $this->counseling = $counseling;
     $this->title = $title;
     $this->month = $title;
     $this->judul = $title->getName();
     $this->tahun = $academic_calendar->getYear();
     $this->subtitle = 'Absensi Bulan ' . $title->getName() . ' - ' . $academic_calendar->getYear() . ' # ' . $counseling->getClassGroup()->toString();
     $this->employee_id = $employee_id;
     $this->academic_calendar = $academic_calendar;
 }