<?php
session_start();
$ruta = '../../';
include($ruta."cxc/clases/covensol_cxc_c_cuentasxcobrar.php");
$propiedades['habilitar_json'] = 'no';
$objcxc = new covensol_cxc_cuentasxcobrar($propiedades);
require_once($ruta.'shared/tcpdf/config/lang/ita.php');
require_once($ruta.'shared/tcpdf/tcpdf.php');  
header("Pragma: public");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
ini_set('memory_limit','256M');
ini_set('max_execution_time','0');	

/*
if(!$_GET['gid_fact']){
		echo '<script language="JavaScript"> close(); </script>';
}
*/

$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'LETTER', true, 'UTF-8', false); 
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(PDF_MARGIN_LEFT, 10, PDF_MARGIN_RIGHT);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setPrintHeader(false);
$pdf->setTextoFooter(utf8_encode('Ave. Panteón, Res. Antares, Piso 11, Apto 11-B, Caracas.'));
$pdf->SetFont('helvetica', '', 12);
$pdf->AddPage();

$margenes = $pdf->getMargins();



$pdf->Image($ruta.'shared/imagebank/'.$_SESSION["ls_logo"],$margenes['left'],$margenes['top'], 30, 15); 
$numero_com = '<p  style="text-align:right;"><b>Nº Comunicación:</b> '.$datos['formato_nrocom'].'</p>';
$pdf->writeHTML(utf8_encode($numero_com), true, false, false, false, '');
//$pdf->Ln();
$numero_com = '<p  style="text-align:right;"><b>Nº Correlativo:</b> '. $datos['formato_correl'].'</p>';
$pdf->writeHTML(utf8_encode($numero_com), true, false, false, false, '');
$pdf->Ln();
$pdf->Ln();
$pdf->SetLineStyle(array('width' => 0.2, 'color' => $pdf->decodifica_color('#DDDDDD')));

$ancho[1] = 200;
$ancho[2] = 320;
$ancho_total = array_sum($ancho);

$encabezado ='<table width="'.$ancho_total.'" border="1" cellspacing="0" cellpadding="5" bordercolor="#CCCCCC">
			   <tr>
				<td width="'.$ancho[1].'"><p align="left"><strong><em>Datos de Factura</em></strong></p></td>
				<td width="'.$ancho[2].'"><p align="left"><strong><em>Datos de Factura</em></strong></p></td>
			  </tr>
			  <tr>
				<td width="'.$ancho[1].'"> </td>
				<td width="'.$ancho[2].'"> </td>
			  </tr>			 
			</table>';

$pdf->writeHTML(utf8_encode($encabezado), true, false, false, false, '');


$pdf->getPageWidth();
$pdf->SetLineStyle(array('width' => 0.8, 'color' => array(0,0,0)));
$pdf->Line($margenes['left'],$pdf->GetY()-3,($pdf->getPageWidth()-$margenes['right'])-3,$pdf->GetY()-3);
$pdf->Ln();
$texto = $filas['fila']['texto_com'];
$pdf->writeHTML(utf8_encode($texto), true, 0, true, 0);
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->writeHTML(utf8_encode('<p align="center">'.$filas['fila']['nombre_rem'].' '.$filas['fila']['apellido_rem'].'</p>'), true, 0, true, 0);
$pdf->writeHTML(utf8_encode('<p align="center"><strong>'.$filas['fila']['cargo_rem'].'</strong></p>'), true, 0, true, 0);

$pdf->Output('comunicacion_interna.pdf', 'I');


?>
