Ejemplo n.º 1
0
 function form()
 {
     $data = initializeData($this, "Form");
     $data['page_url'] = main_url() . 'leave_credits';
     $leave = '';
     $dp = '';
     $stat = '';
     $dept = '';
     if (isset($_GET['id'])) {
         if (!empty($_GET['id'])) {
             $data['data'] = $this->mod->getObjectById($this->table, 'id', $_GET['id']);
             $leave = $data['data'][0]->leave_types_id;
             $dept = $this->mod->getEmpTypeOfLeaveCredit($data['data'][0]->id);
             $stat = $this->mod->getStatOfLeaveCredit($data['data'][0]->id);
             $dept = $dept[0]->id;
             $stat = $stat[0]->id;
         }
     }
     $sJs = 'class="form-control form-text"';
     $list1 = $this->emp_types_model->getObjectList('');
     $list2 = $this->status_model->getObjectList('');
     $data['emptypes_list'] = genEmpTypesListUI($this, $list1, $dept);
     $data['status_list'] = genStatusListUI($this, $list2, $stat);
     $this->load->model('leave_types_model');
     $list2 = $this->leave_types_model->getObjectList('');
     $data['leave'] = generateSelectUI($this, $list2, 'leave_types_id', 'id', 'title', $leave, $sJs);
     renderPage($this, $this->table . '/form', $data);
 }
Ejemplo n.º 2
0
 function index()
 {
     $data = initializeData($this, "Employee Records");
     $data['page_url'] = main_url() . 'employment';
     $sJs = 'class="form-control form-text"';
     $list1 = $this->emp_types_model->getObjectList('');
     $list2 = $this->status_model->getObjectList('');
     $list3 = $this->departments_model->getObjectList('');
     $data['dept_list'] = genDepartmentListUI($this, $list3, '');
     $data['emptypes_list'] = genEmpTypesListUI($this, $list1, '');
     $data['status_list'] = genStatusListUI($this, $list2, '');
     renderPage($this, $this->table . '/index', $data);
 }
Ejemplo n.º 3
0
 function form()
 {
     $data = initializeData($this, "Employee Form");
     $gen = '';
     $bt = '';
     $dept = '';
     $stat = '';
     $rank = '';
     $role = '';
     $deps = '';
     if (isset($_GET['id'])) {
         if (!empty($_GET['id'])) {
             //var_dump($this->mod->getObjectById($this->table, 'id', $_GET['id']));
             //exit;
             $data['data'] = $this->mod->getObjectById($this->table, 'id', $_GET['id']);
             $gen = $data['data'][0]->gender;
             $bt = $data['data'][0]->blood_type;
             $dept = $this->mod->getEmpTypeOfEmployee($data['data'][0]->id);
             $stat = $this->mod->getStatOfEmployee($data['data'][0]->id);
             $dept = $dept[0]->id;
             $stat = $stat[0]->id;
             $rank = $data['data'][0]->rank_id;
             $role = $data['data'][0]->role_id;
             $deps = $data['data'][0]->department_id;
             $data['datehired'] = $this->mod->getHireDateByEmployee(getUserId($this));
             $data['employment'] = $this->mod->getEmployment($data['data'][0]->id);
         }
     }
     $sJs = 'class="form-control form-text"';
     $rolelist = $this->roles_model->getObjectList('');
     $rankslist = $this->ranks_model->getObjectList('');
     $departmentslist = $this->departments_model->getObjectList('');
     $data['role_list'] = generateSelectUI($this, $rolelist, 'role_id', 'id', 'role_name', $role, $sJs);
     $data['rank_list'] = generateSelectUI($this, $rankslist, 'rank_id', 'id', 'rank_name', $rank, $sJs);
     $data['department_list'] = generateSelectUI($this, $departmentslist, 'department_id', 'id', 'department_name', $deps, $sJs);
     $list1 = $this->emp_types_model->getObjectList('');
     $list2 = $this->status_model->getObjectList('');
     $data['emptypes_list'] = genEmpTypesListUI($this, $list1, $dept);
     $data['status_list'] = genStatusListUI($this, $list2, $stat);
     $genderlist = $this->mod->getEnumValues('employees', 'employees', 'gender');
     $bloodtypelist = $this->mod->getEnumValues('employees', 'employees', 'blood_type');
     $data['gender_list'] = form_dropdown('gender', $genderlist, $gen, $sJs);
     $data['bloodtype_list'] = form_dropdown('blood_type', $bloodtypelist, $bt, $sJs);
     renderPage($this, $this->table . '/form', $data);
 }
Ejemplo n.º 4
0
 function form()
 {
     $data = initializeData($this, "Form");
     $data['page_url'] = main_url() . 'emp_types_stat';
     $empt = '';
     $stat = '';
     if (isset($_GET['id'])) {
         if (!empty($_GET['id'])) {
             $data['data'] = $this->mod->getObjectById($this->table, 'id', $_GET['id']);
             $empt = $data['data'][0]->emp_types_id;
             $stat = $data['data'][0]->status_id;
         }
     }
     $emptlist = $this->emp_types_model->getObjectList('');
     $statuslist = $this->status_model->getObjectList('');
     $data['emptypes_list'] = genEmpTypesListUI($this, $emptlist, $empt);
     $data['status_list'] = genStatusListUI($this, $statuslist, $stat);
     renderPage($this, $this->table . '/form', $data);
 }