function get_single_educ($employee_id, $level) { $data = array(); $e = new Education(); $e->where('employee_id', $employee_id); $e->where('level', $level); $e->get(); return $e; /* $this->db->where('employee_id', $employee_id); $this->db->where('level', $level); $this->db->order_by('level'); $q = $this->db->get('education_background'); if ($q->num_rows() > 0) { foreach ($q->result_array() as $row) { $data = $row; } } return $data; $q->free_result(); */ }
public function studentPerSchoolFilter($id) { $school = School::find($id); $educations = Education::where('project_id', '=', Auth::user()->curr_project_id)->where('school_id', '=', $id)->get(); $menu = 'report'; return View::make('reports.studentperschool', compact('educations', 'school', 'menu')); }
public function normalizeIssue() { $issues = Issue::all(); foreach ($issues as $issue) { // Normalize Educations $educations = Education::where('student_id', '=', $issue->student_id)->get(); foreach ($educations as $education) { $education->student_id = $issue->id; $education->save(); } // Normalize Placements $placements = Placement::where('student_id', '=', $issue->student_id)->get(); foreach ($placements as $placement) { $placement->student_id = $issue->id; $placement->save(); } // Normalize Receivables $receivables = Receivable::where('student_id', '=', $issue->student_id)->get(); foreach ($receivables as $receivable) { $receivable->student_id = $issue->id; $receivable->save(); } } }
function education($employee_id = '') { $data['page_name'] = '<b>Personal Data Sheet</b>'; $data['section_name'] = '<b>Personal Information</b>'; $data['focus_field'] = 'elem_school'; $data['msg'] = ''; $e = new Employee_m(); $data['employee'] = $e->get_by_id($employee_id); $e = new Education(); if (Input::get('op')) { // EDUCATIONAL BACKGROUND============================================ // ELEMENTARY if (Input::get('elem_school') != "") { $e = new Education(); $e->where('level', 1); $e->where('employee_id', $employee_id)->get(); $e->delete_all(); $e->employee_id = $employee_id; $e->level = 1; $e->school_name = Input::get('elem_school'); $e->degree_course = Input::get('elem_degree'); $e->year_graduated = Input::get('elem_grad'); $e->highest_grade = Input::get('elem_units'); $e->attend_from = Input::get('elem_date1'); $e->attend_to = Input::get('elem_date2'); $e->scholarship = Input::get('elem_scho'); $e->save(); } // HIGHSCHOOL if (Input::get('sec_school') != "") { $e = new Education(); $e->where('level', 2); $e->where('employee_id', $employee_id)->get(); $e->delete_all(); $e->employee_id = $employee_id; $e->level = 2; $e->school_name = Input::get('sec_school'); $e->degree_course = Input::get('sec_degree'); $e->year_graduated = Input::get('sec_grad'); $e->highest_grade = Input::get('sec_units'); $e->attend_from = Input::get('sec_date1'); $e->attend_to = Input::get('sec_date2'); $e->scholarship = Input::get('sec_scho'); $e->save(); } // VOC if (Input::get('voc_school') != "") { $e = new Education(); $e->where('level', 3); $e->where('employee_id', $employee_id)->get(); $e->delete_all(); $e->employee_id = $employee_id; $e->level = 3; $e->school_name = Input::get('voc_school'); $e->degree_course = Input::get('voc_degree'); $e->year_graduated = Input::get('voc_grad'); $e->highest_grade = Input::get('voc_units'); $e->attend_from = Input::get('voc_date1'); $e->attend_to = Input::get('voc_date2'); $e->scholarship = Input::get('voc_scho'); $e->save(); } // COLLEGE if (Input::get('col_school') != "") { $e = new Education(); $e->where('level', 4); $e->where('employee_id', $employee_id)->get(); $e->delete_all(); $e->employee_id = $employee_id; $e->level = 4; $e->school_name = Input::get('col_school'); $e->degree_course = Input::get('col_degree'); $e->year_graduated = Input::get('col_grad'); $e->highest_grade = Input::get('col_units'); $e->attend_from = Input::get('col_date1'); $e->attend_to = Input::get('col_date2'); $e->scholarship = Input::get('col_scho'); $e->save(); } // GRAD SCHOOL if (Input::get('grad_school') != "") { $e = new Education(); $e->where('level', 5); $e->where('employee_id', $employee_id)->get(); $e->delete_all(); $e->employee_id = $employee_id; $e->level = 5; $e->school_name = Input::get('grad_school'); $e->degree_course = Input::get('grad_degree'); $e->year_graduated = Input::get('grad_grad'); $e->highest_grade = Input::get('grad_units'); $e->attend_from = Input::get('grad_date1'); $e->attend_to = Input::get('grad_date2'); $e->scholarship = Input::get('grad_scho'); $e->save(); } $data['msg'] = 'Educational Background has been saved!'; } // Educational Background====================================== $e = new Education(); $data['educs1'] = $e->get_single_educ($employee_id, $level = 1); $data['educs2'] = $e->get_single_educ($employee_id, $level = 2); $data['educs3'] = $e->get_single_educ($employee_id, $level = 3); $data['educs4'] = $e->get_single_educ($employee_id, $level = 4); $data['educs5'] = $e->get_single_educ($employee_id, $level = 5); $e = new Employee_m(); $e->get_by_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'] = 'education'; return View::make('includes/template', $data); }
public function duplicatecvpage($cv_code) { $cv_old = Cv::where('cv_code', $cv_code)->first(); if ($cv_old->user_id != Auth::id()) { return 'False'; } $new_cv_name = $cv_old->cv_name . ' - Copy'; $cv = new Cv(); do { $random = str_random(10); $count = Cv::where('cv_code', $random)->count(); } while ($count != 0); $cv->cv_code = $random; if (Auth::check()) { $cv->user_id = Auth::id(); } $cv->cv_name = $new_cv_name; $cv->user_id = $cv_old->user_id; $cv->full_name = $cv_old->full_name; $cv->phone_num = $cv_old->phone_num; $cv->email = $cv_old->email; $cv->website = $cv_old->website; $cv->add_line1 = $cv_old->add_line1; $cv->add_line2 = $cv_old->add_line2; $cv->dob = $cv_old->dob; $cv->marital_status = $cv_old->marital_status; $cv->profile_image = $cv_old->profile_image; $cv->sex = $cv_old->sex; $cv->state_origin = $cv_old->state_origin; $cv->religion = $cv_old->religion; $cv->religion_text = $cv_old->religion_text; $cv->show_profile_pic = $cv_old->show_profile_pic; $cv->local_government = $cv_old->local_government; $cv->save(); $new_cv_id = $cv->id; // copying sections $sections = Section::where('cv_id', $cv_old->id)->get(); foreach ($sections as $section) { $section_new = new Section(); $section_new->cv_id = $new_cv_id; $section_new->section_name = $section->section_name; $section_new->type = $section->type; $section_new->content = $section->content; $section_new->default = $section->default; $section_new->priority = $section->priority; $section_new->save(); } // copying educations $educations = Education::where('cv_id', $cv_old->id)->get(); foreach ($educations as $education) { $education_new = new Education(); $education_new->cv_id = $new_cv_id; $education_new->coursename = $education->coursename; $education_new->institutename = $education->institutename; $education_new->add_line1 = $education->add_line1; $education_new->add_line2 = $education->add_line2; $education_new->startdate = $education->startdate; $education_new->enddate = $education->enddate; $education_new->otherinfo = $education->otherinfo; $education_new->priority = $education->priority; $education_new->save(); } // copying languages $languages = Language::where('cv_id', $cv_old->id)->get(); foreach ($languages as $language) { $language_new = new Language(); $language_new->cv_id = $new_cv_id; $language_new->language_id = $language->language_id; $language_new->language_name = $language->language_name; $language_new->ability_id = $language->ability_id; $language_new->level_id = $language->level_id; $language_new->priority = $language->priority; $language_new->save(); } // copying nysc $nyscs = Nysc::where('cv_id', $cv_old->id)->get(); foreach ($nyscs as $nysc) { $nysc_new = new Nysc(); $nysc_new->cv_id = $new_cv_id; $nysc_new->year = $nysc->year; $nysc_new->batch = $nysc->batch; $nysc_new->ppa = $nysc->ppa; $nysc_new->cd = $nysc->cd; $nysc_new->otherinfo = $nysc->otherinfo; $nysc_new->priority = $nysc->priority; $nysc_new->save(); } // copying work_exp $work_exps = WorkExperience::where('cv_id', $cv_old->id)->get(); foreach ($work_exps as $work_exp) { $work_exp_new = new WorkExperience(); $work_exp_new->cv_id = $new_cv_id; $work_exp_new->title = $work_exp->title; $work_exp_new->company = $work_exp->company; $work_exp_new->location = $work_exp->location; $work_exp_new->startdate = $work_exp->startdate; $work_exp_new->enddate = $work_exp->enddate; $work_exp_new->otherinfo = $work_exp->otherinfo; $work_exp_new->priority = $work_exp->priority; $work_exp_new->save(); } return Redirect::back(); }
function update() { $education = new Education(); $id = $this->input->post('id'); $education->where('edu_id', $id)->update(array('edu_year' => $this->input->post('edu_year'), 'edu_gelar' => $this->input->post('edu_gelar'), 'edu_name' => $this->input->post('edu_name'))); $this->session->set_flashdata('message', 'Education Update successfuly.'); redirect('staffs/' . $this->staff_id . '/educations/index'); }
public static function getBarAtLaw() { //return Apphelper::getMemberId(); $membership_id = AppHelper::getMemberId(); $Id = Education::where('membership_id', '=', $membership_id)->get(); //return $user; foreach ($Id as $value) { $id = $value['id']; } $education = Education::find($id); return $education->BarAtLaw; }
public function show($id) { $this->breadcrumb->append_crumb('Home', base_url()); $this->breadcrumb->append_crumb('Staff Detail', base_url() . ''); $staff = new Staff(); $data['staff'] = $staff->where('staff_id', $id)->get(); $family = new Family(); $data['families'] = $family->where('staff_fam_staff_id', $data['staff']->staff_id)->get(); $work = new Work(); $data['works'] = $work->where('staff_id', $data['staff']->staff_id)->get(); $education = new Education(); $data['educations'] = $education->where('staff_id', $data['staff']->staff_id)->get(); $medical = new Medical(); $data['medicals'] = $medical->where('staff_id', $data['staff']->staff_id)->get(); $asset_detail = new Asset_Detail(); $data['asset_details'] = $asset_detail->where('staff_id', $data['staff']->staff_id)->get(); $data['btn_back'] = anchor('staffs/', 'Back'); $data['btn_edit'] = anchor('staffs/edit/' . $data['staff']->staff_id, 'Edit'); $this->load->view('staffs/show', $data); }
public function deleteEducation($education_id, $code) { $cv = Cv::where('cv_code', $code)->first(); $cv_id = $cv->id; Education::where('id', $education_id)->where('cv_id', $cv_id)->delete(); $data["success"] = 1; $data["message"] = "Succefully deleted"; return json_encode($data); }