示例#1
0
        echo $i + ($pager->getPage() - 1) * $pager->getMaxPerPage();
        ?>
</td>
                            <td class='first'><?php 
        echo $employee_leave->getAcademicCalendarId() ? $employee_leave->getAcademicCalendar()->toString() : '-';
        ?>
</td>
                            <td align='left'><?php 
        echo $employee_leave->getEmployee() && $employee_leave->getEmployee()->getCode() ? $employee_leave->getEmployee()->getCode() : '-';
        ?>
</td>
                            <td align='left'>    
                                <?php 
        $c = new Criteria();
        $c->add(EmployeeDetailPeer::EMPLOYEE_ID, $employee_leave->getEmployeeId());
        $employee_detail = EmployeeDetailPeer::doSelectOne($c);
        echo $employee_detail->getExtraCode() ? $employee_detail->getExtraCode() : 'N/A';
        ?>
</td>
                            <td align='left'><?php 
        echo $employee_leave->getEmployee() && $employee_leave->getEmployee()->getName() ? $employee_leave->getEmployee()->getName() : '-';
        ?>
</td>
                            <td align="left"><?php 
        echo $employee_leave->getCode() ? $employee_leave->getCode() : '-';
        ?>
</td>
                            <td align="left"><?php 
        echo $employee_leave->getLeaveType() ? $employee_leave->getLeaveType()->toString() : '-';
        ?>
</td>
示例#2
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'));
 }
示例#3
0
 public function executeShowEmployeeSched2()
 {
     $employee = EmployeePeer::retrieveByPk($this->getRequestParameter('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' => 'student_schedule/listSched2', 'color' => 'black'));
     $this->setTemplate('showEmployee');
     $this->actions = $actions;
     $this->employee = $employee;
     $this->employee_detail = $employee_detail;
 }
示例#4
0
 public function executeShowEmployee()
 {
     $employee = EmployeePeer::retrieveByPk($this->getRequestParameter('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);
     $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
     $this->forward404Unless($course_schedule);
     $actions2 = array(array('name' => '<span>Detail Guru</span>', 'url' => 'student_agenda/showEmployee?id=' . $employee->getId() . '&course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct'));
     if ($course_schedule->getAcademicCalendar()->getCourseModel() == 'A') {
         array_unshift($actions2, array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'student_agenda/list', 'color' => 'sky'));
     } else {
         array_unshift($actions2, array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'student_agenda/list2', 'color' => 'sky'));
     }
     $this->actions = array();
     $this->actions2 = $actions2;
     $this->employee = $employee;
     $this->employee_detail = $employee_detail;
     $this->course_schedule = $course_schedule;
 }
示例#5
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');
     }
     $employee_id = $this->getRequestParameter('employee_id');
     if (!$employee_id) {
         $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     }
     $employee = EmployeePeer::retrieveByPk($employee_id);
     $c = new Criteria();
     $c->add(EmployeeDetailPeer::EMPLOYEE_ID, $employee_id);
     $employee_detail = EmployeeDetailPeer::doSelectOne($c);
     $actions = array();
     if (sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo') == 'lector') {
         $actions = array(array('name' => 'back', 'url' => 'employee/list', 'color' => 'white'));
     }
     if ($employee_detail) {
         if ($acl->getEditPriv()) {
             array_push($actions, array('name' => 'edit', 'url' => 'employee_detail/edit?id=' . $employee_detail->getId(), 'color' => 'blue'));
         }
     } else {
         if ($acl->getEditPriv()) {
             array_push($actions, array('name' => 'edit', 'url' => 'employee_detail/create?employee_id=' . $employee_id, 'color' => 'blue'));
         }
     }
     $this->subtitle = $employee ? $employee->toString() . ' - id:' . ($employee_detail ? $employee_detail->getId() : '-') : 'n/a';
     $this->actions = $actions;
     $this->employee_id = $employee_id;
     $this->employee_detail = $employee_detail;
 }
示例#6
0
 public function executeShowEmployee()
 {
     $employee = EmployeePeer::retrieveByPk($this->getRequestParameter('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);
     $academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal_id'));
     $this->forward404Unless($academic_calendar);
     if ($academic_calendar->getCourseModel() == 'A') {
         $actions = array(array('name' => 'back', 'url' => 'employee_agenda/list', 'color' => 'black'));
     } else {
         $actions = array(array('name' => 'back', 'url' => 'employee_agenda/list2', 'color' => 'black'));
     }
     $this->actions = $actions;
     $this->employee = $employee;
     $this->employee_detail = $employee_detail;
     $this->academic_calendar = $academic_calendar;
 }
示例#7
0
 public function executeEdit()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $cd = new Criteria();
     $cd->add(JobPeer::CODE, $this->getModuleName());
     $job = JobPeer::doSelectOne($cd);
     $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 = EmployeePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($employee);
     $c = new Criteria();
     $c->add(EmployeeDetailPeer::EMPLOYEE_ID, $employee->getId());
     $employee_detail = EmployeeDetailPeer::doSelectOne($c);
     $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     if ($acl->getRemovePriv()) {
         array_push($actions, array('name' => 'delete', 'url' => 'employee/delete?id=' . $employee->getId(), 'color' => 'red'));
     }
     array_push($actions, array('name' => 'cancel', 'url' => 'employee/list', 'color' => 'black'));
     $this->subtitle = $employee->toString() . ' - id:' . $employee->getId();
     $this->type = 'edit';
     $this->employee = $employee;
     $this->employee_detail = $employee_detail;
     $this->actions = $actions;
     #Father
     $cw = new Criteria();
     $cw->add(EmployeeParentsPeer::EMPLOYEE_ID, $employee->getId());
     $cw->add(EmployeeParentsPeer::RELATION, EmployeeParents::RELATION_FATHER);
     $father = EmployeeParentsPeer::doSelectOne($cw);
     if ($father == null) {
         $father = new EmployeeParents();
     }
     #Mother
     $ct = new Criteria();
     $ct->add(EmployeeParentsPeer::EMPLOYEE_ID, $employee->getId());
     $ct->add(EmployeeParentsPeer::RELATION, EmployeeParents::RELATION_MOTHER);
     $mother = EmployeeParentsPeer::doSelectOne($ct);
     if ($mother == null) {
         $mother = new EmployeeParents();
     }
     #Father In Law
     $cwi = new Criteria();
     $cwi->add(EmployeeParentsPeer::EMPLOYEE_ID, $employee->getId());
     $cwi->add(EmployeeParentsPeer::RELATION, EmployeeParents::RELATION_FATHER_INLAW);
     $father_inlaw = EmployeeParentsPeer::doSelectOne($cwi);
     if ($father_inlaw == null) {
         $father_inlaw = new EmployeeParents();
     }
     #Mother In Law
     $cti = new Criteria();
     $cti->add(EmployeeParentsPeer::EMPLOYEE_ID, $employee->getId());
     $cti->add(EmployeeParentsPeer::RELATION, EmployeeParents::RELATION_MOTHER_INLAW);
     $mother_inlaw = EmployeeParentsPeer::doSelectOne($cti);
     if ($mother_inlaw == null) {
         $mother_inlaw = new EmployeeParents();
     }
     $this->father = $father;
     $this->mother = $mother;
     $this->father_inlaw = $father_inlaw;
     $this->mother_inlaw = $mother_inlaw;
     $cli = new Criteria();
     $cli->add(EmployeeChildsPeer::EMPLOYEE_ID, $employee->getId());
     $employee_childs = EmployeeChildsPeer::doSelect($cli);
     $childs = array();
     foreach ($employee_childs as $emp_child) {
         $childs[$emp_child->getRelation()] = $emp_child->getId();
     }
     $this->childs = $childs;
     $this->employee_childs = $employee_childs;
 }
示例#8
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_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $employee_job_history = EmployeeJobHistoryPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($employee_job_history);
     $this->subtitle = $employee_job_history->toString() . ' - id:' . $employee_job_history->getId();
     $actions = array(array('name' => 'Kembali', 'url' => 'employee_job_history_o/list', 'color' => 'black'));
     if ($acl->getEditPriv()) {
         array_push($actions, array('name' => 'Ubah', 'url' => 'employee_job_history_o/edit?id=' . $employee_job_history->getId(), 'color' => 'blue'));
     }
     if ($acl->getRemovePriv()) {
         array_push($actions, array('name' => 'Hapus', 'url' => 'employee_job_history_o/delete?id=' . $employee_job_history->getId(), 'color' => 'red'));
     }
     $this->actions = $actions;
     $this->employee_job_history = $employee_job_history;
     $cd = new Criteria();
     $cd->add(EmployeeDetailPeer::EMPLOYEE_ID, $employee_job_history->getEmployeeId());
     $this->employee_detail = EmployeeDetailPeer::doSelectOne($cd);
 }
示例#9
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'));
 }
示例#10
0
 public function executeEdit()
 {
     $employee_id = $this->getContext()->getUser()->getAttribute('user_id', '', 'bo');
     $this->forward404Unless($employee_id);
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $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' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     array_push($actions, array('name' => 'cancel', 'url' => 'user_profile_l/show', 'color' => 'black'));
     $this->subtitle = $employee->toString() . ' - id:' . $employee->getId();
     $this->type = 'edit';
     $this->employee = $employee;
     $this->employee_detail = $employee_detail;
     $this->actions = $actions;
     #Father
     $cw = new Criteria();
     $cw->add(EmployeeParentsPeer::EMPLOYEE_ID, $employee->getId());
     $cw->add(EmployeeParentsPeer::RELATION, EmployeeParents::RELATION_FATHER);
     $father = EmployeeParentsPeer::doSelectOne($cw);
     if ($father == null) {
         $father = new EmployeeParents();
     }
     #Mother
     $ct = new Criteria();
     $ct->add(EmployeeParentsPeer::EMPLOYEE_ID, $employee->getId());
     $ct->add(EmployeeParentsPeer::RELATION, EmployeeParents::RELATION_MOTHER);
     $mother = EmployeeParentsPeer::doSelectOne($ct);
     if ($mother == null) {
         $mother = new EmployeeParents();
     }
     #Father In Law
     $cwi = new Criteria();
     $cwi->add(EmployeeParentsPeer::EMPLOYEE_ID, $employee->getId());
     $cwi->add(EmployeeParentsPeer::RELATION, EmployeeParents::RELATION_FATHER_INLAW);
     $father_inlaw = EmployeeParentsPeer::doSelectOne($cwi);
     if ($father_inlaw == null) {
         $father_inlaw = new EmployeeParents();
     }
     #Mother In Law
     $cti = new Criteria();
     $cti->add(EmployeeParentsPeer::EMPLOYEE_ID, $employee->getId());
     $cti->add(EmployeeParentsPeer::RELATION, EmployeeParents::RELATION_MOTHER_INLAW);
     $mother_inlaw = EmployeeParentsPeer::doSelectOne($cti);
     if ($mother_inlaw == null) {
         $mother_inlaw = new EmployeeParents();
     }
     $this->father = $father;
     $this->mother = $mother;
     $this->father_inlaw = $father_inlaw;
     $this->mother_inlaw = $mother_inlaw;
     $cli = new Criteria();
     $cli->add(EmployeeChildsPeer::EMPLOYEE_ID, $employee->getId());
     $employee_childs = EmployeeChildsPeer::doSelect($cli);
     $childs = array();
     foreach ($employee_childs as $emp_child) {
         $childs[$emp_child->getRelation()] = $emp_child->getId();
     }
     $this->childs = $childs;
     $this->employee_childs = $employee_childs;
 }
示例#11
0
 public function executeShowEmployee()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, 'sm_book/listEmployee');
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $employee = EmployeePeer::retrieveByPk($this->getRequestParameter('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' => 'sm_book/listEmployee', 'color' => 'black'));
     $this->actions = $actions;
     $this->employee = $employee;
     $this->employee_detail = $employee_detail;
 }
示例#12
0
 public function executeShowEmployee()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     #$c->add(JobPeer::CODE, $this->getModuleName());
     $c->add(JobPeer::ID, 208);
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     #$member = MemberPeer::retrieveByPk($this->getRequestParameter('id'));
     #$this->forward404Unless($member);
     #$this->subtitle = $member->toString().' - id:'.$member->getId();
     $employee = EmployeePeer::retrieveByPK($this->getRequestParameter('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);
     if ($this->hasRequestParameter('no_reg') && $this->getRequestParameter('no_reg') != '' && $this->getRequestParameter('no_reg') != null) {
         $actions = array(array('name' => 'back', 'url' => 'member/listEmployee?filters[NO_REG]=' . $this->getRequestParameter('no_reg'), 'color' => 'white'));
     } elseif ($this->hasRequestParameter('code') && $this->getRequestParameter('code') != '' && $this->getRequestParameter('code') != null) {
         $actions = array(array('name' => 'back', 'url' => 'member/listEmployee?filters[CODE]=' . $this->getRequestParameter('code'), 'color' => 'white'));
     } elseif ($this->hasRequestParameter('dept_id') && $this->getRequestParameter('dept_id') != '' && $this->getRequestParameter('dept_id') != null) {
         $actions = array(array('name' => 'back', 'url' => 'member/listEmployee?filters[DEPARTMENT_ID]=' . $this->getRequestParameter('dept_id'), 'color' => 'white'));
     } elseif ($this->hasRequestParameter('staff_type') && $this->getRequestParameter('staff_type') != '' && $this->getRequestParameter('staff_type') != null) {
         $actions = array(array('name' => 'back', 'url' => 'member/listEmployee?filters[STAFF_TYPE_ID]=' . $this->getRequestParameter('staff_type'), 'color' => 'white'));
     } elseif ($this->hasRequestParameter('name') && $this->getRequestParameter('name') != '' && $this->getRequestParameter('name') != null) {
         $actions = array(array('name' => 'back', 'url' => 'member/listEmployee?filters[NAME]=' . $this->getRequestParameter('name'), 'color' => 'white'));
     } else {
         $actions = array(array('name' => 'back', 'url' => 'member/listEmployee', 'color' => 'white'));
     }
     $this->actions = $actions;
     $this->employee = $employee;
     $this->employee_detail = $employee_detail;
     #Father
     $cw = new Criteria();
     $cw->add(EmployeeParentsPeer::EMPLOYEE_ID, $employee->getId());
     $cw->add(EmployeeParentsPeer::RELATION, EmployeeParents::RELATION_FATHER);
     $father = EmployeeParentsPeer::doSelectOne($cw);
     if ($father == null) {
         $father = new EmployeeParents();
     }
     #Mother
     $ct = new Criteria();
     $ct->add(EmployeeParentsPeer::EMPLOYEE_ID, $employee->getId());
     $ct->add(EmployeeParentsPeer::RELATION, EmployeeParents::RELATION_MOTHER);
     $mother = EmployeeParentsPeer::doSelectOne($ct);
     if ($mother == null) {
         $mother = new EmployeeParents();
     }
     #Father In Law
     $cwi = new Criteria();
     $cwi->add(EmployeeParentsPeer::EMPLOYEE_ID, $employee->getId());
     $cwi->add(EmployeeParentsPeer::RELATION, EmployeeParents::RELATION_FATHER_INLAW);
     $father_inlaw = EmployeeParentsPeer::doSelectOne($cwi);
     if ($father_inlaw == null) {
         $father_inlaw = new EmployeeParents();
     }
     #Mother In Law
     $cti = new Criteria();
     $cti->add(EmployeeParentsPeer::EMPLOYEE_ID, $employee->getId());
     $cti->add(EmployeeParentsPeer::RELATION, EmployeeParents::RELATION_MOTHER_INLAW);
     $mother_inlaw = EmployeeParentsPeer::doSelectOne($cti);
     if ($mother_inlaw == null) {
         $mother_inlaw = new EmployeeParents();
     }
     $this->father = $father;
     $this->mother = $mother;
     $this->father_inlaw = $father_inlaw;
     $this->mother_inlaw = $mother_inlaw;
     $cli = new Criteria();
     $cli->add(EmployeeChildsPeer::EMPLOYEE_ID, $employee->getId());
     $employee_childs = EmployeeChildsPeer::doSelect($cli);
     $childs = array();
     foreach ($employee_childs as $emp_child) {
         $childs[$emp_child->getRelation()] = $emp_child->getId();
     }
     $this->childs = $childs;
     $this->employee_childs = $employee_childs;
 }
示例#13
0
 public function executeShowEmployee()
 {
     $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);
     $employee = EmployeePeer::retrieveByPk($this->getRequestParameter('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);
     $student_id = $this->getRequestParameter('student_id');
     $student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id'));
     $this->forward404Unless($student);
     $actions = array(array('name' => 'back', 'url' => 'counseling_detail/listEkskul?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'black'));
     $this->actions = $actions;
     $this->counseling = $counseling;
     $this->counseling_id = $counseling_id;
     $this->student = $student;
     $this->employee = $employee;
     $this->employee_detail = $employee_detail;
     $this->academic_calendar = $academic_calendar;
 }
示例#14
0
 public function executeShowEmployee()
 {
     $student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $student = StudentPeer::retrieveByPK($student_id);
     $this->forward404Unless($student);
     $employee = EmployeePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($employee);
     $academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal_id'));
     $this->forward404Unless($academic_calendar);
     $this->subtitle = $employee->toString() . ' - id:' . $employee->getId();
     $c = new Criteria();
     $c->add(EmployeeDetailPeer::EMPLOYEE_ID, $employee->getId());
     $employee_detail = EmployeeDetailPeer::doSelectOne($c);
     $actions = array();
     $this->actions = $actions;
     if ($academic_calendar->getCourseModel() == 'A') {
         $actions2 = array(array('name' => '<span>Semester 1 ' . $academic_calendar->getParentName() . '</span>', 'url' => 'student_ekskul/list', 'color' => 'sun'));
     } else {
         $actions2 = array(array('name' => '<span>Semester 2 ' . $academic_calendar->getParentName() . '</span>', 'url' => 'student_ekskul/list2', 'color' => 'sun'));
     }
     array_push($actions2, array('name' => '<span>Detail Pembina / Pendamping</span>', 'url' => 'student_ekskul/showEmployee?id=' . $employee->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun', 'type' => 'direct'));
     $this->actions2 = $actions2;
     $this->student = $student;
     $this->employee = $employee;
     $this->employee_detail = $employee_detail;
 }
示例#15
0
 public function executeShowMedical()
 {
     $employee_medical = EmployeeMedicalPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($employee_medical);
     $this->subtitle = $employee_medical->toString() . ' - id:' . $employee_medical->getId();
     $academic_calendar_id = $this->getRequestParameter('academic_calendar_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id);
     $this->forward404Unless($academic_calendar);
     $department_id = $this->getRequestParameter('department_id');
     $department = DepartmentPeer::retrieveByPK($department_id);
     $this->forward404Unless($department);
     $actions = array(array('name' => 'Kembali', 'url' => 'employee_report/lisMedical?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'black'));
     $this->actions = $actions;
     $this->employee_medical = $employee_medical;
     $actions2 = array(array('name' => '<span>Rekap Kepegawaian</span>', 'url' => 'employee_report/list', 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Mutasi Jabatan</span>', 'url' => 'employee_report/listJob?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Absensi Pegawai</span>', 'url' => 'employee_report/listAbsence?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Absen Per Pegawai</span>', 'url' => 'employee_report/listAbsenceEmployee?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Cuti Pegawai</span>', 'url' => 'employee_report/listLeave?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Izin Pegawai</span>', 'url' => 'employee_report/listPermit?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Pengobatan</span>', 'url' => 'employee_report/listMedical?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'sun', 'type' => 'direct'));
     array_push($actions2, array('name' => '<span>Gaji Pegawai</span>', 'url' => 'employee_report/listSalary?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'sky'));
     $this->actions2 = $actions2;
     $cd = new Criteria();
     $cd->add(EmployeeDetailPeer::EMPLOYEE_ID, $employee_permit->getEmployeeId());
     $this->employee_detail = EmployeeDetailPeer::doSelectOne($cd);
     $this->academic_calendar = $academic_calendar;
     $this->department = $department;
 }
示例#16
0
 public function executeShow()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $usertype = $this->getContext()->getUser()->getAttribute('usertype', null, 'bo');
     $jobtemplate = $this->getContext()->getUser()->getAttribute('job_template_id', null, 'bo');
     if ($jobtemplate == 1) {
         $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;
         $byEmployee = false;
     } else {
         $c = new Criteria();
         $c->add(JobPeer::CODE, 'employee_job_history_l');
         $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;
         $byEmployee = true;
     }
     $employee_job_history = EmployeeJobHistoryPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($employee_job_history);
     $this->subtitle = $employee_job_history->toString() . ' - id:' . $employee_job_history->getId();
     $actions = array(array('name' => 'Kembali', 'url' => 'employee_job_history/list?employee_id=' . $employee_job_history->getEmployeeId() . '&byEmployee=' . $byEmployee, 'color' => 'black'));
     if ($acl->getEditPriv()) {
         array_push($actions, array('name' => 'Ubah', 'url' => 'employee_job_history/edit?id=' . $employee_job_history->getId() . '&byEmployee=' . $byEmployee, 'color' => 'blue'));
     }
     if ($acl->getRemovePriv()) {
         array_push($actions, array('name' => 'Hapus', 'url' => 'employee_job_history/delete?id=' . $employee_job_history->getId(), 'color' => 'red'));
     }
     $this->actions = $actions;
     $this->employee_job_history = $employee_job_history;
     $employee = $employee_job_history->getEmployee();
     if ($byEmployee == false) {
         $actions2 = array(array('name' => '<span>Catatan Kepegawaian</span>', 'url' => 'employee_list/list', 'color' => 'sky'));
         array_push($actions2, array('name' => '<span>Mutasi Jabatan</span>', 'url' => 'employee_job_history/list?employee_id=' . $employee->getId(), 'color' => 'sun', 'type' => 'direct'));
         array_push($actions2, array('name' => '<span>Absensi Pegawai</span>', 'url' => 'employee_absence/list?employee_id=' . $employee->getId(), 'color' => 'sky'));
         array_push($actions2, array('name' => '<span>Administrasi Cuti</span>', 'url' => 'employee_leave/list?employee_id=' . $employee->getId(), 'color' => 'sky'));
         array_push($actions2, array('name' => '<span>Administrasi Izin</span>', 'url' => 'employee_permit/list?employee_id=' . $employee->getId(), 'color' => 'sky'));
         array_push($actions2, array('name' => '<span>Administrasi Pengobatan</span>', 'url' => 'employee_medical/list?employee_id=' . $employee->getId(), 'color' => 'sky'));
         array_push($actions2, array('name' => '<span>Gaji Pegawai</span>', 'url' => 'employee_salary/list?employee_id=' . $employee->getId(), 'color' => 'sky'));
         $this->actions2 = $actions2;
     }
     $this->byEmployee = $byEmployee;
     $cd = new Criteria();
     $cd->add(EmployeeDetailPeer::EMPLOYEE_ID, $employee_job_history->getEmployeeId());
     $this->employee_detail = EmployeeDetailPeer::doSelectOne($cd);
 }