Beispiel #1
0
 public function executeEmailExpirationNotice(sfWebRequest $request)
 {
     $notices = $request->getParameter('expired');
     $mail_count = 0;
     // prepare swift mailer
     require_once sfConfig::get('sf_lib_dir') . '/vendor/swift/swift_required.php';
     # needed due to symfony autoloader
     $mailer = Swift_Mailer::newInstance(Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -t'));
     foreach ($notices as $emp_id => $notices) {
         $employee = EmployeePeer::retrieveByPK($emp_id);
         if ($employee) {
             foreach ($notices as $notice => $expired) {
                 // queue an email of type $notice with this $employee's info
                 switch ($notice) {
                     case 'tb_date':
                         $type = 'Tb';
                         break;
                     case 'physical_date':
                         $type = 'Physical';
                         break;
                 }
                 $mailBody = $this->getPartial('employee/emailExpired' . $type, array('name' => $employee->getFullname(), 'expiration' => $expired));
                 $to_address = $employee->getCompanyEmail() ? $employee->getCompanyEmail() : $employee->getPersonalEmail();
                 $message = Swift_Message::newInstance('Expired ' . $type . ' Notice')->setFrom(array('*****@*****.**' => 'North Country Kids, Inc.'))->setTo(array($to_address, '*****@*****.**'))->setBody($mailBody, 'text/html');
                 // queue it up
                 $mailer->send($message);
                 $mail_count++;
             }
         }
     }
     return $this->renderText($mail_count . ' messages have been sent.');
 }
Beispiel #2
0
 public function executeByEmployee()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $c = new Criteria();
     $cton1 = $c->getNewCriterion(InboxPeer::EMPLOYEE_ID, $employee_id, Criteria::IN);
     $cton2 = $c->getNewCriterion(InboxPeer::TYPE, 1, Criteria::IN);
     $cton1->addAnd($cton2);
     $c->add($cton1);
     $c->addDescendingOrderByColumn(InboxPeer::SUBJECT);
     $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', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'outbox'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'outbox');
     $pager = new sfPropelPager('Inbox', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'outbox'));
     $this->getUser()->setAttribute('page', $page, 'outbox');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     $this->actions = $actions;
     $this->subtitle = $employee->toString();
     $this->employee_id = $employee_id;
 }
 public function configure()
 {
     unset($this['note_entry_id']);
     $this->widgetSchema['delete'] = new sfWidgetFormInputHidden(array('default' => '0'));
     $this->validatorSchema['delete'] = new sfValidatorBoolean();
     $employee = EmployeePeer::retrieveByPK($this->getOption('employee_id'));
     $c = new Criteria();
     $c->add(AreaOfConcernPeer::JOB_ID, $employee->getJobId());
     // if job_id = special instruction (7), they also need to see speech (8)
     if ($employee->getJobId() == 7) {
         $c->addOr(AreaOfConcernPeer::JOB_ID, 8);
     }
     $this->widgetSchema['area_of_concern_id']->setOption('criteria', $c);
     $c = new Criteria();
     $c->add(PromptPeer::ID, 44, Criteria::GREATER_EQUAL);
     $this->widgetSchema['prompt_id']->setOption('criteria', $c);
     $this->widgetSchema['accuracy'] = new sfWidgetFormSelect(array('choices' => EntryConcernPeer::getAccuracyChoices()));
     $this->widgetSchema->setLabels(array('area_of_concern_id' => 'Area of concern', 'objective_id' => 'Objective', 'prompt_id' => 'Prompt', 'level_id' => 'Level', 'accuracy' => 'Accuracy'));
 }
Beispiel #4
0
 public function executeListByEmployee()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $c = new Criteria();
     $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     $c->add(CurriculumPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
     $c->addJoin(SubjectCurrPeer::CURRICULUM_ID, CurriculumPeer::ID);
     $c->addDescendingOrderByColumn(SubjectCurrPeer::ID);
     $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', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'subject_curriculum'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'subject_curriculum');
     $pager = new sfPropelPager('SubjectCurr', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'subject_curriculum'));
     $this->getUser()->setAttribute('page', $page, 'subject_curriculum');
     $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->subtitle = $employee->toString();
 }
Beispiel #5
0
 public function executeListSummary()
 {
     $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);
     $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/listSummaryAsCSVSD?counseling_id=" . $counseling_id . "&accal_id=" . $academic_calendar->getId() . "&{$filter_string}", 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => 'Print PDF', 'url' => "counseling_sd/listSummaryAsPDF?counseling_id=" . $counseling_id . "&accal_id=" . $academic_calendar->getId() . "&{$filter_string}", 'color' => 'black', 'type' => 'direct'));
     $this->actions = $actions;
     $actions2 = array(array('name' => '<span>Wali Kelas (2013)</span>', 'url' => 'counseling_sd/list?academic_calendar_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Ledger Penilaian (Ringkasan Penilaian)</span>', 'url' => 'counseling_sd/listSummary?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sky', 'type' => 'direct'));
     array_push($actions2, array('name' => '<span>Ledger Penilaian KI.1 (Ringkasan Penilaian)</span>', 'url' => 'counseling_sd/listSummary?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Ledger Penilaian KI.2 (Ringkasan Penilaian)</span>', 'url' => 'counseling_sd/listSummary?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun'));
     $this->actions2 = $actions2;
     ## Criterria Score Rule
     $ct = new Criteria();
     $ct->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getDepartmentId());
     $ct->add(ScoreRulePeer::CLASS_TYPE_ID, $counseling->getClassTypeId());
     $ct->add(ScoreRulePeer::CURRICULUM_ID, $academic_calendar->getCurriculumId());
     $ct->add(ScoreRulePeer::TYPE, ScoreRule::TYPE_TWO);
     $score_rule = ScoreRulePeer::doSelectOne($ct);
     $cm = new Criteria();
     $cm->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $cm->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $course_scheds = VCoursePeer::doSelect($cm);
     $subject_ids = array();
     foreach ($course_scheds as $course_sched) {
         $subject_ids[] = $course_sched->getSubjectCurrId();
     }
     $cc = new Criteria();
     $cc->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN);
     $cc->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId());
     ##Sort Option
     $cc->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
     $course_schedules = ScoreRuleSubjectPeer::doSelect($cc);
     $course_count = ScoreRuleSubjectPeer::doCount($cc);
     $this->course_count = $course_count;
     $this->course_schedules = $course_schedules;
     $this->score_rule = $score_rule;
     $this->counseling = $counseling;
     $this->subtitle = $academic_calendar->toString() . ' # ' . $counseling->getClassGroup()->toString();
     $this->employee_id = $employee_id;
     $this->academic_calendar = $academic_calendar;
 }
Beispiel #6
0
 public function executeListLeave()
 {
     $employee_id = $this->getRequestParameter('employee_id');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $accal_id = $this->getRequestParameter('academic_calendar_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $c = new Criteria();
     $c->add(EmployeePermitPeer::EMPLOYEE_ID, $employee->getId(), Criteria::IN);
     $c->add(EmployeePermitPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $this->sortPermit($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->filterPermit($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'employee_permit'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'employee_permit');
     $pager = new sfPropelPager('EmployeePermit', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'employee_permit'));
     $this->getUser()->setAttribute('page', $page, 'employee_permit');
     $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' => "employee_permit_recapt/listLeaveAsCSV?{$filter_string}&employee_id=" . $employee->getId() . "&academic_calendar_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => 'Print PDF', 'url' => "employee_permit_recapt/listLeaveAsPDF?{$filter_string}&employee_id=" . $employee->getId() . "&academic_calendar_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct'));
     $this->actions = $actions;
     $this->subtitle = $employee->toString();
     $this->employee = $employee;
     $this->academic_calendar = $academic_calendar;
     $actions2 = array(array('name' => '<span>Rekap Cuti</span>', 'url' => 'employee_permit_recapt/list', 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Detail Cuti</span>', 'url' => 'employee_permit_recapt/listLeave?employee_id=' . $employee->getId() . '&academic_calendar_id=' . $academic_calendar->getId(), 'color' => 'sun', 'type' => 'direct'));
     $this->actions2 = $actions2;
 }
Beispiel #7
0
 public function executeSave()
 {
     $i18n = new sfI18N();
     $i18n->initialize($this->getContext());
     $i18n->setCulture($this->getUser()->getCulture());
     $action_i18n = $i18n->globalMessageFormat->format('save as new');
     $action_type = $this->getRequestParameter('action_type');
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     if ($action_type == $action_i18n || !$this->getRequestParameter('id')) {
         $class_agenda = new ClassAgenda();
     } else {
         $class_agenda = ClassAgendaPeer::retrieveByPk($this->getRequestParameter('id'));
         $this->forward404Unless($class_agenda);
     }
     $class_agenda->setId($this->getRequestParameter('id'));
     $class_agenda->setCourseScheduleId($this->getRequestParameter('course_schedule_id'));
     $class_agenda->setDetail($this->getRequestParameter('detail'));
     if ($this->getRequestParameter('date')) {
         $class_agenda->setDate($this->getRequestParameter('date'));
     }
     $class_agenda->setStatus($this->getRequestParameter('status'));
     $class_agenda->setSubjectGradingId($this->getRequestParameter('subject_grading_id'));
     $class_agenda->setMeetingPoint($this->getRequestParameter('meeting_point'));
     $class_agenda->setActionType($this->getRequestParameter('action_type'));
     $class_agenda->setDay($this->getRequestParameter('day'));
     if ($this->getRequestParameter('class_group_id')) {
         $class_agenda->setClassGroupId($this->getRequestParameter('class_group_id'));
     } else {
         $cs = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_schedule_id'));
         $this->forward404Unless($cs);
         $class_agenda->setClassGroupId($cs->getClassGroupId());
     }
     $class_agenda->setDescription($this->getRequestParameter('description'));
     $class_agenda->save();
     #$params = array();
     #foreach (explode('&', $this->getRequestParameter('student_list_ser')) as $p) {
     #	$p = explode('=', $p);
     #	$params[rawurldecode($p[0])][] = rawurldecode($p[1]);
     #}
     #if (array_key_exists('students', $params)) {
     #	foreach ($params['students'] as $su_id) {
     #		$student_absence = new StudentAbsence();
     #
     #		$student_absence->setStudentId($su_id);
     #		$student_absence->setStart($this->getRequestParameter('date'));
     #		$student_absence->setEnd($this->getRequestParameter('date'));
     #		$student_absence->setAcademicCalendarId($class_agenda->getCourseSchedule()->getAcademicCalendarId());
     #		$student_absence->setClassGroupId($this->getRequestParameter('class_group_id'));
     #		$student_absence->save();
     #	}
     #}
     return $this->redirect('agenda/edit?id=' . $class_agenda->getId());
     #return $this->forward('agenda', 'list');
     #return $this->forward('agenda', 'edit?id='.$class_agenda->getId());
 }
Beispiel #8
0
 public function executeListElse()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $group = $this->getContext()->getUser()->getAttribute('group', null, 'bo');
     if ($group == 'lector') {
         $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
         $employee = EmployeePeer::retrieveByPK($employee_id);
         if ($employee->getStaffTypeId() == 13 || $employee->getStaffTypeId() == 14) {
             $this->can_add == 0;
             $this->can_edit == 0;
             $this->can_remove == 0;
         }
         $this->employee = $employee;
     } else {
         $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;
     }
     $counseling_id = $this->getRequestParameter('counseling_id');
     $counseling = CounselingPeer::retrieveByPK($counseling_id);
     $this->forward404Unless($counseling);
     $c = new Criteria();
     $c->add(VStudentElsePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId(), Criteria::IN);
     $c->add(VStudentElsePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $c->add(VStudentElsePeer::STATUS, Student::STATUS_GRADUATE, Criteria::NOT_EQUAL);
     $c->add(VStudentElsePeer::STATUS, Student::STATUS_OVERDUE, Criteria::NOT_EQUAL);
     $this->sortElse($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->filterElse($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'else'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'else');
     $pager = new sfPropelPager('VStudentElse', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'else'));
     $this->getUser()->setAttribute('page', $page, 'else');
     $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' => 'back', 'url' => "student_finance/list", 'color' => 'black'));
     array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "student_finance/listElseAsCSV?counseling_id={$counseling_id}&{$filter_string}", 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "student_finance/listElseAsPDF?counseling_id={$counseling_id}&{$filter_string}", 'color' => 'black', 'type' => 'direct'));
     $this->actions = $actions;
     $this->counseling = $counseling;
     $this->subtitle = $counseling->getAcademicCalendar()->toString() . ' # ' . $counseling->getClassGroup()->toString();
     $actions2 = array(array('name' => '<span>Jurnal Pembayaran Wakaf</span>', 'url' => 'student_finance/listStudent?counseling_id=' . $counseling->getId(), 'color' => 'sky'));
     array_unshift($actions2, array('name' => '<span>Jurnal Keuangan Murid</span>', 'url' => 'student_finance/list', 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Jurnal Pembayaran Infaq</span>', 'url' => 'student_finance/listInfaq?counseling_id=' . $counseling->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Jurnal Pembayaran SPP</span>', 'url' => 'student_finance/listSpp?counseling_id=' . $counseling->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Jurnal Pembayaran Lain-lain</span>', 'url' => 'student_finance/listElse?counseling_id=' . $counseling->getId(), 'color' => 'sun', 'type' => 'direct'));
     $this->actions2 = $actions2;
 }
Beispiel #9
0
 public function executeListStudentAll()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $schedule = SchedulePeer::retrieveByPk($this->getRequestParameter('schedule_id'));
     $this->forward404Unless($schedule);
     $schedule_detail = ScheduleDetailPeer::retrieveByPk($this->getRequestParameter('detail_id'));
     $this->forward404Unless($schedule_detail);
     $schedule_id = $schedule->getId();
     $tanggal = $this->getRequestParameter('time');
     $c = new Criteria();
     $c->add(AbsenceEkskulPeer::SCHEDULE_ID, $schedule->getId());
     $c->add(AbsenceEkskulPeer::SCHEDULE_DETAIL_ID, $schedule_detail->getId());
     $c->add(AbsenceEkskulPeer::TIME, $this->getRequestParameter('time'));
     $c->addJoin(StudentPeer::ID, AbsenceEkskulPeer::STUDENT_ID);
     $c->addAscendingOrderByColumn(StudentPeer::NAME);
     $rpp = $this->getRequestParameter('max_per_page', 999);
     $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' => 'kembali', 'url' => 'course_ekskul/listAbsence?id=' . $schedule->getId() . '&detail_id=' . $schedule_detail->getId(), 'color' => 'black'));
     $this->actions = $actions;
     $actions2 = array(array('name' => '<span>Peserta Ekskul</span>', 'url' => 'course_ekskul/list?id=' . $schedule->getId() . '&detail_id=' . $schedule_detail->getId(), 'color' => 'sun'));
     array_unshift($actions2, array('name' => '<span>Detail Jadwal Ekskul</span>', 'url' => 'course_ekskul/listDetail?id=' . $schedule->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Absensi Ekskul</span>', 'url' => 'course_ekskul/listAbsence?id=' . $schedule->getId() . '&detail_id=' . $schedule_detail->getId(), 'color' => 'sun', 'type' => 'direct'));
     array_push($actions2, array('name' => '<span>Penilaian Ekskul</span>', 'url' => 'course_ekskul/listScore?id=' . $schedule->getId() . '&detail_id=' . $schedule_detail->getId(), 'color' => 'sun'));
     $this->actions2 = $actions2;
     $this->subtitle = $schedule->getGradeComponent()->toString() . ' - ' . $schedule_detail->getDayString();
     $cw = new Criteria();
     $cw->add(AbsenceEkskulPeer::SCHEDULE_ID, $schedule->getId());
     $cw->add(AbsenceEkskulPeer::SCHEDULE_DETAIL_ID, $schedule_detail->getId());
     $cw->add(AbsenceEkskulPeer::TIME, $tanggal);
     $absence_course = AbsenceEkskulPeer::doSelectOne($cw);
     $this->absence_course = $absence_course;
     $this->schedule = $schedule;
     $this->schedule_detail = $schedule_detail;
     $this->schedule_id = $schedule_id;
     $this->employee = $employee;
     $this->tanggal = $tanggal;
 }
Beispiel #10
0
 public function executeDeleteByEmployee()
 {
     $class_agenda = ClassAgendaPeer::retrieveByPK($this->getRequestParameter('agenda_id'));
     $this->forward404Unless($class_agenda);
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $this->employee = $employee;
     $student_absence = StudentAbsencePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($student_absence);
     $ref_error = 0;
     foreach ($student_absence->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $student_absence->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('leave/deleteByEmployee/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('leave/deleteByEmployee', '_ERR_DELETE_ (' . $student_absence->toString() . ' - id:' . $student_absence->getId() . ')');
     } else {
         $student_absence->delete();
     }
     return $this->redirect('leave/listByEmployee?agenda_id=' . $class_agenda->getId());
 }
Beispiel #11
0
 public function executeShowByStudent()
 {
     $student_id = $this->getRequestParameter('student_id');
     $student = StudentPeer::retrieveByPk($student_id);
     $this->forward404Unless($student);
     $employee = EmployeePeer::retrieveByPk($this->getRequestParameter('id'));
     if (!$employee) {
         $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
         $employee = EmployeePeer::retrieveByPK($employee_id);
     }
     $this->forward404Unless($employee);
     $this->subtitle = $employee->toString() . ' - id:' . $employee->getId();
     $c = new Criteria();
     $c->add(EmployeeDetailPeer::EMPLOYEE_ID, $employee->getId());
     $employee_detail = EmployeeDetailPeer::doSelectOne($c);
     $actions = array(array('name' => 'back', 'url' => 'employee/listByStudent?student_id=' . $student_id, 'color' => 'black'));
     $this->actions = $actions;
     $this->employee = $employee;
     $this->employee_detail = $employee_detail;
 }
Beispiel #12
0
 public function executeUpdate()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $i18n = new sfI18N();
     $i18n->initialize($this->getContext());
     $i18n->setCulture($this->getUser()->getCulture());
     $action_i18n = $i18n->globalMessageFormat->format('save as new');
     $action_type = $this->getRequestParameter('action_type');
     if ($action_type == $action_i18n || !$this->getRequestParameter('id')) {
         $schedule = new Schedule();
     } else {
         $schedule = SchedulePeer::retrieveByPk($this->getRequestParameter('id'));
         $this->forward404Unless($schedule);
     }
     $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
     $this->forward404Unless($course_schedule);
     $schedule->setId($this->getRequestParameter('id'));
     $schedule->setSubjectCurrId($course_schedule->getSubjectCurrId());
     $schedule->setClassGroupId($course_schedule->getClassGroupId());
     $schedule->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
     $schedule->setDay($this->getRequestParameter('day'));
     $schedule->setName($this->getRequestParameter('name'));
     $schedule->setSemester($this->getRequestParameter('semester'));
     $schedule->setKkm($this->getRequestParameter('kkm'));
     $schedule->setType(1);
     $schedule->setClassSessionId($this->getRequestParameter('class_session_id'));
     $c = new Criteria();
     $c->add(CourseScheduleTutorPeer::COURSE_SCHEDULE_ID, $course_schedule->getId());
     $cst = CourseScheduleTutorPeer::doSelectOne($c);
     if ($employee->getStaffTypeId() != 21) {
         $schedule->setEmployeeId($this->getRequestParameter('employee_id'));
     } else {
         $schedule->setEmployeeId($cst->getEmployeeId());
     }
     #$schedule->setEmployeeId($this->getRequestParameter('employee_id'));
     $schedule->setLocationId($this->getRequestParameter('location_id'));
     $schedule->setGradeSpecId($this->getRequestParameter('grade_spec_id'));
     $schedule->setDate($this->getRequestParameter('date'));
     $schedule->setDetail($this->getRequestParameter('detail'));
     $schedule->save();
     /* SMS Add */
     if (SF_ENVIRONMENT == 'dev') {
         if ($this->getRequestParameter('send_message') == 1) {
             $lekarSms = new lekarSms();
             $userType = $this->getContext()->getUser()->getAttribute('usertype', '', 'bo');
             $lekarSms->sendSmsCourseTest($schedule, $userType);
         }
     }
     /* --- */
     return $this->redirect('course_test/list?course_id=' . $course_schedule->getId());
 }
Beispiel #13
0
 public function executeListScore()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $this->employee_id = $employee_id;
     $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
     $this->forward404Unless($course_schedule);
     $academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal_id'));
     $this->forward404Unless($academic_calendar);
     $course_schedule_id = $course_schedule->getId();
     $cr = new Criteria();
     $cr->add(GradeSpecPeer::PARENT, 1);
     $this->grade1 = GradeSpecPeer::doSelect($cr);
     $this->count1 = GradeSpecPeer::doCount($cr);
     $cw = new Criteria();
     $cw->add(GradeSpecPeer::PARENT, 7);
     $this->grade2 = GradeSpecPeer::doSelect($cw);
     $this->count2 = GradeSpecPeer::doCount($cw);
     $c = new Criteria();
     $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
     $c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
     $c->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID);
     $c->addJoin(StudentPeer::ID, VStudentActivePeer::ID);
     $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;
     $this->student_count = StudentPeer::doCount($c);
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     array_unshift($actions, array('name' => '_AS_CSV_', 'url' => 'employee_agenda/listScoreAsCSV?course_id=' . $course_schedule->getId(), 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => '_AS_PDF_', 'url' => 'employee_agenda/listScoreAsPDF?course_id=' . $course_schedule->getId(), 'color' => 'black', 'type' => 'direct'));
     array_push($actions, array());
     $this->actions = $actions;
     if ($course_schedule->getAcademicCalendar()->getCourseModel() == 'A') {
         $actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'employee_agenda/list', 'color' => 'sun'));
     } else {
         $actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'employee_agenda/list2', 'color' => 'sun'));
     }
     array_push($actions2, array('name' => '<span>Agenda Kelas</span>', 'url' => 'employee_agenda/listAgenda?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Absensi</span>', 'url' => 'employee_agenda/listAbsence?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Jadwal Tugas/Ulangan/PR</span>', 'url' => 'employee_agenda/listTest?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Penilaian</span>', 'url' => 'employee_agenda/listScore?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun', 'type' => 'direct'));
     if ($course_schedule->getClassGroup()->getParent() == 70 || $course_schedule->getClassGroup()->getParent() == 85 || $course_schedule->getClassGroup()->getParent() == 117) {
         array_push($actions2, array('name' => '<span>Penilaian Tryout</span>', 'url' => 'course_detail/listTryout?course_id=' . $course_schedule->getId() . '&accal_id=' . $course_schedule->getAcademicCalendarId(), 'color' => 'sun'));
     }
     $this->actions2 = $actions2;
     $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString();
     $this->type = 'edit';
     $this->course_schedule = $course_schedule;
     $this->academic_calendar = $academic_calendar;
 }
Beispiel #14
0
 public function executeUpdate()
 {
     $i18n = new sfI18N();
     $i18n->initialize($this->getContext());
     $i18n->setCulture($this->getUser()->getCulture());
     $action_i18n = $i18n->globalMessageFormat->format('save as new');
     $action_type = $this->getRequestParameter('action_type');
     if ($action_type == $action_i18n || !$this->getRequestParameter('id')) {
         $employee_medical = new EmployeeMedical();
     } else {
         $employee_medical = EmployeeMedicalPeer::retrieveByPk($this->getRequestParameter('id'));
         $this->forward404Unless($employee_medical);
     }
     $employee_medical->setId($this->getRequestParameter('id'));
     $employee_medical->setEmployeeId($this->getRequestParameter('employee_id'));
     $employee = EmployeePeer::retrieveByPK($this->getRequestParameter('employee_id'));
     if ($employee) {
         $cd = new Criteria();
         $cd->add(EmployeeDetailPeer::EMPLOYEE_ID, $employee->getId());
         $employee_detail = EmployeeDetailPeer::doSelectOne($cd);
         if ($employee_detail->getEmployeeDivisionId()) {
             $employee_medical->setEmployeeDivisionId($employee_detail->getEmployeeDivisionId());
         }
         if ($employee->getDepartmentId()) {
             $employee_medical->setDepartmentId($employee->getDepartmentId());
         }
     }
     $employee_medical->setStaffTypeId($this->getRequestParameter('staff_type_id'));
     $employee_medical->setEmployeeLevelId($this->getRequestParameter('employee_level_id'));
     $employee_medical->setIllnessId($this->getRequestParameter('illness_id'));
     $employee_medical->setDetailMedical($this->getRequestParameter('detail_medical'));
     $employee_medical->setHospital($this->getRequestParameter('hospital'));
     $employee_medical->setPatientName($this->getRequestParameter('patient_name'));
     $employee_medical->setTotal($this->getRequestParameter('total'));
     $employee_medical->setRelation($this->getRequestParameter('relation'));
     $employee_medical->setStatus($this->getRequestParameter('status'));
     $employee_medical->setMedicine($this->getRequestParameter('medicine'));
     $employee_medical->setHospitalization($this->getRequestParameter('hospitalization'));
     $employee_medical->setCode($this->getRequestParameter('code'));
     $employee_medical->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id'));
     if ($this->getRequestParameter('medical_date')) {
         $employee_medical->setMedicalDate($this->getRequestParameter('medical_date'));
     }
     $employee_medical->save();
     return $this->redirect('employee_medical/list?employee_id=' . $this->getRequestParameter('employee_id'));
 }
Beispiel #15
0
 public function executeListRecapt()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
     $this->forward404Unless($course_schedule);
     $this->course_schedule = $course_schedule;
     $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     #array_unshift($actions, array('name'=>'Print Excel','url'=>"course_sd/listRecaptAsCSV?course_id=".$course_schedule->getId(), 'color'=>'black', 'type'=>'direct'));
     #array_unshift($actions, array('name'=>'Print PDF','url'=>"course_sd/listRecaptAsPDF?course_id=".$course_schedule->getId(), 'color'=>'black', 'type'=>'direct'));
     $this->actions = $actions;
     ## Mengambil Kompetensi Dasar Untuk KI.3
     $cur13_ki = ScoreRule::THREE;
     $ct = new Criteria();
     $ct->add(Cur13TermPeer::CUR13_KI_ID, $cur13_ki);
     $ct->add(Cur13TermPeer::COURSE_SCHEDULE_ID, $course_schedule->getId());
     $cur13_terms = Cur13TermPeer::doSelect($ct);
     $cur13_term_count = Cur13TermPeer::doCount($ct);
     $this->cur13_terms = $cur13_terms;
     $this->cur13_term_count = $cur13_term_count;
     $actions2 = array(array('name' => '<span>Penilaian 2013</span>', 'url' => 'course_sd/list?accal_id=' . $course_schedule->getAcademicCalendarId() . '&class_id=' . $course_schedule->getClassGroupId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Proses Nilai KI.3 (Pengetahuan)</span>', 'url' => 'course_sd/listRecapt?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct'));
     array_push($actions2, array('name' => '<span>Proses Nilai KI.4 (Keterampilan)</span>', 'url' => 'course_sd/listRecaptKi4?course_id=' . $course_schedule->getId(), 'color' => 'sky'));
     $this->actions2 = $actions2;
     $this->subtitle = $course_schedule->getAcademicCalendar()->getName() . ' # ' . $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - id:' . $course_schedule->getId();
     $this->type = 'edit';
     $this->cur13_ki = $cur13_ki;
     $this->title = 'Proses Nilai Raport KI.3 (Pengetahuan)';
     $c = new Criteria();
     $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
     $c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
     $c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID);
     $c->add(StudentPeer::STATUS, Student::STATUS_ACTIVE);
     $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;
     ## Mengambil Student Accal Id
     $cm = new Criteria();
     $cm->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
     $cm->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
     $stu_accals = StudentAccalPeer::doSelect($cm);
     $student_accal_id = array();
     foreach ($stu_accals as $stu_accal) {
         $student_accal_id[$stu_accal->getStudentId()] = $stu_accal->getId();
     }
     $this->student_accal_id = $student_accal_id;
     $cri = new Criteria();
     $stuterms = Cur13GradeTermPeer::doSelect($cri);
     $this->stuterms = $stuterms;
     $grade_scale = array();
     $grade_value = array();
     $remark = array();
     foreach ($stuterms as $stuterm) {
         $grade_scale[$stuterm->getStudentAccalId() . '#' . $stuterm->getCur13TermId()] = $stuterm->getGradeScale();
         $grade_value[$stuterm->getStudentAccalId() . '#' . $stuterm->getCur13TermId()] = $stuterm->getGrade();
         $remark[$stuterm->getStudentAccalId() . '#' . $stuterm->getCur13TermId()] = $stuterm->getRemark();
     }
     $this->grade_scale = $grade_scale;
     $this->grade_value = $grade_value;
     $this->remark = $remark;
     $ct = new Criteria();
     $ct->add(GradeConversionPeer::GRADE_CONVERSION_TEMPLATE_ID, 17);
     $grade_convs = GradeConversionPeer::doSelect($ct);
     $descript_select = array();
     foreach ($grade_convs as $grade_conv) {
         $descript_select[$grade_conv->getName()] = $grade_conv->getDescription();
     }
     $this->descript_select = $descript_select;
 }
Beispiel #16
0
 public function executeListAbsenceByEmployee()
 {
     #$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     #$c = new Criteria();
     #$c->add(JobPeer::CODE, 'counseling/listByEmployee');
     #$job = JobPeer::doSelectOne($c);
     #acl = AclPeer::retrieveByPK($group_id, $job->getId());
     #if (!$acl) $this->forward('default', 'error404');
     $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, 2, Criteria::NOT_EQUAL);
     $c->add(StudentPeer::STATUS, 3, Criteria::NOT_EQUAL);
     $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();
     $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/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' => 'Print PDF', 'url' => "counseling/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/listByEmployee', 'color' => 'volcadot'));
     foreach ($months as $month) {
         if ($month->getId() == $title->getId()) {
             array_push($actions2, array('name' => '<span>' . $month->getName() . '</span>', 'url' => 'counseling/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/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;
     $this->jumHari = cal_days_in_month(CAL_GREGORIAN, $title->getMonth(), $academic_calendar->getYear());
 }
Beispiel #17
0
 public function executeShowEkskul()
 {
     $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);
     $grade_component = GradeComponentPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($grade_component);
     $student_id = $this->getRequestParameter('student_id');
     $student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id'));
     $this->forward404Unless($student);
     $actions = array(array('name' => 'back', 'url' => 'counseling_hist/listEkskul?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'black'));
     $this->actions = $actions;
     $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'counseling_hist/listDetail?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Absensi Siswa</span>', 'url' => 'counseling_hist/listAbsence?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Prestasi Siswa</span>', 'url' => 'counseling_hist/listAchievement?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Orang Tua</span>', 'url' => 'counseling_hist/listParent?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Ekskul Siswa</span>', 'url' => 'counseling_hist/listEkskul?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun', 'type' => 'direct'));
     array_push($actions2, array('name' => '<span>Pembiasaan Siswa</span>', 'url' => 'counseling_hist/listExtra?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Raport Bayangan</span>', 'url' => 'counseling_hist/listMiddle?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Raport</span>', 'url' => 'counseling_hist/listFinal?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     $this->actions2 = $actions2;
     $this->subtitle = $student->getName() . ' # Kelas : ' . $student->getClassGroup()->toString() . ' (' . $academic_calendar->toString() . ') ';
     $this->counseling = $counseling;
     $this->counseling_id = $counseling_id;
     $this->student = $student;
     $this->grade_component = $grade_component;
     $this->academic_calendar = $academic_calendar;
 }
Beispiel #18
0
 public function executeDelete()
 {
     $emp_id = $this->getRequestParameter('employee_id');
     $emp = EmployeePeer::retrieveByPK($emp_id);
     $this->forward404Unless($emp);
     $this->employee = $emp;
     $teaching_competency = TeachingCompetencyPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($teaching_competency);
     $ref_error = 0;
     foreach ($teaching_competency->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $teaching_competency->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('teaching_competency/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('teaching_competency/delete', '_ERR_DELETE_ (' . $teaching_competency->toString() . ' - id:' . $teaching_competency->getId() . ')');
     } else {
         $teaching_competency->delete();
     }
     $this->getRequest()->setParameter('employee_id', $emp_id);
     return $this->forward('teaching_competency', 'list');
 }
Beispiel #19
0
 public static function RecoverPassword($id, $request_type = null)
 {
     //Generate Random Password of 6 characters
     $password = self::GenerateRandomPassword(Constant::PASSWORD_MIMIMUM_LENGTH);
     //Encrypt password
     $password_encrypted = self::EncryptPassword($password);
     //check if this employee exists
     $employee = EmployeePeer::retrieveByPK($id);
     if ($employee) {
         $employee->setPassword($password_encrypted);
         //Set newly created password to databaes
         if ($employee->save()) {
             //send the new password and other details to use via email
             //prepare the constants that will be replaced in email body
             $email_vars = array('USER' => $employee->getName(), 'EMAIL' => $employee->getEmail(), 'PASSWORD' => $password);
             Emails::SendEmail($employee->getEmail(), $request_type, $email_vars);
             return Constant::LOGIN_PASSWORD_SENT_SUCCESS;
         } else {
             return Constant::DB_ERROR;
         }
     } else {
         return Constant::LOGIN_INVALIDATION_EMAIL_FIELD;
     }
 }
Beispiel #20
0
 public function executeListFullTryout()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $this->employee_id = $employee_id;
     $this->employee = $employee;
     $counseling = CounselingPeer::retrieveByPk($this->getRequestParameter('counseling_id'));
     $this->forward404Unless($counseling);
     $academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal_id'));
     $this->forward404Unless($academic_calendar);
     $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, 2, Criteria::NOT_EQUAL);
     $c->add(StudentPeer::STATUS, 3, Criteria::NOT_EQUAL);
     $c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME);
     $this->students = StudentPeer::doSelect($c);
     $this->student_count = StudentPeer::doCount($c);
     $rpp = $this->getRequestParameter('max_per_page', 999);
     $pager = new sfPropelPager('Student', $rpp);
     $pager->setCriteria($c);
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     $this->pager = $pager;
     $grade_id = $this->getRequestParameter('grade_id');
     $this->grade_id = $grade_id;
     $cr = new Criteria();
     $cr->add(GradeSpecPeer::PARENT, 45, Criteria::IN);
     #$cr->add(GradeSpecPeer::ID, $grade_id, Criteria::NOT_IN);
     $grade1 = GradeSpecPeer::doSelect($cr);
     $count1 = GradeSpecPeer::doCount($cr);
     $this->grade1 = $grade1;
     $this->count1 = $count1;
     $grade_current = GradeSpecPeer::retrieveByPk($grade_id);
     $this->counseling = $counseling;
     $this->academic_calendar = $academic_calendar;
     $this->subtitle = $grade_current->getCode() . ' # ' . $counseling->getClassGroup()->getName() . ' - ' . $academic_calendar->toString();
     #SMP
     if ($academic_calendar->getDepartmentId() == 2) {
         $cw = new Criteria();
         $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
         $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
         $cton1 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 350, Criteria::IN);
         $cton2 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 351, Criteria::IN);
         $cton3 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 346, Criteria::IN);
         $cton4 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 339, Criteria::IN);
         $cton5 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 340, Criteria::IN);
         $cton6 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 337, Criteria::IN);
         $cton5->addOr($cton6);
         $cton4->addOr($cton5);
         $cton3->addOr($cton4);
         $cton2->addOr($cton3);
         $cton1->addOr($cton2);
         $cw->add($cton1);
         $cw->addAscendingOrderByColumn(VCoursePeer::CODE);
         $this->smp_subjects = VCoursePeer::doSelect($cw);
         $this->smp_count = VCoursePeer::doCount($cw);
         $cd = new Criteria();
         $cd->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
         $cd->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
         $cton1 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 352, Criteria::IN);
         $cton2 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 349, Criteria::IN);
         $cton3 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 348, Criteria::IN);
         $cton4 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 341, Criteria::IN);
         $cton5 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 355, Criteria::IN);
         $cton4->addOr($cton5);
         $cton3->addOr($cton4);
         $cton2->addOr($cton3);
         $cton1->addOr($cton2);
         $cd->add($cton1);
         $cd->addAscendingOrderByColumn(VCoursePeer::CODE);
         $this->smp_subjects2 = VCoursePeer::doSelect($cd);
         $this->smp_count2 = VCoursePeer::doCount($cd);
         $cm = new Criteria();
         $cm->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
         $cm->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
         $cton1 = $cm->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 353, Criteria::IN);
         $cton2 = $cm->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 354, Criteria::IN);
         $cton1->addOr($cton2);
         $cm->add($cton1);
         $cm->addAscendingOrderByColumn(VCoursePeer::CODE);
         $this->ipas = VCoursePeer::doSelect($cm);
         $this->ipa_count = VCoursePeer::doCount($cm);
         $cl = new Criteria();
         $cl->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
         $cl->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
         $cton1 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 343, Criteria::IN);
         $cton2 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 338, Criteria::IN);
         $cton3 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 347, Criteria::IN);
         $cton2->addOr($cton3);
         $cton1->addOr($cton2);
         $cl->add($cton1);
         $cl->addAscendingOrderByColumn(VCoursePeer::CODE);
         $this->ips = VCoursePeer::doSelect($cl);
         $this->ips_count = VCoursePeer::doCount($cl);
         #SD
     } else {
         if ($counseling->getClassGroup()->getParent() == 54) {
             $cw = new Criteria();
             $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
             $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
             $cton1 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN);
             $cton2 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 332, Criteria::NOT_IN);
             $cton1->addAnd($cton2);
             $cw->add($cton1);
             $cw->addAscendingOrderByColumn(VCoursePeer::CODE);
             $this->sd_subjects = VCoursePeer::doSelect($cw);
             $this->sd_count = VCoursePeer::doCount($cw);
         } else {
             $cw = new Criteria();
             $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
             $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
             $cw->add(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN);
             $cw->addAscendingOrderByColumn(VCoursePeer::CODE);
             $this->sd_subjects = VCoursePeer::doSelect($cw);
             $this->sd_count = VCoursePeer::doCount($cw);
         }
         $cri = new Criteria();
         $cri->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
         $cri->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
         $cri->add(VCoursePeer::SUBJECT_GROUP_ID, 7, Criteria::IN);
         $cri->add(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN);
         $cri->addAscendingOrderByColumn(VCoursePeer::CODE);
         $this->sd_subjects7 = VCoursePeer::doSelect($cri);
         $this->sd_count7 = VCoursePeer::doCount($cri);
         $crit = new Criteria();
         $crit->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
         $crit->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
         $crit->add(VCoursePeer::SUBJECT_GROUP_ID, 8);
         $crit->addAscendingOrderByColumn(VCoursePeer::CODE);
         $this->sd_subjects8 = VCoursePeer::doSelect($crit);
         $this->sd_count8 = VCoursePeer::doCount($crit);
     }
     $actions = array();
     array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "counseling/listFullTryoutAsCSV?counseling_id=" . $counseling->getId() . "&accal_id=" . $academic_calendar->getId() . "&grade_id=" . $grade_id, 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "counseling/listFullTryoutAsPDF?counseling_id=" . $counseling->getId() . "&accal_id=" . $academic_calendar->getId() . "&grade_id=" . $grade_id, 'color' => 'black', 'type' => 'direct'));
     $this->actions = $actions;
     $actions2 = array(array('name' => '<span>' . $academic_calendar->getName() . '</span>', 'url' => 'counseling/listByEmployee', 'color' => 'volcadot'));
     foreach ($grade1 as $grade) {
         if ($grade->getId() == $grade_id) {
             array_push($actions2, array('name' => '<span>' . $grade->getCode() . '</span>', 'url' => 'counseling/listFullTryout?counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId() . '&grade_id=' . $grade->getId(), 'color' => 'sky', 'type' => 'direct'));
         } else {
             array_push($actions2, array('name' => '<span>' . $grade->getCode() . '</span>', 'url' => 'counseling/listFullTryout?counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId() . '&grade_id=' . $grade->getId(), 'color' => 'sun'));
         }
     }
     $this->actions2 = $actions2;
 }
Beispiel #21
0
 public function executeShowByEmployee2()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $schedule = SchedulePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($schedule);
     $this->subtitle = $schedule->toStringCap() . ' - id:' . $schedule->getId();
     $actions = array(array('name' => 'back', 'url' => 'extracurricular/listByEmployee2?employee_id=' . $employee_id, 'color' => 'black'));
     $this->setTemplate('show');
     $this->actions = $actions;
     $this->schedule = $schedule;
     $c = new Criteria();
     $c->add(ScheduleDetailPeer::SCHEDULE_ID, $schedule->getId());
     $c->addDescendingOrderByColumn(ScheduleDetailPeer::ID);
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'schedule_detail'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'schedule_detail');
     $pager = new sfPropelPager('ScheduleDetail', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'schedule_detail'));
     $this->getUser()->setAttribute('page', $page, 'schedule_detail');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions2 = array(array('name' => 'filter', 'color' => 'white'));
     $this->actions2 = $actions2;
 }
Beispiel #22
0
 public static function doSelectAllByLector()
 {
     $emp_id = sfContext::getInstance()->getuser()->getAttribute('user_id', null, 'bo');
     $emp = EmployeePeer::retrieveByPK($emp_id);
     if ($emp == null) {
         return array();
     }
     $c = new Criteria();
     $c->add(SubjectAccalLectorPeer::EMPLOYEE_ID, $emp_id);
     $c->addJoin(SubjectAccalLectorPeer::SUBJECT_ACCAL_ID, SubjectAccalPeer::ID);
     $c->addJoin(SubjectAccalPeer::SUBJECT_ID, SubjectPeer::ID);
     $c->addAscendingOrderByColumn(SubjectPeer::NAME);
     return SubjectPeer::doSelect($c);
 }
Beispiel #23
0
 public function executeSave()
 {
     $counseling_id = $this->getRequestParameter('counseling_id');
     $counseling = CounselingPeer::retrieveByPK($counseling_id);
     $this->forward404Unless($counseling);
     $term = $this->getRequestParameter('term');
     $accal_id = $this->getRequestParameter('academic_calendar_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $employee_id = $this->getRequestParameter('employee_id');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $descs = $this->getRequestParameter('desc');
     foreach ($descs as $m => $desc) {
         if ($desc != null) {
             if ($desc != '-') {
                 $ced = new Criteria();
                 $ced->add(StudentDescPeer::STUDENT_ACCAL_ID, $m);
                 $ced->add(StudentDescPeer::TERM, $term);
                 $spec = StudentDescPeer::doSelectOne($ced);
                 if ($spec == null) {
                     $spec = new StudentDesc();
                 }
                 $spec->setStudentAccalId($m);
                 $spec->setTerm($term);
                 $spec->setNote($desc);
                 $spec->save();
             } else {
                 $ced = new Criteria();
                 $ced->add(StudentDescPeer::STUDENT_ACCAL_ID, $m);
                 $ced->add(StudentDescPeer::TERM, $term);
                 $spec = StudentDescPeer::doSelectOne($ced);
                 if ($spec != null) {
                     $spec->delete();
                 }
             }
         }
     }
     return $this->redirect('course_tk/listScore?accal_id=' . $academic_calendar->getId() . '&term=' . $term . '&counseling_id=' . $counseling->getId() . '&employee_id=' . $employee_id);
 }
Beispiel #24
0
 public function executeUpdateEmail()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $i18n = new sfI18N();
     $i18n->initialize($this->getContext());
     $i18n->setCulture($this->getUser()->getCulture());
     $action_i18n = $i18n->globalMessageFormat->format('save as new');
     $action_type = $this->getRequestParameter('action_type');
     if (!$this->getRequestParameter('student_id')) {
         $emp = EmployeePeer::retrieveByPK($this->getRequestParameter('employee_2'));
         $this->forward404Unless($emp);
         $inbox_emp = new InboxEmp();
         $inbox_emp->setEmployee2($this->getRequestParameter('employee_id'));
         $inbox_emp->setEmployeeId($emp->getId());
         $inbox_emp->setSubject($this->getRequestParameter('subject'));
         $inbox_emp->setDetail($this->getRequestParameter('detail'));
         $inbox_emp->setType(2);
         $inbox_emp->setCreatedAt($this->getRequestParameter('created_at'));
         $inbox_emp->setCode($emp->toString());
         $inbox_emp->save();
         $employee = EmployeePeer::retrieveByPK($this->getRequestParameter('employee_id'));
         $this->forward404Unless($employee);
         $outbox_emp = new OutboxEmp();
         $outbox_emp->setEmployee2($this->getRequestParameter('employee_id'));
         $outbox_emp->setEmployeeId($emp->getId());
         $outbox_emp->setSubject($this->getRequestParameter('subject'));
         $outbox_emp->setDetail($this->getRequestParameter('detail'));
         $outbox_emp->setType(2);
         $outbox_emp->setCreatedAt($this->getRequestParameter('created_at'));
         $outbox_emp->setCode($employee->toString());
         $outbox_emp->save();
     } else {
         $emp = EmployeePeer::retrieveByPK($this->getRequestParameter('employee_2'));
         $this->forward404Unless($emp);
         $inbox_stu = new InboxStu();
         $inbox_stu->setStudent2($this->getRequestParameter('student_id'));
         $inbox_stu->setEmployeeId($emp->getId());
         $inbox_stu->setSubject($this->getRequestParameter('subject'));
         $inbox_stu->setDetail($this->getRequestParameter('detail'));
         $inbox_stu->setType(1);
         $inbox_stu->setCreatedAt($this->getRequestParameter('created_at'));
         $inbox_stu->setCode($emp->toString());
         $inbox_stu->save();
         $stu = StudentPeer::retrieveByPK($this->getRequestParameter('student_id'));
         $this->forward404Unless($stu);
         $outbox_emp = new OutboxEmp();
         $outbox_emp->setStudentId($this->getRequestParameter('student_id'));
         $outbox_emp->setEmployeeId($emp->getId());
         $outbox_emp->setSubject($this->getRequestParameter('subject'));
         $outbox_emp->setDetail($this->getRequestParameter('detail'));
         $outbox_emp->setType(1);
         $outbox_emp->setCreatedAt($this->getRequestParameter('created_at'));
         $outbox_emp->setCode($stu->toStringCap());
         $outbox_emp->save();
     }
     return $this->redirect('employee_counsel/list');
 }
Beispiel #25
0
 public function executeUpdate()
 {
     $i18n = new sfI18N();
     $i18n->initialize($this->getContext());
     $i18n->setCulture($this->getUser()->getCulture());
     $action_i18n = $i18n->globalMessageFormat->format('save as new');
     $action_type = $this->getRequestParameter('action_type');
     if ($action_type == $action_i18n || !$this->getRequestParameter('id')) {
         $employee_leave = new EmployeeLeave();
     } else {
         $employee_leave = EmployeeLeavePeer::retrieveByPk($this->getRequestParameter('id'));
         $this->forward404Unless($employee_leave);
     }
     $employee_leave->setId($this->getRequestParameter('id'));
     $employee_leave->setEmployeeId($this->getRequestParameter('employee_id'));
     if ($this->getRequestParameter('start')) {
         $employee_leave->setStart($this->getRequestParameter('start'));
     }
     if ($this->getRequestParameter('end')) {
         $employee_leave->setEnd($this->getRequestParameter('end'));
     }
     $employee = EmployeePeer::retrieveByPK($this->getRequestParameter('employee_id'));
     if ($employee) {
         $cd = new Criteria();
         $cd->add(EmployeeDetailPeer::EMPLOYEE_ID, $employee->getId());
         $employee_detail = EmployeeDetailPeer::doSelectOne($cd);
         if ($employee_detail->getEmployeeDivisionId()) {
             $employee_leave->setEmployeeDivisionId($employee_detail->getEmployeeDivisionId());
         }
         if ($employee->getDepartmentId()) {
             $employee_leave->setDepartmentId($employee->getDepartmentId());
         }
     }
     $employee_leave->setCode($this->getRequestParameter('code'));
     $employee_leave->setEmployeeLevelId($this->getRequestParameter('employee_level_id'));
     $employee_leave->setLeaveTypeId($this->getRequestParameter('leave_type_id'));
     $employee_leave->setLeaveLength($this->getRequestParameter('leave_length'));
     $employee_leave->setDetail($this->getRequestParameter('detail'));
     $employee_leave->setAddress($this->getRequestParameter('address'));
     $employee_leave->setStatus($this->getRequestParameter('status'));
     $employee_leave->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id'));
     $employee_leave->save();
     return $this->redirect('employee_leave/list?employee_id=' . $this->getRequestParameter('employee_id'));
 }
Beispiel #26
0
 public function executeShow()
 {
     $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;
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $outbox_emp = OutboxEmpPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($outbox_emp);
     $this->subtitle = $outbox_emp->toString() . ' - id:' . $outbox_emp->getId();
     $actions = array(array('name' => 'back', 'url' => 'employee_outmail', 'color' => 'black'));
     array_push($actions, array('name' => 'delete', 'url' => 'employee_outmail/delete?id=' . $outbox_emp->getId(), 'color' => 'red'));
     $this->actions = $actions;
     $this->outbox_emp = $outbox_emp;
 }
 public function getEmployee($con = null)
 {
     include_once 'lib/model/om/BaseEmployeePeer.php';
     if ($this->aEmployee === null && $this->employee_id !== null) {
         $this->aEmployee = EmployeePeer::retrieveByPK($this->employee_id, $con);
     }
     return $this->aEmployee;
 }
Beispiel #28
0
 public function executeEdit()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $catalog = CatalogPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($catalog);
     if (method_exists($catalog, 'getName')) {
         $subtitle = $catalog->getName() . ' - ' . __('id') . ':' . $catalog->getId();
     } else {
         $subtitle = $catalog->toString() ? $catalog->toString() : '-' . ' - ' . __('id') . ':' . $catalog->getId();
     }
     $this->actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'cancel', 'url' => 'employee_bank/list', 'color' => 'black'));
     $this->type = 'edit';
     $this->employee = $employee;
     $this->catalog = $catalog;
     $this->subtitle = $subtitle;
 }
Beispiel #29
0
 public function executeGetScore()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $academic_calendar_id = $this->getRequestParameter('academic_calendar_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id);
     $this->forward404Unless($academic_calendar);
     $counseling_id = $this->getRequestParameter('counseling_id');
     $counseling = CounselingPeer::retrieveByPK($counseling_id);
     $this->forward404Unless($counseling);
     $student_id = $this->getRequestParameter('student_id');
     $student = StudentPeer::retrieveByPK($student_id);
     $this->forward404Unless($student);
     $c = new Criteria();
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'counseling_spec'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'counseling_spec');
     $pager = new sfPropelPager('CounselingSpec', $rpp);
     $pager->setPeerMethod('doSelectOrdered');
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'counseling_spec'));
     $this->getUser()->setAttribute('page', $page, 'counseling_spec');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $cem = new Criteria();
     $cem->add(StudentAccalPeer::STUDENT_ID, $student->getId());
     $cem->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $cem->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $cem->add(StudentAccalPeer::STATUS, 1);
     $stu_acc = StudentAccalPeer::doSelectOne($cem);
     $this->stu_acc = $stu_acc;
     $cr = new Criteria();
     $cr->add(CounselingRaportPeer::STUDENT_ACCAL_ID, $stu_acc->getId());
     $student_couns = CounselingRaportPeer::doSelect($cr);
     $stu_coun = array();
     foreach ($student_couns as $student_coun) {
         $stu_coun[$student_coun->getCounselingSpecId()] = $student_coun->getGrade();
     }
     $this->stu_coun = $stu_coun;
     $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     $this->actions = $actions;
     $this->academic_calendar = $academic_calendar;
     $this->employee_id = $employee_id;
     $this->employee = $employee;
     $this->counseling = $counseling;
     $this->student = $student;
 }
Beispiel #30
0
 public function getEmployeeRelatedByEmployee2($con = null)
 {
     include_once 'lib/model/om/BaseEmployeePeer.php';
     if ($this->aEmployeeRelatedByEmployee2 === null && $this->employee_2 !== null) {
         $this->aEmployeeRelatedByEmployee2 = EmployeePeer::retrieveByPK($this->employee_2, $con);
     }
     return $this->aEmployeeRelatedByEmployee2;
 }