function page1($employee_id) { $this->load->helper('settings'); $this->load->library('fpdf'); //define('FPDF_FONTPATH',$this->config->item('fonts_path')); $this->load->library('fpdi'); //$this->load->model('Personal_Info'); //Get personal info //$pi = $this->Personal_Info->get_personal_info($employee_id); $pi = new Personal(); $pi->get_by_employee_id($employee_id); //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/page1.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); /******************************* *START PERSONAL INFORMATION == ******************************/ $split[0] = ''; $split[1] = ''; $split[2] = ''; $split[3] = ''; $split[4] = ''; $split[5] = ''; $split[6] = ''; $split[7] = ''; $split[8] = ''; $split[9] = ''; $split[10] = ''; $split[11] = ''; $split[12] = ''; $split[13] = ''; $split[14] = ''; $split[15] = ''; $split[16] = ''; $split[17] = ''; $split[18] = ''; $split[19] = ''; $split[20] = ''; $split[21] = ''; $split[22] = ''; $split[23] = ''; $split[24] = ''; $split[25] = ''; $split[26] = ''; $split[27] = ''; $split[28] = ''; $split[29] = ''; //$pdf->MultiCell(0,3,"hello this is a sample \nlong text with line break" ,'',1,'L',false); //$pdf->MultiCell(0,3,"hello this is a sample \nlong text with line break" ,'',1,'L',false); //$pdf->MultiCell(0,3,"hello this is a sample \nlong text with line break" ,'',1,'L',false); $this->load->helper('text'); //$pdf->MultiCell(0,3,word_wrap("hello this is a sample nlong text with line break", 15) ,'',1,'L',false); $split = str_split($pi->lname); // Write something ==LAST NAME ========= $pdf->SetXY(39, 53); $pdf->Write(0, $split[0]); $pdf->SetX(44); $pdf->Write(0, $split[1]); $pdf->SetX(49); $pdf->Write(0, $split[2]); $pdf->SetX(54); $pdf->Write(0, $split[3]); $pdf->SetX(60); $pdf->Write(0, $split[4]); $pdf->SetX(65); $pdf->Write(0, $split[5]); $pdf->SetX(70); $pdf->Write(0, $split[6]); $pdf->SetX(75); $pdf->Write(0, $split[7]); $pdf->SetX(81); $pdf->Write(0, $split[8]); $pdf->SetX(86); $pdf->Write(0, $split[9]); $pdf->SetX(91); $pdf->Write(0, $split[10]); $pdf->SetX(96); $pdf->Write(0, $split[11]); $pdf->SetX(101); $pdf->Write(0, $split[12]); $pdf->SetX(106); $pdf->Write(0, $split[13]); $pdf->SetX(111); $pdf->Write(0, $split[14]); $pdf->SetX(116); $pdf->Write(0, $split[15]); $pdf->SetX(121); $pdf->Write(0, $split[16]); $pdf->SetX(126); $pdf->Write(0, $split[17]); $pdf->SetX(131); $pdf->Write(0, $split[18]); $pdf->SetX(137); $pdf->Write(0, $split[19]); $pdf->SetX(142); $pdf->Write(0, $split[20]); $pdf->SetX(147); $pdf->Write(0, $split[21]); $pdf->SetX(152); $pdf->Write(0, $split[22]); $pdf->SetX(157); $pdf->Write(0, $split[23]); $pdf->SetX(163); $pdf->Write(0, $split[24]); $pdf->SetX(168); $pdf->Write(0, $split[25]); $pdf->SetX(173); $pdf->Write(0, $split[26]); $pdf->SetX(178); $pdf->Write(0, $split[27]); $pdf->SetX(183); $pdf->Write(0, $split[28]); $pdf->SetX(188); $pdf->Write(0, $split[29]); // line break //=========FIRST NAME==== $split = str_split($pi->fname); $pdf->Ln(6); $pdf->SetX(39); $pdf->Write(0, $split[0]); $pdf->SetX(44); $pdf->Write(0, $split[1]); $pdf->SetX(49); $pdf->Write(0, $split[2]); $pdf->SetX(54); $pdf->Write(0, $split[3]); $pdf->SetX(60); $pdf->Write(0, $split[4]); $pdf->SetX(65); $pdf->Write(0, $split[5]); $pdf->SetX(70); $pdf->Write(0, $split[6]); $pdf->SetX(75); $pdf->Write(0, $split[7]); $pdf->SetX(81); $pdf->Write(0, $split[8]); $pdf->SetX(86); $pdf->Write(0, $split[9]); $pdf->SetX(91); $pdf->Write(0, $split[10]); $pdf->SetX(96); $pdf->Write(0, $split[11]); $pdf->SetX(101); $pdf->Write(0, $split[12]); $pdf->SetX(106); $pdf->Write(0, $split[13]); $pdf->SetX(111); $pdf->Write(0, $split[14]); $pdf->SetX(116); $pdf->Write(0, $split[15]); $pdf->SetX(121); $pdf->Write(0, $split[16]); $pdf->SetX(126); $pdf->Write(0, $split[17]); $pdf->SetX(131); $pdf->Write(0, $split[18]); $pdf->SetX(137); $pdf->Write(0, $split[19]); $pdf->SetX(142); $pdf->Write(0, $split[20]); $pdf->SetX(147); $pdf->Write(0, $split[21]); $pdf->SetX(152); $pdf->Write(0, $split[22]); $pdf->SetX(157); $pdf->Write(0, $split[23]); $pdf->SetX(163); $pdf->Write(0, $split[24]); $pdf->SetX(168); $pdf->Write(0, $split[25]); $pdf->SetX(173); $pdf->Write(0, $split[26]); $pdf->SetX(178); $pdf->Write(0, $split[27]); $pdf->SetX(183); $pdf->Write(0, $split[28]); $pdf->SetX(188); $pdf->Write(0, $split[29]); //======== MNAME $split = str_split($pi->mname); // line break $pdf->Ln(6); $pdf->SetX(39); $pdf->Write(0, $split[0]); $pdf->SetX(44); $pdf->Write(0, $split[1]); $pdf->SetX(49); $pdf->Write(0, $split[2]); $pdf->SetX(54); $pdf->Write(0, $split[3]); $pdf->SetX(60); $pdf->Write(0, $split[4]); $pdf->SetX(65); $pdf->Write(0, $split[5]); $pdf->SetX(70); $pdf->Write(0, $split[6]); $pdf->SetX(75); $pdf->Write(0, $split[7]); $pdf->SetX(81); $pdf->Write(0, $split[8]); $pdf->SetX(86); $pdf->Write(0, $split[9]); $pdf->SetX(91); $pdf->Write(0, $split[10]); $pdf->SetX(96); $pdf->Write(0, $split[11]); $pdf->SetX(101); $pdf->Write(0, $split[12]); $pdf->SetX(106); $pdf->Write(0, $split[13]); $pdf->SetX(111); $pdf->Write(0, $split[14]); $pdf->SetX(116); $pdf->Write(0, $split[15]); $pdf->SetX(121); $pdf->Write(0, $split[16]); $pdf->SetX(126); $pdf->Write(0, $split[17]); $pdf->SetX(131); $pdf->Write(0, $split[18]); $pdf->SetX(137); $pdf->Write(0, $split[19]); $pdf->SetX(142); $pdf->Write(0, $split[20]); $pdf->SetX(147); $pdf->Write(0, $split[21]); $pdf->SetX(152); $pdf->Write(0, $split[22]); $pdf->SetX(157); $pdf->Write(0, $split[23]); $pdf->SetX(163); $pdf->Write(0, $split[24]); $pdf->SetX(168); $pdf->Write(0, $split[25]); $pdf->SetX(173); $pdf->Write(0, $split[26]); $pdf->SetX(178); $pdf->Write(0, $split[27]); $pdf->SetX(183); $pdf->Write(0, $split[28]); $pdf->SetX(188); $pdf->Write(0, $split[29]); $pdf->SetX(189); $pdf->Write(0, $pi->extension); $date = $pi->birth_date; list($year, $month, $day) = explode('-', $date); $pdf->Ln(6); $pdf->SetX(67); $pdf->Write(0, $month . '-' . $day . '-' . $year); $res_address = splitstroverflow($pi->res_address, 30); $pdf->SetX(126); $pdf->Write(0, $res_address[0]); $pdf->Ln(4); $pdf->SetX(39); $pdf->Write(0, $pi->birth_place); $pdf->SetX(126); $pdf->Write(0, $res_address[1]); $pdf->Ln(5); if ($pi->sex == 'M') { $setx = 41.5; } if ($pi->sex == 'F') { $setx = 58; } $pdf->SetX($setx); $pdf->Write(0, 'X'); if ($pi->civil_status == 1) { $pdf->SetXY(41.5, 85); $pdf->Write(0, 'X'); } if ($pi->civil_status == 2) { $pdf->SetXY(41.5, 89); $pdf->Write(0, 'X'); } if ($pi->civil_status == 3) { $pdf->SetXY(41.5, 94.5); $pdf->Write(0, 'X'); } if ($pi->civil_status == 4) { $pdf->SetXY(64, 85); $pdf->Write(0, 'X'); } if ($pi->civil_status == 5) { $pdf->SetXY(64, 89); $pdf->Write(0, 'X'); } if ($pi->civil_status == 6) { $pdf->SetXY(64, 94.5); $pdf->Write(0, 'X'); } //citizeship $pdf->SetXY(39, 103); $pdf->Write(0, $pi->citizenship); $pdf->Ln(5.2); $pdf->SetX(39); $pdf->Write(0, $pi->height); $pdf->Ln(5.2); $pdf->SetX(39); $pdf->Write(0, $pi->weight); $pdf->Ln(5.2); $pdf->SetX(39); $pdf->Write(0, $pi->blood_type); $pdf->Ln(4); $pdf->SetX(39); $pdf->Write(0, $pi->gsis); $pdf->Ln(5); $pdf->SetX(39); $pdf->Write(0, $pi->pagibig); $pdf->Ln(4); $pdf->SetX(39); $pdf->Write(0, $pi->philhealth); $pdf->Ln(5); $pdf->SetX(39); $pdf->Write(0, $pi->sss); $pdf->SetXY(126, 85); $pdf->Write(0, $pi->res_zip); $pdf->Ln(5); $pdf->SetX(126); $pdf->Write(0, $pi->res_tel); $pdf->Ln(5); $pdf->SetX(126); $permanent_address = splitstroverflow($pi->permanent_address, 30); $pdf->Write(0, $permanent_address[0]); $pdf->Ln(4); $pdf->SetX(126); $pdf->Write(0, $permanent_address[1]); $pdf->Ln(15); $pdf->SetX(126); $pdf->Write(0, $pi->permanent_zip); $pdf->Ln(4); $pdf->SetX(126); $pdf->Write(0, $pi->permanent_tel); $pdf->Ln(4.3); $pdf->SetX(126); $pdf->Write(0, $pi->email); $pdf->Ln(4.9); $pdf->SetX(126); $pdf->Write(0, $pi->cp); $pdf->Ln(4.3); $pdf->SetX(126); $pdf->Write(0, $pi->agency_employee_no); $pdf->Ln(4.3); $pdf->SetX(126); $pdf->Write(0, $pi->tin); /******************************* *END PERSONAL INFORMATION ===== ******************************/ //====================================================================== /******************************* *START FAMILY BACK GROUND======= ******************************/ //Get family background //$fb = $this->Family_Background->get_family_background($employee_id); $fb = new Family(); $fb->get_by_employee_id($employee_id); $pdf->SetXY(39, 146); $pdf->Write(0, $fb->spouse_lname); $pdf->Ln(4.3); $pdf->SetX(39); $pdf->Write(0, $fb->spouse_fname); $pdf->Ln(4.3); $pdf->SetX(39); $pdf->Write(0, $fb->spouse_mname); $pdf->Ln(5); $pdf->SetX(39); $pdf->Write(0, $fb->spouse_occupation); $pdf->Ln(5); $pdf->SetX(39); $pdf->Write(0, $fb->spouse_employer); $pdf->Ln(5); $pdf->SetX(39); $pdf->Write(0, $fb->spouse_biz_ad); $pdf->Ln(5); $pdf->SetX(39); $pdf->Write(0, $fb->spouse_tel); $pdf->Ln(9); $pdf->SetX(57); $pdf->Write(0, $fb->father_lname); $pdf->Ln(4.5); $pdf->SetX(57); $pdf->Write(0, $fb->father_fname); $pdf->Ln(4.5); $pdf->SetX(57); $pdf->Write(0, $fb->father_mname); $pdf->Ln(4.5); $pdf->SetX(57); $pdf->Write(0, $fb->mother_lname); $pdf->Ln(4.5); $pdf->SetX(57); $pdf->Write(0, $fb->mother_fname); $pdf->Ln(4.5); $pdf->SetX(57); $pdf->Write(0, $fb->mother_mname); /******************************* *END FAMILY BACK GROUND======= ******************************/ //============================================================================= /******************************* *START CHILDREN================ ******************************/ //$children = $this->Children->get_child($employee_id); $children = new Children(); $children->order_by('birth_date'); $children->get_by_employee_id($employee_id); $pdf->SetXY(110, 145); $i = 1; $pdf->SetFont('Arial', '', 10); foreach ($children as $child) { if ($i == 7 || $i == 9 || $i == 11) { $pdf->Ln(4.5); } else { $pdf->Ln(5); } $pdf->SetX(110); $pdf->Write(0, $child->children); $date = $child->birth_date; list($year, $month, $day) = explode('-', $date); $pdf->SetX(170); $pdf->Write(0, $month . '/' . $day . '/' . $year); $i++; } /******************************* *END CHILDREN================== ******************************/ //===================================================================== /******************************* *START EDUC================== ******************************/ $e = new Education(); //$educs = $this->Educational_Background->get_educ($employee_id, $level = 1); $educs = $e->get_single_educ($employee_id, $level = 1); $pdf->SetFont('Arial', '', 10); $pdf->SetXY(39, 233); // /******************************* *END EDUC================== ******************************/ foreach ($educs as $educ) { $sch = wordwrap(ucwords(strtolower($educ->school_name)), 23, "|"); $sch = explode("|", $sch); //$degree = wordwrap($educ->degree_course, 15, "|"); $degree = wordwrap(ucwords(strtolower($educ->degree_course)), 15, "|"); $degree = explode("|", $degree); $pdf->Write(0, $sch[0]); $pdf->SetX(78); $pdf->Write(0, $degree[0]); $pdf->SetX(107); $pdf->Write(0, $educ->year_graduated); $pdf->SetX(130); $pdf->Write(0, $educ->highest_grade); $pdf->SetX(150); $pdf->Write(0, $educ->attend_from); $pdf->SetX(163); $pdf->Write(0, $educ->attend_to); $pdf->SetX(177); $pdf->Write(0, $educ->scholarship); $pdf->Ln(3); $pdf->SetX(39); $pdf->Write(0, $sch[1]); $pdf->SetX(78); $pdf->Write(0, $degree[1]); $pdf->Ln(3); $pdf->SetX(39); $pdf->Write(0, $sch[2]); $pdf->SetX(78); $pdf->Write(0, $degree[2]); $pdf->Ln(3); $pdf->SetX(39); $pdf->Write(0, $sch[3]); $pdf->SetX(78); $pdf->Write(0, $degree[3]); } //secondary // $educs = $this->Educational_Background->get_educ($employee_id, $level = 2); $educs = $e->get_single_educ($employee_id, $level = 2); $pdf->SetXY(39, 246); foreach ($educs as $educ) { //$sch = wordwrap($educ->school_name, 23, "|"); $sch = wordwrap(ucwords(strtolower($educ->school_name)), 23, "|"); $sch = explode("|", $sch); //$degree = wordwrap($educ->degree_course, 15, "|"); $degree = wordwrap(ucwords(strtolower($educ->degree_course)), 15, "|"); $degree = explode("|", $degree); $pdf->Write(0, $sch[0]); $pdf->SetX(78); $pdf->Write(0, $degree[0]); $pdf->SetX(107); $pdf->Write(0, $educ->year_graduated); $pdf->SetX(130); $pdf->Write(0, $educ->highest_grade); $pdf->SetX(150); $pdf->Write(0, $educ->attend_from); $pdf->SetX(163); $pdf->Write(0, $educ->attend_to); $pdf->SetX(177); $pdf->Write(0, $educ->scholarship); $pdf->Ln(3); $pdf->SetX(39); $pdf->Write(0, $sch[1]); $pdf->SetX(78); $pdf->Write(0, $degree[1]); $pdf->Ln(3); $pdf->SetX(39); $pdf->Write(0, $sch[2]); $pdf->SetX(78); $pdf->Write(0, $degree[2]); $pdf->Ln(3); $pdf->SetX(39); $pdf->Write(0, $sch[3]); $pdf->SetX(78); $pdf->Write(0, $degree[3]); } //vocational // $educs = $this->Educational_Background->get_educ($employee_id, $level = 3); $educs = $e->get_single_educ($employee_id, $level = 3); $pdf->SetXY(39, 259); foreach ($educs as $educ) { //$sch = wordwrap($educ->school_name, 23, "|"); $sch = wordwrap(ucwords(strtolower($educ->school_name)), 23, "|"); $sch = explode("|", $sch); //$degree = wordwrap($educ->degree_course, 15, "|"); $degree = wordwrap(ucwords(strtolower($educ->degree_course)), 15, "|"); $degree = explode("|", $degree); $pdf->Write(0, $sch[0]); $pdf->SetX(78); $pdf->Write(0, $degree[0]); $pdf->SetX(107); $pdf->Write(0, $educ->year_graduated); $pdf->SetX(130); $pdf->Write(0, $educ->highest_grade); $pdf->SetX(150); $pdf->Write(0, $educ->attend_from); $pdf->SetX(163); $pdf->Write(0, $educ->attend_to); $pdf->SetX(177); $pdf->Write(0, $educ->scholarship); $pdf->Ln(3); $pdf->SetX(39); $pdf->Write(0, $sch[1]); $pdf->SetX(78); $pdf->Write(0, $degree[1]); $pdf->Ln(3); $pdf->SetX(39); $pdf->Write(0, $sch[2]); $pdf->SetX(78); $pdf->Write(0, $degree[2]); $pdf->Ln(3); $pdf->SetX(39); $pdf->Write(0, $sch[3]); $pdf->SetX(78); $pdf->Write(0, $degree[3]); } //college // $educs = $this->Educational_Background->get_educ($employee_id, $level = 4); $educs = $e->get_single_educ($employee_id, $level = 4); $pdf->SetXY(39, 274); foreach ($educs as $educ) { //$sch = wordwrap($educ->school_name, 23, "|"); $sch = wordwrap(ucwords(strtolower($educ->school_name)), 23, "|"); $sch = explode("|", $sch); //$degree = wordwrap($educ->degree_course, 15, "|"); $degree = wordwrap(ucwords(strtolower($educ->degree_course)), 15, "|"); $degree = explode("|", $degree); $pdf->Write(0, $sch[0]); $pdf->SetX(78); $pdf->Write(0, $degree[0]); $pdf->SetX(107); $pdf->Write(0, $educ->year_graduated); $pdf->SetX(130); $pdf->Write(0, $educ->highest_grade); $pdf->SetX(150); $pdf->Write(0, $educ->attend_from); $pdf->SetX(163); $pdf->Write(0, $educ->attend_to); $pdf->SetX(177); $pdf->Write(0, $educ->scholarship); $pdf->Ln(3); $pdf->SetX(39); $pdf->Write(0, $sch[1]); $pdf->SetX(78); $pdf->Write(0, $degree[1]); $pdf->Ln(3); $pdf->SetX(39); $pdf->Write(0, $sch[2]); $pdf->SetX(78); $pdf->Write(0, $degree[2]); $pdf->Ln(3); $pdf->SetX(39); $pdf->Write(0, $sch[3]); $pdf->SetX(78); $pdf->Write(0, $degree[3]); } //graduate studies //$educs = $this->Educational_Background->get_educ($employee_id, $level = 5); $educs = $e->get_single_educ($employee_id, $level = 5); $pdf->SetXY(39, 290); foreach ($educs as $educ) { //$sch = wordwrap($educ->school_name, 23, "|"); $sch = wordwrap(ucwords(strtolower($educ->school_name)), 23, "|"); $sch = explode("|", $sch); //$degree = wordwrap($educ->degree_course, 15, "|"); $degree = wordwrap(ucwords(strtolower($educ->degree_course)), 15, "|"); $degree = explode("|", $degree); $pdf->Write(0, $sch[0]); $pdf->SetX(78); $pdf->Write(0, $degree[0]); $pdf->SetX(107); $pdf->Write(0, $educ->year_graduated); $pdf->SetX(130); $pdf->Write(0, $educ->highest_grade); $pdf->SetX(150); $pdf->Write(0, $educ->attend_from); $pdf->SetX(163); $pdf->Write(0, $educ->attend_to); $pdf->SetX(177); $pdf->Write(0, $educ->scholarship); $pdf->Ln(3); $pdf->SetX(39); $pdf->Write(0, $sch[1]); $pdf->SetX(78); $pdf->Write(0, $degree[1]); $pdf->Ln(3); $pdf->SetX(39); $pdf->Write(0, $sch[2]); $pdf->SetX(78); $pdf->Write(0, $degree[2]); $pdf->Ln(3); $pdf->SetX(39); $pdf->Write(0, $sch[3]); $pdf->SetX(78); $pdf->Write(0, $degree[3]); } // Output //$pdf->Output('resources/pdfs/archives/page1_'.$employee_id.'.pdf', 'F'); $pdf->Output('dtr/template/pds/page1_' . $employee_id . '.pdf', 'F'); $this->pds[] = 'dtr/template/pds/page1_' . $employee_id . '.pdf'; //$this->pds[] = 'resources/pdfs/archives/page1_'.$employee_id.'.pdf'; //header("location:".base_url()."resources/pdfs/archives/page1_".$employee_id.'.pdf'); }
function back_id($results) { $this->load->helper('settings'); //print preview of MR $this->load->library('fpdf'); $this->load->library('fpdi'); // initiate FPDI $pdf = new FPDI('L'); // add a page $pdf->AddPage(); // set the sourcefile $pagecount = $pdf->setSourceFile('pdf-report/id/back-id.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); // now write some text above the imported page $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Arial', '', 7); $n = 1; foreach ($results as $result) { $s = new Personal_m(); $row = $s->get_by_employee_id($result->employee_id); //======================== START Column 1 | Right to Left ============================== if ($n == 11) { //add new page $pdf->addPage(); for ($n = 1; $n <= 1; $n++) { $tplidx = $pdf->ImportPage(1); $pdf->useTemplate($tplIdx); //, 1, 1, 210 } $n = $n - 1; } $bday = $row->birth_date; $address = $row->res_address; $blood_type = '"' . $row->blood_type . '"'; $gsis = $row->gsis; $pagibig = $row->pagibig; $philhealth = $row->philhealth; $tin = $row->tin; $emergency = ''; $contact = $row->cp; //----------------------------- Row 1 ---------------------------------- ///Birthday if ($n == 1) { //Birthday if ($bday != '0000-00-00') { $pdf->SetXY(247, 23); $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false); } //Address $pdf->SetXY(257, 15); $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28); $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false); //display text overflow if ($addr[1]) { $pdf->Ln(2.5); $pdf->SetX(257); $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false); } if ($addr[2]) { $pdf->Ln(2.5); $pdf->SetX(257); $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false); } if ($addr[3]) { $pdf->Ln(2.5); $pdf->SetX(257); $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false); } //Blood Type $pdf->SetXY(247, 28.3); $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false); //GSIS $pdf->SetXY(247, 33); $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false); //PAGIBIG $pdf->SetXY(247, 38); $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(247, 43.5); $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(247, 48.5); $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false); //in case of emergency $pdf->SetXY(235, 75.5); $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false); //CP No. $pdf->SetXY(250, 78); $cpno = splitstroverflow($contact, 13); $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false); if ($cpno[1]) { $pdf->Ln(3); $pdf->SetX(250); $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false); } } //----------------------------- Row 2 ---------------------------------- if ($n == 2) { //Birthday if ($bday != '0000-00-00') { $pdf->SetXY(189, 23); $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false); } //Address $pdf->SetXY(199, 15); $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28); $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false); //display text overflow if ($addr[1]) { $pdf->Ln(2.5); $pdf->SetX(199); $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false); } if ($addr[2]) { $pdf->Ln(2.5); $pdf->SetX(199); $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false); } if ($addr[3]) { $pdf->Ln(2.5); $pdf->SetX(199); $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false); } //Blood Type $pdf->SetXY(189, 28.3); $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false); //GSIS $pdf->SetXY(189, 33); $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false); //PAGIBIG $pdf->SetXY(189, 38); $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(189, 43.5); $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(189, 48.5); $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false); //in case of emergency $pdf->SetXY(177, 75.5); $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false); //CP No. $pdf->SetXY(192, 78); $cpno = splitstroverflow($contact, 13); $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false); if ($cpno[1]) { $pdf->Ln(3); $pdf->SetX(192); $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false); } } //----------------------------- Row 3 ---------------------------------- if ($n == 3) { //Birthday if ($bday != '0000-00-00') { $pdf->SetXY(131, 23); $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false); } //Address $pdf->SetXY(141, 15); $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28); $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false); //display text overflow if ($addr[1]) { $pdf->Ln(2.5); $pdf->SetX(141); $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false); } if ($addr[2]) { $pdf->Ln(2.5); $pdf->SetX(141); $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false); } if ($addr[3]) { $pdf->Ln(2.5); $pdf->SetX(141); $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false); } //Blood Type $pdf->SetXY(131, 28.3); $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false); //GSIS $pdf->SetXY(131, 33); $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false); //PAGIBIG $pdf->SetXY(131, 38); $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(131, 43.5); $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(131, 48.5); $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false); //in case of emergency $pdf->SetXY(119, 75.5); $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false); //CP No. $pdf->SetXY(134, 78); $cpno = splitstroverflow($contact, 13); $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false); if ($cpno[1]) { $pdf->Ln(3); $pdf->SetX(134); $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false); } } //----------------------------- Row 4 ---------------------------------- if ($n == 4) { //Birthday if ($bday != '0000-00-00') { $pdf->SetXY(73, 23); $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false); } //Address $pdf->SetXY(83, 15); $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28); $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false); //display text overflow if ($addr[1]) { $pdf->Ln(2.5); $pdf->SetX(83); $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false); } if ($addr[2]) { $pdf->Ln(2.5); $pdf->SetX(83); $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false); } if ($addr[3]) { $pdf->Ln(2.5); $pdf->SetX(3); $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false); } //Blood Type $pdf->SetXY(73, 28.3); $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false); //GSIS $pdf->SetXY(73, 33); $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false); //PAGIBIG $pdf->SetXY(73, 38); $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(73, 43.5); $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(73, 48.5); $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false); //in case of emergency $pdf->SetXY(61, 75.5); $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false); //CP No. $pdf->SetXY(76, 78); $cpno = splitstroverflow($contact, 13); $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false); if ($cpno[1]) { $pdf->Ln(3); $pdf->SetX(76); $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false); } } //----------------------------- Row 5 ---------------------------------- if ($n == 5) { //Birthday if ($bday != '0000-00-00') { $pdf->SetXY(15, 23); $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false); } //Address $pdf->SetXY(25, 15); $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28); $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false); //display text overflow if ($addr[1]) { $pdf->Ln(2.5); $pdf->SetX(25); $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false); } if ($addr[2]) { $pdf->Ln(2.5); $pdf->SetX(25); $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false); } if ($addr[3]) { $pdf->Ln(2.5); $pdf->SetX(25); $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false); } //Blood Type $pdf->SetXY(15, 28.3); $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false); //GSIS $pdf->SetXY(15, 33); $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false); //PAGIBIG $pdf->SetXY(15, 38); $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(15, 43.5); $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(15, 48.5); $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false); //in case of emergency $pdf->SetXY(3, 75.5); $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false); //CP No. $pdf->SetXY(18, 78); $cpno = splitstroverflow($contact, 13); $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false); if ($cpno[1]) { $pdf->Ln(3); $pdf->SetX(18); $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false); } } //======================== END Column 1 | Right to Left ============================== //======================== START Column 2 | Right to Left ============================== //----------------------------- Row 1 ---------------------------------- ///Birthday if ($n == 6) { //Birthday if ($bday != '0000-00-00') { $pdf->SetXY(247, 123.5); $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false); } //Address $pdf->SetXY(257, 115); $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28); $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false); //display text overflow if ($addr[1]) { $pdf->Ln(2.5); $pdf->SetX(257); $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false); } if ($addr[2]) { $pdf->Ln(2.5); $pdf->SetX(257); $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false); } if ($addr[3]) { $pdf->Ln(2.5); $pdf->SetX(257); $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false); } //Blood Type $pdf->SetXY(247, 128.5); $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false); //GSIS $pdf->SetXY(247, 133.5); $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false); //PAGIBIG $pdf->SetXY(247, 138.5); $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(247, 144); $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false); //TIN $pdf->SetXY(247, 149); $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false); //in case of emergency $pdf->SetXY(235, 176.3); $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false); //CP No. $pdf->SetXY(250, 178.5); $cpno = splitstroverflow($contact, 13); $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false); if ($cpno[1]) { $pdf->Ln(3); $pdf->SetX(250); $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false); } } //----------------------------- Row 2 ---------------------------------- //----------------------------- Row 2 ---------------------------------- if ($n == 7) { //Birthday if ($bday != '0000-00-00') { $pdf->SetXY(189, 123.5); $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false); } //Address $pdf->SetXY(199, 115); $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28); $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false); //display text overflow if ($addr[1]) { $pdf->Ln(2.5); $pdf->SetX(199); $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false); } if ($addr[2]) { $pdf->Ln(2.5); $pdf->SetX(199); $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false); } if ($addr[3]) { $pdf->Ln(2.5); $pdf->SetX(199); $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false); } //Blood Type $pdf->SetXY(189, 128.5); $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false); //GSIS $pdf->SetXY(189, 133.5); $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false); //PAGIBIG $pdf->SetXY(189, 138.5); $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(189, 144); $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false); //tin $pdf->SetXY(189, 149); $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false); //in case of emergency $pdf->SetXY(177, 176.3); $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false); //CP No. $pdf->SetXY(192, 178.5); $cpno = splitstroverflow($contact, 13); $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false); if ($cpno[1]) { $pdf->Ln(3); $pdf->SetX(192); $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false); } } //----------------------------- Row 3 ---------------------------------- if ($n == 8) { //Birthday if ($bday != '0000-00-00') { $pdf->SetXY(131, 123.5); $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false); } //Address $pdf->SetXY(141, 115); $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28); $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false); //display text overflow if ($addr[1]) { $pdf->Ln(2.5); $pdf->SetX(141); $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false); } if ($addr[2]) { $pdf->Ln(2.5); $pdf->SetX(141); $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false); } if ($addr[3]) { $pdf->Ln(2.5); $pdf->SetX(141); $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false); } //Blood Type $pdf->SetXY(131, 128.5); $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false); //GSIS $pdf->SetXY(131, 133.5); $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false); //PAGIBIG $pdf->SetXY(131, 138.5); $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(131, 144); $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(131, 149); $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false); //in case of emergency $pdf->SetXY(119, 176.3); $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false); //CP No. $pdf->SetXY(134, 178.5); $cpno = splitstroverflow($contact, 13); $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false); if ($cpno[1]) { $pdf->Ln(3); $pdf->SetX(134); $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false); } } //----------------------------- Row 4 ---------------------------------- if ($n == 9) { //Birthday if ($bday != '0000-00-00') { $pdf->SetXY(73, 123.5); $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false); } //Address $pdf->SetXY(83, 115); $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28); $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false); //display text overflow if ($addr[1]) { $pdf->Ln(2.5); $pdf->SetX(83); $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false); } if ($addr[2]) { $pdf->Ln(2.5); $pdf->SetX(83); $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false); } if ($addr[3]) { $pdf->Ln(2.5); $pdf->SetX(3); $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false); } //Blood Type $pdf->SetXY(73, 128.5); $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false); //GSIS $pdf->SetXY(73, 133.5); $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false); //PAGIBIG $pdf->SetXY(73, 138.5); $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(73, 144); $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(73, 149); $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false); //in case of emergency $pdf->SetXY(61, 176.3); $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false); //CP No. $pdf->SetXY(76, 178.5); $cpno = splitstroverflow($contact, 13); $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false); if ($cpno[1]) { $pdf->Ln(3); $pdf->SetX(76); $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false); } } //----------------------------- Row 5 ---------------------------------- if ($n == 10) { //Birthday if ($bday != '0000-00-00') { $pdf->SetXY(15, 123.5); $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false); } //Address $pdf->SetXY(25, 115); $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28); $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false); //display text overflow if ($addr[1]) { $pdf->Ln(2.5); $pdf->SetX(25); $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false); } if ($addr[2]) { $pdf->Ln(2.5); $pdf->SetX(25); $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false); } if ($addr[3]) { $pdf->Ln(2.5); $pdf->SetX(25); $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false); } //Blood Type $pdf->SetXY(15, 128.5); $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false); //GSIS $pdf->SetXY(15, 133.5); $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false); //PAGIBIG $pdf->SetXY(15, 138.5); $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false); //PHILHEALTH $pdf->SetXY(15, 144); $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false); //tin $pdf->SetXY(15, 149); $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false); //in case of emergency $pdf->SetXY(3, 176.3); $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false); //CP No. $pdf->SetXY(18, 178.5); $cpno = splitstroverflow($contact, 13); $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false); if ($cpno[1]) { $pdf->Ln(3); $pdf->SetX(18); $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false); } } //======================== END Column 2 | Right to Left ============================== $n++; } // Output $pdf->Output('pdf-report/back-id.pdf', 'F'); return 'pdf-report/back-id.pdf'; }