Ejemplo n.º 1
0
 function personal_info($employee_id = '')
 {
     $data['page_name'] = '<b>Personal Data Sheet</b>';
     $data['section_name'] = '<b>Personal Information</b>';
     $data['focus_field'] = 'lname';
     $data['msg'] = '';
     $e = new Employee_m();
     $data['employee'] = $e->get_by_id($employee_id);
     if (Input::get('op')) {
         $p = new Personal();
         $p->get_by_employee_id($employee_id);
         $p->employee_id = $employee_id;
         $p->lname = Input::get('lname');
         $p->fname = Input::get('fname');
         $p->mname = Input::get('mname');
         $p->extension = Input::get('extension');
         $p->birth_date = Input::get('birth_date');
         $p->birth_place = Input::get('birth_place');
         $p->sex = Input::get('sex');
         $p->civil_status = Input::get('civil_status');
         $p->citizenship = Input::get('citizenship');
         $p->height = Input::get('height');
         $p->weight = Input::get('weight');
         $p->blood_type = Input::get('blood_type');
         $p->gsis = Input::get('gsis');
         $p->pagibig = Input::get('pagibig');
         $p->philhealth = Input::get('philhealth');
         $p->sss = Input::get('sss');
         $p->res_address = Input::get('res_address');
         $p->res_zip = Input::get('res_zip');
         $p->res_tel = Input::get('res_tel');
         $p->permanent_address = Input::get('permanent_address');
         $p->permanent_zip = Input::get('permanent_zip');
         $p->permanent_tel = Input::get('permanent_tel');
         $p->email = Input::get('email');
         $p->cp = Input::get('cp');
         $p->agency_employee_no = Input::get('agency_employee_no');
         $p->tin = Input::get('tin');
         $p->save();
         $e2 = new Employee_m();
         $e2->where('id', $employee_id);
         $info = array('birth_date' => Input::get('birth_date'), 'sex' => Input::get('sex'), 'res_address' => Input::get('res_address'));
         $e2->update($info);
         $data['msg'] = 'Personal Information has been saved!';
     }
     $data['sex_options'] = array('M' => 'Male', 'F' => 'Female');
     $data['civil_status_options'] = array('1' => 'Single', '2' => 'Married', '3' => 'Annulled', '4' => 'Widowed', '5' => 'Separated', '6' => 'Others');
     $personal = new Personal();
     $data['personal'] = $personal->get_by_employee_id($employee_id);
     $data['selected'] = $e->office_id;
     // Use for office listbox
     $data['options'] = $this->options->office_options();
     $data['employee_id'] = $employee_id;
     $data['main_content'] = 'personal_info';
     return View::make('includes/template', $data);
 }