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 page4($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/page4.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, 14); $q = new Question(); $q->order_by('question_no'); $questions = $q->get_by_employee_id($employee_id); foreach ($questions as $question) { if ($question->question_no == 1) { if ($question->answer == 1) { $setx = 138.5; } else { $setx = 164; } $pdf->SetX($setx); $pdf->Write(0, 'X'); } if ($question->question_no == 2) { $pdf->Ln(21); if ($question->answer == 1) { $setx = 138.5; } else { $setx = 164; } $pdf->SetX($setx); $pdf->Write(0, 'X'); } if ($question->question_no == 3) { $pdf->Ln(26); if ($question->answer == 1) { $setx = 138.5; } else { $setx = 164; } $pdf->SetX($setx); $pdf->Write(0, 'X'); } if ($question->question_no == 4) { $pdf->Ln(21); if ($question->answer == 1) { $setx = 138.5; } else { $setx = 164; } $pdf->SetX($setx); $pdf->Write(0, 'X'); } if ($question->question_no == 5) { $pdf->Ln(26); if ($question->answer == 1) { $setx = 138.5; } else { $setx = 164; } $pdf->SetX($setx); $pdf->Write(0, 'X'); } if ($question->question_no == 6) { $pdf->Ln(26); if ($question->answer == 1) { $setx = 138.5; } else { $setx = 164; } $pdf->SetX($setx); $pdf->Write(0, 'X'); } if ($question->question_no == 7) { $pdf->Ln(21); if ($question->answer == 1) { $setx = 138.5; } else { $setx = 164; } $pdf->SetX($setx); $pdf->Write(0, 'X'); } if ($question->question_no == 8) { $pdf->Ln(35); if ($question->answer == 1) { $setx = 138.5; } else { $setx = 164; } $pdf->SetX($setx); $pdf->Write(0, 'X'); } if ($question->question_no == 9) { $pdf->Ln(12); if ($question->answer == 1) { $setx = 138.5; } else { $setx = 164; } $pdf->SetX($setx); $pdf->Write(0, 'X'); } if ($question->question_no == 10) { $pdf->Ln(13); if ($question->answer == 1) { $setx = 138.5; } else { $setx = 164; } $pdf->SetX($setx); $pdf->Write(0, 'X'); } } $pdf->SetXY(8, 233); //$pdf->Write(0, 'X'); $r = new Reference(); $references = $r->get_by_employee_id($employee_id); foreach ($references as $reference) { $pdf->SetX(8); $pdf->Write(0, $reference->name); $pdf->SetX(72); $pdf->Write(0, $reference->address); $pdf->SetX(134); $pdf->Write(0, $reference->tel_no); $pdf->Ln(4); } // CTC NO $pdf->SetXY(15, 275); $pdf->Write(0, $reference->ctc_no); $pdf->Ln(13); $pdf->SetX(15); $pdf->Write(0, $reference->issue_at); $pdf->Ln(13); $pdf->SetX(15); $pdf->Write(0, $reference->issue_on); $pdf->SetX(90); $pdf->Write(0, date('F d, Y')); // Output $pdf->Output('dtr/template/pds/page4_' . $employee_id . '.pdf', 'F'); //header("location:".base_url()."resources/pdfs/archives/page4_".$employee_id.'.pdf'); $this->pds[] = 'dtr/template/pds/page4_' . $employee_id . '.pdf'; }