function SetHeader() { $this->SetFont('Arial', 'B', 16); $this->Image(image_url() . '/ufma.png', 10, 10); parent::Ln(7); $this->Cell(0, 7, specialChars('UNIVERSIDADE FEDERAL DO MARANHÃO'), 0, 0, 'C'); parent::Ln(7); $this->SetFont('Arial', '', 11); $this->Cell(0, 7, specialChars('Fundação Instituída nos termos da Lei 5.152 de 21/10/1966'), 0, 0, 'C'); parent::Ln(7); $this->Cell(0, 7, specialChars('São Luís - Maranhão'), 0, 0, 'C'); parent::Ln(7); }
function preview($rows, $report_name = '') { $html = ' <table width="100%" border="0"> <tr> <td colspan="3" align="center">' . $report_name . '</td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> <table width="100%" border="1"> <tbody><tr> <td width="10%"><strong>Employee ID</strong></td> <td width="9%"><strong>Name</strong></td> <td width="4%"><strong>Sex</strong></td> <td width="10%"><strong>Position/<br /> Designation</strong></td> <td width="13%"><strong>Office / Department</strong></td> <td width="11%"><strong>Employment Status</strong></td> <td width="6%"><strong>Salary Grade</strong></td> <td width="9%"><strong>Eligibility</strong></td> <td width="11%"><strong>Education</strong></td> <td width="8%"><strong>Birthday</strong></td> <td width="9%"><strong>Address</strong></td></tr>'; $office = new Orm_office(); foreach ($rows as $row) { $office->get_by_office_id($row->office_id); $type_employment = $this->options->type_employment(); $birth_date = $row->birth_date; if ($row->birth_date == '0000-00-00') { $birth_date = ''; } $html .= ' <tr> <td>' . $row->id . '</td> <td>' . $row->lname . ',' . $row->fname . ' ' . $row->mname . '</td> <td>' . $row->sex . '</td> <td>' . $row->position . '</td> <td>' . $office->office_name . '</td> <td>' . $type_employment[$row->permanent] . '</td> <td>' . $row->salary_grade . '-' . $row->step . '</td> <td>' . $row->eligibility . '</td> <td>' . $row->education . '</td> <td>' . $birth_date . '</td> <td>' . $row->res_address . '</td> </tr>'; } $html .= ' <tr><td><p> </p></td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td><td> </td></tr> </tbody></table>'; // Signatories $sr_prepared = $this->Settings->get_selected_field('sr_prepared'); $sr_prepared_position = $this->Settings->get_selected_field('sr_prepared_position'); $sr_certified = $this->Settings->get_selected_field('sr_certified'); $sr_certified_position = $this->Settings->get_selected_field('sr_certified_position'); $html .= ' <table width="100%" border="0"> <tr> <td width="38%"> </td> <td width="23%"> </td> <td width="39%"> </td> </tr> <tr> <td align="center">PREPARED BY:</td> <td> </td> <td align="center">CERTIFIED CORRECT:</td> </tr> <tr> <td align="center"> </td> <td> </td> <td align="center"> </td> </tr> <tr> <td align="center"> </td> <td> </td> <td align="center"> </td> </tr> <tr> <td align="center">' . $sr_prepared . '</td> <td> </td> <td align="center">' . $sr_certified . '</td> </tr> <tr> <td align="center">' . $sr_prepared_position . '</td> <td> </td> <td align="center">' . $sr_certified_position . '</td> </tr> </table> '; $this->load->library('MPDF52/mpdf'); //$this->mpdf->WriteHTML('<p>Hello There hahahaha</p>'); //$this->mpdf->Output('mpdf.pdf','I'); // LOAD a stylesheet $stylesheet = file_get_contents(base_url() . 'css/mpdf/mpdfstyletables.css'); $this->mpdf->WriteHTML($stylesheet, 1); // The parameter 1 tells that this is css/style only and no body/html/text $this->mpdf->WriteHTML($html); $this->mpdf->Output('dtr/template/pds/archives/pds_' . date('Y_m_d') . '.pdf', 'F'); return 'dtr/template/pds/archives/pds_' . date('Y_m_d') . '.pdf'; exit; $this->load->helper('settings'); $this->load->library('fpdf'); //define('FPDF_FONTPATH',$this->config->item('fonts_path')); $this->load->library('fpdi'); // initiate FPDI $pdf = new FPDI('L', 'mm', 'Letter'); // add a page $pdf->AddPage(); // set the sourcefile //$pdf->setSourceFile('dtr/template/service_record/service_record.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(15, 60); $pdf->SetFont('Arial', '', 16); $pdf->Cell(0, 3, "Report Name", '', 1, 'C', false); //$pdf->Ln(4); //$e = new Employee_m(); //$e->get_by_employee_id( $employee_id ); $pdf->SetFont('Arial', '', 12); //$pdf->Cell(0,8,"Employee No.:".$e->id ,'',1,'L',false); //$pdf->Ln(2); //$pdf->SetFont('Arial', '', 12); //$pdf->Cell(0,8,"Employee Name:".$e->lname.', '.$e->fname.' '.$e->mname ,'',1,'L',false); $pdf->Ln(4); $pdf->Cell(0, 8, "Emp ID Name Sex Position/Designation Office Employment Status Salary Grade Eligibility Education Birth Day Address", '1', 1, 'L', false); $pdf->Ln(4); $i = 1; $this->load->helper('text'); //$pdf->Cell(30,12, word_wrap('msayado maahhn ndhah ahhhehe so ano gagawin mo now', 10) ,'1',1,'L',false); //$pdf->MultiCell(30,3,word_wrap("hello this is a sample nlong text with line break ", 15) ,'1',1,'L',false); //$pdf->MultiCell(30,3,word_wrap("hello this is a sample nlong text with line break ", 15) ,'0',1,'L',false); foreach ($rows as $row) { $pdf->SetFont('Arial', '', 11); $pdf->SetX(10); //$pdf->Write(0, $row->id); $pdf->Cell(15, 12, $row->id, '1', 0, 'L', false); $pdf->SetX(29); //$pdf->Write(0, $row->lname.', '.$row->fname.''.$row->mname); $pdf->Cell(30, 12, word_wrap($row->lname . ', ' . $row->fname . '' . $row->mname, 10), '1', 1, 'L', false); $pdf->SetFont('Arial', '', 8); $pdf->SetX(62); $pdf->Write(0, $row->sex); $pdf->SetX(75); //$pdf->Write(0, $row->company); $pdf->Write(0, $row->position); //$pdf->SetFont('Arial', '', 12); $pdf->SetX(160); $pdf->Write(0, $row->movement); //$pdf->SetX(150); //$pdf->Write(0, $row->salary_grade); $pdf->SetFont('Arial', '', 8); $pdf->SetX(185); //$pdf->Write(0, $row->status); if ($row->govt_service == 1) { $row->govt_service = 'Yes'; } else { $row->govt_service = 'No'; } $pdf->SetX(190); //$pdf->Write(0, $row->govt_service); $pdf->SetFont('Arial', '', 12); if ($i == 6 || $i == 10 || $i == 13 || $i == 16 || $i == 19 || $i == 22) { $pdf->Ln(8); } else { $pdf->Ln(7); } $i++; } $pdf->Cell(0, 8, "--------------------------------------------------------- Nothing Follows ---------------------------------------------------------", '', 1, 'C', false); // Signatories $pdf->Ln(15); $pdf->SetX(20); $pdf->Cell(90, 5, "PREPARED BY:", '0', 0, 'C', false); $pdf->Cell(90, 5, "CERTIFIED CORRECT:", '0', 1, 'C', false); $pdf->Ln(10); $sr_prepared = $this->Settings->get_selected_field('sr_prepared'); $sr_prepared_position = $this->Settings->get_selected_field('sr_prepared_position'); $sr_certified = $this->Settings->get_selected_field('sr_certified'); $sr_certified_position = $this->Settings->get_selected_field('sr_certified_position'); $pdf->SetX(20); $pdf->Cell(90, 5, $sr_prepared, '0', 0, 'C', false); //4th param border $pdf->Cell(90, 5, $sr_certified, '0', 1, 'C', false); $pdf->SetX(20); $pdf->Cell(90, 5, $sr_prepared_position, '0', 0, 'C', false); $pdf->Cell(90, 5, $sr_certified_position, '0', 1, 'C', false); // Output $pdf->Output('dtr/template/pds/archives/pds_' . date('Y_m_d') . '.pdf', 'F'); return 'dtr/template/pds/archives/pds_' . date('Y_m_d') . '.pdf'; }
function ten_tardiness_second($second_offenders = array()) { $this->load->library('fpdf'); define('FPDF_FONTPATH', $this->config->item('fonts_path')); $this->load->library('fpdi'); // initiate FPDI $pdf = new FPDI('P', 'mm', 'Legal'); $pdf->SetLeftMargin(20); $pdf->SetRightMargin(15); // add a page $pdf->AddPage(); // set the sourcefile $pdf->setSourceFile('dtr/template/notice2nd.pdf'); // select the first page $tplIdx = $pdf->importPage(1); // use the page we imported $pdf->useTemplate($tplIdx); $offices = Input::get('offices'); $office_id = $offices[0]; $m1 = 'Jul'; $m2 = 'Aug'; $m3 = 'Sep'; $m4 = 'Oct'; $m5 = 'Nov'; $m6 = 'Dec'; $mo1 = '07'; $mo2 = '08'; $mo3 = '09'; $mo4 = '10'; $mo5 = '11'; $mo6 = '12'; $pdf->SetFont('Arial', '', '12'); $pdf->SetXY(155, 50); $pdf->Write(0, date('F d, Y')); $pdf->SetX(35); $pdf->SetFont('Arial', 'B', ''); $pdf->Cell(0, 6, "HON. EDWARD S. HAGEDORN ", '', 1, 'L', FALSE); $pdf->SetFont('Arial', '', ''); $pdf->SetX(35); $pdf->Cell(0, 6, "City Mayor", '', 1, 'L', FALSE); $pdf->SetX(35); $pdf->Cell(0, 6, "Puerto Princesa City", '', 1, 'L', FALSE); $pdf->Cell(0, 6, "", '', 1, 'C', FALSE); $pdf->Cell(0, 6, "Thru: ATTY. SHIRLEY R. DAGANTA", '', 1, 'C', FALSE); $pdf->Cell(0, 6, "CG Assistant Dept. Head II", '', 1, 'C', FALSE); $pdf->Cell(0, 6, "Assistant City Legal Officer II", '', 1, 'C', FALSE); $pdf->Ln(12); $pdf->SetX(35); $pdf->SetFont('Arial', 'B', ''); $pdf->Write(0, 'Madam:'); $pdf->SetFont('Arial', '', ''); $pdf->Ln(6); $pdf->SetX(35); $pdf->MultiCell(0, 6, " Please be informed that despite the first notice issued to him/her as per records in this office, it has been observed that the he/she has continuously incurred the following tardiness and undertime, viz:", 0, 'L', false); //$pdf->SetX(35); //$pdf->Cell(0,6," $number of your employees has incurred the following, viz:",'',0,'L',false); $pdf->SetFont('Arial', 'BI', 10); $pdf->Ln(2); $pdf->SetFillColor(210, 210, 210); //$pdf->SetX(20); //header $pdf->Cell(50, 8, "Name", 'RLTB', 0, 'C', 1); $pdf->Cell(20, 4, $m1, '1', 0, 'C', 1); $pdf->Cell(20, 4, $m2, '1', 0, 'C', 1); $pdf->Cell(20, 4, $m3, '1', 0, 'C', 1); $pdf->Cell(20, 4, $m4, '1', 0, 'C', 1); $pdf->Cell(20, 4, $m5, '1', 0, 'C', 1); $pdf->Cell(20, 4, $m6, '1', 1, 'C', 1); $pdf->SetFont('Arial', '', 9); $pdf->SetFillColor(240, 240, 240); $pdf->Cell(50, 4, "", 'RLB', 0, 'C', false); $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1); $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1); $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1); $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1); $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1); $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1); $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1); $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1); $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1); $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1); $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1); $pdf->Cell(10, 4, "UT", '1', 1, 'C', 1); $pdf->SetFillColor(215, 255, 215); $year1 = Input::get('year'); $tardis = $second_offenders; if (is_array($tardis)) { foreach ($tardis as $tardi) { $name = $this->Employee->get_employee_info($tardi, $field = ''); $late1 = $this->Tardiness->count_late($name['employee_id'], $mo1, $year1, 1, 3); $late2 = $this->Tardiness->count_late($name['employee_id'], $mo2, $year1, 1, 3); $late3 = $this->Tardiness->count_late($name['employee_id'], $mo3, $year1, 1, 3); $late4 = $this->Tardiness->count_late($name['employee_id'], $mo4, $year1, 1, 3); $late5 = $this->Tardiness->count_late($name['employee_id'], $mo5, $year1, 1, 3); $late6 = $this->Tardiness->count_late($name['employee_id'], $mo6, $year1, 1, 3); $under_time1 = $this->Tardiness->count_late($name['employee_id'], $mo1, $year1, 2, 4); $under_time2 = $this->Tardiness->count_late($name['employee_id'], $mo2, $year1, 2, 4); $under_time3 = $this->Tardiness->count_late($name['employee_id'], $mo3, $year1, 2, 4); $under_time4 = $this->Tardiness->count_late($name['employee_id'], $mo4, $year1, 2, 4); $under_time5 = $this->Tardiness->count_late($name['employee_id'], $mo5, $year1, 2, 4); $under_time6 = $this->Tardiness->count_late($name['employee_id'], $mo6, $year1, 2, 4); $late1['tardi_count'] = $this->Tardiness->is_tardy_zero($late1['tardi_count']); $late2['tardi_count'] = $this->Tardiness->is_tardy_zero($late2['tardi_count']); $late3['tardi_count'] = $this->Tardiness->is_tardy_zero($late3['tardi_count']); $late4['tardi_count'] = $this->Tardiness->is_tardy_zero($late4['tardi_count']); $late5['tardi_count'] = $this->Tardiness->is_tardy_zero($late5['tardi_count']); $late6['tardi_count'] = $this->Tardiness->is_tardy_zero($late6['tardi_count']); $under_time1['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time1['tardi_count']); $under_time2['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time2['tardi_count']); $under_time3['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time3['tardi_count']); $under_time4['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time4['tardi_count']); $under_time5['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time5['tardi_count']); $under_time6['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time6['tardi_count']); //start employee tardy $pdf->Cell(50, 4, ucwords(strtolower(utf8_decode($name['fname'] . ' ' . $name['mname'] . ' ' . $name['lname']))), 'RLTB', 0, 'L', false); $pdf->Cell(10, 4, $late1['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $under_time1['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $late2['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $under_time2['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $late3['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $under_time3['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $late4['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $under_time4['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $late5['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $under_time5['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $late6['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $under_time6['tardi_count'], '1', 1, 'C', FALSE); } } $pdf->Cell(50, 4, "", 'RLTB', 0, 'L', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 1, 'C', FALSE); // line break $pdf->Ln(5); $pdf->SetFont('Arial', '', '12'); $pdf->SetX(35); $pdf->MultiCell(0, 6, " Section 8, Rule XVII of the Omnibus Rules Implementing Book V of Executive Order No. 292, states that: \n\t\t\t\t 'Officers and employees who have incurred tardiness and undertime, regardless of the number of minutes per day, ten (10) times a month for at least two (2) consecutive months during the year or for at least two (2) months in a semester shall be subject to disciplinary action.'\n\t\t\t\t Violation of the said rule carries the following penalties:\n\t\t\n\t\t\t\t 1.\tFirst Offense - Reprimand;\n\t\t\t\t 2.\tSecond Offense - Suspension for one (1) day to thirty (30) days; and\n\t\t\t\t 3.\tThird Offense - Dismissal.\n\t\t\n\t\t\t\t For your appropriate action.\n\t\t", '', 1, 'L', false); $pdf->Cell(0, 6, " Very truly yours, ", 0, 'R', FALSE); $pdf->Cell(0, 6, " ", '', 1, 'R', FALSE); $pdf->Cell(0, 6, " ", '', 1, 'R', FALSE); $pdf->SetFont('Arial', 'B', ''); $pdf->Cell(0, 6, " FELIMON R. SABAS ", '', 1, 'R', FALSE); $pdf->SetFont('Arial', '', ''); $pdf->Cell(0, 6, " CG Department Head II ", '', 1, 'R', FALSE); $pdf->Cell(0, 6, " (City Personnel Officer) ", '', 1, 'R', FALSE); $pdf->MultiCell(0, 6, "\n\t\tNOTED:\n\t\t\n\t\tBY AUTHORITY OF THE CITY MAYOR:", 0, 'L', FALSE); $pdf->SetFont('Arial', 'B', ''); $pdf->Cell(0, 6, " ATTY. AGUSTIN M. ROCAMORA", '', 1, 'L', FALSE); $pdf->SetFont('Arial', '', ''); $pdf->Cell(0, 6, " City Administrator II", '', 1, 'L', FALSE); header('Cache-Control: maxage=3600'); //Adjust maxage appropriately header('Pragma: public'); //If the parameter is D = download F = save as file $pdf->Output('dtr/reports/ten_tardiness_second.pdf', 'F'); }
function cto_apps($id = '') { $c = CompensatoryTimeoff::find($id); $name = $this->Employee->get_employee_info($c->employee_id); $office_name = $this->Office->get_office_name($name['office_id']); $this->load->library('fpdf'); define('FPDF_FONTPATH', $this->config->item('fonts_path')); $this->load->library('fpdi'); $pdf = new FPDI('P', 'mm', 'Legal'); // add a page $pdf->AddPage(); // set the sourcefile $pdf->setSourceFile('dtr/template/app_for_offset.pdf'); // select the first page $tplIdx = $pdf->importPage(1); // use the page we imported $pdf->useTemplate($tplIdx); // set font, font style, font size. $pdf->SetFont('Arial', 'B', 12); // set initial placement $pdf->SetXY(158, 10.5); $pdf->Write(0, 'Tracking no: ' . $id); $pdf->Ln(9); $pdf->SetX(158); $pdf->Ln(20); // go to 25 X (indent) $pdf->SetX(12); $this->Office->fields = array('office_code'); $office = $this->Office->get_office_info($name['office_id']); // write office $pdf->SetFont('Arial', 'B', 10); $pdf->Write(0, $office['office_name']); $pdf->SetFont('Arial', 'B', 12); //lname $pdf->SetX(99); $pdf->Write(0, $name['lname']); //fname $pdf->SetX(145); $pdf->Write(0, $name['fname']); //mname $pdf->SetX(187); $pdf->Write(0, $name['mname'][0] . '.'); $pdf->Ln(10); //date of file $pdf->SetX(20); $pdf->Write(0, $c->date_file); //position $pdf->SetFont('Arial', 'B', 10); $pdf->SetX(63); $pdf->Write(0, $name['position']); $pdf->SetFont('Arial', 'B', 12); // We need to check what salary grade the office use if ($office['salary_grade_type'] == 'hospital') { $this->Salary_grade->salary_grade_type = 'hospital'; } //monthly salary $pdf->SetX(140); $pdf->Write(0, 'P ' . number_format($this->Salary_grade->get_monthly_salary($name['salary_grade'], $name['step']), 2)); $days = 'day'; if ($c->days > 1) { $days = 'days'; } $pdf->Ln(13); $pdf->SetX(30); $pdf->Write(0, $c->days . ' ' . $days); $pdf->SetX(140); //$pdf->Write(0, 'daily rate here'); $pdf->Ln(13); $pdf->SetX(50); $pdf->Write(0, $this->Helps->get_month_name($c->month) . ' ' . $c->dates . ', ' . $c->year); $cto_balances_as_of = date("F d, Y", strtotime($c->date_file . "-1 day")); $pdf->SetXY(30, 106); $pdf->Write(0, $cto_balances_as_of); // Compute balances // (balance + earn) - spent $cto = CompensatoryTimeoff::getBalance($c->employee_id); //$balance = $cto->days; $balance = $cto; $cto = CompensatoryTimeoff::getEarnedSpent($c->employee_id); //$earn = $cto->days; $earn = $cto; $cto = CompensatoryTimeoff::getEarnedSpent($c->employee_id, 'spent'); //$spent = $cto->days; $spent = $cto; $total_balance = $balance + $earn - $spent; $pdf->SetXY(35, 116); $pdf->Write(0, $total_balance); $pdf->SetX(87); $pdf->Write(0, ''); // hours here // Get office head $office = $this->Office->get_office_info($name['office_id']); // If detailed if ($name['detailed_office_id'] != 0) { $detailed_office = $this->Office->get_office_info($name['detailed_office_id']); $office['office_head'] = $detailed_office['office_head']; $office['position'] = $detailed_office['position']; } // If Employee is Department head $o = new Office_m(); $o->get_by_employee_id($c->employee_id); if ($o->exists()) { $office['office_head'] = 'CARMENCITA O. REYES'; $office['position'] = 'Governor'; } // We need to work out for this as exception if ($c->employee_id == '61') { $office['office_head'] = 'ANTONIO L. UY, JR. M.D.'; $office['position'] = 'Vice Governor'; } $pdf->Ln(6); $pdf->SetX(120); $pdf->Cell(73, 4, strtoupper($office['office_head']), '0', 0, 'C', FALSE); $pdf->Ln(5); $pdf->SetFont('Arial', '', 10); $pdf->SetX(120); $pdf->Cell(73, 4, $office['position'], '0', 0, 'C', FALSE); $pdf->SetFont('Arial', 'B', 12); // Statement of CTO signatory $statement_certified = Setting::getField('cto_certification'); $statement_certified_position = Setting::getField('cto_certification_position'); $pdf->Ln(5); $pdf->SetX(22); $pdf->Cell(73, 4, strtoupper($statement_certified), '0', 0, 'C', FALSE); $pdf->Ln(5); $pdf->SetFont('Arial', '', 10); $pdf->SetX(22); $pdf->Cell(73, 4, $statement_certified_position, '0', 0, 'C', FALSE); $pdf->SetFont('Arial', 'B', 12); // ====================Second Form ============= $pdf->Ln(44); $pdf->SetX(12); // write office $pdf->SetFont('Arial', 'B', 10); $pdf->Write(0, $office['office_name']); $pdf->SetFont('Arial', 'B', 12); //lname $pdf->SetX(99); $pdf->Write(0, $name['lname']); //fname $pdf->SetX(145); $pdf->Write(0, $name['fname']); //mname $pdf->SetX(187); $pdf->Write(0, $name['mname'][0] . '.'); $pdf->Ln(10); //date of file $pdf->SetX(20); $pdf->Write(0, $c->date_file); //position $pdf->SetFont('Arial', 'B', 10); $pdf->SetX(63); $pdf->Write(0, $name['position']); $pdf->SetFont('Arial', 'B', 12); //monthly salary $pdf->SetX(140); $pdf->Write(0, 'P ' . number_format($this->Salary_grade->get_monthly_salary($name['salary_grade'], $name['step']), 2)); $pdf->Ln(13); $pdf->SetX(30); $pdf->Write(0, $c->days . ' ' . $days); $pdf->SetX(140); //$pdf->Write(0, 'daily rate here'); $pdf->Ln(13); $pdf->SetX(50); $pdf->Write(0, $this->Helps->get_month_name($c->month) . ' ' . $c->dates . ', ' . $c->year); $cto_balances_as_of = date("F d, Y", strtotime($c->date_file . "-1 day")); $pdf->Ln(30); $pdf->SetX(30); //$pdf->Write(0, $cto_balances_as_of); $pdf->Ln(10); $pdf->SetX(35); //$pdf->Write(0, $total_balance); $pdf->Ln(6); $pdf->SetX(120); $pdf->Cell(73, 4, strtoupper($office['office_head']), '0', 0, 'C', FALSE); $pdf->Ln(5); $pdf->SetFont('Arial', '', 10); $pdf->SetX(120); $pdf->Cell(73, 4, $office['position'], '0', 0, 'C', FALSE); $pdf->SetFont('Arial', 'B', 12); $pdf->Ln(5); $pdf->SetX(22); $pdf->Cell(73, 4, strtoupper($statement_certified), '0', 0, 'C', FALSE); $pdf->Ln(5); $pdf->SetFont('Arial', '', 10); $pdf->SetX(22); $pdf->Cell(73, 4, $statement_certified_position, '0', 0, 'C', FALSE); $pdf->SetFont('Arial', 'B', 12); header('Cache-Control: maxage=3600'); //Adjust maxage appropriately header('Pragma: public'); $pdf->Output('dtr/reports/cto-apps-' . intval($c->employee_id) . '.pdf', 'I'); //return Redirect::to('dtr/reports/leave-apps-'.$rows['employee_id'].'.pdf', 'refresh'); }
file_put_contents('img.png', $unencodedData); //Show the image //echo '<img src="'.$_POST['img_val'].'" />'; $pdf = new FPDI(); $pdf->setSourceFile('TemplateReporte.pdf'); // seteamos la fuente, el estilo y el tamano $pdf->SetFont('Times', 'B', 10); // seteamos la posicion inicial $pdf->SetXY(25, 80); date_default_timezone_set('America/Bogota'); setlocale(LC_ALL, "es_ES"); $dias = array("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sábado"); $meses = array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"); //agregamos una pagina $pdf->AddPage(); $pdf->SetFont('Arial'); // seleccionamos la primera pagina del docuemnto importado $tplIdx = $pdf->importPage(1); // usamos la pagina importado como template $pdf->useTemplate($tplIdx); //seteamos la posicion X $pdf->SetX(25); //salto de linea $pdf->Ln(55.2); $pdf->SetFontSize(9); $pdf->Write(0, utf8_decode(" " . $dias[date('w')] . " " . date('d') . " de " . $meses[date('n') - 1] . " del " . date('Y'))); $pdf->Image('img.png', 50, 110, 200); unlink('img.png'); $pdf->Ln(155); $pdf->Write(0, utf8_decode(" Relación de costos anuales sobre proyectos ejecutados con éxito.")); $pdf->Output();
"SELECT fi_caracter, fi_firmante FROM cfi_firma WHERE fi_id = 444"; // Queda fijo Ana Bordachar.. $stmt = DBExecSql($conn, $sql, array()); $rowFirmante = DBGetQuery($stmt, 1, false); $pdf = new FPDI(); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/usuarios_registrados/agentes_comerciales/comisiones/templates/ingresos_brutos_generico.pdf"); $pdf->AddPage(); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $pdf->SetFont("Arial", "", 13); $numeroComprobante = str_pad($row["NROCOMPROBANTE"], 12, "0", STR_PAD_LEFT); $pdf->Ln(4.6); $pdf->Cell(148); $pdf->Cell(0, 0, substr($numeroComprobante, 0, 4)."-".substr($numeroComprobante, 4)); $pdf->SetFont("Arial", "B", 12); $pdf->Ln(14); $pdf->Cell(2); $pdf->Cell(0, 0, "Provincia Aseguradora de Riesgos de Trabajo S.A."); $pdf->SetFont("Arial", "", 10); $pdf->Ln(6); $pdf->Cell(2); $pdf->Cell(0, 0, "Carlos Pellegrini 91 1º Piso - Capital Federal"); $pdf->Ln(6); $pdf->Cell(2);
$sql = "SELECT fi_caracter, fi_firmante FROM cfi_firma WHERE fi_id = 444"; // Queda fijo Ana Bordachar.. $stmt = DBExecSql($conn, $sql, array()); $rowFirmante = DBGetQuery($stmt, 1, false); $pdf = new FPDI(); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/usuarios_registrados/agentes_comerciales/comisiones/templates/obra_social.pdf"); $pdf->AddPage(); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $pdf->SetFont("Arial", "", 12); $pdf->Ln(4); $pdf->Cell(8); $pdf->Cell(0, 0, "Provincia Aseguradora de Riesgos de Trabajo S.A."); $pdf->SetFont("Arial", "", 10); $pdf->Ln(6); $pdf->Cell(8); $pdf->Cell(0, 0, "Carlos Pellegrini 91 1º Piso - Capital Federal"); $pdf->Ln(6); $pdf->Cell(8); $pdf->Cell(0, 0, "C.P. 1009"); $pdf->Ln(6); $pdf->Cell(8); $pdf->Cell(0, 0, "Tel: 4819-2800 Fax: 0800-999-1829");
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'; }
$sql = "SELECT fi_caracter, fi_firmante FROM cfi_firma WHERE fi_id = 444"; // Queda fijo Ana Bordachar.. $stmt = DBExecSql($conn, $sql, array()); $rowFirmante = DBGetQuery($stmt, 1, false); $pdf = new FPDI(); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/usuarios_registrados/agentes_comerciales/comisiones/templates/afip.pdf"); $pdf->AddPage(); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $pdf->SetFont("Arial", "", 10); $pdf->Ln(27.4); $pdf->Cell(138); $pdf->Cell(56, 0, $row["NUMERO"]); $pdf->Ln(5.4); $pdf->Cell(124); $pdf->Cell(56, 0, $row["FECHA"]); $pdf->Ln(25.2); $pdf->Cell(76); $pdf->Cell(0, 0, "PROVINCIA ART S.A."); $pdf->Ln(6.2); $pdf->Cell(32); $pdf->Cell(0, 0, "30-68825409-0");
"SELECT fi_caracter, fi_firmante FROM cfi_firma WHERE fi_id = 444"; // Queda fijo Ana Bordachar.. $stmt = DBExecSql($conn, $sql, array()); $rowFirmante = DBGetQuery($stmt, 1, false); $pdf = new FPDI(); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/usuarios_registrados/agentes_comerciales/comisiones/templates/ingresos_brutos_2.pdf"); $pdf->AddPage(); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $pdf->SetFont("Arial", "", 14); $numeroComprobante = str_pad($row["NROCOMPROBANTE"], 12, "0", STR_PAD_LEFT); $pdf->Ln(23.2); $pdf->Cell(130); $pdf->Cell(0, 0, substr($numeroComprobante, 0, 4)."-".substr($numeroComprobante, 4)); $pdf->SetFont("Arial", "B", 10); $pdf->Ln(26); $pdf->Cell(64); $pdf->Cell(40, 0, $row["AGENTERETENCION"]); $pdf->SetFont("Arial", "", 10); $pdf->Cell(4); $pdf->Cell(0, 0, "Provincia Aseguradora de Riesgos de Trabajo S.A."); $pdf->SetFont("Arial", "B", 10); $pdf->Ln(4.8); $pdf->Cell(64);
catch (Exception $e) { $graficoOk = false; } // FIN - Generación de gráfico que va incrustado en el reporte.. if ($graficoOk) { $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_cotizacion/plantillas/analisis_comparativo_costos.pdf"); $pdf->SetDrawColor(255, 255, 255); $pdf->SetFillColor(255, 255, 255); $pdf->AddPage(); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $pdf->SetFont("Arial", "B", 10); $pdf->Ln(33); $pdf->Cell(40); $pdf->Cell(144, 0, $row["RAZONSOCIAL"]); $pdf->Ln(6.6); $pdf->Cell(28); $pdf->Cell(36, 0, $row["CUIT"]); $pdf->Cell(16); $pdf->Cell(80, 0, $row["CIIU"]); $pdf->Ln(6.6); $pdf->Cell(38); $pdf->Cell(146, 0, $row["DESCRIPCIONCIIU"]); $pdf->Ln(6);
AND co_contrato = dc_contrato AND dc_tipo = 'L' AND dc_provincia = zg_idprovincia AND co_contrato = :contrato"; $stmt = DBExecSql($conn, $sql, $params); $row = DBGetQuery($stmt, 1, false); $pdf = new FPDI(); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/usuarios_registrados/agentes_comerciales/rc_contratos_activos/templates/cotizacion_responsabilidad_civil_patronal.pdf"); $pdf->AddPage(); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $pdf->SetFont("Arial", "B", 9); $pdf->Ln(36); $pdf->Cell(20); $pdf->Cell(0, 0, date("d/m/Y")); $pdf->Ln(42); $pdf->Cell(16); $pdf->Cell(0, 0, $row["CUIT"]); $pdf->Ln(5.2); $pdf->Cell(32); $pdf->Cell(160, 0, $row["EM_NOMBRE"]); $pdf->Ln(5.7); $pdf->Cell(108); $pdf->Cell(0, 0, $row["AC_CODIGO"]);
mysql_query($sqli); // initiate FPDI $pdf = new FPDI(); // add a page $pdf->AddPage(); // set the source file $pdf->setSourceFile("fpdi/timbre.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, 0, 0, 210); // now write some text above the imported page $pdf->SetFont('Arial','B',14); $pdf->Ln(60); $pdf->Cell(85); $pdf->Cell(20,10,'RECIBO'); $pdf->SetFont('Arial','',10); $pdf->Ln(20); $pdf->Cell(20); $pdf->MultiCell(150,10,utf8_decode('Recebi de '.$nome.', CPF '.$cpf.', a importância de R$'.$valor.' ('.$valorex.') referente à consulta médica.'),0,J); $pdf->SetY(250); $pdf->Cell(45); $pdf->Cell(20,10,'_____________________________________________________'); $pdf->Ln(5); $pdf->Cell(65); $pdf->Cell(20,10,'Dra. Clarissa de Oliveira Soares Peixoto'); $pdf->Ln(5); $pdf->Cell(80); $pdf->Cell(20,10,'CPF: 030.771.727-55');
"SELECT fi_caracter, fi_firmante FROM cfi_firma WHERE fi_id = 444"; // Queda fijo Ana Bordachar.. $stmt = DBExecSql($conn, $sql, array()); $rowFirmante = DBGetQuery($stmt, 1, false); $pdf = new FPDI(); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/usuarios_registrados/agentes_comerciales/comisiones/templates/ingresos_brutos_16.pdf"); $pdf->AddPage(); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $pdf->SetFont("Arial", "B", 12); $numeroComprobante = str_pad($row["NROCOMPROBANTE"], 12, "0", STR_PAD_LEFT); $pdf->Ln(21.2); $pdf->Cell(156); $pdf->Cell(0, 0, substr($numeroComprobante, 0, 4)."-".substr($numeroComprobante, 4)); $pdf->SetFont("Arial", "", 10); $pdf->Ln(12.2); $pdf->Cell(62); $pdf->Cell(86, 0, "Provincia Aseguradora de Riesgos de Trabajo S.A."); $pdf->Cell(3); $pdf->Cell(12, 0, "CUIT:"); $pdf->Cell(0.2); $pdf->Cell(0, 0, "30-68825409-0"); $pdf->Ln(6.4);
if ($autoPrint) $pdf = new PDF_AutoPrint(); else $pdf = new FPDI(); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_afiliacion/templates/ubicacion_riesgo.pdf"); $pdf->AddPage(); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); setNumeroSolicitud($row2["CUIT"], $row2["FO_FORMULARIO"]); $pdf->SetFont("Arial", "B", 8); $pdf->Ln(15.6); $pdf->Cell(31); $pdf->Cell(110, 0, $row2["RAZONSOCIAL"]); $pdf->Cell(16); $pdf->Cell(0, 0, ponerGuiones($row2["CUIT"])); $pdf->Ln(4.4); $pdf->Cell(28); $pdf->Cell(168, 0, $row2["AC_DESCRIPCION"]); $pdf->Ln(4); $pdf->Cell(128); $pdf->Cell(16, 0, $row2["AC_CODIGO"]); $pdf->Cell(44);
public function executeBatchPrintBadge(sfWebRequest $request) { $ids = $request->getParameter('ids'); // initiate FPDI $pdf = new FPDI('P', 'pt'); // set the sourcefile $pdf->setSourceFile(sfConfig::get('sf_upload_dir') . '/badges/ID_new.pdf'); foreach ($ids as $id) { $this->employee = EmployeePeer::retrieveByPk($id); // import page 1 $tplIdx = $pdf->importPage(1); // add a new page based on size of the badge $s = $pdf->getTemplatesize($tplIdx); $pdf->AddPage('P', array($s['w'], $s['h'])); $pdf->useTemplate($tplIdx); $pdf->setMargins(0, 0, 0, 0); $pdf->SetAutoPageBreak(false); if ($this->employee->getPicture()) { $pdf->Image(sfConfig::get('sf_upload_dir') . '/' . sfConfig::get('app_employee_images_dir') . '/' . $this->employee->getPicture(), 29.5, 25.5, 60.3, 74.3); } else { $pdf->Image(sfConfig::get('sf_upload_dir') . '/badges/picture_missing.jpg', 29.5, 25.5, 60.3, 74.3); } // now write some text above the imported page $pdf->SetFont('freesans', 'B', 12); $pdf->SetTextColor(82, 78, 134); $pdf->SetXY(22, 110); $pdf->Cell(0, 12, $this->employee->getFullName()); $pdf->Ln(); $pdf->SetX(22); $pdf->SetFont('freesans', 'BI', 10); $pdf->Cell(0, 14, $this->employee->getJob()); $pdf->SetDisplayMode('real'); } return $pdf->Output('newpdf.pdf', 'D'); }
public function generatesExternalReport($id = -1) { /* * Loading libraries and helpers */ $this->load->library(array('rb', 'fpdf_gen')); $this->load->helper(array('date', 'utility')); /* * The request id is not set */ if ($id == -1) { echo "Parece que não foi especificado qual o id da Solicitação."; exit; } /* * Loading request */ $request = R::findOne('request', 'id=?', array($id)); /* * Request exists */ if ($request == null) { echo 'Parece que a solicitação não existe.'; exit; } /* * Creating PDF */ $pdf = new FPDI(); $pdf->addPage('L'); /* ********************************************************* * BEGIN - HEADER ********************************************************* */ $pdf->image(public_url('img/' . $this->config->item('system_report_logo')), 140, 5); $pdf->ln(14); $pdf->SetFont('Courier', 'B', 9); $pdf->Cell(0, 0, utf8_decode($this->config->item('system_name')), 0, 0, 'C'); $pdf->Ln(5); $pdf->SetFont('Courier', '', 9); $pdf->Cell(0, 0, utf8_decode("SOLICITAÇÃO DE INFORMAÇÃO"), 0, 0, 'C'); /* ********************************************************* * END - HEADER ********************************************************* */ $pdf->Ln(10); $pdf->SetFont('Courier', 'B', 9); $pdf->SetDrawColor(217, 217, 217); $pdf->SetFillColor(217, 217, 217); $pdf->Cell(0, 10, utf8_decode(' DADOS DA SOLICITAÇÃO'), 'LRTB', 0, 'L', true); $pdf->Ln(10); $pdf->Cell(24, 10, utf8_decode(' PROTOCOLO: '), 'LTB', 0, 'L', false); $pdf->SetFont('Courier', '', 9); $pdf->Cell(110, 10, utf8_decode($request->protocol), 'TBR', 0, 'L', false); $pdf->SetFont('Courier', 'B', 9); $pdf->Cell(32, 10, utf8_decode(' SOLICITADA EM: '), 'TB', 0, 'L', false); $pdf->SetFont('Courier', '', 9); $pdf->Cell(111, 10, utf8_decode(mdate('%d/%m/%Y', strtotime($request->createdAt))), 'TBR', 0, 'L', false); $pdf->Ln(10); $pdf->SetFont('Courier', 'B', 9); $pdf->Cell(24, 10, utf8_decode(' SITUAÇÃO: '), 'LB', 0, 'L', false); $pdf->SetFont('Courier', '', 9); $pdf->Cell(253, 10, utf8_decode(status_text($request->status)), 'TBR', 0, 'L', false); $pdf->Ln(10); $pdf->SetFont('Courier', 'B', 9); $pdf->Cell(0, 10, utf8_decode(' SOLICITAÇÃO: '), 'LR', 0, 'L', false); $pdf->Ln(8); $pdf->SetFont('Courier', '', 9); $pdf->MultiCell(0, 5, utf8_decode(' ' . $request->request), 'LR', 'L', false); $pdf->Cell(0, 4, '', 'LR', 0, 'L', false); $pdf->Ln(4); $pdf->SetFont('Courier', 'B', 9); $pdf->Cell(0, 10, utf8_decode(' TRÂMITAÇÃO'), 'LRTB', 0, 'L', true); $pdf->Ln(10); $pdf->SetFont('Courier', '', 9); $statuses = R::find('status', ' request_id = ? ORDER BY created_at ASC ', array($request->id)); if (!count($statuses)) { $pdf->Cell(0, 10, utf8_decode(' Nenhuma trâmitação ainda'), 'LRB', 0, 'L', false); } else { foreach ($statuses as $s) { $pdf->SetFont('Courier', 'B', 9); $pdf->Cell(0, 10, utf8_decode(' ' . status_text($s->type) . ' [' . date('d/m/Y', strtotime($s->createdAt)) . ']'), 'LR', 0, 'L', false); $pdf->Ln(10); $pdf->SetFont('Courier', '', 9); $pdf->MultiCell(0, 5, utf8_decode(' ' . $s->response), 'LRB', 'L', false); } } $pdf->Ln(10); $pdf->Output(); }
public function createScreeningPdf($hash) { $screening_entry_model = ScreeningEntry::findOne(['hash' => $hash]); $screening_form_model = ScreeningForm::findOne(['id' => $screening_entry_model->screening_form_id]); $subject_model = Subject::findOne(['id' => $screening_entry_model->subject_id]); $count = 1; //$permissions = \SetaPDF_Core_SecHandler::PERM_DIGITAL_PRINT ; $this->_font = 'Helvetica'; //class_exists('TCPDF', true); // trigger Composers autoloader to load the TCPDF class $pdf = new \FPDI(); $pdf->SetAutoPageBreak(true); // add a page $pdf->SetTopMargin(30); $pdf->AddPage(); $pdf->setSourceFile(\yii::$app->basePath . "/../letterhead-mini-header.pdf"); $tplIdx = $pdf->importPage(1); // use the imported page and place it at point 10,10 with a width of 100 mm $pdf->useTemplate($tplIdx, 0, 0); $pdf->SetFont($this->_font, '', 9); $pdf->SetXY(10, 6); $pdf->Cell(0, 3, 'Confidential - Participant screening form'); $pdf->SetFont($this->_font, '', 12); $pdf->SetXY(10, 14); $pdf->MultiCell(150, 3, yii::$app->DateComponent->timestampToUkDate($screening_entry_model->created_at), 0, 'R'); $pdf->MultiCell(100, 3, $screening_entry_model->screening_form_title, 0, ''); $pdf->Ln(); $pdf->SetFont($this->_font, '', 9); $pdf->Cell(100, 4, sprintf('Participant: %s %s (dob %s)', $screening_entry_model->subject->first_name, $screening_entry_model->subject->last_name, yii::$app->DateComponent->isoToUkDate($screening_entry_model->subject->dob))); $pdf->Cell(50, 4, sprintf('Identifier: %s', $screening_entry_model->subject->cubric_id), 0, '', 'R'); $pdf->Ln(); $pdf->Cell(100, 4, sprintf('Researcher: %s %s (project %s)', $screening_entry_model->researcher->first_name, $screening_entry_model->researcher->last_name, $screening_entry_model->project->code)); $pdf->Cell(50, 4, sprintf('Resource: %s', $screening_entry_model->resource_title), 0, '', 'R'); $pdf->SetXY(10, 38); $pdf->SetFont($this->_font, '', 12); $pdf->Cell(150, 4, sprintf('Responses')); $pdf->SetFont($this->_font, '', 9); $pdf->Ln(); foreach (yii::$app->screeningresponse->getResponses($hash) as $response) { if (strlen($response['caption']) > 0) { $pdf->Ln(); $pdf->MultiCell(180, 4, sprintf('%s ', $response['caption']), 0, 'U'); $count = 1; } $pdf->MultiCell(180, 4, sprintf('%s. %s ', $count, $response['content'])); $pdf->SetFont($this->_font, 'B', 9); if ($response['response'] === null) { $response['response'] = 'Not specified / Unknown.'; } $pdf->MultiCell(180, 4, sprintf('%s ', $response['response'])); $pdf->SetFont($this->_font, '', 9); $count++; $pdf->Ln(); } $pdf->Ln(); $pdf->SetFont($this->_font, '', 12); $pdf->Cell(180, 4, sprintf('Signatures')); $pdf->Ln(); $pdf->Ln(); $pdf->SetFont($this->_font, '', 9); $pdf->Cell(100, 4, 'Participant '); $pdf->Cell(100, 4, 'Researcher '); $pdf->Ln(); $pdf->Ln(); $currentX = $pdf->GetX(); $currentY = $pdf->GetY(); $pdf->Image(sprintf('/tmp/subject-%s.png', $hash), $currentX, $currentY); $currentX = $pdf->GetX(); $pdf->Image(sprintf('/tmp/researcher-%s.png', $hash), $currentX + 100, $currentY); // now write some text above the imported page // NOW SET ScreeningEntry::progress_id = PUBLISHED so it cannot be edited again. // $pdfData = $pdf->Output('S'); // create a writer // create a Http writer //$writer = new \SetaPDF_Core_Writer_Http("fpdf-sign-demo.pdf", true); // load document by filename //$document = new \SetaPDF_Core_Document::loadByString($pdfData, $writer); //$document = new \SetaPDF_Core_Reader_File($pdf->Output(), $writer); $writer = new \SetaPDF_Core_Writer_File("/Users/Spiro/tmp/myPDF.pdf"); $document = \SetaPDF_Core_Document::loadByString($pdf->Output("S"), $writer); // let's prepare the temporary file writer: \SetaPDF_Core_Writer_TempFile::setTempDir("/tmp/"); // create a signer instance for the document $signer = new \SetaPDF_Signer($document); // add a field with the name "Signature" to the top left of page 1 $signer->addSignatureField(\SetaPDF_Signer_SignatureField::DEFAULT_FIELD_NAME, 1, \SetaPDF_Signer_SignatureField::POSITION_LEFT_BOTTOM, array('x' => 10, 'y' => 10), 180, 50); // set some signature properties $signer->setReason('Integrity'); $signer->setLocation('CUBRIC'); $signer->setContactInfo('+44 2920 703859'); // ccreate an OpenSSL module instance $module = new \SetaPDF_Signer_Signature_Module_OpenSsl(); // set the sign certificate $module->setCertificate(file_get_contents("/Users/spiro/Sites/projects/certs/certificate.pem")); // set the private key for the sign certificate $module->setPrivateKey(array(file_get_contents("/Users/spiro/Sites/projects/certs/key.pem"), "")); // create a Signature appearance $visibleAppearance = new \SetaPDF_Signer_Signature_Appearance_Dynamic($module); // choose a document to get the background from and convert the art box to an xObject $backgroundDocument = \SetaPDF_Core_Document::loadByFilename(Yii::getAlias('@frontend/web/img/cubric-logo.pdf')); $backgroundXObject = $backgroundDocument->getCatalog()->getPages()->getPage(1)->toXObject($document); // format the date $visibleAppearance->setShowFormat(\SetaPDF_Signer_Signature_Appearance_Dynamic::CONFIG_DATE, 'd-m-Y H:i:s'); // disable the distinguished name $visibleAppearance->setShow(\SetaPDF_Signer_Signature_Appearance_Dynamic::CONFIG_DISTINGUISHED_NAME, false); // set the background with 50% opacity $visibleAppearance->setGraphic($backgroundXObject, 0.5); //$visibleAppearance->setBackgroundLogo($backgroundXObject, .5); // sign/certify the document // define the appearance $signer->setAppearance($visibleAppearance); $signer->sign($module); if (file_exists(sprintf('/tmp/subject-%s.png', $hash))) { } // unlink(sprintf('/tmp/subject-%s.png' , $hash)); if (file_exists(sprintf('/tmp/researcher-%s.png', $hash))) { } // unlink(sprintf('/tmp/researcher-%s.png' , $hash)); return true; }
$stmt = DBExecSql($conn, $sql, $params); $pdf = new FPDI(); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/usuarios_registrados/agentes_comerciales/comisiones/templates/orden_pago.pdf"); define("MAX_REGISTROS_POR_HOJA", 52); dibujarCabecera($rowCabecera); $i = 1; $netoAPagar = 0; while ($row = DBGetQuery($stmt)) { if (($i % MAX_REGISTROS_POR_HOJA) == 0) dibujarCabecera(); $pdf->Ln(4); $pdf->Cell(-5); $pdf->Cell(32, 0, $row["TIPO"], 0, 0, "C"); $pdf->Cell(20, 0, $row["FECHA"], 0, 0, "C"); $pdf->Cell(32, 0, $row["NUMERO"], 0, 0, "C"); $pdf->Cell(84, 0, $row["DESCRIPCION"], 0, 0, "C"); $pdf->Cell(32, 0, $row["MONTOFORMATEADO"], 0, 0, "R"); $netoAPagar+= str_replace(",", ".", $row["MONTO"]); $i++; } $pdf->SetY(272); $pdf->Ln(1); $pdf->Rect($pdf->GetX() - 5, $pdf->GetY(), 200, 0.2, "F"); $sql = "SELECT TO_CHAR(".$netoAPagar.", '$9,999,999,990.00') montoformateado FROM DUAL";
$curs = null; $params = array(":idtransaccion" => $_REQUEST["id"]); $sql = "BEGIN art.webart.get_denuncia_siniestro(:data, :idtransaccion); END;"; $stmt = DBExecSP($conn, $curs, $sql, $params); $row = DBGetSP($curs, false); // ******* INICIO - Armado del reporte.. ******* $pdf = new FPDI(); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/usuarios_registrados/clientes/denuncias_de_siniestros/templates/denuncia_siniestro.pdf"); $pdf->AddPage(); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $pdf->SetFont("Arial", "", 8); $pdf->Ln(15); switch ($row["EW_TIPOSINIESTRO"]) { case 1: $pdf->Cell(81); $pdf->Cell(0, 0, "X"); break; case 2: $pdf->Cell(113); $pdf->Cell(0, 0, "X"); break; case 3: $pdf->Cell(45.2); $pdf->Cell(0, 0, "X"); break; }
$pdf = new PDF_AutoPrint(); else $pdf = new FPDI(); if ($msgSqlVacio == "") { $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_afiliacion/templates/responsabilidad_civil.pdf"); $pdf->SetDrawColor(255, 255, 255); $pdf->SetFillColor(255, 255, 255); $pdf->AddPage(); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $pdf->SetFont("Arial", "B", 9); $pdf->Ln(30); $pdf->Cell(168); $pdf->Cell(0, 0, "PCI".$row2["IDFORMULARIO"]); $pdf->Ln(5); $pdf->SetDrawColor(0, 0, 0); if ($row2["BOLETA"] == "") { $pdf->Cell(46); $pdf->Cell(7, 0, "", 1, 0, "C"); } if ($row2["DEBITO"] == "") { $pdf->Ln(0.1); $pdf->Cell(57); $pdf->Cell(18.6, 0, "", 1, 0, "C"); } $pdf->SetDrawColor(255, 255, 255);
$stmt = DBExecSql($conn, $sql, $params); $rowE = DBGetQuery($stmt, 1, false); if ($autoPrint) $pdf = new PDF_AutoPrint(); else $pdf = new FPDI(); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_afiliacion/templates/exposicion_riesgos_quimicos.pdf"); $pdf->AddPage("L"); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx, null, null, 0, 0, true); $pdf->SetFont("Arial", "B", 9); $pdf->Ln(22); $pdf->Cell(16); $pdf->Cell(252, 0, $row2["SA_NOMBRE"]); $pdf->Cell(20); $pdf->Cell(0, 0, $row2["CUIT"]); $pdf->Ln(8); $pdf->Cell(44); $pdf->Cell(84, 0, $rowE["NROESTABLECIMIENTO"]); $pdf->Cell(20); $pdf->Cell(48, 0, $rowE["CIIU"]); $pdf->Cell(22); $pdf->Cell(76, 0, $rowE["ACTIVIDAD"]);
$sql = "SELECT fi_caracter, fi_firmante FROM cfi_firma WHERE fi_id = 444"; // Queda fijo Ana Bordachar.. $stmt = DBExecSql($conn, $sql, array()); $rowFirmante = DBGetQuery($stmt, 1, false); $pdf = new FPDI(); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/usuarios_registrados/agentes_comerciales/comisiones/templates/ingresos_brutos_4.pdf"); $pdf->AddPage(); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $pdf->SetFont("Arial", "B", 9); $pdf->Ln(41.8); $pdf->Cell(39.6); $pdf->Cell(80, 0, "Provincia Aseguradora de Riesgos de Trabajo S.A."); $pdf->Ln(5.4); $pdf->Cell(39.6); $pdf->Cell(80, 0, "Carlos Pellegrini 91 1º Piso - Capital Federal"); $pdf->Ln(5); $pdf->Cell(39.6); $pdf->Cell(0, 0, "30-68825409-0"); $pdf->SetFont("Arial", "", 10); $pdf->Ln(-4.6); $pdf->Cell(152); $pdf->Cell(8, 0, $row["ANOFECHA"]);
$pdf->SetXY(25, 80); date_default_timezone_set('America/Bogota'); setlocale(LC_ALL, "es_ES"); $dias = array("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sábado"); $meses = array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"); //agregamos una pagina $pdf->AddPage(); $pdf->SetFont('Arial'); // seleccionamos la primera pagina del docuemnto importado $tplIdx = $pdf->importPage(1); // usamos la pagina importado como template $pdf->useTemplate($tplIdx); //seteamos la posicion X $pdf->SetX(25); //salto de linea $pdf->Ln(55.2); $pdf->SetFontSize(9); $pdf->Write(0, utf8_decode(" " . $dias[date('w')] . " " . date('d') . " de " . $meses[date('n') - 1] . " del " . date('Y'))); $pdf->Ln(10); $pdf->SetFontSize(15); $pdf->write(15, ' ' . $proBasic["nombreProyecto"]); $pdf->Ln(10); $pdf->SetFontSize(12); $pdf->write(15, ' ' . utf8_decode($proBasic["nombreProyecto"])); $pdf->Ln(6); $pdf->write(15, ' ' . $proBasic["fechaInicio"]); $pdf->Ln(6); $pdf->write(15, ' ' . $proBasic["fechaFin"]); $pdf->Ln(6); $pdf->write(15, ' ' . utf8_decode($proBasic["estadoProyecto"])); $pdf->Ln(6);
if ($autoPrint) $pdf = new PDF_AutoPrint(); else $pdf = new FPDI(); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_afiliacion/templates/solicitud_afiliacion.pdf"); //Página 1.. $pdf->AddPage(); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $pdf->SetFont("Arial", "", 8); if (($row2["SA_MOTIVOALTA"] == "03") or ($row2["SA_MOTIVOALTA"] == "04") or ($row2["SA_MOTIVOALTA"] == "05")) { $pdf->Ln(6); $pdf->Cell(-0.4); $pdf->Cell(0, 0, "X"); $pdf->Ln(8.2); $pdf->Cell(1); } else { $pdf->Ln(10.2); $pdf->Cell(-0.4); $pdf->Cell(0, 0, "X"); $pdf->SetFont("Arial", "B", 8); $pdf->Ln(4); $pdf->Cell(1); $pdf->Cell(45, 0, $row2["AR_NOMBRE"]);
$sql = "SELECT art.utiles.armar_cuit(sa_cuit) cuit, sa_nombre FROM asa_solicitudafiliacion WHERE sa_idformulario = :idformulario"; $stmt = DBExecSql($conn, $sql, $params); $row2 = DBGetQuery($stmt, 1, false); if ($autoPrint) $pdf = new PDF_AutoPrint(); else $pdf = new FPDI(); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_afiliacion/templates/nomina_personal_expuesto.pdf"); $pdf->AddPage("L"); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx, null, null, 0, 0, true); $pdf->SetFont("Arial", "B", 9); $pdf->Ln(17); $pdf->Cell(14); $pdf->Cell(226, 0, $row2["SA_NOMBRE"]); $pdf->Cell(16); $pdf->Cell(0, 0, $row2["CUIT"]); if ($autoPrint) $pdf->AutoPrint(false); $pdf->Output(); ?>
"SELECT art.utiles.armar_cuit(sa_cuit) cuit, sa_nombre FROM asa_solicitudafiliacion WHERE sa_idformulario = :sa_idformulario"; $stmt = DBExecSql($conn, $sql, $params); $row2 = DBGetQuery($stmt, 1, false); if ($autoPrint) $pdf = new PDF_AutoPrint(); else $pdf = new FPDI(); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_afiliacion/templates/ventanilla_electronica.pdf"); $pdf->AddPage(); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $pdf->SetFont("Arial", "B", 9); $pdf->Ln(34.5); $pdf->Cell(38); $pdf->Cell(136, 0, $row2["SA_NOMBRE"]); $pdf->Ln(5.2); $pdf->Cell(31); $pdf->Cell(32, 0, $row2["CUIT"]); if ($autoPrint) $pdf->AutoPrint(false); $pdf->Output(); ?>
else $pdf = new FPDI("P", "mm", array(216, 320)); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_afiliacion/templates/rgrl.pdf"); $pdf->AddPage(); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $pagina = 1; dibujarPie($pagina); // Cabecera.. setNumeroSolicitud($row["CUIT"], $row["FO_FORMULARIO"]); $pdf->SetFont("Arial", "B", 8); $pdf->Ln(-7.2); $pdf->Cell(4); $pdf->Cell(0, 0, date("d/m/Y")); $pdf->SetFont("Arial", "B", 9); $pdf->Ln(3); $pdf->Cell(192, 0, $row["TITULO"], 0, 0, "C"); $pdf->SetFont("Arial", "B", 8); $pdf->Ln(34.6); $pdf->Cell(26); $pdf->Cell(100, 0, $row["NOMBRE"]); $pdf->Cell(26); $pdf->Cell(0, 0, ponerGuiones($row["CUIT"]));
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'; }