function other_info($employee_id = '') { $data['page_name'] = '<b>Personal Data Sheet</b>'; $data['section_name'] = '<b>Personal Information</b>'; $data['focus_field'] = 'skill'; $data['msg'] = ''; $e = new Employee_m(); $data['employee'] = $e->get_by_id($employee_id); if (Input::get('op')) { // OTHER INFORMATION========================= $skills = Input::get('skill'); $recognition = Input::get('recognition'); $membership_organization = Input::get('membership_organization'); $o = new Other_info(); $o->get_by_employee_id($employee_id); $o->delete_all(); $i = 0; foreach ($skills as $skill) { $o = new Other_info(); $o->employee_id = $employee_id; $o->special_skills = $skills[$i]; $o->recognition = $recognition[$i]; $o->membership_organization = $membership_organization[$i]; $o->save(); $i++; } // QUESTIONS======================================= $questions = Input::get('q'); $answer = Input::get('q'); $details = Input::get('details'); $q = new Question(); $q->get_by_employee_id($employee_id); // Delete Questions $q->delete_all(); $i = 0; $count = 0; foreach ($questions as $question) { $count += 1; $q = new Question(); $q->employee_id = $employee_id; $q->question_no = $count; $q->answer = $answer[$i]; $q->details = $details[$i]; $q->save(); $i++; } // REFERENCE $names = Input::get('ref_name'); $address = Input::get('ref_address'); $no = Input::get('ref_tel'); $r = new Reference(); $r->get_by_employee_id($employee_id); $r->delete_all(); $i = 0; foreach ($names as $name) { $r = new Reference(); $r->employee_id = $employee_id; $r->name = $names[$i]; $r->address = $address[$i]; $r->tel_no = $no[$i]; $r->ctc_no = Input::get('ctc_no'); $r->issue_at = Input::get('issue_at'); $r->issue_on = Input::get('issue_on'); $r->save(); $i++; } $data['msg'] = 'Other Information has been saved!'; } // Other information============================================ $o = new Other_info(); $data['infos'] = $o->get_by_employee_id($employee_id); // Question ==================================================== $q = new Question(); $data['question_options'] = array('0' => 'No', '1' => 'Yes'); $data['question1'] = $q->get_question($employee_id, 1); $data['question2'] = $q->get_question($employee_id, 2); $data['question3'] = $q->get_question($employee_id, 3); $data['question4'] = $q->get_question($employee_id, 4); $data['question5'] = $q->get_question($employee_id, 5); $data['question6'] = $q->get_question($employee_id, 6); $data['question7'] = $q->get_question($employee_id, 7); $data['question8'] = $q->get_question($employee_id, 8); $data['question9'] = $q->get_question($employee_id, 9); $data['question10'] = $q->get_question($employee_id, 10); // References================================================= $r = new Reference(); $data['references'] = $r->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'] = 'other_info'; return View::make('includes/template', $data); }
function page3($employee_id) { $this->load->helper('settings'); $this->load->library('fpdf'); //define('FPDF_FONTPATH',$this->config->item('fonts_path')); $this->load->library('fpdi'); //print_r($personal_info); // initiate FPDI $pdf = new FPDI('P', 'mm', 'Legal'); // add a page $pdf->AddPage(); // set the sourcefile $pdf->setSourceFile('dtr/template/pds/page3.pdf'); // import page 1 $tplIdx = $pdf->importPage(1); // use the imported page and place it at point 10,10 with a width of 100 mm $pdf->useTemplate($tplIdx, 1, 1, 210); // now write some text above the imported page $pdf->SetFont('Arial'); $pdf->SetTextColor(0, 0, 0); $pdf->SetXY(8, 31); $org = new Organization(); $orgs = $org->get_by_employee_id($employee_id); $i = 1; foreach ($orgs as $org) { $pdf->SetX(8); $pdf->Write(0, $org->name); $pdf->SetFont('Arial', '', 8); $pdf->SetX(95); $pdf->Write(0, $org->inclusive_date_from); $pdf->SetX(117); $pdf->Write(0, $org->inclusive_date_from); $pdf->SetFont('Arial', '', 12); $pdf->SetX(138); $pdf->Write(0, $org->number_of_hours); $pdf->SetX(155); $pdf->Write(0, $org->position); $pdf->SetX(188); $pdf->Write(0, $org->license_release_date); $pdf->SetFont('Arial', '', 12); if ($i == 2 || $i == 6) { $pdf->Ln(8); } else { $pdf->Ln(7); } $i++; } // ther info $pdf->SetXY(8, 258); $i = new Other_info(); $infos = $i->get_by_employee_id($employee_id); $i = 1; foreach ($infos as $info) { $pdf->SetFont('Arial', '', 8); $pdf->SetX(8); $pdf->Write(0, $info->special_skills); $pdf->SetX(58); $pdf->Write(0, $info->recognition); $pdf->SetX(155); //$pdf->Write(0, $info->membership_organization); $pdf->Write(0, str_replace('…', '..', character_limiter($info->membership_organization, 25))); $pdf->SetX(138); $pdf->Write(0, $info->number_hours); $pdf->SetX(155); $pdf->Write(0, $info->conducted_by); $pdf->SetFont('Arial', '', 12); if ($i == 6 || $i == 10 || $i == 11 || $i == 16) { $pdf->Ln(8); } else { $pdf->Ln(7); } $i++; } //Training (we set this code below other info // because of long list of trainings // but this will be first in page $pdf->SetXY(8, 105); $t = new Training(); $t->order_by('date_from', 'DESC'); // Lets set the limit first // //$t->limit(18); $trainings = $t->get_by_employee_id($employee_id); $i = 1; foreach ($trainings as $training) { $pdf->SetFont('Arial', '', 8); $pdf->SetX(8); //$pdf->Write(0, $training->name); $pdf->Write(0, str_replace('…', '..', character_limiter($training->name, 50))); $pdf->SetX(95); $pdf->Write(0, $training->date_from); $pdf->SetX(117); $pdf->Write(0, $training->date_to); $pdf->SetX(138); $pdf->Write(0, $training->number_hours); $pdf->SetX(155); //$pdf->Write(0, $training->conducted_by); $pdf->Write(0, str_replace('…', '..', character_limiter($training->conducted_by, 25))); $pdf->SetFont('Arial', '', 12); if ($i == 6 || $i == 10 || $i == 11 || $i == 16) { $pdf->Ln(8); } else { $pdf->Ln(7); } if ($i == 18) { //break; $pdf->AddPage(); } $i++; } // Output $pdf->Output('dtr/template/pds/page3_' . $employee_id . '.pdf', 'F'); //header("location:".base_url()."resources/pdfs/archives/page3_".$employee_id.'.pdf'); $this->pds[] = 'dtr/template/pds/page3_' . $employee_id . '.pdf'; }