コード例 #1
0
ファイル: actions.class.php プロジェクト: taryono/school
 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;
 }
コード例 #2
0
ファイル: actions.class.php プロジェクト: taryono/school
 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());
 }
コード例 #3
0
ファイル: actions.class.php プロジェクト: taryono/school
 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;
 }
コード例 #4
0
ファイル: actions.class.php プロジェクト: taryono/school
 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());
 }
コード例 #5
0
ファイル: BaseMonthPeer.php プロジェクト: taryono/school
 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;
 }
コード例 #6
0
ファイル: actions.class.php プロジェクト: taryono/school
 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;
 }