function header() { global $s_date, $e_date, $t_date; // // Place // $str = 'Guatemala'; $this->pdf->addTextWrap(125, $this->pdf->cy(90), $this->pdf->getTextWidth(8, $str) + 100, 8, $str); // // Today // list($t_date_day, $t_date_month, $t_date_year) = explode('-', date('d-m-Y', $t_date)); list($tdd1, $tdd2) = $this->explode($t_date_day); list($tdm1, $tdm2) = $this->explode($t_date_month); list($tdy1, $tdy2, $tdy3, $tdy4) = $this->explode($t_date_year); $this->pdf->addTextWrap(50, $this->pdf->cy(106), $this->pdf->getTextWidth(10, $tdd1) + 100, 10, $tdd1); $this->pdf->addTextWrap(70, $this->pdf->cy(106), $this->pdf->getTextWidth(10, $tdd2) + 100, 10, $tdd2); $this->pdf->addTextWrap(125, $this->pdf->cy(106), $this->pdf->getTextWidth(10, $tdm1) + 100, 10, $tdm1); $this->pdf->addTextWrap(145, $this->pdf->cy(106), $this->pdf->getTextWidth(10, $tdm2) + 100, 10, $tdm2); $this->pdf->addTextWrap(200, $this->pdf->cy(106), $this->pdf->getTextWidth(10, $tdy1) + 100, 10, $tdy1); $this->pdf->addTextWrap(220, $this->pdf->cy(106), $this->pdf->getTextWidth(10, $tdy2) + 100, 10, $tdy2); $this->pdf->addTextWrap(245, $this->pdf->cy(106), $this->pdf->getTextWidth(10, $tdy3) + 100, 10, $tdy3); $this->pdf->addTextWrap(264, $this->pdf->cy(106), $this->pdf->getTextWidth(10, $tdy4) + 100, 10, $tdy4); // // NIT // $nit = $this->explode($this->hd['nit']); $nit_pos = array(70, 85, 100, 115, 130, 145, 160, 188); foreach ($nit_pos as $i => $x) { $i_nit = $nit[$i]; $this->pdf->addTextWrap($x, $this->pdf->cy(151), $this->pdf->getTextWidth(10, $i_nit) + 100, 10, $i_nit); } // // Start date // list($t_date_day, $t_date_month, $t_date_year) = explode('-', date('d-m-Y', $s_date)); $this->pdf->addTextWrap(285, $this->pdf->cy(143), $this->pdf->getTextWidth(10, $t_date_day) + 100, 10, $t_date_day); $this->pdf->addTextWrap(360, $this->pdf->cy(143), $this->pdf->getTextWidth(10, $t_date_month) + 100, 10, $t_date_month); $this->pdf->addTextWrap(425, $this->pdf->cy(143), $this->pdf->getTextWidth(10, $t_date_year) + 100, 10, $t_date_year); // // End date // list($t_date_day, $t_date_month, $t_date_year) = explode('-', date('d-m-Y', $e_date)); $this->pdf->addTextWrap(285, $this->pdf->cy(158), $this->pdf->getTextWidth(10, $t_date_day) + 100, 10, $t_date_day); $this->pdf->addTextWrap(360, $this->pdf->cy(158), $this->pdf->getTextWidth(10, $t_date_month) + 100, 10, $t_date_month); $this->pdf->addTextWrap(425, $this->pdf->cy(158), $this->pdf->getTextWidth(10, $t_date_year) + 100, 10, $t_date_year); // // Organization data // $this->pdf->addTextWrap(200, $this->pdf->cy(186), $this->pdf->getTextWidth(10, $this->hd['name']) + 100, 10, $this->hd['name']); $this->pdf->addTextWrap(100, $this->pdf->cy(215), $this->pdf->getTextWidth(10, $this->hd['avenue']) + 100, 10, $this->hd['avenue']); $this->pdf->addTextWrap(220, $this->pdf->cy(215), $this->pdf->getTextWidth(10, $this->hd['number']) + 100, 10, $this->hd['number']); $this->pdf->addTextWrap(330, $this->pdf->cy(215), $this->pdf->getTextWidth(10, $this->hd['zone']) + 100, 10, $this->hd['zone']); $this->pdf->addTextWrap(495, $this->pdf->cy(215), $this->pdf->getTextWidth(10, $this->hd['city']) + 100, 10, $this->hd['city']); $this->pdf->addTextWrap(100, $this->pdf->cy(243), $this->pdf->getTextWidth(10, $this->hd['city']) + 100, 10, $this->hd['city']); $this->pdf->addTextWrap(250, $this->pdf->cy(243), $this->pdf->getTextWidth(10, $this->hd['phone']) + 100, 10, $this->hd['phone']); $this->pdf->addTextWrap(330, $this->pdf->cy(243), $this->pdf->getTextWidth(10, $this->hd['fax']) + 100, 10, $this->hd['fax']); $this->hd['sig_name'] = strtoupper_tilde($this->hd['sig_name']); $this->hd['sig_name'] = html_entity_decode($this->hd['sig_name']); $this->pdf->addTextWrap(250, $this->pdf->cy(670), $this->pdf->getTextWidth(8, $this->hd['sig_name']) + 100, 8, $this->hd['sig_name']); $this->pdf->ezStartPageNumbers(575, $this->pdf->cy(15), 7); return true; }
function parse_nulled(&$row, $all = false) { if ($row['c_null']) { $row['c_text'] = 'A N U L A D O'; $row['c_nit'] = $row['p_name'] = ''; $row['p_nit'] = 0; if ($all) { $row['f_date'] = $row['f_fact'] = $row['f_total'] = $row['f_serie'] = 0; } } else { $row['p_name'] = strtoupper_tilde($row['p_name']); $row['p_name'] = html_entity_decode($row['p_name']); $row['c_text'] = strtoupper($row['c_text']); //$row['p_name'] = strtoupper($row['p_name']); } }