function run() { // change some win codes, and xhtml into html $str = array('<br />' => '<br>', '<hr />' => '<hr>', '[r]' => '<red>', '[/r]' => '</red>', '[l]' => '<blue>', '[/l]' => '</blue>', '“' => '"', '”' => '"', '„' => '"', '…' => '...', '’' => '\''); foreach ($str as $_from => $_to) { $this->html = str_replace($_from, $_to, $this->html); } $pdf = new PDF('P', 'mm', 'A4'); $pdf->SetDisplayMode('real'); $pdf->AddPage(); // html $pdf->WriteHTML($this->_convert(stripslashes($this->html)), $this->bi); // output $pdf->Output(); // stop processing exit; }
$obsinmu = utf8_decode($row['obsinmu']); $zonificacion = utf8_decode($row['zonificacion']); $deszonrie = utf8_decode($row['deszonrie']); $descon = utf8_decode($row['descon']); $obscon = utf8_decode($row['obscon']); $fotos = explode(",", $row['fotos']); //Creación del objeto de la clase heredada //$pdf=new PDF(); //$pdf->AliasNbPages(); /* if (!isset($pdf)) { $pdf=new PDF(); $pdf->AliasNbPages(); } */ $pdf->AddPage(); $pdf->SetDisplayMode('fullpage'); $pdf->SetMargins(20, 20, 20); $pdf->SetFont('Arial', 'BU', 14); $pdf->SetTextColor(70, 125, 25); $pdf->Cell(0, 10, 'FICHA DE CHECK DOMICILIARIO', 0, 1, 'C'); $pdf->Ln(2); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(55, 7, 'NOMBRES Y APELLIDOS', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $nombre, 1, 1, 'C'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(55, 7, 'DIRECCION', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->MultiCell(0, 7, $domicilio, 1, 'C'); //$pdf->Ln(2);
function Footer() { $this->SetY(-15); $this->SetDrawColor(90, 90, 90); $this->Line(15, 278, 195, 278); $this->SetFont('Arial', '', 9); $this->SetTextColor(150, 150, 150); $this->Cell(0, 0, chr(169) . ' ' . appconf('company_name') . ', ' . date('Y') . ' For further information, visit us online at ' . appconf('company_website'), 0, 0, 'R'); $this->SetTextColor(0); } } // end PDF $pdf = new PDF(); $pdf->SetFont('Arial', '', 10); $pdf->Open(); $pdf->SetDisplayMode(150, 'single'); $pdf->SetLeftMargin(15); $pdf->SetRightMargin(15); $pdf->SetFillColor(240, 240, 240); $pdf->AddPage(); $pdf->Cell(0, 5, ' ', 0, 1, 'C'); $pdf->Ln(); // heading $pdf->SetFont('Arial', '', 10); //$pdf->Cell (0, 5, 'Simian Systems Inc.', 0, 1, 'R'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, 5, appconf('company_address'), 0, 1, 'R'); $pdf->SetLeftMargin(131.5); $pdf->WriteHTML('tel: ' . appconf('company_phone') . ', web: <a href="http://' . appconf('company_website') . '/">' . appconf('company_website') . '</a>'); $pdf->SetLeftMargin(15); $pdf->Ln();
while ($row = tep_db_fetch_array($result)) { $row['fmargin'] = number_format($row['margin'], 1) . '%'; $row['weekly'] = array(); $row['total_sold_L4W'] = 0; foreach ($weekly_name as $wkey => $wn) { $row['weekly'][$wkey] = getOrderWeekly($row['products_id'], $wkey, $filter_date, $sp_list); $row['total_sold_L4W'] += $row['weekly'][$wkey]['total_sold']; } $products[$row['catid']][$row['products_id']] = $row; } $logger->write('Creating PDF File'); $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('Sales Report Weekly Products'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('Manobo PDF Generator'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(true, 25); $pdf->AliasNbPages(); $pdf->AddPage('L'); $margin = 30; $ypos = 10; $cellstart = $margin; $cellsize = 48; $cellsize_half = $cellsize / 2; $cellsizecollweek = $cellsize + $margin; $cell_height_col = 55; $cell_height = 5; $pdf->setXY($margin, $ypos); $pdf->setFont('Arial', 'B', '14'); $pdf->cell(240, 5, 'SALES REPORT WEEKLY PRODUCT KW ' . date('W') . ' (' . date('d.m.Y', strtotime($filter_date)) . ')', 0, 0, 'C'); $pdf->setFont('Arial', '', '10');
$content = $row->content; $date = $row->datum; $author = $row->author; } } else { print "Error!"; } $pdf = new PDF($currentCategory, $thema, $tree->categoryName, $orientation = "P", $unit = "mm", $format = "A4"); $pdf->Open(); $pdf->SetAutoPageBreak(true, 2 * (40 / $pdf->k)); $pdf->SetTitle($thema); $pdf->SetCreator($PMF_CONF["title"]); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont("Arial", "", 12); $pdf->SetDisplayMode("real"); $pdf->WriteHTML(str_replace("../", "", $content)); $pdf->Ln(); $pdf->Ln(); $pdf->SetStyle('I', true); $pdf->Write(5, unhtmlentities($PMF_LANG['ad_entry_solution_id']) . ': #' . $solution_id); $pdf->SetAuthor($author); $pdf->Ln(); $pdf->Write(5, unhtmlentities($PMF_LANG["msgAuthor"]) . $author); $pdf->SetAuthor($author); $pdf->Ln(); $pdf->Write(5, unhtmlentities($PMF_LANG["msgLastUpdateArticle"]) . makeDate($date)); $pdf->SetStyle('I', false); $pdfFile = "pdf/" . $id . ".pdf"; $pdf->Output($pdfFile); $file = basename($pdfFile);
function run() { // change some win codes, and xhtml into html $str = array('<br />' => '<br>', '<hr />' => '<hr>', '[r]' => '<red>', '[/r]' => '</red>', '[l]' => '<blue>', '[/l]' => '</blue>', '“' => '"', '”' => '"', '„' => '"', '…' => '...', '’' => '\''); foreach ($str as $_from => $_to) { $this->html = str_replace($_from, $_to, $this->html); } $pdf = new PDF('P', 'mm', 'A4', $this->title, $this->articleurl, false); $pdf->Open(); $pdf->SetCompression(true); $pdf->SetCreator("Script by Radek HULAN, http://hulan.info/blog/"); $pdf->SetDisplayMode('real'); $pdf->SetTitle($this->_convert($this->title)); $pdf->SetAuthor($this->articleurl); $pdf->AddPage(); // face $pdf->PutMainTitle($this->_convert($this->title)); $pdf->PutMinorHeading('Article URI'); $pdf->PutMinorTitle($this->articleurl, $this->articleurl); $pdf->PutMinorHeading('Author'); $pdf->PutMinorTitle($this->_convert($this->author)); $pdf->PutMinorHeading("Published: " . date("F j, Y, g:i a", $this->date)); $pdf->PutLine(); $pdf->Ln(10); // html $pdf->WriteHTML($this->_convert(stripslashes($this->html)), $this->bi); //save and redirect $filename = $this->directory . $this->_makeFileName($this->title) . '.pdf'; $http = $this->http . $this->_makeFileName($this->title) . '.pdf'; $pdf->Output($filename); header("Location: {$http}"); // cleanup $files = opendir($this->directory); while (false !== ($filename = readdir($files))) { if (!(strpos($filename, '.pdf') === false)) { // delete old temp files $time = filectime($this->directory . $filename); if (!($time === false) && $time > 0) { if ($time + $this->delete * 60 < time()) { unlink($this->directory . $filename); } } } } // stop processing exit; }
{ $this->Image('../images/logo_sistecart.jpg', 7, 0.8, 7); $this->Ln(2.5); } function Footer() { $this->SetY(-2); $this->SetFont('Arial', '', 8); $this->SetTextColor(22, 32, 108); $this->Cell(0, 0.4, Linha1, 0, 1, 'C'); $this->Cell(0, 0.4, Linha2, 0, 1, 'C'); $this->Cell(0, 0.4, 'http://www.cartoriopostal.com.br', 0, 1, 'C'); } } $pdf = new PDF('P', 'cm', 'A4'); $pdf->SetDisplayMode(100, 'continuous'); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 'cm', 12); $pdf->Cell(19.2, 0.4, 'Protocolo de Atendimento nº ' . $pedido->id_pedido, '', 1, 'C'); $pdf->Ln(1); $pdf->SetFont('Arial', '', 10); $pdf->Cell(19.2, 0.4, invert($pedido->data, '/', 'PHP'), '', 1, 'R'); $pdf->Cell(19.2, 0.6, 'Cliente: ' . $pedido->nome, 'LRT', 1); $pdf->Cell(19.2, 0.6, 'CPF: ' . $pedido->cpf, 'RL', 1); $pdf->Cell(19.2, 0.6, 'Endereço: ' . $pedido->cidade . '/' . $pedido->estado . ' - ', 'RL', 1); $pdf->Cell(19.2, 0.6, 'Atendente: ' . $pedido->contato, 'LR', 1); $pdf->Cell(19.2, 0.6, 'Telefone: ' . $pedido->tel, 'LR', 1); $pdf->Cell(9.199999999999999, 0.6, 'Origem: ' . $pedido->origem, 'LB', 0); $pdf->setX(10.2); $pdf->Cell(10, 0.6, 'Forma Pagamento: ' . $pedido->forma_pagamento, 'RB', 1, 'R');
function Imprimir_Checks($codper, $codsol, $link, $swInit, $pdf) { /* echo "SELECT a.codchkser, CONCAT(c.apepatper,' ',c.apematper,', ',c.nomper) AS nombre, d.despue AS puesto, a.imgreniec, a.obsimgreniec, a.indrefpol, a.refpolchk, a.indantpol, a.indreqjud, a.indrefter, a.indrefdro, a.indimpsalpai, a.indinvpen,a.invpenchk, e.desdel, a.recchk FROM tb_chkservice AS a LEFT JOIN tb_detallesolicitud AS b ON b.codper=a.codper AND b.codsol=a.codsol LEFT JOIN tb_persona AS c ON c.codper=a.codper LEFT JOIN tb_puesto AS d ON d.codpue=b.codpue LEFT JOIN tb_delito AS e ON e.coddel=a.coddel WHERE a.codper in ($codper) AND a.codsol=$codsol";*/ /*Check Service*/ $result = mysql_query("SELECT a.codchkser,\r\n\t\t\tCONCAT(c.apepatper,' ',c.apematper,', ',c.nomper) AS nombre,\r\n\t\t\td.despue AS puesto,\r\n\t\t\ta.imgreniec,\r\n\t\t\ta.obsimgreniec,\r\n\t\t\ta.indrefpol, a.refpolchk,\r\n\t\t\ta.indantpol,\r\n\t\t\ta.indreqjud,\r\n\t\t\ta.indrefter,\r\n\t\t\ta.indrefdro,\r\n\t\t\ta.indimpsalpai,\r\n\t\t\ta.indinvpen,a.invpenchk,\r\n\t\t\ta.recchk\r\n\t\t\tFROM tb_chkservice AS a\r\n\t\t\tLEFT JOIN tb_detallesolicitud AS b ON b.codper=a.codper AND b.codsol=a.codsol\r\n\t\t\tLEFT JOIN tb_persona AS c ON c.codper=a.codper\r\n\t\t\tLEFT JOIN tb_puesto AS d ON d.codpue=b.codpue\r\n\t\t\tWHERE a.codper in ({$codper}) AND a.codsol={$codsol}", $link); if (!isset($pdf)) { $pdf = new PDF(); $pdf->AliasNbPages(); } while ($row = mysql_fetch_array($result)) { $nombre = utf8_decode($row['nombre']); $puesto = utf8_decode($row['puesto']); $imgreniec = utf8_decode($row['imgreniec']); $obs = utf8_decode($row['obsimgreniec']); $indrefpol = utf8_decode($row['indrefpol']); $refpolchk = utf8_decode($row['refpolchk']); $indantpol = utf8_decode($row['indantpol']); $indreqjud = utf8_decode($row['indreqjud']); $indrefter = utf8_decode($row['indrefter']); $indrefdro = utf8_decode($row['indrefdro']); $indimpsalpai = utf8_decode($row['indimpsalpai']); $indinvpen = utf8_decode($row['indinvpen']); $invpenchk = utf8_decode($row['invpenchk']); $delitos = mysql_query("SELECT cd.coddel,d.nomdel,d.desdel FROM tb_delito_chkservice cd\r\n LEFT JOIN tb_delito d ON cd.coddel=d.coddel\r\n where cd.codsol=" . $codsol . " and cd.codper=" . $codper); $desdel = ""; while ($fildel = mysql_fetch_array($delitos)) { $desdel = $desdel . utf8_decode($fildel['nomdel']) . " : " . utf8_decode($fildel['desdel']) . "\n\n"; } // $desdel= utf8_decode($row['desdel']); $recchk = utf8_decode($row['recchk']); $sw1 = 0; if ($indrefpol == 0) { $TXTindrefpol = 'No Registra'; } else { $TXTindrefpol = 'Si Registra'; $sw1 = 1; } if ($indantpol == 0) { $TXTindantpol = 'No Registra'; } else { $TXTindantpol = 'Si Registra'; $sw1 = 1; } if ($indreqjud == 0) { $TXTindreqjud = 'No Registra'; } else { $TXTindreqjud = 'Si Registra'; $sw1 = 1; } if ($indrefter == 0) { $TXTindrefter = 'No Registra'; } else { $TXTindrefter = 'Si Registra'; $sw1 = 1; } if ($indrefdro == 0) { $TXTindrefdro = 'No Registra'; } else { $TXTindrefdrol = 'Si Registra'; $sw1 = 1; } if ($indimpsalpai == 0) { $TXTindimpsalpai = 'No Registra'; } else { $TXTindimpsalpai = 'Si Registra'; $sw1 = 1; } $sw2 = 0; if ($indinvpen == 0) { $TXTindinvpen = 'No Registra'; } else { $TXTindinvpen = 'Si Registra'; $sw2 = 1; } //Creación del objeto de la clase heredada // $pdf=new PDF(); // $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetDisplayMode('fullpage'); $pdf->SetMargins(20, 20, 20); $pdf->SetFont('Arial', 'BU', 14); $pdf->SetTextColor(70, 125, 25); $pdf->Cell(0, 10, 'CHECK SERVICE', 0, 1, 'C'); $pdf->Ln(2); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'CHECK IDENTIDAD', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $nombre, 1, 1, 'L'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'PUESTO AL QUE POSTULA', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $puesto, 1, 1, 'L'); $pdf->Ln(2); //$pdf->Image('../files/images_dni/imagen1.png',40,null,0,130); $pdf->Image('../files/images_dni/' . $imgreniec, 40, null, 0, 130); $pdf->Ln(2); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 7, 'OBSERVACIONES', 1, 1, 'C'); $pdf->SetFont('Arial', '', 12); $pdf->MultiCell(0, 5, $obs, 1, 'J'); $pdf->Ln(2); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 7, 'CHECK DELICTIVO', 1, 1, 'C'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Referencia Policial:', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); if ($TXTindrefpol == 'Si Registra') { $pdf->SetFont('Arial', 'B', 12); $pdf->SetTextColor(255, 0, 0); $pdf->Cell(0, 7, $TXTindrefpol, 1, 1, 'C'); $pdf->SetTextColor(0, 0, 0); } else { $pdf->Cell(0, 7, $TXTindrefpol, 1, 1, 'C'); } $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Antecedente Policial:', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); if ($TXTindantpol == 'Si Registra') { $pdf->SetFont('Arial', 'B', 12); $pdf->SetTextColor(255, 0, 0); $pdf->Cell(0, 7, $TXTindantpol, 1, 1, 'C'); $pdf->SetTextColor(0, 0, 0); } else { $pdf->Cell(0, 7, $TXTindantpol, 1, 1, 'C'); } $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Requisitoria Judicial:', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); if ($TXTindreqjud == 'Si Registra') { $pdf->SetFont('Arial', 'B', 12); $pdf->SetTextColor(255, 0, 0); $pdf->Cell(0, 7, $TXTindreqjud, 1, 1, 'C'); $pdf->SetTextColor(0, 0, 0); } else { $pdf->Cell(0, 7, $TXTindreqjud, 1, 1, 'C'); } $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Referencia por Terrorismo', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); if ($TXTindrefter == 'Si Registra') { $pdf->SetFont('Arial', 'B', 12); $pdf->SetTextColor(255, 0, 0); $pdf->Cell(0, 7, $TXTindrefter, 1, 1, 'C'); $pdf->SetTextColor(0, 0, 0); } else { $pdf->Cell(0, 7, $TXTindrefter, 1, 1, 'C'); } $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Referencia por Drogas:', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); if ($TXTindrefdro == 'Si Registra') { $pdf->SetFont('Arial', 'B', 12); $pdf->SetTextColor(255, 0, 0); $pdf->Cell(0, 7, $TXTindrefdro, 1, 1, 'C'); $pdf->SetTextColor(0, 0, 0); } else { $pdf->Cell(0, 7, $TXTindrefdro, 1, 1, 'C'); } $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, utf8_decode('Impedimento de salida del país:'), 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); if ($TXTindimpsalpai == 'Si Registra') { $pdf->SetFont('Arial', 'B', 12); $pdf->SetTextColor(255, 0, 0); $pdf->Cell(0, 7, $TXTindimpsalpai, 1, 1, 'C'); $pdf->SetTextColor(0, 0, 0); } else { $pdf->Cell(0, 7, $TXTindimpsalpai, 1, 1, 'C'); } //$str = utf8_decode('Investigación Penal:'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, utf8_decode('Investigación Penal:'), 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); if ($TXTindinvpen == 'Si Registra') { $pdf->SetFont('Arial', 'B', 12); $pdf->SetTextColor(255, 0, 0); $pdf->Cell(0, 7, $TXTindinvpen, 1, 1, 'C'); $pdf->SetTextColor(0, 0, 0); } else { $pdf->Cell(0, 7, $TXTindinvpen, 1, 1, 'C'); } if ($sw1 == 1 or $sw2 == 1) { $pdf->AddPage(); $pdf->SetXY(20, 25); //$pdf->SetDisplayMode('fullpage'); //$pdf->SetMargins(20, 20,20); $pdf->SetFont('Arial', 'BU', 14); $pdf->SetTextColor(70, 125, 25); $pdf->Cell(0, 10, 'ANEXO CHECK DELICTIVO', 0, 1, 'C'); $pdf->SetTextColor(0, 0, 0); $pdf->Ln(2); if ($sw1 == 1) { $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 7, 'INVESTIGACION POLICIAL', 1, 1, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->MultiCell(0, 5, $refpolchk, 1, 'J'); $pdf->Ln(2); } if ($sw2 == 1) { $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 7, 'INVESTIGACION PENAL', 1, 1, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->MultiCell(0, 5, $invpenchk, 1, 'J'); $pdf->Ln(2); } $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 7, 'DEFINICION DEL DELITO', 1, 1, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->MultiCell(0, 5, $desdel, 1, 'J'); $pdf->Ln(2); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 7, 'RECOMENDACION', 1, 1, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->MultiCell(0, 5, $recchk, 1, 'J'); $pdf->Ln(2); } } /*Check Familiar*/ $result = mysql_query("SELECT a.codchkser,\r\n a.nombre,\r\n p.despar AS parentesco,\r\n a.imgreniec,\r\n a.obsimgreniec,\r\n a.indrefpol, a.refpolchk,\r\n a.indantpol,\r\n a.indreqjud,\r\n a.indrefter,\r\n a.indrefdro,\r\n a.indimpsalpai,\r\n a.indinvpen,a.invpenchk,\r\n a.recchk\r\n FROM tb_chkfamiliar AS a\r\n LEFT JOIN tb_detallesolicitud AS b ON b.codper=a.codper AND b.codsol=a.codsol\r\n LEFT JOIN tb_persona AS c ON c.codper=a.codper\r\n LEFT JOIN tb_parentesco AS p ON a.codpar=p.codpar\r\n WHERE a.codper in ({$codper}) AND a.codsol={$codsol}", $link); if (!isset($pdf)) { $pdf = new PDF(); $pdf->AliasNbPages(); } while ($row = mysql_fetch_array($result)) { $codchkser = utf8_decode($row['codchkser']); $nombre = utf8_decode($row['nombre']); $parentesco = utf8_decode($row['parentesco']); $imgreniec = utf8_decode($row['imgreniec']); $obs = utf8_decode($row['obsimgreniec']); $indrefpol = utf8_decode($row['indrefpol']); $refpolchk = utf8_decode($row['refpolchk']); $indantpol = utf8_decode($row['indantpol']); $indreqjud = utf8_decode($row['indreqjud']); $indrefter = utf8_decode($row['indrefter']); $indrefdro = utf8_decode($row['indrefdro']); $indimpsalpai = utf8_decode($row['indimpsalpai']); $indinvpen = utf8_decode($row['indinvpen']); $invpenchk = utf8_decode($row['invpenchk']); $delitos = mysql_query("SELECT cd.coddel,d.nomdel,d.desdel FROM tb_chkfamilia_delito cd\r\n LEFT JOIN tb_delito d ON cd.coddel=d.coddel\r\n where cd.codchkser=" . $codchkser); $desdel = ""; while ($fildel = mysql_fetch_array($delitos)) { $desdel = $desdel . utf8_decode($fildel['nomdel']) . " : " . utf8_decode($fildel['desdel']) . "\n\n"; } //$desdel= utf8_decode($row['desdel']); $recchk = utf8_decode($row['recchk']); $sw1 = 0; if ($indrefpol == 0) { $TXTindrefpol = 'No Registra'; } else { $TXTindrefpol = 'Si Registra'; $sw1 = 1; } if ($indantpol == 0) { $TXTindantpol = 'No Registra'; } else { $TXTindantpol = 'Si Registra'; $sw1 = 1; } if ($indreqjud == 0) { $TXTindreqjud = 'No Registra'; } else { $TXTindreqjud = 'Si Registra'; $sw1 = 1; } if ($indrefter == 0) { $TXTindrefter = 'No Registra'; } else { $TXTindrefter = 'Si Registra'; $sw1 = 1; } if ($indrefdro == 0) { $TXTindrefdro = 'No Registra'; } else { $TXTindrefdrol = 'Si Registra'; $sw1 = 1; } if ($indimpsalpai == 0) { $TXTindimpsalpai = 'No Registra'; } else { $TXTindimpsalpai = 'Si Registra'; $sw1 = 1; } $sw2 = 0; if ($indinvpen == 0) { $TXTindinvpen = 'No Registra'; } else { $TXTindinvpen = 'Si Registra'; $sw2 = 1; } //Creación del objeto de la clase heredada // $pdf=new PDF(); // $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetDisplayMode('fullpage'); $pdf->SetMargins(20, 20, 20); $pdf->SetFont('Arial', 'BU', 14); $pdf->SetTextColor(70, 125, 25); $pdf->Cell(0, 10, 'CHECK FAMILIAR', 0, 1, 'C'); $pdf->Ln(2); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'NOMBRE', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $nombre, 1, 1, 'L'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'PARENTESCO', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $parentesco, 1, 1, 'L'); $pdf->Ln(2); //$pdf->Image('../files/images_dni/imagen1.png',40,null,0,130); $pdf->Image('../files/images_dni/fam/' . $imgreniec, 40, null, 0, 130); $pdf->Ln(2); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 7, 'OBSERVACIONES', 1, 1, 'C'); $pdf->SetFont('Arial', '', 12); $pdf->MultiCell(0, 5, $obs, 1, 'J'); $pdf->Ln(2); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 7, 'CHECK DELICTIVO', 1, 1, 'C'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Referencia Policial:', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); if ($TXTindrefpol == 'Si Registra') { $pdf->SetFont('Arial', 'B', 12); $pdf->SetTextColor(255, 0, 0); $pdf->Cell(0, 7, $TXTindrefpol, 1, 1, 'C'); $pdf->SetTextColor(0, 0, 0); } else { $pdf->Cell(0, 7, $TXTindrefpol, 1, 1, 'C'); } $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Antecedente Policial:', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); if ($TXTindantpol == 'Si Registra') { $pdf->SetFont('Arial', 'B', 12); $pdf->SetTextColor(255, 0, 0); $pdf->Cell(0, 7, $TXTindantpol, 1, 1, 'C'); $pdf->SetTextColor(0, 0, 0); } else { $pdf->Cell(0, 7, $TXTindantpol, 1, 1, 'C'); } $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Requisitoria Judicial:', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); if ($TXTindreqjud == 'Si Registra') { $pdf->SetFont('Arial', 'B', 12); $pdf->SetTextColor(255, 0, 0); $pdf->Cell(0, 7, $TXTindreqjud, 1, 1, 'C'); $pdf->SetTextColor(0, 0, 0); } else { $pdf->Cell(0, 7, $TXTindreqjud, 1, 1, 'C'); } $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Referencia por Terrorismo', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); if ($TXTindrefter == 'Si Registra') { $pdf->SetFont('Arial', 'B', 12); $pdf->SetTextColor(255, 0, 0); $pdf->Cell(0, 7, $TXTindrefter, 1, 1, 'C'); $pdf->SetTextColor(0, 0, 0); } else { $pdf->Cell(0, 7, $TXTindrefter, 1, 1, 'C'); } $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Referencia por Drogas:', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); if ($TXTindrefdro == 'Si Registra') { $pdf->SetFont('Arial', 'B', 12); $pdf->SetTextColor(255, 0, 0); $pdf->Cell(0, 7, $TXTindrefdro, 1, 1, 'C'); $pdf->SetTextColor(0, 0, 0); } else { $pdf->Cell(0, 7, $TXTindrefdro, 1, 1, 'C'); } $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, utf8_decode('Impedimento de salida del país:'), 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); if ($TXTindimpsalpai == 'Si Registra') { $pdf->SetFont('Arial', 'B', 12); $pdf->SetTextColor(255, 0, 0); $pdf->Cell(0, 7, $TXTindimpsalpai, 1, 1, 'C'); $pdf->SetTextColor(0, 0, 0); } else { $pdf->Cell(0, 7, $TXTindimpsalpai, 1, 1, 'C'); } //$str = utf8_decode('Investigación Penal:'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, utf8_decode('Investigación Penal:'), 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); if ($TXTindinvpen == 'Si Registra') { $pdf->SetFont('Arial', 'B', 12); $pdf->SetTextColor(255, 0, 0); $pdf->Cell(0, 7, $TXTindinvpen, 1, 1, 'C'); $pdf->SetTextColor(0, 0, 0); } else { $pdf->Cell(0, 7, $TXTindinvpen, 1, 1, 'C'); } if ($sw1 == 1 or $sw2 == 1) { $pdf->AddPage(); $pdf->SetXY(20, 25); //$pdf->SetDisplayMode('fullpage'); //$pdf->SetMargins(20, 20,20); $pdf->SetFont('Arial', 'BU', 14); $pdf->SetTextColor(70, 125, 25); $pdf->Cell(0, 10, 'ANEXO CHECK DELICTIVO', 0, 1, 'C'); $pdf->SetTextColor(0, 0, 0); $pdf->Ln(2); if ($sw1 == 1) { $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 7, 'INVESTIGACION POLICIAL', 1, 1, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->MultiCell(0, 5, $refpolchk, 1, 'J'); $pdf->Ln(2); } if ($sw2 == 1) { $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 7, 'INVESTIGACION PENAL', 1, 1, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->MultiCell(0, 5, $invpenchk, 1, 'J'); $pdf->Ln(2); } $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 7, 'DEFINICION DEL DELITO', 1, 1, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->MultiCell(0, 5, $desdel, 1, 'J'); $pdf->Ln(2); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 7, 'RECOMENDACION', 1, 1, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->MultiCell(0, 5, $recchk, 1, 'J'); $pdf->Ln(2); } } /*Check Domiciliario*/ $result = mysql_query("SELECT a.codchkdom,\r\n\t\t\tCONCAT(c.nomper,' ',c.apepatper,' ',c.apematper) AS nombre,\r\n\t\t\tCONCAT(i.destipvia,' ',a.nomviadom,' ',a.numdom,' ',a.urbdom,' - ',h.desdist,' ',g.despro,' ',desdpto) AS domicilio,\r\n\t\t\ta.domici,\r\n\t\t\ta.perent,IF (a.codpar=6,a.otroparent,(SELECT w.despar FROM tb_parentesco AS w WHERE w.codpar=a.codpar LIMIT 1)) AS parentesco,\r\n\t\t\ta.anoresdom, a.mesresdom,\r\n\t\t\t(SELECT GROUP_CONCAT(z2.desres ORDER BY z2.codres ASC SEPARATOR ',') FROM tb_residentesdomicilio AS z1 LEFT JOIN tb_residentes AS z2 ON z1.codres=z2.codres WHERE z1.codchkdom=a.codchkdom GROUP BY z1.codchkdom) AS residecon,\r\n\t\t\td.desviv,\r\n\t\t\tIF (a.codtipviv=3,otrtipviv,(SELECT z3.destipviv FROM tb_tipovivienda AS z3 WHERE z3.codtipviv=a.codtipviv LIMIT 1)) AS tipo_vivienda,\r\n\t\t\ta.numpis, a.pisres,\r\n\t\t\tIF (a.codtipmat=4,otrmatcon,(SELECT z4.destipmat FROM tb_tipomaterial AS z4 WHERE z4.codtipmat=a.codtipmat LIMIT 1)) AS tipo_material,\r\n\t\t\te.desestcon,\r\n\t\t\ta.arever,\r\n\t\t\ta.colfac, a.numpue,a.numven, a.tipmat, a.rejpro, a.pueaccveh, a.obsinmu,\r\n\t\t\tIF (a.codzonif=8,otrzonif,(SELECT z5.deszonif FROM tb_zonificacion AS z5 WHERE z5.codzonif=a.codzonif LIMIT 1)) AS zonificacion,\r\n\t\t\tj.deszonrie,\r\n\t\t\tk.descon,\r\n\t\t\tobscon,\r\n\t\t\t(SELECT GROUP_CONCAT(z.nomimgdom ORDER BY z.numimgdom ASC SEPARATOR ',') FROM tb_imgdomicilio AS z WHERE z.codchkdom=a.codchkdom GROUP BY z.codchkdom) AS fotos\r\n\t\t\tFROM tb_chkdomicilio AS a\r\n\t\t\tLEFT JOIN tb_persona AS c ON c.codper=a.codper\r\n\t\t\tLEFT JOIN tb_vivienda AS d ON d.codviv=a.codviv\r\n\t\t\tLEFT JOIN tb_estadoconstruccion AS e ON e.codestcon=a.codestcon\r\n\t\t\tLEFT JOIN tb_departamento AS f ON f.coddpto=a.coddpto\r\n\t\t\tLEFT JOIN tb_provincia AS g ON g.coddpto=a.coddpto AND g.codpro=a.codpro\r\n\t\t\tLEFT JOIN tb_distrito AS h ON h.coddpto=a.coddpto AND h.codpro=a.codpro AND h.coddist=a.coddist\r\n\t\t\tLEFT JOIN tb_tipvias AS i ON i.codtipvia=a.codtipvia\r\n\t\t\tLEFT JOIN tb_zonariesgo AS j ON j.codzonrie=a.codzonrie\r\n\t\t\tLEFT JOIN tb_conclusion AS k ON k.codcon=a.codcon\r\n\t\t\tWHERE a.codper in ({$codper}) AND a.codsol={$codsol}", $link); if (!isset($pdf)) { $pdf = new PDF(); $pdf->AliasNbPages(); } while ($row = mysql_fetch_array($result)) { $nombre = utf8_decode($row['nombre']); $domicilio = utf8_decode($row['domicilio']); $domiciliado = utf8_decode($row['domici']); $txtdomiciliadoSI = ''; $txtdomiciliadoNO = ''; if ($domiciliado == 1) { $txtdomiciliadoSI = 'X'; } else { $txtdomiciliadoNO = 'X'; } $persona_entrevistada = utf8_decode($row['perent']); $parentesco = utf8_decode($row['parentesco']); $anoresdom = utf8_decode($row['anoresdom']); $mesresdom = utf8_decode($row['mesresdom']); $reside_con = utf8_decode($row['residecon']); $vivienda = utf8_decode($row['desviv']); $tipo_vivienda = utf8_decode($row['tipo_vivienda']); $numpis = utf8_decode($row['numpis']); $pisres = utf8_decode($row['pisres']); $tipo_material = utf8_decode($row['tipo_material']); $desestcon = utf8_decode($row['desestcon']); $arever = utf8_decode($row['arever']); $txtareverSI = ''; $txtareverNO = ''; if ($arever == 1) { $txtareverSI = 'X'; } else { $txtareverNO = 'X'; } $colfac = utf8_decode($row['colfac']); $tipmat = utf8_decode($row['tipmat']); $numpue = utf8_decode($row['numpue']); $numven = utf8_decode($row['numven']); $rejpro = utf8_decode($row['rejpro']); if ($rejpro == 1) { $txtrejpro = 'X'; } else { $txtrejpro = ''; } $pueaccveh = utf8_decode($row['pueaccveh']); if ($pueaccveh == 1) { $txtpueaccveh = 'X'; } else { $txtpueaccveh = ''; } $obsinmu = utf8_decode($row['obsinmu']); $zonificacion = utf8_decode($row['zonificacion']); $deszonrie = utf8_decode($row['deszonrie']); $descon = utf8_decode($row['descon']); $obscon = utf8_decode($row['obscon']); $fotos = explode(",", $row['fotos']); //Creación del objeto de la clase heredada //$pdf=new PDF(); //$pdf->AliasNbPages(); /* if (!isset($pdf)) { $pdf=new PDF(); $pdf->AliasNbPages(); } */ $pdf->AddPage(); $pdf->SetDisplayMode('fullpage'); $pdf->SetMargins(20, 20, 20); $pdf->SetFont('Arial', 'BU', 14); $pdf->SetTextColor(70, 125, 25); $pdf->Cell(0, 10, 'FICHA DE CHECK DOMICILIARIO', 0, 1, 'C'); $pdf->Ln(2); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(55, 7, 'NOMBRES Y APELLIDOS', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $nombre, 1, 1, 'L'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(55, 7, 'DIRECCION', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->MultiCell(0, 7, $domicilio, 1, 'L'); //$pdf->Ln(2); //$pdf->Image('../files/images_dni/imagen1.png',40,null,0,130); $pdf->Ln(2); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(35); $pdf->Cell(33, 7, 'DOMICILIADO', 0, 0, 'L'); $pdf->SetFont('Arial', '', 16); $pdf->Cell(6, 7, $txtdomiciliadoSI, 1, 0, 'C'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(5); $pdf->Cell(40, 7, 'NO DOMICILIADO', 0, 0, 'L'); $pdf->SetFont('Arial', '', 16); $pdf->Cell(6, 7, $txtdomiciliadoNO, 1, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', 'BU', 12); $pdf->Cell(0, 7, 'I. INFORMACION PROPORCIONADA POR EL ENTREVISTADO:', 0, 1, 'L'); $pdf->Ln(2); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(47, 7, 'Persona Entrevistada:', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(60, 7, $persona_entrevistada, 1, 0, 'L'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(27, 7, 'Parentesco:', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $parentesco, 1, 1, 'L'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(50, 7, 'Tiempo que Reside:', 0, 0, 'L'); $pdf->Cell(15, 7, utf8_decode('Años'), 0, 0, 'R'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(10, 7, $anoresdom, 1, 0, 'C'); $pdf->Cell(5); $pdf->Cell(40, 7, 'Meses', 0, 0, 'R'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(10, 7, $mesresdom, 1, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(50, 7, 'Reside con:', 0, 0, 'L'); $pdf->Cell(0, 7, $reside_con, 1, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(50, 7, 'Vivienda:', 0, 0, 'L'); $pdf->Cell(0, 7, $vivienda, 1, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', 'BU', 12); $pdf->Cell(0, 7, 'II. DESCRIPCION DEL INMUEBLE:', 0, 1, 'L'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(50, 7, 'Tipo de Vivienda:', 0, 0, 'L'); $pdf->Cell(0, 7, $tipo_vivienda, 1, 1, 'C'); $pdf->Ln(2); $pdf->Cell(65, 7, utf8_decode('Número de Pisos:'), 0, 0, 'R'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(10, 7, $numpis, 1, 0, 'C'); $pdf->Cell(5); $pdf->Cell(40, 7, 'Piso en el que reside', 0, 0, 'R'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(10, 7, $pisres, 1, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(50, 7, utf8_decode('Material de Construcción:'), 0, 0, 'L'); $pdf->Cell(0, 7, $tipo_material, 1, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(55, 7, utf8_decode('Estado de la Construcción:'), 0, 0, 'L'); $pdf->Cell(0, 7, $desestcon, 1, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(50, 7, 'Vivienda con Areas Verdes:', 0, 0, 'L'); $pdf->Cell(15, 7, utf8_decode('Si'), 0, 0, 'R'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(10, 7, $txtareverSI, 1, 0, 'C'); $pdf->Cell(5); $pdf->Cell(40, 7, 'No', 0, 0, 'R'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(10, 7, $txtareverNO, 1, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(50, 7, utf8_decode('Color de la Fachada:'), 0, 0, 'L'); $pdf->Cell(0, 7, $colfac, 1, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(50, 7, utf8_decode('Tipo de Material:'), 0, 0, 'L'); $pdf->Cell(0, 7, $tipmat, 1, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(65, 7, utf8_decode('Nº Puertas de Ingreso'), 0, 0, 'R'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(10, 7, $numpue, 1, 0, 'C'); $pdf->Cell(5); $pdf->Cell(40, 7, utf8_decode('Nº Ventanas'), 0, 0, 'R'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(10, 7, $numven, 1, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(65, 7, utf8_decode('Rejas de Protección'), 0, 0, 'R'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(10, 7, $txtrejpro, 1, 0, 'C'); $pdf->Cell(5); $pdf->Cell(40, 7, utf8_decode('P. de Acc. Vehicular'), 0, 0, 'R'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(10, 7, $txtpueaccveh, 1, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(50, 7, utf8_decode('Observaciones:'), 0, 0, 'L'); $pdf->MultiCell(0, 5, $obsinmu, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', 'BU', 12); $pdf->Cell(0, 7, 'III. DESCRIPCION DE LA ZONA:', 0, 1, 'L'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(50, 7, utf8_decode('Zonificación:'), 0, 0, 'L'); $pdf->Cell(0, 7, $zonificacion, 1, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(50, 7, utf8_decode('Zona de Riesgo Delictivo:'), 0, 0, 'L'); $pdf->Cell(0, 7, $deszonrie, 1, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(50, 7, utf8_decode('Conclusiones:'), 0, 0, 'L'); $pdf->Cell(0, 7, $descon, 1, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 12); $pdf->Cell(50, 7, utf8_decode('Observaciones:'), 0, 0, 'L'); $pdf->MultiCell(0, 5, $obscon, 1, 'C'); $pdf->AddPage(); $pdf->SetXY(20, 25); $pdf->SetFont('Arial', 'BU', 14); $pdf->SetTextColor(70, 125, 25); $pdf->Cell(0, 10, 'CHECK FOTOGRAFICO DE LA VIVIENDA Y ALREDEDORES', 0, 1, 'C'); $pdf->SetTextColor(0, 0, 0); $pdf->Ln(2); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(55, 7, 'NOMBRES Y APELLIDOS', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $nombre, 1, 1, 'L'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(55, 7, 'DIRECCION', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->MultiCell(0, 7, $domicilio, 1, 'C'); $pdf->Ln(7); $pdf->Image("../files/images_dom/{$fotos['0']}", 40, null, 130, 100); $pdf->Ln(4); $pdf->Image("../files/images_dom/{$fotos['1']}", 40, null, 130, 100); $pdf->Ln(2); $pdf->AddPage(); $pdf->SetXY(20, 25); $pdf->SetFont('Arial', 'BU', 14); $pdf->SetTextColor(70, 125, 25); $pdf->Cell(0, 10, 'MAPA DE ZONIFICACION - CHECK DOMICILIARIO', 0, 1, 'C'); $pdf->SetTextColor(0, 0, 0); $pdf->Ln(2); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(55, 7, 'NOMBRES Y APELLIDOS', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $nombre, 1, 1, 'L'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(55, 7, 'DIRECCION', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->MultiCell(0, 7, $domicilio, 1, 'L'); $pdf->Ln(10); $pdf->Image("../files/images_dom/{$fotos['2']}", 30, null, 0, 120); } /*Check laboral*/ $result = mysql_query("SELECT a.codchklab,\r\n\t\t\tCONCAT(c.apepatper,' ',c.apematper,', ',c.nomper) AS nombre,\r\n\t\t\td.despue AS puesto,\r\n\t\t\ta.nomperref,\r\n\t\t\ta.nomemp,\r\n\t\t\ta.telemp,\r\n\t\t\ta.perlab,\r\n\t\t\ta.motces,\r\n\t\t\ta.percont,\r\n\t\t\ta.carpercont,\r\n\t\t\ta.fecent,\r\n\t\t\ta.obsent,\r\n\t\t\ta.noment\r\n\t\t\tFROM tb_chklaboral AS a\r\n\t\t\tLEFT JOIN tb_detallesolicitud AS b ON b.codper=a.codper AND b.codsol=a.codsol\r\n\t\t\tLEFT JOIN tb_persona AS c ON c.codper=a.codper\r\n\t\t\tLEFT JOIN tb_puesto AS d ON d.codpue=b.codpue\r\n\t\t\tWHERE a.codper in ({$codper}) AND a.codsol={$codsol}", $link); if (!isset($pdf)) { $pdf = new PDF(); $pdf->AliasNbPages(); } $sw = 0; while ($row = mysql_fetch_array($result)) { $sw = $sw + 1; $codchklab = utf8_decode($row['codchklab']); $nombre = utf8_decode($row['nombre']); $puesto = utf8_decode($row['puesto']); $nomperref = utf8_decode($row['nomperref']); $nomemp = utf8_decode($row['nomemp']); $telemp = utf8_decode($row['telemp']); $perlab = utf8_decode($row['perlab']); $motces = utf8_decode($row['motces']); $percont = utf8_decode($row['percont']); $carpercont = utf8_decode($row['carpercont']); $fecent = utf8_decode($row['fecent']); $obsent = utf8_decode($row['obsent']); $noment = utf8_decode($row['noment']); //Creación del objeto de la clase heredada $pdf->AddPage(); $pdf->SetDisplayMode('fullpage'); $pdf->SetMargins(20, 20, 20); $pdf->SetFont('Arial', 'BU', 14); $pdf->SetTextColor(70, 125, 25); $pdf->Cell(0, 10, 'CHECK LABORAL ' . $sw, 0, 1, 'C'); $pdf->Ln(2); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Candidato', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $nombre, 1, 1, 'L'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Puesto al que postula', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $puesto, 1, 1, 'L'); $pdf->Ln(2); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Persona dada como referencia', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $nomperref, 1, 1, 'L'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Empresa', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $nomemp, 1, 1, 'L'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, utf8_decode('Teléfono'), 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $telemp, 1, 1, 'L'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Periodo laboral', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $perlab, 1, 1, 'L'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Motivo de Cese', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $motces, 1, 1, 'L'); $qryPreguntas = "SELECT b.despre,a.respre FROM tb_respuestas AS a\r\n\t\t\t\t\t\t\t\t\tLEFT JOIN tb_preguntas AS b ON a.codpre=b.codpre\r\n\t\t\t\t\t\t\t\t\tWHERE a.codchklab={$codchklab}"; $result_qryPreguntas = mysql_query($qryPreguntas); $pdf->SetFont('Arial', 'BU', 14); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(0, 10, 'CUESTIONARIO', 0, 1, 'C'); $pdf->Ln(2); $pdf->SetTextColor(0, 0, 0); $sw2 = 0; while ($row2 = mysql_fetch_array($result_qryPreguntas)) { $sw2 = $sw2 + 1; $pdf->SetFont('Arial', 'B', 12); //$pdf->Cell(70,7,utf8_decode($row2['despre']),1,1,'L'); $pdf->MultiCell(0, 5, $sw2 . ' ' . utf8_decode($row2['despre']), 1, 'L'); $pdf->SetFont('Arial', '', 12); //$pdf->Cell(0,7,utf8_decode($row2['respre']),1,1,'L'); $pdf->MultiCell(0, 5, utf8_decode($row2['respre']), 1, 'L'); $pdf->Ln(1); } $pdf->AddPage(); $pdf->Ln(2); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Persona de contacto', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $percont, 1, 1, 'L'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Cargo de contacto', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $carpercont, 1, 1, 'L'); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Fecha de entrevista', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $fecent, 1, 1, 'L'); $pdf->Ln(2); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 7, 'Observaciones del entrevistador', 1, 1, 'L'); $pdf->SetFont('Arial', '', 12); //$pdf->Cell(0,7,$percont,1,1,'C'); $pdf->MultiCell(0, 5, utf8_decode($obsent), 1, 'J'); $pdf->Ln(2); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(70, 7, 'Nombre del entrevistador', 1, 0, 'L'); $pdf->SetFont('Arial', '', 12); $pdf->Cell(0, 7, $noment, 1, 1, 'L'); } }
/** * * @global array $DIAMOND_BRAND_IDS * @global string $server * @global jng_sp $class_sp * @global products_minierp $class_pm * @global logger $logger * @global string $icon_diamond * @global string $icon_gold_585_w * @global string $icon_gold_585_g * @param string $timestamp * @param int $jng_sp_id * @return boolean */ function generateReports($timestamp, $jng_sp_id) { global $DIAMOND_BRAND_IDS, $server, $class_sp, $class_pm, $logger, $icon_diamond, $icon_gold_585_w, $icon_gold_585_g; $log_date = strtotime($timestamp); $sp_detail = $jng_sp_id > 0 ? $class_sp->retrieveDetail($jng_sp_id) : array('package_prefix' => 'JG.DE'); $filter_sold = 1; $filter_age = 56; $logger->write("GENERATING REPORT {$sp_detail['package_prefix']}"); /* * Query get new products which: * 1) age <= 8 weeks (56 days) * 2) total sold >= 1 */ $q = "SELECT p.products_id, p.products_model, p.products_image, p.products_price, p.material_expenses, p.stars "; $q .= " , ptc.categories_id AS catid, cd.categories_name"; $q .= " , IFNULL(plps.sold_monthly_1, 0) AS sold_monthly_1, IFNULL(plps.sold_monthly_2, 0) AS sold_monthly_2"; if ($jng_sp_id > 0) { $q .= " , ((jc.total_returned / jc.total_sold) * 100) AS returned_rate, jc.active_age"; } else { $q .= " , 'N/A' AS returned_rate, DATEDIFF(NOW(), p.products_date_added) AS active_age"; } $q .= " FROM products p"; if ($jng_sp_id > 0) { $q .= " INNER JOIN jng_sp_catalog jc ON jc.jng_sp_id = {$jng_sp_id} AND jc.products_id = p.products_id"; } else { $q .= " INNER JOIN orders_products op ON op.products_id = p.products_id"; } $q .= " LEFT JOIN products_log_per_sp plps ON plps.products_id = p.products_id AND plps.jng_sp_id = {$jng_sp_id}"; $q .= " LEFT JOIN products_to_categories ptc ON ptc.products_id = p.products_id"; $q .= " LEFT JOIN categories_description cd ON cd.categories_id = ptc.categories_id AND cd.language_id = 1"; $q .= " WHERE"; if ($jng_sp_id > 0) { $q .= " jc.active_age <= {$filter_age}"; $q .= " AND jc.active_status = 1"; $q .= " AND total_sold >= {$filter_sold}"; } else { //$q .= " p.products_date_added >= '2013-01-01 00:00:00'"; $q .= " DATEDIFF(NOW(), p.products_date_added) <= {$filter_age}"; $q .= " AND p.products_status = 1"; $q .= " AND op.status NOT IN (10, 12)"; $q .= " GROUP BY p.products_id"; $q .= " HAVING SUM(op.products_quantity) >= {$filter_sold}"; } //$q .= " LIMIT 5"; $dbq = tep_db_query($q); $products = array(); while ($row = tep_db_fetch_array($dbq)) { $row['margin'] = $class_pm->calculateMargin($row['products_price'], $row['material_expenses'], 1); $products[$row['catid']][$row['products_id']] = $row; } if (count($products) == 0) { $logger->write("NO DATA RETRIEVED"); return false; } //Start Creating PDF Reports $margin = 20; $ypos = 10; $col_width = 48; $col_height = 77; $line_height = 5; $cell_text_width = $col_width - 3; $no = 0; $row = 1; $icon_w = 4; $icon_h = 4; $first_page = true; $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('New Comer Report'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('Manobo PDF Generator'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(true, 25); $pdf->AliasNbPages(); $pdf->AddPage('L'); $pdf->setXY($margin, $ypos); $pdf->setFont('Arial', 'B', '14'); $pdf->cell(240, 5, 'SALES REPORT NEWCOMER PRODUCT ' . $sp_detail['package_prefix'] . ' (' . date('d.m.Y', $log_date) . ')', 0, 0, 'C'); $pdf->setFont('Arial', '', '10'); $ypos += 15; $pdf->setXY($margin, $ypos); $catids = load_config('products-categories-sorting'); foreach ($catids as $catid) { $xpos = $margin; if (is_array($products[$catid])) { foreach ($products[$catid] as $pid => $p) { $obj_product = new product($pid); $no++; if ($ypos >= 150 || $no == 1 && !$first_page) { //Reset vars to new page state $xpos = $margin; $ypos = 25; $row = 1; $pdf->AddPage('L'); $pdf->setXY($margin, $ypos); } //Draw product box $pdf->Cell($col_width, $col_height, '', 1, 0); //Start drawing contents $pdf->drawProductsImage($xpos + 10, $ypos + 1, $p['products_image']); if (is_object($obj_product) && in_array($obj_product->brand_id, $DIAMOND_BRAND_IDS)) { $ypos_icon = $ypos + 3; $pdf->drawIcon($icon_diamond, $xpos + 39.5, $ypos_icon, $icon_w, $icon_h); } if (is_object($obj_product) && ($obj_product->metal_stamp_code > 0 && $obj_product->metal_stamp_code != 925)) { $icon_gold_selected = "icon_gold_" . $obj_product->metal_stamp_code . '_' . strtolower(substr($obj_product->metal_stamp_info, 0, 1)); $icon_gold = ${$icon_gold_selected}; $ypos_icon += $icon_h; //gold icon dimension is 21 x 16 $icon_gold_w = 21 / 16 * $icon_h; $pdf->drawIcon($icon_gold, $xpos + 38, $ypos_icon, $icon_gold_w, $icon_h); } $pdf->setXY($xpos + 2, $ypos + 3); $pdf->setFont('Arial', 'B', '10'); $pdf->Cell($col_width, $line_height, $no . ". " . ($no == 1 ? $p['categories_name'] : '')); $pdf->setFont('Arial', '', '10'); $pdf->drawStar($p['stars'], $xpos + 15, $ypos + 29); $pdf->setXY($xpos + 2, $ypos + 35); $link = "http://{$server}/?open=product-detail&products_id=" . $pid; $pdf->SetFont('Arial', 'U'); $pdf->SetTextColor(0, 0, 255); $pdf->Cell($cell_text_width, $line_height, $pid . ' / ' . $p['products_model'], 0, 0, 'C', 0, $link); $pdf->SetFont('Arial', ''); $pdf->SetTextColor(0, 0, 0); $pdf->setXY($xpos + 2, $ypos + 40); $pdf->Cell($cell_text_width, $line_height, 'Price: ' . displayCurrency('EUR', $p['products_price'], false) . ' EUR', 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 45); $pdf->Cell($cell_text_width, $line_height, 'Margin: ' . number_format($p['margin'], 1) . '%', 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 50); $pdf->Cell($cell_text_width, $line_height, 'Return Rate: ' . ($jng_sp_id > 0 ? number_format($p['returned_rate'], 1) . '%' : $p['returned_rate']), 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 60); $pdf->Cell($cell_text_width, $line_height, 'Age in ' . ($jng_sp_id > 0 ? 'SP' : 'JG') . ': ' . $p['active_age'] . ' days', 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 65); $pdf->Cell($cell_text_width, $line_height, 'Sold L30D in ' . ($jng_sp_id > 0 ? 'SP' : 'JG') . ': ' . $p['sold_monthly_1'], 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 70); $pdf->Cell($cell_text_width, $line_height, 'Sold L60D in ' . ($jng_sp_id > 0 ? 'SP' : 'JG') . ': ' . $p['sold_monthly_2'], 0, 0, 'C'); if ($no % 5 == 0) { $row++; $xpos = $margin; $ypos += $col_height * ($row - 1) + 5; } else { $xpos += $col_width + 5; } $pdf->setXY($xpos, $ypos); } $first_page = false; } $no = 0; } $filepath = 'sales-report-newcomer-products/'; $yeardir = $filepath . date('Y/', $log_date); if (!file_exists(DIR_FS_ARCHIVES . $yeardir) || !is_dir(DIR_FS_ARCHIVES . $yeardir)) { mkdir(DIR_FS_ARCHIVES . $yeardir); } $monthdir = $yeardir . date('m/', $log_date); if (!file_exists(DIR_FS_ARCHIVES . $monthdir) || !is_dir(DIR_FS_ARCHIVES . $monthdir)) { mkdir(DIR_FS_ARCHIVES . $monthdir); } $path_location = DIR_FS_ARCHIVES . $monthdir; $filename = date('YmdHi', strtotime($timestamp)) . '-sales-report-newcomer-products-' . $sp_detail['package_prefix'] . '.pdf'; $pdf->Output($path_location . $filename, 'F'); $logger->write("PDF CREATED: {$filename}"); //$pdf->Output($filename, 'D'); return true; }
function createPDF($ignoreStockStatusDepot = false, $output = 'D', $add_to_daily_statistic = false, $print_per_orders = true) { /* OUTPUT : D -> WILL PRODUCE ONE PDF FOR ALL ORDERS WITH ITEMS IN IT OUTPUT : F -> WILL PRODUCE MULTI PDF PER ORDER ITEMS */ global $class_jo, $class_o, $class_do; $pi_printed_jg = array(); $pi_printed_sp = array(); $pi_printed_dp = array(); if ($output == 'D') { //PRODUCE SINGLE PDF FILE $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('Production Instruction'); $pdf->SetAuthor('JULIE GRACE / Bonofactum'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(false); $pdf->AliasNbPages(); $pdf->SetFillColor(191, 191, 191); } $item_printed = 0; $oiid_last_printed = ''; /* Moved this on function constructPIContent and replace using below $print_per_orders, * so eventhough we use $output='F' we still could create pi which consists of collection of orders */ //foreach($this->orders as $order) { // $o = $order['detail']; // foreach($order['items'] as $oiid=>$i) { // if($i['status']<8) $this->pi_printed[strtolower($o['type'])][] = $oiid; // //if($i['status']<8) ${'pi_printed_'.strtolower($o['type'])}[] = $oiid; // $this->constructPIContent($pdf, $output, $order, $oiid, $ignoreStockStatusDepot, $print_per_orders); // $item_printed++; // $oiid_last_printed = $oiid; // } //} if ($print_per_orders) { foreach ($this->orders as $order) { $this->constructPIContent($pdf, $output, $order, $ignoreStockStatusDepot, true); $item_printed++; } } else { $this->constructPIContent($pdf, $output, $this->orders, $ignoreStockStatusDepot, false); } #PI Print Counter if (count($this->pi_printed['sp']) > 0) { $class_jo->printCountAdd($this->pi_printed['sp']); } if (count($this->pi_printed['jg']) > 0) { $class_o->printCountAdd($this->pi_printed['jg']); } if (count($this->pi_printed['dp']) > 0) { $class_do->printCountAdd($this->pi_printed['dp']); } /* D: Download; F: Save File on Server */ if ($output == 'D') { $infix = ''; //$infix = count($this->orders)>1 ? '' : strtoupper($o['type']).'O'.$o['id'].'-'; //if($item_printed==1) $infix = strtoupper($o['type']).'-'.$oiid_last_printed.'-'; if ($item_printed == 1) { $infix = array_keys($this->orders); $infix = $infix[0] . '-'; } $filename = 'PI-' . $infix . date('YmdHi'); $pdf->Output($filename . '.pdf', $output); //$pdf->Output($filename.'.pdf','D'); } if ($add_to_daily_statistic) { $pt = new production_target(); $timestamp = date('Y-m-d H:i:s'); if ($this->qty_total_first_printed > 0) { $pt->addDataToField($timestamp, 'start', $this->qty_total_first_printed); } } }
$this->Cell(0, 0, 'This chapter has a title', 0, 0, 'R'); } else { $this->Cell(160, 0, 'Topic of this chapter', 0, 0, 'L'); $this->Cell(0, 0, $this->PageNo(), 0, 2, 'R'); } //Line break $this->SetY(20); $this->SetLineWidth(0.01); $this->Line($this->lMargin, 18, 210 - $this->rMargin, 18); $this->Ln(15); } function Footer() { //Position at 1.5 cm from bottom $this->SetLineWidth(0.01); $this->Line($this->lMargin, 281.2, 210 - $this->rMargin, 281.2); $this->SetY(-10); //Page number $this->Cell(0, 3, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C'); } } $pdf = new PDF(); $pdf->AliasNbPages(); $pdf->SetDoubleSided(20, 10); $pdf->SetFont('Arial', '', 12); $pdf->AddPage(); for ($i = 0; $i < 60; $i++) { $pdf->MultiCell(0, 10, str_repeat('a lot of text ', 30) . "...\n"); } $pdf->SetDisplayMode('fullpage', 'single'); $pdf->Output();
{ //Position at 1.5 cm from bottom $this->SetY(-15); //Arial italic 8 $this->SetFont('Arial', 'I', 8); //Page number $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C'); } } $pdf = new PDF('L'); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Inventory Report"); $pdf->SetTitle("Inventory Report"); $pdf->SetCreator("Imran Zahid"); $pdf->SetDisplayMode("fullpage"); $title = "Inventory Report"; $data = array(); $sites = array('' => ''); $gWhere = ""; if (isset($_GET['godown']) && count($_GET['godown']) > 0) { $gWhere = "AND g_code IN ('" . implode("', '", $_GET['godown']) . "') "; } $result = $mysqli->query("SELECT g_code, g_name FROM godown WHERE company_ref_id = {$_SESSION['company_id']} {$gWhere} ORDER BY g_name"); while ($row = $result->fetch_assoc()) { $sites["{$row['g_code']}"] = $row['g_name']; } $data[0] = array(); $data[0]['Item'] = 'Description of Goods'; $tdata = array(); $gtdata = array();