Example #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);
 }
 function getpage($p)
 {
     $data = initializeData($this, "Leave Transactions");
     $data['page_url'] = main_url() . 'leave_transactions';
     if ($p == 'form') {
         $this->load->model('leave_credits_model');
         $list2 = $this->leave_credits_model->getLeaveCreditsByEmployee(getUserId($this), 1);
         $sJs = 'class="form-control form-text"';
         $data['leave_list'] = generateSelectUI($this, $list2, 'leave_credits_id', 'id', 'title', '', $sJs);
     }
     $data['eid'] = $this->mod->getEmploymentId(getUserId($this));
     renderPage($this, $this->table . '/' . $p, $data);
 }
Example #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);
 }
Example #4
0
 function form()
 {
     $data = initializeData($this, "Form");
     $data['page_url'] = main_url() . 'employment';
     $leave = '';
     $dp = '';
     if (isset($_GET['id'])) {
         if (!empty($_GET['id'])) {
             $data['data'] = $this->mod->getObjectById($this->table, 'id', $_GET['id']);
             $leave = $data['data'][0]->dept_stat_id;
             $dp = $data['data'][0]->employee_id;
         }
     }
     $sJs = 'class="form-control form-text"';
     $this->load->model('dept_stat_model');
     $emptstat = $this->emp_types_stat_model->getListByQuery('');
     $this->load->model('employees_model');
     $emp = $this->employees_model->getEmployeeList('');
     $data['emptypesstat_list'] = generateSelectUI($this, $list1, 'emp_types_stat_id', 'id', 'emp_types_name', $emptstat, $sJs);
     $data['employees_list'] = generateSelectUI($this, $list2, 'employee_id', 'id', 'fullname', $emp, $sJs);
     renderPage($this, $this->table . '/form', $data);
 }
Example #5
0
function genRanksListUI($context, $list, $defaultVal)
{
    $sJs = 'class="form-control form-text"';
    return generateSelectUI($context, $list, 'rank_id', 'id', 'rank_name', $defaultVal, $sJs);
}