%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/tjamichg/intranet.tjamich.gob.mx/intranet/sistemas/declaraciones/
Upload File :
Create Path :
Current File : /home/tjamichg/intranet.tjamich.gob.mx/intranet/sistemas/declaraciones/pdfresultadopatrimonial.php

<?php



ini_set('memory_limit', '8182M');



//Biblioteca en uso, contiene:

// -FlowingBlock: Permite justificar y cargar estilos al texto encapsulados.

// -WriteHMTL: Permite cargar etiquestas HTML de estilos de texto.

// -Justify: Permite justificar sin cargar estilos de texto.

//require 'flowing_block.php';



//session_start();

//Direccion config diferente a /sistema

//include "config/config.php";

//$_SESSION['expire'] = time() + (120 * 139.5);





/* 

    ESTA CONDICIONAL ES NECESARIA YA QUE SI SE LLAMA EL ARCHIVO DESDE SU CONTROLLER(generar_acuse.php)

    ESTAS VARIABLES YA FUERON INCLUIDAS Y LLAMARLAS MAS DE UNA VEZ GENERA CONFLICTOS

*/


 if(!isset($controller))

 {

    require 'flowing_block.php';

    include "../../config/config.php";

    $conf = new Configuracion();

    $conf->conectarBD();

 } 

 

// Datos declaracion

$id_declaracion             =   isset($_REQUEST['id_declaracion']) ? $_REQUEST['id_declaracion'] : 0;

$insert             =   isset($_REQUEST['insert']) ? $_REQUEST['insert'] : 0;

  

    

//  $conf = new Configuracion();

//    $conf->conectarBD();



    //CONSULTA

    $consultarh = "SELECT cd.id_declaracion, cd.year, e.nombre, e.rfc, cd.tipo_declaracion, cd.id_declaracion, cd.finalizar

    			FROM tjam_empleados e

                JOIN contraloria_declaraciones cd ON (e.id = cd.id_usuario)

                WHERE cd.id_declaracion > 0 AND cd.id_declaracion = '$id_declaracion';";

	$rst1rh = $conf->consulta($consultarh);



if($insert==1)  //BITACORA

{

        

    $ip = $_SERVER['REMOTE_ADDR'];

    $accion = 'Ingreso a ver el pdf de la declaración del usuario: '.$rst1rh[0]['rfc'];

    RegistrarBitacoraDeclaraciones($conf,'Contralor TAAM',$ip,$accion,$id_declaracion);

} 

	$year = $rst1rh[0]['year'] - 1 ;

	$t1rhnombre = $rst1rh[0]['nombre'];

	$t1rhrfc = $rst1rh[0]['rfc'];

	$t1rhtipo_declaracion = $rst1rh[0]['tipo_declaracion'];

	$tipo = $t1rhtipo_declaracion;

	$t1rhid_declaracion = $rst1rh[0]['id_declaracion'];

	$t1rhfinalizar = $rst1rh[0]['finalizar'];



if ($t1rhtipo_declaracion == 1) {

	$t1rhtipo_declaracion2 = "INICIAL";

} elseif ($t1rhtipo_declaracion == 2) {

	$t1rhtipo_declaracion2 = "MODIFICACIÓN";

} else {

	$t1rhtipo_declaracion2 = "CONCLUSIÓN";

}



if ($t1rhtipo_declaracion == 1) {

	$t1rhtipo_declaracion3 = "QUE INICIA";

} elseif ($t1rhtipo_declaracion == 2) {

	$t1rhtipo_declaracion3 = "ACTUAL";

} else {

	$t1rhtipo_declaracion3 = "QUE CONCLUYE";

}





if ($t1rhtipo_declaracion == 1) {

	$t1rhtipo_declaracion4 = "I.8 INGRESOS NETOS DEL DECLARANTE, PAREJA Y / O DEPENDIENTES ECONÓMICOS (SITUACIÓN ACTUAL)";

} elseif ($t1rhtipo_declaracion == 2) {

	$t1rhtipo_declaracion4 = "I.8 INGRESOS NETOS DEL DECLARANTE, PAREJA Y / O DEPENDIENTES ECONÓMICOS (ENTRE EL 1 DE ENERO Y EL 31 DE DICIEMBRE DEL AÑO INMEDIATO ANTERIOR)";

} else {

	$t1rhtipo_declaracion4 = "I.8 INGRESOS DEL AÑO EN CURSO A LA FECHA DE CONCLUSIÓN DEL EMPLEO, CARGO O COMISIÓN NETOS DEL DECLARANTE, PAREJA, Y/O DEPENDIENTES ECONÓMICOS.";

}





//IMAGE (RUTA,X,Y,ANCHO,ALTO,EXTEN)

//COMIENZA CONSTRUCIÓN DE PDF

$pdf = new PDF_FlowingBlock();


$pdf->AddPage('L');

//$pdf->Image('escudo.png','60','40','170','160','PNG'); 

/*$pdf->Image('../sistema/apps/usuarios/img/'.$t1imagen1.'','10','10','30','40','PNG'); 

$pdf->Image('../sistema/apps/usuarios/img/'.$t1imagen2.'','255','10','30','40','PNG');

$pdf->Image('../../common/images/49f611d6bd032933f0547012bc6410bc.png','10','10','30','40','PNG'); 

$pdf->Image('../../common/images/859957e0b91b70930c1738ff40acc65e.png','255','10','30','40','PNG');*/
if($year >= 2025){

    $pdf->Image('../../common/images/Logo-TJAM.png','10','10','40','40','PNG'); 

}else{
    
    $pdf->Image('../../common/images/49f611d6bd032933f0547012bc6410bc_b.png','10','10','40','40','PNG');
    
}

$pdf->Image('../../common/images/859957e0b91b70930c1738ff40acc65e.png','255','10','30','40','PNG');



// Cabecera

$pdf->SetFont('helvetica','B',15);

$pdf->WriteHTML('<br>');

$pdf->Cell(279,5,utf8_decode('DECLARACIÓN DE SITUACIÓN PATRIMONIAL Y DE INTERESES '.$year),0,1,'C',0);

$pdf->WriteHTML('<br>');



if ($t1rhfinalizar==1) {

    //CONSULTA DE FINALIZACIÓN

    $consultaf = "SELECT cd.No_Comprobacion, cd.No_Trasaccion, cd.token, cd.datos_publicos

                FROM contraloria_declaraciones_acuses cd

                WHERE cd.id_declaracion > 0 AND cd.id_declaracion = '$id_declaracion';";

    $rst1f = $conf->consulta($consultaf);

    

    $t1fdatos_publicos = $rst1f[0]['datos_publicos'];

    $No_Comprobacion = $rst1f[0]['No_Comprobacion'];

    $No_Trasaccion = $rst1f[0]['No_Trasaccion'];

    $token = $rst1f[0]['token'];



    $pdf->SetFont('helvetica','',9);

    $pdf->Cell(279,5,utf8_decode('NO. DE COMPROBACIÓN: '.$No_Comprobacion.''),0,1,'C',0);

    $pdf->Cell(279,5,utf8_decode('NO. DE TRANSACCIÓN: '.$No_Trasaccion.''),0,1,'C',0);

    $pdf->Cell(279,5,utf8_decode('TOKEN: '.$token.''),0,1,'C',0);

} else {

    $pdf->SetFont('helvetica','B',9);

    $pdf->Cell(279,5,utf8_decode('DOCUMENTO SOLO PARA VISUALIZACIÓN - FINALICE SU ACUSE PARA ACCEDER A ESTE DOCUMENTO'),0,1,'C',0);

    $pdf->Cell(279,5,utf8_decode('DOCUMENTO SOLO PARA VISUALIZACIÓN - FINALICE SU ACUSE PARA ACCEDER A ESTE DOCUMENTO'),0,1,'C',0);

    $pdf->Cell(279,5,utf8_decode('DOCUMENTO SOLO PARA VISUALIZACIÓN - FINALICE SU ACUSE PARA ACCEDER A ESTE DOCUMENTO'),0,1,'C',0);

    $pdf->Cell(279,5,utf8_decode('DOCUMENTO SOLO PARA VISUALIZACIÓN - FINALICE SU ACUSE PARA ACCEDER A ESTE DOCUMENTO'),0,1,'C',0);

    $pdf->Cell(279,5,utf8_decode('DOCUMENTO SOLO PARA VISUALIZACIÓN - FINALICE SU ACUSE PARA ACCEDER A ESTE DOCUMENTO'),0,1,'C',0);

}



$pdf->WriteHTML('<br><br><br>');

$pdf->SetFont('helvetica','B',13);

// $pdf->MultiCell(279,5,utf8_decode('Folio: '.$t1rhid_declaracion),0,'R',0);





    //CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_1

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' LIMIT 1;";

    $rst1 = $conf->consulta($consulta);

    

    //VARIABLES DE CONSULTA

    $t1nombre = $rst1[0]['nombre'];

    $t1apPat = $rst1[0]['apPat'];

    $t1apMat = $rst1[0]['apMat'];

    $t1curp = $rst1[0]['curp'];

    $t1rfc = $rst1[0]['rfc'];

    $t1homoclave = $rst1[0]['homoclave'];

    $t1correoI = $rst1[0]['correoI'];

    $t1correoP = $rst1[0]['correoP'];

    $t1estado_civil = $rst1[0]['estado_civil'];

    $t1pais_nacimiento = $rst1[0]['pais_nacimiento'];

    $t1nacionalidad = $rst1[0]['nacionalidad'];

    $t1celular = $rst1[0]['celular'];

    $t1telefono = $rst1[0]['telefono'];

    $t1regimen_matrimonial = $rst1[0]['regimen_matrimonial'];

    $t1otro_regimen = $rst1[0]['otro_regimen'];

    $t1observaciones = $rst1[0]['observaciones'];



$pdf->newFlowingBlock( 270, 5, 'J' );

$pdf->SetFont('helvetica','B',9);

$pdf->WriteFlowingBlock(utf8_decode('NOTA: '));

$pdf->SetFont('helvetica','',9);

$pdf->WriteFlowingBlock(utf8_decode(' Sirvase a revisar las normas e instructivo para el llenado y presentación del formato de declaraciones de situación patrimonial y de interés. '));

$pdf->SetFont('helvetica','B',9);

$pdf->WriteFlowingBlock(utf8_decode('"C. '.$t1nombre.' '.$t1apPat.' '.$t1apMat.'"'));

$pdf->SetFont('helvetica','',9);

$pdf->WriteFlowingBlock(utf8_decode(' bajo protesta de decir la verdad, presento a usted mi declaración patrimonail y de interés conforme a lo dispuesto en la Ley General de Responsabilidades Administrativas, La Ley General del Sistema Nacional Anticorrupción y La Normatividad Aplicable.'));

$pdf->finishFlowingBlock();



$pdf->newFlowingBlock( 270, 5, 'J' );

$pdf->SetFont('helvetica','',9);

$pdf->WriteFlowingBlock(utf8_decode('LOS DATOS DE TERCEROS SIEMPRE Y CUANDO SEAN PERSONAS FISICAS, Y LOS DATOS RESALTADOS NO SERAN PÚBLICOS.'));

$pdf->finishFlowingBlock();

$pdf->WriteHTML('<br>');



$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->SetFont('helvetica','B',10);

$pdf->Cell(239,5,utf8_decode('I. DECLARACIÓN DE SITUACIÓN PATRIMONIAL'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

// $pdf->Ln(7);

$pdf->SetFont('helvetica','B',10);

$pdf->Cell(239,5,utf8_decode('I-1. DATOS GENERALES'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);



$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(93,5,utf8_decode('NOMBRE (S)'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('PRIMER APELLIDO'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('SEGUNDO APELLIDO'),1,1,'C',1);

$pdf->Cell(93,5,utf8_decode($t1nombre),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode($t1apPat),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode($t1apMat),1,1,'C',0);

$pdf->Cell(93,5,utf8_decode('CURP'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('RFC'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('HOMOCLAVE'),1,1,'C',1);

$pdf->Cell(93,5,utf8_decode($t1curp),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode($t1rfc),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode($t1homoclave),1,1,'C',0);

$pdf->Cell(93,5,utf8_decode('NÚMERO TELEFÓNICO DE CASA'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('NÚMERO CELULAR PERSONAL'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('SITUACIÓN PERSONAL/ESTADO CIVIL'),1,1,'C',1);

$pdf->Cell(93,5,utf8_decode($t1telefono),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode($t1celular),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode($t1estado_civil),1,1,'C',0);

$pdf->Cell(93,5,utf8_decode('CORREO ELECTRÓNICO INSTITUCIONAL'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('CORREO ELECTRÓNICO PERSONAL'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('REGIMEN MATRIMONIAL'),1,1,'C',1);

$pdf->Cell(93,5,utf8_decode($t1correoI),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode($t1correoP),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode($t1regimen_matrimonial),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('PAÍS DE NACIMIENTO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('NACIONALIDAD'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t1pais_nacimiento),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode($t1nacionalidad),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t1observaciones),1,1,'L',0);

$pdf->WriteHTML('<br>');



    //CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_2

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' LIMIT 1;";

    $rst2 = $conf->consulta($consulta);

    

            //VARIABLES DE CONSULTA

            $t2residencia           =   $rst2[0]['residencia'];

            $t2calle_mx                 =   $rst2[0]['calle_mx'];

            $t2numInt_mx                =   $rst2[0]['num_int_mx'];

            $t2numExt_mx                =   $rst2[0]['num_ext_mx'];

            $t2codigo_postal_mx         =   $rst2[0]['codigo_postal_mx'];

            $t2colonia_localidad_mx     =   $rst2[0]['colonia_localidad_mx'];

            $t2municipio_alcaldia_mx    =   $rst2[0]['municipio_alcaldia_mx'];

            $t2entidad_federativa_mx    =   $rst2[0]['entidad_federativa_mx'];

            $t2calle_ext                =   $rst2[0]['calle_ext'];

            $t2numInt_ext           =   $rst2[0]['num_int_ext'];

            $t2numExt_ext           =   $rst2[0]['num_ext_ext'];

            $t2codigo_postal_ext        =   $rst2[0]['codigo_postal_ext'];

            $t2ciudad_localidad_ext     =   $rst2[0]['ciudad_localidad_ext'];

            $t2estado_provincia_ext     =   $rst2[0]['estado_provincia_ext'];

            $t2pais_ext                 =   $rst2[0]['pais_ext'];

            $t2observaciones            =   $rst2[0]['aclaraciones'];

    



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(239,5,utf8_decode('I-2. DOMICILIO DEL DECLARANTE'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



$pdf->Cell(139.5,5,utf8_decode('EN MÉXICO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('EN EL EXTRANJERO'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('CALLE - NÚMERO EXTERIOR - NÚMERO INTERIOR'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('CALLE - NÚMERO EXTERIOR - NÚMERO INTERIOR'),1,1,'C',1);

//CHECAR EL ACOMODO DE ESTAS VARIABLES

$pdf->Cell(139.5,5,utf8_decode(''.$t2calle_mx.' - '.$t2numExt_mx.' - '.$t2numInt_mx),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode(''.$t2calle_ext.' - '.$t2numExt_ext.' - '.$t2numInt_ext),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->Cell(139.5,5,utf8_decode('COLONIA/LOCALIDAD - MUNICIPIO/ALCALDÍA - ENTIDAD FEDERATIVA'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('COLONIA/LOCALIDAD - ESTADO/PROVINCIA - PAÍS'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode(''.$t2colonia_localidad_mx.' - '.$t2municipio_alcaldia_mx.' - '.$t2entidad_federativa_mx),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode(''.$t2ciudad_localidad_ext.' - '.$t2estado_provincia_ext.' - '.$t2pais_ext),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t2observaciones),1,1,'L',0);

$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



    //CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_3

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' LIMIT 1;";

    $rst3 = $conf->consulta($consulta);

    

    //VARIABLES DE CONSULTA

    $t3nivel                    =   $rst3[0]['nivel'];

    $t3institucion_educativa  = $rst3[0]['institucion_educativa'];

    $t3carrera_area             =   $rst3[0]['carrera_area'];

    $t3estatus              =   $rst3[0]['estatus'];

    $t3doc_obtenido             =   $rst3[0]['doc_obtenido'];

    $t3fecha_obtencion      =   $rst3[0]['fecha_obtencion'];

    $t3ubicacion_institucion  =   $rst3[0]['ubicacion_institucion'];

    $t3observaciones          =   $rst3[0]['observaciones'];



    if($t3fecha_obtencion=='1900-01-01'){$t3fecha_obtencion='0000-00-00';}



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(239,5,utf8_decode('I-3. DATOS CURRICULARES DEL DECLARANTE'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);



$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(279,5,utf8_decode('ESCOLARIDAD'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



$pdf->Cell(69.75,5,utf8_decode('INSTITUCIÓN EDUCATIVA'),1,0,'C',1);

$pdf->Cell(169.25,5,utf8_decode($t3institucion_educativa),1,0,'C',0);

$pdf->Cell(40,5,utf8_decode('NIVEL'),1,1,'C',1);

$pdf->Cell(69.75,5,utf8_decode('CARRERA O ÁREA DE CONOCIMIENTO'),1,0,'C',1);

$pdf->Cell(169.25,5,utf8_decode($t3carrera_area),1,0,'C',0);

$pdf->Cell(40,5,utf8_decode($t3nivel),1,1,'C',0);

$pdf->Cell(69.75,5,utf8_decode('FECHA DE OBTENCION DE DOCUMENTO'),1,0,'C',1);

$pdf->Cell(169.25,5,utf8_decode('DOCUMENTOS OBTENIDOS'),1,0,'C',1);

$pdf->Cell(40,5,utf8_decode('ESTATUS'),1,1,'C',1);

$pdf->Cell(69.75,5,utf8_decode($t3fecha_obtencion),1,0,'C',0);

$pdf->Cell(169.25,5,utf8_decode($t3doc_obtenido),1,0,'C',0);

$pdf->Cell(40,5,utf8_decode($t3estatus),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t3observaciones),1,1,'L',0);

// $pdf->AddPage('L');

$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



    //CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_4

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' LIMIT 1;";

    $rst41 = $conf->consulta($consulta);

    

            //VARIABLES DE CONSULTA

            $t41orden_gob               =   $rst41[0]['orden_gob'];

            $t41ente_publico    =   $rst41[0]['ente_publico'];

            $t41ambito_publico          =   $rst41[0]['ambito_publico'];

            $t41area_adscripcion        =   $rst41[0]['area_adscripcion'];

            $t41empleo_cargo            =   $rst41[0]['empleo_cargo'];

            $t41contrato_honorarios =   $rst41[0]['contrato_honorarios'];

            $t41funcion_principal      =    $rst41[0]['funcion_principal'];

            $t41tel_oficina_extencion           =   $rst41[0]['tel_oficina_extencion'];

            $t41nivel_empleo            =   $rst41[0]['nivel_empleo'];

            $t41fecha_toma             =   $rst41[0]['fecha_toma'];

            $t41residencia             =   $rst41[0]['residencia'];

            $t41calle_mx                =   $rst41[0]['calle_mx'];

            $t41num_int_mx              =   $rst41[0]['num_int_mx'];

            $t41num_ext_mx              =   $rst41[0]['num_ext_mx'];

            $t41codigo_postal_mx        =   $rst41[0]['codigo_postal_mx'];

            $t41colonia_localidad_mx    =   $rst41[0]['colonia_localidad_mx'];

            $t41municipio_alcaldia_mx   =   $rst41[0]['municipio_alcaldia_mx'];

            $t41entidad_federativa_mx   =   $rst41[0]['entidad_federativa_mx'];

            $t41calle_ext               =   $rst41[0]['calle_ext'];

            $t41num_int_ext             =   $rst41[0]['num_int_ext'];

            $t41num_ext_ext             =   $rst41[0]['num_ext_ext'];

            $t41codigo_postal_ext       =   $rst41[0]['codigo_postal_ext'];

            $t41ciudad_localidad_ext    =   $rst41[0]['ciudad_localidad_ext'];

            $t41estado_provincia_ext    =   $rst41[0]['estado_provincia_ext'];

            $t41pais_ext                =   $rst41[0]['pais_ext'];

            $t41observaciones           =   $rst41[0]['observaciones'];



            if($t41fecha_toma=='1900-01-01'){$t41fecha_toma='0000-00-00';}



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(239,5,utf8_decode('I-4. DATOS DEL EMPLEO, CARGO O COMISIÓN '.$t1rhtipo_declaracion3),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(69.75,5,utf8_decode('NOMBRE DEL ENTE PUBLICO'),1,0,'C',1);

$pdf->Cell(209.25,5,utf8_decode($t41ente_publico),1,1,'C',0);

$pdf->Cell(69.75,5,utf8_decode('EMPLEO, CARGO O COMISION'),1,0,'C',1);

$pdf->Cell(209.25,5,utf8_decode($t41empleo_cargo),1,1,'C',0);

$pdf->Cell(69.75,5,utf8_decode('ESPECIFIQUE FUNCION PRINCIPAL'),1,0,'C',1);

//$pdf->Cell(209.25,5,utf8_decode($t41funcion_principal),1,1,'C',0);

$pdf->MultiCell(0,5,utf8_decode($t41funcion_principal), 1, 'J');

$pdf->SetFont('helvetica','',8);

$pdf->Cell(69.75,5,utf8_decode('NIVEL / ORDEN DE GOBIERNO'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('AMBITO PUBLICO'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('ÁREA DE ADSCRIPCIÓN'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('NIVEL DEL EMPLEO, CARGO O COMISION'),1,1,'C',1);

$pdf->Cell(69.75,5,utf8_decode($t41orden_gob),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t41ambito_publico),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t41area_adscripcion),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t41nivel_empleo),1,1,'C',0);

$pdf->SetFont('helvetica','',8);



if($tipo == 3)

{ $finfecha = 'FECHA DE SEPARACIÓN DEL EMPLEO, CARGO O COMISIÓN';}

else

    $finfecha = 'FECHA DE TOMA DE POSESIÓN DEL EMPLEO, CARGO O COMISIÓN';



$pdf->Cell(139.5,5,utf8_decode($finfecha),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('TELEFÓNO DE OFICINA Y EXTENSIÓN'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('¿ESTA CONTRATADO POR HORARIOS?'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t41fecha_toma),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t41tel_oficina_extencion),1,0,'C',0);

if ($t41contrato_honorarios==1) {

    $pdf->Cell(69.75,5,utf8_decode('SI'),1,1,'C',0);

} else {

    $pdf->Cell(69.75,5,utf8_decode('NO'),1,1,'C',0);

}

$pdf->SetFont('helvetica','',8);

$pdf->Cell(279,5,utf8_decode('DOMICILIO DEL EMPLEO, CARGO O COMISIÓN'),1,1,'C',1);

$pdf->SetTextColor(0,0,0);

$pdf->Cell(139.5,5,utf8_decode('EN MÉXICO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('EN EL EXTRANJERO'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('CALLE - NÚMERO EXTERIOR - NÚMERO INTERIOR'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('CALLE - NÚMERO EXTERIOR - NÚMERO INTERIOR'),1,1,'C',1);

//CHECAR EL ACOMODO DE ESTAS VARIABLES

$pdf->Cell(139.5,5,utf8_decode(''.$t41calle_mx.' - '.$t41num_ext_mx.' - '.$t41num_int_mx),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode(''.$t41calle_ext.' - '.$t41num_ext_ext.' - '.$t41num_int_ext),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->Cell(139.5,5,utf8_decode('COLONIA/LOCALIDAD - MUNICIPIO/ALCALDÍA - ENTIDAD FEDERATIVA'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('COLONIA/LOCALIDAD - ESTADO PROVINCIA'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode(''.$t41colonia_localidad_mx.' - '.$t41municipio_alcaldia_mx.' - '.$t41entidad_federativa_mx),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode(''.$t41ciudad_localidad_ext.' - '.$t41estado_provincia_ext),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->Cell(139.5,5,utf8_decode('CODIGO POSTAL'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('PAÍS - CODIGO POSTAL'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t41codigo_postal_mx),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode(''.$t41pais_ext.' - '.$t41codigo_postal_ext),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t41observaciones),1,1,'L',0);

// $pdf->WriteHTML('<br>');



    //CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_4_secundario

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' LIMIT 1;";

    $rst42 = $conf->consulta($consulta);

    if(count($rst42) > 0)

    {

            //VARIABLES DE CONSULTA

            $t42orden_gob               =   $rst42[0]['orden_gob2'];

            $t42ente_publico            =   $rst42[0]['ente_publico2'];

            $t42ambito_publico          =   $rst42[0]['ambito_publico2'];

            $t42area_adscripcion        =   $rst42[0]['area_adscripcion2'];

            $t42empleo_cargo            =   $rst42[0]['empleo_cargo2'];

            $t42contrato_honorarios     =   $rst42[0]['contrato_honorarios2'];

            $t42funcion_principal       =    $rst42[0]['funcion_principal2'];

            $t42tel_oficina_extencion   =   $rst42[0]['tel_oficina_extencion2'];

            $t42nivel_empleo            =   $rst42[0]['nivel_empleo2'];

            $t42fecha_toma              =   $rst42[0]['fecha_toma2'];

            $t42residencia              =   $rst42[0]['residencia2'];

            $t42calle_mx                =   $rst42[0]['calle_mx2'];

            $t42num_int_mx              =   $rst42[0]['num_int_mx2'];

            $t42num_ext_mx              =   $rst42[0]['num_ext_mx2'];

            $t42codigo_postal_mx        =   $rst42[0]['codigo_postal_mx2'];

            $t42colonia_localidad_mx    =   $rst42[0]['colonia_localidad_mx2'];

            $t42municipio_alcaldia_mx   =   $rst42[0]['municipio_alcaldia_mx2'];

            $t42entidad_federativa_mx   =   $rst42[0]['entidad_federativa_mx2'];

            $t42calle_ext               =   $rst42[0]['calle_ext2'];

            $t42num_int_ext             =   $rst42[0]['num_int_ext2'];

            $t42num_ext_ext             =   $rst42[0]['num_ext_ext2'];

            $t42codigo_postal_ext       =   $rst42[0]['codigo_postal_ext2'];

            $t42ciudad_localidad_ext    =   $rst42[0]['ciudad_localidad_ext2'];

            $t42estado_provincia_ext    =   $rst42[0]['estado_provincia_ext2'];

            $t42pais_ext                =   $rst42[0]['pais_ext2'];

            $t42observaciones           =   $rst42[0]['observaciones2'];



            if($t42fecha_toma=='1900-01-01'){$t42fecha_toma='0000-00-00';}

    

        if ($t42empleo_cargo == null || $t42empleo_cargo == '') {

            // SIN EMPLEO SECUNDARIO

            $pdf->SetFont('helvetica','',8);

            $pdf->SetTextColor(0,0,0);

            $pdf->SetFillColor(122,215,163);

            $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        } else {

        $pdf->SetFont('helvetica','',8);

        $pdf->SetTextColor(255,255,255);

        $pdf->SetFillColor(124,71,101);

        $pdf->Cell(279,5,utf8_decode('I-4.2. DATOS DEL EMPLEO, CARGO O COMISIÓN SECUNDARIO'),1,1,'L',1);

        $pdf->SetFont('helvetica','',8);

        $pdf->SetTextColor(0,0,0);

        $pdf->SetFillColor(122,215,163);

        $pdf->Cell(69.75,5,utf8_decode('NOMBRE DEL ENTE PÚBLICO'),1,0,'C',1);

        $pdf->Cell(209.25,5,utf8_decode($t42ente_publico),1,1,'C',0);

        $pdf->Cell(69.75,5,utf8_decode('EMPLEO, CARGO O COMISIÓN'),1,0,'C',1);

        $pdf->Cell(209.25,5,utf8_decode($t42empleo_cargo),1,1,'C',0);

        $pdf->Cell(69.75,5,utf8_decode('ESPECIFIQUE FUNCIÓN PRINCIPAL'),1,0,'C',1);

        $pdf->Cell(209.25,5,utf8_decode($t42funcion_principal),1,1,'C',0);

        $pdf->SetFont('helvetica','',8);

        $pdf->Cell(69.75,5,utf8_decode('NIVEL / ORDEN DE GOBIERNO'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('AMBITO PÚBLICO'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('ÁREA DE ADSCRIPCIÓN'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('NIVEL DEL EMPLEO, CARGO O COMISION'),1,1,'C',1);

        $pdf->Cell(69.75,5,utf8_decode($t42orden_gob),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t42ambito_publico),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t42area_adscripcion),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t42nivel_empleo),1,1,'C',0);

        $pdf->SetFont('helvetica','',8);

        $pdf->Cell(139.5,5,utf8_decode('FECHA DE TOMA DE POSESIÓN DEL EMPLEO, CARGO O COMISIÓN'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('TELEFÓNO DE OFICINA Y EXTENSIÓN'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('¿ESTA CONTRATADO POR HORARIOS?'),1,1,'C',1);

        $pdf->Cell(139.5,5,utf8_decode($t42fecha_toma),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t42tel_oficina_extencion),1,0,'C',0);

        if ($t42contrato_honorarios==1) {

            $pdf->Cell(69.75,5,utf8_decode('SI'),1,1,'C',0);

        } else {

            $pdf->Cell(69.75,5,utf8_decode('NO'),1,1,'C',0);

        }

    }

$pdf->Cell(279,5,utf8_decode('DOMICILIO DEL EMPLEO, CARGO O COMISIÓN'),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->Cell(139.5,5,utf8_decode('EN MÉXICO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('EN EL EXTRANJERO'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('CALLE - NÚMERO EXTERIOR - NÚMERO INTERIOR'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('CALLE - NÚMERO EXTERIOR - NÚMERO INTERIOR'),1,1,'C',1);

//CHECAR EL ACOMODO DE ESTAS VARIABLES

$pdf->Cell(139.5,5,utf8_decode(''.$t42calle_mx.' - '.$t42num_ext_mx.' - '.$t42num_int_mx),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode(''.$t42calle_ext.' - '.$t42num_ext_ext.' - '.$t42num_int_ext),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->Cell(139.5,5,utf8_decode('COLONIA/LOCALIDAD - MUNICIPIO/ALCALDÍA - ENTIDAD FEDERATIVA'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('COLONIA/LOCALIDAD - ESTADO PROVINCIA'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode(''.$t42colonia_localidad_mx.' - '.$t42municipio_alcaldia_mx.' - '.$t42entidad_federativa_mx),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode(''.$t42ciudad_localidad_ext.' - '.$t42estado_provincia_ext),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->Cell(139.5,5,utf8_decode('CÓDIGO POSTAL'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('PAÍS - CODIGO POSTAL'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t42codigo_postal_mx),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode(''.$t42pais_ext.' - '.$t42codigo_postal_ext),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t42observaciones),1,1,'L',0);

}

$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



    //CONSULTA

    $consultab5 = "SELECT * FROM contraloria_declaracion_tab_5

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' ORDER BY id_tab_5 DESC LIMIT 1;";

    $rst5b = $conf->consulta($consultab5);

    $t5bantecedentes_laborales            =   $rst5b[0]['antecedentes_laborales'];



    $pdf->SetFont('helvetica','B',10);

    $pdf->SetTextColor(255,255,255);

    $pdf->SetFillColor(124,71,101);

    $pdf->Cell(239,5,utf8_decode('I-5. EXPERIENCIA LABORAL (ÚLTIMOS CINCO EMPLEOS)'),1,0,'L',1);

    $pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

    // $pdf->SetFont('helvetica','',8);

    // $pdf->SetTextColor(255,255,255);

    // $pdf->SetFillColor(124,71,101);



    if($t5bantecedentes_laborales == 'SI')

    {

        $consulta = "SELECT * FROM contraloria_declaracion_tab_5_det

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' ORDER BY fechaIngreso DESC LIMIT 5;";

        $rst5 = $conf->consulta($consulta);

        $i=0;

        while ($i < 6) {

            //VARIABLES DE CONSULTA

            $t5ambito_laboro            =   $rst5[$i]['ambito_laboro'];

            $t5orden_gob                =   $rst5[$i]['orden_gob'];

            $t5ambito_publico           =   $rst5[$i]['ambito_publico'];

            $t5nombre_ente_publico      =   $rst5[$i]['nombre_ente_publico'];

            $t5rfc                      =   $rst5[$i]['rfc'];

            $t5area_adscripcion         =   $rst5[$i]['area_adscripcion'];

            $t5empleo_cargo             =   $rst5[$i]['empleo_cargo'];

            $t5funcion_principal        =   $rst5[$i]['funcion_principal'];

            $t5sector_pertenece         =   $rst5[$i]['sector_pertenece'];

            $t5otro_sector_pertenece    =   $rst5[$i]['otro_sector_pertenece'];

            $t5fechaIngreso             =   $rst5[$i]['fechaIngreso'];

            $t5fechaEgreso              =   $rst5[$i]['fechaEgreso'];

            $t5ubicacion                =   $rst5[$i]['ubicacion'];

            $t5observaciones            =   $rst5[$i]['observaciones'];

            $t5ambito_sector            =   $rst5[$i]['ambito_sector'];

            $t5ente_publico             =   $rst5[$i]['ente_publico'];

            $t5sector                   =   $rst5[$i]['sector'];

            $t5otro_sector              =   $rst5[$i]['otro_sector'];

            $t5ubicacion_institucion    =   $rst5[$i]['ubicacion_institucion'];

            $t5habilitado               =   $rst5[$i]['habilitado'];



            if($t5fechaIngreso=='1900-01-01'){$t5fechaIngreso='0000-00-00';}

            if($t5fechaEgreso=='1900-01-01'){$t5fechaEgreso='0000-00-00';}



        if ($t5ambito_laboro == null || $t5ambito_laboro == '') {

            if ($i == 0) {

                $pdf->SetFont('helvetica','',8);

                $pdf->SetTextColor(0,0,0);

                $pdf->SetFillColor(122,215,163);

                $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

                $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

                $i=12;

            } else {

                # code...

            }

        } else {

            $pdf->SetFont('helvetica','',8);

            $pdf->SetTextColor(255,255,255);

            $pdf->SetFillColor(124,71,101);

            $pdf->Cell(279,5,utf8_decode('EMPLEO, CARGO O COMISIÓN / PUESTO'),1,1,'L',1);

            $pdf->SetFont('helvetica','',8);

            $pdf->SetTextColor(255,255,255);

            $pdf->SetFillColor(124,71,101);

            // $pdf->SetFont('helvetica','',8);

            // $pdf->SetTextColor(0,0,0);

            // $pdf->SetFillColor(122,215,163);



            // $pdf->Cell(189,5,utf8_decode('EMPLEO, CARGO O COMISIÓN / PUESTO'),1,1,'L',1);

            $pdf->SetTextColor(0,0,0);

            $pdf->SetFillColor(122,215,163);







            $pdf->Cell(139.5,5,utf8_decode('NOMBRE DEL ENTE PÚBLICO/NOMBRE DE LA EMPRESA, SOCIEDAD O ASOCIACION'),1,0,'C',1);

            $pdf->Cell(139.5,5,utf8_decode($t5nombre_ente_publico),1,1,'C',0);

            $pdf->Cell(139.5,5,utf8_decode('EMPLEO, CARGO O COMISIÓN / PUESTO'),1,0,'C',1);

            $pdf->Cell(139.5,5,utf8_decode($t5empleo_cargo),1,1,'C',0);

            $pdf->Cell(139.5,5,utf8_decode('ESPECIFIQUE FUNCIÓN PRINCIPAL'),1,0,'C',1);

            $pdf->Cell(139.5,5,utf8_decode($t5funcion_principal),1,1,'C',0);

            $pdf->Cell(69.75,5,utf8_decode('NIVEL / ORDEN DE GOBIERNO'),1,0,'C',1);

            $pdf->Cell(69.75,5,utf8_decode('ÁMBITO/SECTOR EN EL QUE LABORASTE'),1,0,'C',1);

            $pdf->Cell(69.75,5,utf8_decode('ÁMBITO PÚBLICO'),1,0,'C',1);

            $pdf->Cell(69.75,5,utf8_decode('ÁREA DE ADSCRIPCIÓN'),1,1,'C',1);

            $pdf->Cell(69.75,5,utf8_decode(''.$t5orden_gob),1,0,'C',0);

            $pdf->Cell(69.75,5,utf8_decode(''.$t5ambito_laboro.' '.$t5otro_sector),1,0,'C',0);

            $pdf->Cell(69.75,5,utf8_decode(''.$t5ambito_publico),1,0,'C',0);

            $pdf->Cell(69.75,5,utf8_decode($t5area_adscripcion),1,1,'C',0);

            $pdf->Cell(69.75,5,utf8_decode('RFC'),1,0,'C',1);

            $pdf->Cell(69.75,5,utf8_decode('FECHA DE INGRESO'),1,0,'C',1);

            $pdf->Cell(69.75,5,utf8_decode('FECHA DE EGRESO'),1,0,'C',1);

            $pdf->Cell(69.75,5,utf8_decode('SECTOR AL QUE PERTENECE'),1,1,'C',1);

            $pdf->Cell(69.75,5,utf8_decode($t5rfc),1,0,'C',0);

            $pdf->Cell(69.75,5,utf8_decode($t5fechaIngreso),1,0,'C',0);

            $pdf->Cell(69.75,5,utf8_decode($t5fechaEgreso),1,0,'C',0);

            $pdf->Cell(69.75,5,utf8_decode($t5sector_pertenece.' '.$t5otro_sector_pertenece),1,1,'C',0);

            $pdf->Cell(69.75,5,utf8_decode('LUGAR DONDE SE UBICA'),1,0,'C',1);

            $pdf->Cell(209.25,5,utf8_decode($t5ubicacion.' '.$t5ubicacion_institucion),1,1,'C',0);

            $pdf->SetFont('helvetica','',8);

            $pdf->SetTextColor(0,0,0);

            $pdf->SetFillColor(122,215,163);

            $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

            $pdf->Cell(229,5,utf8_decode($t5observaciones),1,1,'L',0);

            }

        $i++;

        }

}

$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



    //CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_6

                WHERE id_declaracion > 0 AND sin_pareja = 'SI' AND id_declaracion = '$id_declaracion' LIMIT 1;";

    $rst6 = $conf->consulta($consulta);



    //VARIABLES DE CONSULTA

    $t6fecha_registro = $rst6[0]['fecha_registro'];

    $t6sin_pareja = $rst6[0]['sin_pareja'];

    $t6nombre = $rst6[0]['nombre'];

    $t6apPat = $rst6[0]['apPat'];

    $t6apMat = $rst6[0]['apMat'];

    $t6fecha_nacimiento = $rst6[0]['fecha_nacimiento'];

    $t6rfc = $rst6[0]['rfc'];

    $t6relacion = $rst6[0]['relacion'];

    $t6ciudadano_ext = $rst6[0]['ciudadano_ext'];

    $t6curp = $rst6[0]['curp'];

    $t6dependiente_e = $rst6[0]['dependiente_e'];

    $t6cohabitante = $rst6[0]['cohabitante'];

    $t6lugar_recidencia = $rst6[0]['lugar_recidencia'];

    $t6calle_mx = $rst6[0]['calle_mx'];

    $t6num_int_mx = $rst6[0]['num_int_mx'];

    $t6num_ext_mx = $rst6[0]['num_ext_mx'];

    $t6colonia_localidad_mx = $rst6[0]['colonia_localidad_mx'];

    $t6municipio_alcaldia_mx = $rst6[0]['municipio_alcaldia_mx'];

    $t6entidad_mx = $rst6[0]['entidad_mx'];

    $t6codigo_postal_mx = $rst6[0]['codigo_postal_mx'];

    $t6calle_ext = $rst6[0]['calle_ext'];

    $t6num_int_ext = $rst6[0]['num_int_ext'];

    $t6num_ext_ext = $rst6[0]['num_ext_ext'];

    $t6ciudad_localidad_ext = $rst6[0]['ciudad_localidad_ext'];

    $t6estado_provincia_ext = $rst6[0]['estado_provincia_ext'];

    $t6pais_ext = $rst6[0]['pais_ext'];

    $t6codigo_postal_ext = $rst6[0]['codigo_postal_ext'];

    $t6actividad_laboral = $rst6[0]['actividad_laboral'];

    $t6otra_actividad_laboral = $rst6[0]['otra_actividad_laboral'];

    $t6orden_gob = $rst6[0]['orden_gob'];

    $t6ambito_publico = $rst6[0]['ambito_publico'];

    $t6ente_publico = $rst6[0]['ente_publico'];

    $t6area_adscripcion = $rst6[0]['area_adscripcion'];

    $t6empleo_cargo = $rst6[0]['empleo_cargo'];

    $t6funcion_principal = $rst6[0]['funcion_principal'];

    $t6salario_mensual_neto = $rst6[0]['salario_mensual_neto'];

    $t6fecha_ingreso = $rst6[0]['fecha_ingreso'];

    $t6nombre_empresa_2 = $rst6[0]['nombre_empresa_2'];

    $t6empleo_cargo_2 = $rst6[0]['empleo_cargo_2'];

    $t6rfc_empresa_2 = $rst6[0]['rfc_empresa_2'];

    $t6fecha_ingreso_2 = $rst6[0]['fecha_ingreso_2'];

    $t6sector_2 = $rst6[0]['sector_2'];

    $t6salario_net_2 = $rst6[0]['salario_net_2'];

    $t6proveedor_gob = $rst6[0]['proveedor_gob'];

    $t6otro_sector_2 = $rst6[0]['otro_sector_2'];



    if($t6fecha_registro=='1900-01-01'){$t6fecha_registro='0000-00-00';}

    if($t6fecha_nacimiento=='1900-01-01'){$t6fecha_nacimiento='0000-00-00';}

    if($t6fecha_ingreso=='1900-01-01'){$t6fecha_ingreso='0000-00-00';}

    if($t6fecha_ingreso_2=='1900-01-01'){$t6fecha_ingreso_2='0000-00-00';}

    

$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(239,5,utf8_decode('I-6. DATOS DE LA PAREJA'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

if ($t6sin_pareja=='NO') {

    $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

    $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

    $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

} else {

    # code...

}



$pdf->Cell(66.33,5,utf8_decode('NOMBRE (S)'),1,0,'C',1);

$pdf->Cell(66.33,5,utf8_decode('PRIMER APELLIDO'),1,0,'C',1);

$pdf->Cell(66.33,5,utf8_decode('SEGUNDO APELLIDO'),1,0,'C',1);

$pdf->Cell(40,5,utf8_decode('FECHA DE NACIMIENTO'),1,0,'C',1);

$pdf->Cell(40,5,utf8_decode('RFC'),1,1,'C',1);

$pdf->Cell(66.33,5,utf8_decode($t6nombre),1,0,'C',0);

$pdf->Cell(66.33,5,utf8_decode($t6apPat),1,0,'C',0);

$pdf->Cell(66.33,5,utf8_decode($t6apMat),1,0,'C',0);

$pdf->Cell(40,5,utf8_decode($t6fecha_nacimiento),1,0,'C',0);

$pdf->Cell(40,5,utf8_decode($t6rfc),1,1,'C',0);

$pdf->Cell(93,5,utf8_decode('RELACIÓN DEL DECLARANTE'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('¿ES DEPENDIENTE ECONÓMICO?'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('¿HABITA EN EL DOMICILIO DEL DECLARANTE?'),1,1,'C',1);

$pdf->Cell(93,5,utf8_decode(''.$t6relacion),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode(''.$t6dependiente_e),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode(''.$t6cohabitante),1,1,'C',0);

if ($t6cohabitante=='SI') {

    

} else {

    $pdf->Cell(93,5,utf8_decode('¿ES CIUDADANO EXTRANJERO?'),1,0,'C',1);

    $pdf->Cell(93,5,utf8_decode('CURP'),1,0,'C',1);

    $pdf->Cell(93,5,utf8_decode('LUGAR DONDE RESIDE'),1,1,'C',1);

    $pdf->Cell(93,5,utf8_decode($t6ciudadano_ext),1,0,'C',0);

    $pdf->Cell(93,5,utf8_decode($t6curp),1,0,'C',0);

    $pdf->Cell(93,5,utf8_decode($t6lugar_recidencia),1,1,'C',0);

    $pdf->Cell(279,5,utf8_decode('DOMICILIO DE LA PAREJA'),1,1,'C',1);

    $pdf->Cell(139.5,5,utf8_decode('MÉXICO'),1,0,'C',1);

    $pdf->Cell(139.5,5,utf8_decode('EN EL EXTRANJERO'),1,1,'C',1);

    $pdf->Cell(139.5,5,utf8_decode('CALLE - NÚMERO EXTERIOR - NÚMERO INTERIOR'),1,0,'C',1);

    $pdf->Cell(139.5,5,utf8_decode('CALLE - NÚMERO EXTERIOR - NÚMERO INTERIOR'),1,1,'C',1);

    $pdf->Cell(139.5,5,utf8_decode($t6calle_mx.' - '.$t6num_ext_mx.' - '.$t6num_int_mx),1,0,'C',0);

    $pdf->Cell(139.5,5,utf8_decode($t6calle_ext.' - '.$t6num_ext_ext.' - '.$t6num_int_ext),1,1,'C',0);

    $pdf->SetFont('helvetica','',8);

    $pdf->Cell(139.5,5,utf8_decode('COLONIA/LOCALIDAD - MUNICIPIO/ALCALDÍA - ENTIDAD FEDERATIVA'),1,0,'C',1);

    $pdf->Cell(139.5,5,utf8_decode('COLONIA/LOCALIDAD - ESTADO PROVINCIA'),1,1,'C',1);

    $pdf->Cell(139.5,5,utf8_decode(''.$t6colonia_localidad_mx.' - '.$t6municipio_alcaldia_mx.' - '.$t6entidad_mx),1,0,'C',0);

    $pdf->Cell(139.5,5,utf8_decode(''.$t6ciudad_localidad_ext.' - '.$t6estado_provincia_ext),1,1,'C',0);

    $pdf->SetFont('helvetica','',8);

    $pdf->Cell(139.5,5,utf8_decode('CÓDIGO POSTAL'),1,0,'C',1);

    $pdf->Cell(139.5,5,utf8_decode('PAÍS - CÓDIGO POSTAL'), 1,1,'C',1);

    $pdf->Cell(139.5,5,utf8_decode($t6codigo_postal_mx),1,0,'C',0);

    $pdf->Cell(139.5,5,utf8_decode($t6pais_ext.' '.$t6ciudad_localidad_ext),1,1,'C',0);

}

$pdf->Cell(279,5,utf8_decode('DATOS LABORALES DE LA PAREJA'),1,1,'C',1);

$pdf->Cell(93,5,utf8_decode('ACTIVIDAD LABORAL'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('NIVEL / ORDEN DE GOBIERNO'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('ÁMBITO PÚBLICO'),1,1,'C',1);

$pdf->Cell(93,5,utf8_decode(''.$t6actividad_laboral.' '.$t6otra_actividad_laboral),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode(''.$t6orden_gob),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode(''.$t6ambito_publico),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('EMPLEO, CARGO O COMISIÓN'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('NOMBRE DEL ENTE PUBLICO'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('ÁREA DE ADSCRIPCIÓN'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t6empleo_cargo),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t6ente_publico),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t6area_adscripcion),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('ESPECIFIQUE FUNCIÓN PRINCIPAL'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('SALARIO MENSUAL NETO'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('FECHA DE INGRESO AL EMPLEO'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t6funcion_principal),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode(formatMoney($t6salario_mensual_neto)),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t6fecha_ingreso),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('NOMBRE DE LA EMPRESA, SOCIEDAD O ASOSIACIÓN'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('EMPLEO, CARGO O COMISIÓN'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('RFC'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t6nombre_empresa_2.''.$t6empleo_cargo),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t6empleo_cargo_2.''.$t6empleo_cargo),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t6rfc_empresa_2.''),1,1,'C',0);

$pdf->Cell(69.75,5,utf8_decode('FECHA DE INGRESO AL EMPLEO'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('¿ES PROVEEDOR O CONTRATISTA DEL GOBIERNO?'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('SALARIO MENSUAL NETO'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('SECTOR AL QUE PERTENECE'),1,1,'C',1);

$pdf->Cell(69.75,5,utf8_decode($t6fecha_ingreso_2.''.$t6fecha_ingreso),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t6proveedor_gob),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode(formatMoney($t6salario_net_2)),1,0,'C',0); //$t6salario_net_2.''.$t6salario_mensual_neto

$pdf->Cell(69.75,5,utf8_decode($t6sector_2.' '.$t6otro_sector_2),1,1,'C',0);

// NO SE ENCUENTRAN OBSERVACIONES

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

//$pdf->Cell(229,5,utf8_decode(),1,1,'L',0);

$pdf->Cell(229,5,'',1,1,'L',0);

$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



    //CONSULTA

    $consultab7 = "SELECT * FROM contraloria_declaracion_tab_7

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' ORDER BY id_tab_7 DESC LIMIT 1;";

    $rst7b = $conf->consulta($consultab7);

    $t7bantecedentes_dependientes            =   $rst7b[0]['antecedentes_dependientes'];



    $pdf->SetFont('helvetica','B',10);

    $pdf->SetTextColor(255,255,255);

    $pdf->SetFillColor(124,71,101);

    $pdf->Cell(239,5,utf8_decode('I-7. DATOS DEL DEPENDIENTE ECONÓMICO'),1,0,'L',1);

    $pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

    $pdf->SetFont('helvetica','',8);

    $pdf->SetTextColor(0,0,0);

    $pdf->SetFillColor(122,215,163);

    $pdf->Cell(279,5,utf8_decode('TODOS LOS DATOS RELATIVOS DE EDAD NO SERAN PÚBLICOS'),1,1,'C',1);

    if($t7bantecedentes_dependientes == 'SI')

    {

        $consulta = "SELECT * FROM contraloria_declaracion_tab_7_det

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' AND habilitado = 1 ORDER BY id_dependiente DESC LIMIT 5;";

        $rst7 = $conf->consulta($consulta);

        $i=0;

        while ($i < 6) {

            //VARIABLES DE CONSULTA

            $t7num_ext_ext = $rst7[$i]['num_ext_ext'];

            $t7num_int_ext = $rst7[$i]['num_int_ext'];

            $t7calle_ext = $rst7[$i]['calle_ext'];

            $t7codigo_postal_mx = $rst7[$i]['codigo_postal_mx'];

            $t7entidad_mx = $rst7[$i]['entidad_mx'];

            $t7municipio_alcaldia_mx = $rst7[$i]['municipio_alcaldia_mx'];

            $t7colonia_localidad_mx = $rst7[$i]['colonia_localidad_mx'];

            $t7num_ext_mx = $rst7[$i]['num_ext_mx'];

            $t7num_int_mx = $rst7[$i]['num_int_mx'];

            $t7calle_mx = $rst7[$i]['calle_mx'];

            $t7lugar_recidencia = $rst7[$i]['lugar_recidencia'];

            $t7cohabitante = $rst7[$i]['cohabitante'];

            $t7dependiente_e = $rst7[$i]['dependiente_e'];

            $t7curp = $rst7[$i]['curp'];

            $t7ciudadano_ext = $rst7[$i]['ciudadano_ext'];

            $t7parentesco = $rst7[$i]['parentesco'];

            $t7rfc = $rst7[$i]['rfc'];

            $t7fecha_nacimiento = $rst7[$i]['fecha_nacimiento'];

            $t7apMat = $rst7[$i]['apMat'];

            $t7apPat = $rst7[$i]['apPat'];

            $t7nombre = $rst7[$i]['nombre'];

            $t7otra_actividad_laboral = $rst7[$i]['otra_actividad_laboral'];

            $t7cohabitantesino = $rst7[$i]['cohabitantesino'];

            $t7parentesco_otro = $rst7[$i]['parentesco_otro'];

            $t7observaciones = $rst7[$i]['observaciones'];

            $t7proveedor_gob = $rst7[$i]['proveedor_gob'];

            $t7otro_sector_2 = $rst7[$i]['otro_sector_2'];

            $t7sector_2 = $rst7[$i]['sector_2'];

            $t7salario_neto_2 = $rst7[$i]['salario_neto_2'];

            $t7fecha_ingreso_2 = $rst7[$i]['fecha_ingreso_2'];

            $t7empleo_cargo_2 = $rst7[$i]['empleo_cargo_2'];

            $t7rfc_2 = $rst7[$i]['rfc_2'];

            $t7nombre_empresa_2 = $rst7[$i]['nombre_empresa_2'];

            $t7fecha_ingreso = $rst7[$i]['fecha_ingreso'];

            $t7salario_neto = $rst7[$i]['salario_neto'];

            $t7funcion_principal = $rst7[$i]['funcion_principal'];

            $t7empreo_cargo = $rst7[$i]['empreo_cargo'];

            $t7area_adscripcion = $rst7[$i]['area_adscripcion'];

            $t7ente_publico = $rst7[$i]['ente_publico'];

            $t7ambito_publico = $rst7[$i]['ambito_publico'];

            $t7orden_gob = $rst7[$i]['orden_gob'];

            $t7otra_actividad = $rst7[$i]['otra_actividad'];

            $t7actividad_laboral = $rst7[$i]['actividad_laboral'];

            $t7codigo_postal_ext = $rst7[$i]['codigo_postal_ext'];

            $t7pais_ext = $rst7[$i]['pais_ext'];

            $t7estado_provincia_ext = $rst7[$i]['estado_provincia_ext'];

            $t7ciudad_localidad_ext = $rst7[$i]['ciudad_localidad_ext'];



            if($t7fecha_nacimiento=='1900-01-01'){$t7fecha_nacimiento='0000-00-00';}

            if($t7fecha_ingreso_2=='1900-01-01'){$t7fecha_ingreso_2='0000-00-00';}

            if($t7fecha_ingreso=='1900-01-01'){$t7fecha_ingreso='0000-00-00';}



    if ($t7nombre == null || $t7nombre == '') {

            // NO IMPRIMIR O DEFINIR NO HAY

            if ($i == 0) {

                //NO HAY COSAS POR REPORTAR

                $pdf->SetFont('helvetica','',8);

                $pdf->SetTextColor(0,0,0);

                $pdf->SetFillColor(122,215,163);

                $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

                $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

                $i=12;

            } else {

                //NO IMPRIMIR

                $i=12;

            }

    } else {

        //IMPRIMIR



        // //NO ACEPTAR MENORES DE EDAD

        // // OMITIR MENORES DE EDAD

        // if (time() < strtotime('+18 years', strtotime($t7fecha_nacimiento))) {

        //    // MENOR DE EDAD

        // } else {

        $pdf->SetFont('helvetica','',8);

        $pdf->SetTextColor(255,255,255);

        $pdf->SetFillColor(124,71,101);

        $pdf->Cell(279,5,utf8_decode('DEPENDIENTE ECONÓMICO'),1,1,'L',1);

        $pdf->SetFont('helvetica','',8);

        $pdf->SetTextColor(0,0,0);

        $pdf->SetFillColor(122,215,163);



        $pdf->Cell(55.8,5,utf8_decode('NOMBRE (S)'),1,0,'C',1);

        $pdf->Cell(55.8,5,utf8_decode('PRIMER APELLIDO'),1,0,'C',1);

        $pdf->Cell(55.8,5,utf8_decode('SEGUNDO APELLIDO'),1,0,'C',1);

        $pdf->Cell(55.8,5,utf8_decode('FECHA DE NACIMIENTO'),1,0,'C',1);

        $pdf->Cell(55.8,5,utf8_decode('RFC'),1,1,'C',1);

        $pdf->Cell(55.8,5,utf8_decode($t7nombre),1,0,'C',0);

        $pdf->Cell(55.8,5,utf8_decode($t7apPat),1,0,'C',0);

        $pdf->Cell(55.8,5,utf8_decode($t7apMat),1,0,'C',0);

        $pdf->Cell(55.8,5,utf8_decode($t7fecha_nacimiento),1,0,'C',0);

        $pdf->Cell(55.8,5,utf8_decode($t7rfc),1,1,'C',0);



            //CONSULTA PARENTESCO

         //    $consulta4 = "SELECT relacion FROM contraloria_declaracion_relacion

         //                WHERE id_relacion = '$t7parentesco';";

            // $rst7r = $conf->consulta($consulta4);



            // $t7rrelacion = $rst7[$i]['relacion'];



        $pdf->Cell(69.75,5,utf8_decode('PARENTESCO O RELACION CON DECLARANTE'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('¿ES CIUDADANO EXTRANJERO?'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('CURP'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('¿ES DEPENDIENTE ECONÓMICO?'),1,1,'C',1);

        $pdf->Cell(69.75,5,utf8_decode($t7parentesco.' '.$t7parentesco_otro),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t7ciudadano_ext),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t7curp),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t7dependiente_e),1,1,'C',0);

        $pdf->Cell(279,5,utf8_decode('¿HABITA EN EL DOMICILIO DEL DECLARANTE?'),1,1,'C',1);

        $pdf->Cell(279,5,utf8_decode($t7cohabitante),1,1,'C',0);

        // OMITIBLE

        // $pdf->Cell(139.5,5,utf8_decode('¿ES CIUDADANO EXTRANJERO?'),1,0,'C',1);

        // $pdf->Cell(139.5,5,utf8_decode('¿ES DEPENDIENTE ECONÓMICO?'),1,1,'C',1);

        // $pdf->Cell(139.5,5,utf8_decode($t7ciudadano_ext.'                 CURP: '.$t7curp),1,0,'C',0);

        // $pdf->Cell(139.5,5,utf8_decode($t7dependiente_e),1,1,'C',0);

        // $pdf->Cell(189,10,utf8_decode('¿HABITA EN EL DOMICILIO DEL DECLARANTE?        '.$t7cohabitante),1,1,'C',0);

        if ($t7cohabitante=='SI') {

            

        } else {

        // $pdf->MultiCell(189,5,utf8_decode('LUGAR DONDE RESIDE

        //  '.$t7lugar_recidencia),1,'C',0);

        $pdf->Cell(279,5,utf8_decode('DOMICILIO DEL DEPENDIENTE ECONÓMICO'),1,1,'C',1);

        $pdf->Cell(139.5,5,utf8_decode('MÉXICO'),1,0,'C',1);

        $pdf->Cell(139.5,5,utf8_decode('EN EL EXTRANJERO'),1,1,'C',1);

        $pdf->Cell(139.5,5,utf8_decode('CALLE - NÚMERO EXTERIOR - NÚMERO INTERIOR'),1,0,'C',1);

        $pdf->Cell(139.5,5,utf8_decode('CALLE - NÚMERO EXTERIOR - NÚMERO INTERIOR'),1,1,'C',1);

        $pdf->Cell(139.5,5,utf8_decode($t7calle_mx.' - '.$t7num_ext_mx.' - '.$t7num_int_mx),1,0,'C',0);

        $pdf->Cell(139.5,5,utf8_decode($t7calle_ext.' - '.$t7num_ext_ext.' - '.$t7num_int_ext),1,1,'C',0);

        $pdf->SetFont('helvetica','',8);

        $pdf->Cell(139.5,5,utf8_decode('COLONIA/LOCALIDAD - MUNICIPIO/ALCALDÍA - ENTIDAD FEDERATIVA'),1,0,'C',1);

        $pdf->Cell(139.5,5,utf8_decode('CIUDAD/LOCALIDAD - ESTADO/PROVINCIA'),1,1,'C',1);

        $pdf->Cell(139.5,5,utf8_decode(''.$t7colonia_localidad_mx.' - '.$t7municipio_alcaldia_mx.' - '.$t7entidad_mx),1,0,'C',0);

        $pdf->Cell(139.5,5,utf8_decode(''.$t7ciudad_localidad_ext.' - '.$t7estado_provincia_ext),1,1,'C',0);

        $pdf->SetFont('helvetica','',8);

        $pdf->Cell(139.5,5,utf8_decode('CÓDIGO POSTAL'),1,0,'C',1);

        $pdf->Cell(139.5,5,utf8_decode('PAÍS - CODIGO POSTAL'),1,1,'C',1);

        $pdf->Cell(139.5,5,utf8_decode($t7codigo_postal_mx),1,0,'C',0);

        $pdf->Cell(139.5,5,utf8_decode($t7pais_ext.' - '.$t7codigo_postal_ext),1,1,'C',0);

        }

        //CHECK DECIDIR AGREGAR IF PARA OMITIR ACTIVIDAD LABORAL

        $pdf->Cell(93,5,utf8_decode('ACTIVIDAD LABORAL'),1,0,'C',1);

        $pdf->Cell(93,5,utf8_decode('NIVEL / ORDEN DE GOBIERNO'),1,0,'C',1);

        $pdf->Cell(93,5,utf8_decode('ÁMBITO PÚBLICO'),1,1,'C',1);

        $pdf->Cell(93,5,utf8_decode(''.$t7actividad_laboral.' '.$t7otra_actividad_laboral),1,0,'C',0);

        $pdf->Cell(93,5,utf8_decode(''.$t7orden_gob),1,0,'C',0);

        $pdf->Cell(93,5,utf8_decode(''.$t7ambito_publico),1,1,'C',0);

        $pdf->Cell(139.5,5,utf8_decode('EMPLEO, CARGO O COMISIÓN'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('NOMBRE DEL ENTE PÚBLICO'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('ÁREA DE ADSCRIPCIÓN'),1,1,'C',1);

        $pdf->Cell(139.5,5,utf8_decode($t7empreo_cargo),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t7ente_publico),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t7area_adscripcion),1,1,'C',0);

        $pdf->Cell(139.5,5,utf8_decode('ESPECIFIQUE FUNCIÓN PRINCIPAL'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('SALARIO MENSUAL NETO'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('FECHA DE INGRESO AL EMPLEO'),1,1,'C',1);

        $pdf->Cell(139.5,5,utf8_decode($t7funcion_principal),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t7salario_neto),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t7fecha_ingreso),1,1,'C',0);

        $pdf->Cell(139.5,5,utf8_decode('NOMBRE DE LA EMPRESA, SOCIEDAD O ASOSIACION'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('EMPLEO O CARGO'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('RFC'),1,1,'C',1);

        $pdf->Cell(139.5,5,utf8_decode($t7nombre_empresa_2),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t7empleo_cargo_2),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t7rfc_2.''),1,1,'C',0);

        $pdf->Cell(69.75,5,utf8_decode('FECHA DE INGRESO AL EMPLEO'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('¿ES PROVEEDOR O CONTRATISTA DEL GOBIERNO?'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('SALARIO MENSUAL NETO'),1,0,'C',1);

        $pdf->Cell(69.75,5,utf8_decode('SECTOR AL QUE PERTENECE'),1,1,'C',1);

        $pdf->Cell(69.75,5,utf8_decode($t7fecha_ingreso_2),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t7proveedor_gob),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t7salario_neto_2),1,0,'C',0);

        $pdf->Cell(69.75,5,utf8_decode($t7sector_2.' '.$t7otro_sector_2),1,1,'C',0);

        $pdf->SetFont('helvetica','',8);

        $pdf->SetTextColor(0,0,0);

        $pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode($t7observaciones),1,1,'L',0);

// }//FIN MENOR DE EDAD

$i++;

    }

    }

// $i++;

}//FIN CICLO



$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



    //CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_8

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' LIMIT 1;";

    $rst8 = $conf->consulta($consulta);

    

    //VARIABLES DE CONSULTA

    $t8fecha_registro                   =   $rst8[0]['fecha_registro'];

    $t8I                    =   $rst8[0]['I'];

    $t8II                   =   $rst8[0]['II'];

    $t8II_1                     =   $rst8[0]['II_1'];

    $t8nombre_razon                     =   $rst8[0]['nombre_razon'];

    $t8tipo_negocio                     =   $rst8[0]['tipo_negocio'];

    $t8II_2                     =   $rst8[0]['II_2'];

    $t8tipo_instrumento                     =   $rst8[0]['tipo_instrumento'];

    $t8otro_tipo_instru                     =   $rst8[0]['otro_tipo_instru'];

    $t8II_3                     =   $rst8[0]['II_3'];

    $t8tipo_servicio                    =   $rst8[0]['tipo_servicio'];

    $t8II_4                     =   $rst8[0]['II_4'];

    $t8tipo_ingreso                     =   $rst8[0]['tipo_ingreso'];

    $t8A                    =   $rst8[0]['A'];

    $t8B                    =   $rst8[0]['B'];

    $t8C                    =   $rst8[0]['C'];

    $t8observaciones                    =   $rst8[0]['observaciones'];



    if($t8fecha_registro=='1900-01-01'){$t8fecha_registro='0000-00-00';}



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

if ($t1rhtipo_declaracion == 1) {

    $t1rhtipo_declaracion4 = "I.8 INGRESOS NETOS DEL DECLARANTE, PAREJA Y / O DEPENDIENTES ECONÓMICOS (SITUACIÓN ACTUAL)";

} elseif ($t1rhtipo_declaracion == 2) {

    $t1rhtipo_declaracion4 = "I.8 INGRESOS NETOS DEL DECLARANTE, PAREJA Y / O DEPENDIENTES ECONÓMICOS (ENTRE EL 1 DE ENERO Y EL 31 DE DICIEMBRE DEL AÑO INMEDIATO ANTERIOR)";

} else {

    $t1rhtipo_declaracion4 = "I.8 INGRESOS DEL AÑO EN CURSO A LA FECHA DE CONCLUSIÓN DEL EMPLEO, CARGO O COMISIÓN NETOS DEL DECLARANTE, PAREJA, Y/O DEPENDIENTES ECONÓMICOS.";

}





$pdf->Cell(239,5,utf8_decode($t1rhtipo_declaracion4),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(279,5,utf8_decode('CAPTURAR CANTIDADES LIBRES DE IMPUESTOS, SIN COMA, SIN PUNTOS, SIN CENTAVOS Y SIN CEROS A LA IZQUIERDA'),1,1,'L',1);



if($tipo == 2) {$mensual = 'I.- REMUNERACIÓN ANUAL NETA DEL DECLARANTE POR SU CARGO PÚBLICO';} 

if($tipo == 3) {$mensual = 'I.- REMUNERACIÓN EN EL AÑO EN CURSO DEL DECLARANTE A LA FECHA DE CONCLUSIÓN POR SU CARGO PÚBLICO';} 

if($tipo == 1 ) {$mensual = 'I.- REMUNERACIÓN MENSUAL NETA DEL DECLARANTE POR SU CARGO PÚBLICO';} 



$pdf->Cell(229,5,utf8_decode($mensual),1,0,'L',1);

$pdf->Cell(50,10,utf8_decode(formatMoney($t8I)),1,1,'C',0);

$pdf->Ln(-5);

$pdf->Cell(229,5,utf8_decode('(POR CONCEPTO DE SUELDOS, HONORARIOS, COMPENSACIONES, BONOS Y OTRAS PRESTACIONES) (CANTIDADES NETAS DESPUÉS DE IMPUESTOS)'),1,1,'L',1);

// $pdf->Cell(50,5,utf8_decode(''),1,1,'L',0);

if($tipo == 2 ) {$mensual = 'II.- OTROS INGRESOS ANUALES DEL DECLARANTE (SUMA DEL II.1 AL II.4)';}

if($tipo == 3 ) {$mensual = 'II.- OTROS INGRESOS EN EL AÑO EN CURSO A LA FECHA DE CONSLUSIÓN DEL DECLARANTE (SUMA DEL II.1 AL II.4)';}

if($tipo == 1 ) {$mensual = 'II.- OTROS INGRESOS MENSUALES DEL DECLARANTE (SUMA DEL II.1 AL II.4)';} 



$pdf->Cell(229,5,utf8_decode($mensual),1,0,'L',1);

$pdf->Cell(50,5,utf8_decode(formatMoney($t8II)),1,1,'C',0);

$pdf->Cell(229,5,utf8_decode('II.1- POR ACTIVIDAD INDUSTRIAL, COMERCIAL Y / O EMPRESARIAL (DESPUES DE IMPUESTOS)'),1,0,'L',1);

$pdf->Cell(50,5,utf8_decode(formatMoney($t8II_1)),1,1,'C',0);

$pdf->Cell(229,5,utf8_decode('NOMBRE O RAZÓN SOCIAL'),1,0,'L',1);

$pdf->Cell(50,5,utf8_decode($t8nombre_razon),1,1,'C',0);

$pdf->Cell(229,5,utf8_decode('TIPO DE NEGOCIO'),1,0,'L',1);

$pdf->Cell(50,5,utf8_decode($t8tipo_negocio),1,1,'C',0);

$pdf->Cell(229,5,utf8_decode('II.2- POR ACTIVIDAD FINANCIERA (RENDIMIENTOS O GANANCIAS) (DESPUES DE IMPUESTOS)'),1,0,'L',1);

$pdf->Cell(50,5,utf8_decode(formatMoney($t8II_2)),1,1,'C',0);

$pdf->Cell(229,5,utf8_decode('TIPO DE INSTRUMENTO QUE GENERO EL RENDIMIENTO O GANANCIA'),1,0,'L',1);

$pdf->Cell(50,5,utf8_decode($t8tipo_instrumento.' '.$t8otro_tipo_instru),1,1,'C',0);

$pdf->Cell(229,5,utf8_decode('II.3 POR SERVICIOS PROFESIONALES, CONSEJOS, CONSULTORIAS Y / O ASESORIAS (DESPUÉS DE IMPUESTOS)'),1,0,'L',1);

$pdf->Cell(50,5,utf8_decode(formatMoney($t8II_3)),1,1,'C',0);

$pdf->Cell(229,5,utf8_decode('TIPO DE SERVICIO PRESTADO'),1,0,'L',1);

$pdf->Cell(50,5,utf8_decode($t8tipo_servicio),1,1,'C',0);

$pdf->Cell(229,5,utf8_decode('II.4 OTROS INGRESOS NO CONSIDERADOS A LOS ANTERIORES (DESPUÉS DE IMPUESTOS)'),1,0,'L',1);

$pdf->Cell(50,5,utf8_decode(formatMoney($t8II_4)),1,1,'C',0);

$pdf->Cell(229,5,utf8_decode('ESPECIFICAR TIPO DE INGRESO (ARRENDAMIENTO, REGALIA, SORTEOS, CONCURSOS, DONACIONES, SEGUROS DE VIDA, ETC.)O'),1,0,'L',1);

$pdf->Cell(50,5,utf8_decode($t8tipo_ingreso),1,1,'C',0);



if($tipo == 2 ) { $mensual = 'A.- INGRESO ANUAL NETO DEL DECLARANTE (SUMA DEL NUMERAL I Y II)';}

if($tipo == 3 ) { $mensual = 'A.- INGRESO DEL AÑO EN CURSO DEL DECLARANTE A LA FECHA DE CONSLUSIÓN (SUMA DEL NUMERAL I Y II)';}

if($tipo == 1 ) {$mensual = 'A.- INGRESO MENSUAL NETO DEL DECLARANTE (SUMA DEL NUMERAL I Y II)';} 



$pdf->Cell(229,5,utf8_decode($mensual),1,0,'L',1);

$pdf->Cell(50,5,utf8_decode(formatMoney($t8A)),1,1,'C',0);

if($tipo == 2) {$mensual = 'B.- INGRESO ANUAL NETO DE LA PAREJA Y / O DEPENDIENTES ECONÓMICOS (DESPUÉS DE IMPUESTOS)';} 

if($tipo == 3) {$mensual = 'B.- INGRESO DEL AÑO EN CURSO A LA FECHA DE CONSULSIÓN DE LA PAREJA Y / O DEPENDIENTES ECONÓMICOS (DESPUÉS DE IMPUESTOS)';} 

if($tipo == 1 ) { $mensual = 'B.- INGRESO MENSUAL NETO DE LA PAREJA Y / O DEPENDIENTES ECONÓMICOS (DESPUÉS DE IMPUESTOS)';} 



$pdf->Cell(229,5,utf8_decode($mensual),1,0,'L',1);

$pdf->Cell(50,5,utf8_decode(formatMoney($t8B)),1,1,'C',0);



if($tipo == 2 ) {$mensual = 'C.- TOTAL DE INGRESOS ANUALES NETOS PERCIBIDOS POR EL DECLARANTE, PAREJA Y / O DEPENDIENTES ECONÓMICOS';} 

if($tipo == 3) {$mensual = 'C.- TOTAL DE INGRESOS DEL AÑO EN CURSO A LA FECHA DE CONCLUSIÓN PERCIBIDOS POR EL DECLARANTE, PAREJA Y/O DEPENDIENTES ECONÓMICOS';} 

if($tipo == 1 ) { $mensual = 'C.- TOTAL DE INGRESOS MENSUALES NETOS PERCIBIDOS POR EL DECLARANTE, PAREJA Y / O DEPENDIENTES ECONÓMICOS';} 



$pdf->Cell(229,5,utf8_decode($mensual),1,0,'L',1);

$pdf->Cell(50,10,utf8_decode(formatMoney($t8C)),1,1,'C',0);

$pdf->Ln(-5);

$pdf->Cell(229,5,utf8_decode('(APARTADOS A + B)'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t8observaciones),1,1,'L',0);



$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

if($tipo != 2)

{ 



    //CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_9

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' LIMIT 1;";

    $rst9 = $conf->consulta($consulta);



    //VARIABLES DE CONSULTA

    $t9observaciones                    =   $rst9[0]['observaciones'];

    $t9C                    =   $rst9[0]['C'];

    $t9B                    =   $rst9[0]['B'];

    $t9A                    =   $rst9[0]['A'];

    $t9tipo_ingreso                     =   $rst9[0]['tipo_ingreso'];

    $t9II_5                     =   $rst9[0]['II_5'];

    $t9tipo_bien                    =   $rst9[0]['tipo_bien'];

    $t9II_4                     =   $rst9[0]['II_4'];

    $t9tipo_servicio                    =   $rst9[0]['tipo_servicio'];

    $t9II_3                     =   $rst9[0]['II_3'];

    $t9otro_tipo_instru                     =   $rst9[0]['otro_tipo_instru'];

    $t9tipo_instrumento                     =   $rst9[0]['tipo_instrumento'];

    $t9II_2                     =   $rst9[0]['II_2'];

    $t9tipo_negocio                     =   $rst9[0]['tipo_negocio'];

    $t9nombre_razon                     =   $rst9[0]['nombre_razon'];

    $t9II_1                     =   $rst9[0]['II_1'];

    $t9II                   =   $rst9[0]['II'];

    $t9I                    =   $rst9[0]['I'];

    $t9ingresos_netos                   =   $rst9[0]['ingresos_netos'];

    $t9fecha_fin                    =   $rst9[0]['fecha_fin'];

    $t9fecha_inicio                     =   $rst9[0]['fecha_inicio'];

    $t9servidor_anio_anterior                   =   $rst9[0]['servidor_anio_anterior'];



    if($t9fecha_fin=='1900-01-01'){$t9fecha_fin='0000-00-00';}

    if($t9fecha_inicio=='1900-01-01'){$t9fecha_inicio='0000-00-00';}



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(239,5,utf8_decode('I-9. ¿TE DESEMPEÑAS COMO SERVIDOR PÚBLICO EN EL AÑO INMEDIATO ANTERIOR?'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

if ($t9nombre_razon == null || $t9nombre_razon == '') {

$pdf->Cell(239,5,utf8_decode('SI'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode(''),1,1,'C',1);

} else {

$pdf->Cell(239,5,utf8_decode('NO'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode(''),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

// $pdf->Cell(229,5,utf8_decode(''),1,0,'L',1);

// $pdf->Cell(50,10,utf8_decode('$ '.$t9II),1,1,'C',0);

// $pdf->Ln(-5);

// $pdf->Cell(229,5,utf8_decode(''),1,1,'L',1);

$pdf->Cell(139.5,5,utf8_decode('FECHA DE INICIO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('FECHA DE CONCLUSIÓN'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t9fecha_inicio),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode($t9fecha_fin),1,1,'C',0);

$pdf->Cell(229,5,utf8_decode('INGRESOS NETOS, RECIBIDOS DURANTE EL TIEMPO EN EL QUE SE DESEMPEÑO COMO SERVIDOR PUBLICO EN EL AÑO INMEDIATO ANTERIOR'),1,0,'L',1);

$pdf->Cell(50,5,utf8_decode(formatMoney($t9ingresos_netos)),1,1,'C',0);

$pdf->Cell(229,5,utf8_decode('I.- REMUNERACIÓN NETA DEL DECLARANTE, RECIBIDA DURANTE EL TIEMPO EN EL QUE SE DESEMPEÑO COMO SERVIDOR PUBLICO EN EL AÑO'),1,0,'L',1);

$pdf->Cell(50,15,utf8_decode('$ '.$t9I),1,1,'C',0);

$pdf->Ln(-10);

$pdf->Cell(229,5,utf8_decode('INMEDIATO ANTERIOR (POR CONCEPTO DE SUELDOS, HONORARIOS, COMPENSACIONES, BONOS, AGUINALDOS Y OTRAS PRESTACIONES)'),1,1,'L',1);

$pdf->Cell(229,5,utf8_decode('(CANTIDADES NETAS DESPUÉS DE IMPUESTOS)'),1,1,'L',1);

$pdf->Cell(229,5,utf8_decode('II.- OTROS INGRESOS DEL DECLARANTE, RECIBIDOS DURANTE EL TIEMPO EN EL QUE SE DESEMPEÑO COMO SERVIDOR PUBLICO EN EL AÑO'),1,0,'L',1);

$pdf->Cell(50,10,utf8_decode(formatMoney($t9II)),1,1,'C',0);

$pdf->Ln(-5);

$pdf->Cell(229,5,utf8_decode('INMEDIATO ANTERIOR (SUMA DEL II.1 AL II.5'),1,1,'L',1);

$pdf->Cell(229,5,utf8_decode('II.1- POR ACTIVIDAD INDUSTRIAL, COMERCIAL Y / O EMPRESARIAL (DESPUES DE IMPUESTOS)'),1,0,'L',1);

$pdf->Cell(50,10,utf8_decode(formatMoney($t9II_1)),1,1,'C',0);

$pdf->Cell(199,5,utf8_decode('NOMBRE O RAZÓN SOCIAL'),1,0,'L',1);

$pdf->Cell(80,5,utf8_decode($t9nombre_razon),1,1,'L',0);

$pdf->Cell(199,5,utf8_decode('TIPO DE NEGOCIO'),1,0,'L',1);

$pdf->Cell(80,5,utf8_decode($t9tipo_negocio),1,1,'L',0);







$pdf->Cell(139.5,5,utf8_decode('II.2 POR ACTIVIDAD FINANCIERA (RENDIMIENTOS O GANANCIAS) (DESPUES DE IMPUESTOS)'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode(formatMoney($t9II_2)),1,1,'L',0);

$pdf->Cell(279,5,utf8_decode('TIPO DE INSTRUMENTO QUE GENERO EL RENDIMIENTO O GANANCIA'),1,1,'L',1);

$pdf->MultiCell(279,5,utf8_decode(''.$t9tipo_instrumento.' '.$t9otro_tipo_instru),1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('II.3- POR SERVICIOS PROFESIONALES, CONSEJOS, CONSULTORIAS Y / O ASESORIAS (DESPUES DE IMPUESTOS)'),1,'L',1);

$pdf->Cell(279,5,utf8_decode(formatMoney($t9II_3)),1,1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('II.4- POR ENAJENACIÓN DE BIENES (DESPUES DE IMPUESTOS)'),1,'L',1);

$pdf->Cell(279,5,utf8_decode(formatMoney($t9II_4)),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('TIPO DE BIEN ENAJENADO'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t9tipo_bien),1,1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('II.5- OTROS INGRESOS NO CONSIDERADOS A LOS ANTERIORES (DESPUES DE IMPUESTOS)'),1,'L',1);

$pdf->Cell(279,5,utf8_decode(formatMoney($t9II_5)),1,1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('ESPECIFICAR TIPO DE INGRESO (ARRENDAMIENTO, REGALIA, SORTEOS, CONCURSOS, DONACIONES, SEGUROS DE VIDA, ETC.)'),1,'L',1);

$pdf->Cell(279,5,utf8_decode($t9tipo_ingreso),1,1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('A.- INGRESO NETO DEL DECLARANTE, RECIBIDO EN EL AÑO INMEDIATO ANTERIOR (SUMA DEL NUMERAL I Y II)'),1,'L',1);

$pdf->Cell(279,5,utf8_decode(formatMoney($t9A)),1,1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('B.- INGRESO NETO DE LA PAREJA Y / O DEPENDIENTES ECONÓMICOS RECIBIDO EN EL AÑO INMEDIATO ANTERIOR (DESPUES DE IMPUESTOS)'),1,'L',1);

$pdf->Cell(279,5,utf8_decode(formatMoney($t9B)),1,1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('C.- TOTAL DE INGRESOS NETOS PERCIBIDOS POR EL DECLARANTE, PAREJA Y / O DEPENDIENTES ECONÓMICOS EN EL AÑO INMEDIATO ANTERIOR (SUMA DE LOS APARTADOS A Y B)'),1,'L',1);

$pdf->Cell(279,5,utf8_decode(formatMoney($t9C)),1,1,'L',0);

}

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t9observaciones),1,1,'L',0);



$pdf->WriteHTML('<br>');

}

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



    //CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_10_det

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' ORDER BY id_inmueble DESC LIMIT 5;";

                //AND habilitado = 1

    $rst10 = $conf->consulta($consulta);



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);



if($tipo== 1)

    $nuI='I-10.BIENES INMUEBLES (SITUACIÓN ACTUAL)';

if($tipo== 2)

    $nuI='I-9.BIENES INMUEBLES (ENTRE EL 01 DE ENERO Y 31 DE DICIEMBRE DEL AÑO INMEDIATO ANTERIOR)';

if($tipo== 3)

    $nuI='I-10.BIENES INMUEBLES (SITUACIÓN ACTUAL)';



$pdf->Cell(239,5,utf8_decode($nuI),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->MultiCell(279,5,utf8_decode('TODOS LOS DATOS DE BIENES DECLARADOS A NOMBRE DE LA PAREJA, DEPENDIENTES ECONÓMICOS Y/O TERCEROS O QUE SEA EN COPROPIEDAD CON EL DECLARANTE NO SERAN PÚBLICOS'),1,'L',1);



//OMITIR TITULAR PÚBLICO



$i=0;

while ($i < 6) {

    //VARIABLES DE CONSULTA

    $t10tipo_inmueble                   =   $rst10[$i]['tipo_inmueble'];

    $t10otro_tipo                   =   $rst10[$i]['otro_tipo'];

    $t10titular_inmueble                    =   $rst10[$i]['titular_inmueble'];

    $t10porcentaje_propiedad_declarante                     =   $rst10[$i]['porcentaje_propiedad_declarante'];

    $t10superficie_terreno                  =   $rst10[$i]['superficie_terreno'];

    $t10superficie_construccion                     =   $rst10[$i]['superficie_construccion'];

    $t10forma_adquisicion                   =   $rst10[$i]['forma_adquisicion'];

    $t10forma_pago                  =   $rst10[$i]['forma_pago'];

    $t10tipo_transmisor                     =   $rst10[$i]['tipo_transmisor'];

    $t10rfc_transmisor                  =   $rst10[$i]['rfc_transmisor'];

    $t10nombre_transmisor                   =   $rst10[$i]['nombre_transmisor'];

    $t10relacion_transmisor                     =   $rst10[$i]['relacion_transmisor'];

    $t10otra_relacion                   =   $rst10[$i]['otra_relacion'];

    $t10valor_adquisicion                   =   $rst10[$i]['valor_adquisicion'];

    $t10tipo_moneda                     =   $rst10[$i]['tipo_moneda'];

    $t10fecha_adquisicion                   =   $rst10[$i]['fecha_adquisicion'];

    $t10datos_identificacion                    =   $rst10[$i]['datos_identificacion'];

    $t10adquisicion_conforme                    =   $rst10[$i]['adquisicion_conforme'];

    $t10ubicacion_inmueble                  =   $rst10[$i]['ubicacion_inmueble'];

    $t10calle                   =   $rst10[$i]['calle'];

    $t10numero_interior                     =   $rst10[$i]['numero_interior'];

    $t10numero_exterior                     =   $rst10[$i]['numero_exterior'];

    $t10codigo_postal                   =   $rst10[$i]['codigo_postal'];

    $t10colonia_localidad                   =   $rst10[$i]['colonia_localidad'];

    $t10municipio_alcaldia                  =   $rst10[$i]['municipio_alcaldia'];

    $t10entidad_federativa                  =   $rst10[$i]['entidad_federativa'];

    $t10estado_provincia                    =   $rst10[$i]['estado_provincia'];

    $t10pais                    =   $rst10[$i]['pais'];

    $t10observaciones                   =   $rst10[$i]['observaciones'];

    $t10id_declaracion                  =   $rst10[$i]['id_declaracion'];

    $t10id_inmueble                     =   $rst10[$i]['id_inmueble'];

    $t10ciudad_localidad_ext                    =   $rst10[$i]['ciudad_localidad_ext'];

    $t10calle_ext                   =   $rst10[$i]['calle_ext'];

    $t10numero_interior_ext                     =   $rst10[$i]['numero_interior_ext'];

    $t10numero_exterior_ext                     =   $rst10[$i]['numero_exterior_ext'];

    $t10codigo_postal_ext                   =   $rst10[$i]['codigo_postal_ext'];

    $t10baja                    =   $rst10[$i]['baja'];

    $t10baja_otro                   =   $rst10[$i]['baja_otro'];



    if($t10fecha_adquisicion=='1900-01-01'){$t10fecha_adquisicion='0000-00-00';}



// NO IMPRIMIR O DEFINIR NO HAY

if ($t10nombre_transmisor == null || $t10nombre_transmisor == '') {

    /*if ($t1fdatos_publicos == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('EL DECLARANTE NO DESEA HACER PÚBLICOS SUS DATOS PATRIMONIALES.'),1,1,'L',0);

        $i=12;

    } else*/if ($i == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

        $i=12;

    } else {

        //NO IMPRIMIR

    }

} else {

    //IMPRIMIR

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(279,5,utf8_decode('BIENES DEL DECLARANTE, PAREJA Y / O DEPENDIENTES ECONÓMICOS'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



//CONSULTA RELACION TITULAR

    $consulta5 = "SELECT * FROM contraloria_declaracion_titular

                WHERE id_titular = '$t10titular_inmueble';";

    $rst10rr = $conf->consulta($consulta5);



    $t10rrelacion = $rst10rr[0]['titular'];



// $pdf->MultiCell(189,5,utf8_decode('BIENES DEL DECLARANTE, PAREJA Y / O DEPENDIENTES ECONÓMICOS'),1,'L',1);

$pdf->Cell(139.5,5,utf8_decode('TIPO DE INMUEBLE'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('TITULAR DEL INMUEBLE:'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t10tipo_inmueble.' '.$t10otro_tipo),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode($t10rrelacion),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('PORCENTAJE DE PROPIEDAD DEL DECLARANTE CONFORME A ESCRITURACIÓN O CONTRATO'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('SUPERFICIE DEL TERRENO'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('SUPERFICIE DE CONSTRUCCIÓN'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t10porcentaje_propiedad_declarante),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t10superficie_terreno),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t10superficie_construccion),1,1,'C',0);



    //CONSULTA

    $consulta2 = "SELECT * FROM contraloria_declaracion_tab_10_terceros

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' AND id_inmueble = '$t10id_inmueble' ORDER BY id_inmueble_ter DESC LIMIT 1;";

                // AND id_inmueble_ter = '$t10id_inmueble'

                //AND habilitado = 1

                $rst10t = $conf->consulta($consulta2);



//TERCERO

$j=0;

$pdf->Cell(69.75,5,utf8_decode('TERCERO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('NOMBRE DEL TERCERO O TERCEROS'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('RFC'),1,1,'C',1);

// while ($j < 11) {

    //VARIABLES TERCERO

    $t10tid_declaracion                     =   $rst10t[0]['id_declaracion'];

    $t10tid_inmueble_ter                    =   $rst10t[0]['id_inmueble_ter'];

    $t10trfc_tercero                    =   $rst10t[0]['rfc_tercero'];

    $t10tnombre_tercero                     =   $rst10t[0]['nombre_tercero'];

    $t10ttipo_tercero                   =   $rst10t[0]['tipo_tercero'];



if ($t10tnombre_tercero == null || $t10tnombre_tercero == '') {

    // NO IMPRIMIR O DEFINIR NO HAY

    if ($j == 0) {

        //NO TERCEROS POR REPORTAR

        $pdf->SetTextColor(0,0,0);

        $pdf->SetFillColor(122,215,163);

        $pdf->Cell(279,5,utf8_decode('SIN TERCEROS POR REPORTAR'),1,1,'C',0);

        $j=12;

    } else {

        // NO IMPRIMIR TERCERO

    }

} else {

    // IMPRIMIR

    $pdf->Cell(69.75,5,utf8_decode($t10ttipo_tercero),1,0,'C',0);

    $pdf->Cell(139.5,5,utf8_decode($t10tnombre_tercero),1,0,'C',0);

    $pdf->Cell(69.75,5,utf8_decode($t10trfc_tercero),1,1,'C',0);

    }

$j++;

// }



//IMPRIMIR 2

$pdf->Cell(93,5,utf8_decode('FORMA DE ADQUISICIÓN'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('FORMA DE PAGO'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('TRANSMISOR'),1,1,'C',1);

$pdf->Cell(93,5,utf8_decode($t10forma_adquisicion),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode($t10forma_pago),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode($t10tipo_transmisor),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('NOMBRE O RAZÓN SOCIAL DEL TRANSMISOR DE LA PROPIEDAD'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('RFC'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t10nombre_transmisor),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode($t10rfc_transmisor),1,1,'C',0);



    //CONSULTA RELACION

    $consulta4 = "SELECT * FROM contraloria_declaracion_relacion

                WHERE id_relacion = '$t10relacion_transmisor';";

    $rst10r = $conf->consulta($consulta4);



    $t10rrelacion = $rst10r[0]['relacion'];



$pdf->Cell(139.5,5,utf8_decode('RELACIÓN DEL TRANSMISOR DE LA PROPIEDAD CON EL TITULAR'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('VALOR DE ADQUISICIÓN'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('TIPO DE MONEDA'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t10rrelacion.' '.$t10otra_relacion),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode(formatMoney($t10valor_adquisicion)),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t10tipo_moneda),1,1,'C',0);

$pdf->Cell(69.75,5,utf8_decode('FECHA DE ADQUISICIÓN DEL INMUEBLE'),1,0,'C',1);

$pdf->MultiCell(209.25,5,utf8_decode('DATOS DEL REGISTRO PÚBLICO DE LA PROPIEDAD FOLIO REAL U OTRO DATO QUE PERMITA SU IDENTIFICACIÓN'),1,'L',1);

$pdf->Cell(69.75,5,utf8_decode($t10datos_identificacion),1,0,'C',0);

$pdf->Cell(209.25,5,utf8_decode($t10fecha_adquisicion),1,1,'C',0);

$pdf->MultiCell(279,5,utf8_decode('¿EL VALOR DE ADQUISICIÓN DEL INMUEBLE ES CONFORME A?

    '.$t10adquisicion_conforme),1,'C',0);

$pdf->Cell(279,5,utf8_decode('UBICACIÓN DEL INMUEBLE'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('MÉXICO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('EN EL EXTRANJERO'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('CALLE - NÚMERO EXTERIOR - NÚMERO INTERIOR'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('CALLE - NÚMERO EXTERIOR - NÚMERO INTERIOR'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t10calle.' - '.$t10numero_exterior.' - '.$t10numero_interior),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode($t10calle_ext.' - '.$t10numero_exterior_ext.' - '.$t10numero_interior_ext),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->Cell(139.5,5,utf8_decode('COLONIA/LOCALIDAD - MUNICIPIO/ALCALDÍA - ENTIDAD FEDERATIVA'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('COLONIA/LOCALIDAD - ESTADO/PROVINCIA'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode(''.$t10colonia_localidad.' - '.$t10municipio_alcaldia.' - '.$t10entidad_federativa),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode(''.$t10ciudad_localidad_ext.' - '.$t10estado_provincia),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->Cell(139.5,5,utf8_decode('CODIGO POSTAL'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('PAÍS - CODIGO POSTAL'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t10codigo_postal),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode($t10pais.' - '.$t10codigo_postal_ext),1,1,'C',0);

$pdf->Cell(79,5,utf8_decode('EN CASO DE BAJA INDICAR MOTIVO'),1,0,'L',1);

$pdf->Cell(200,5,utf8_decode($t10baja.' '.$t10baja_otro),1,1,'L',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

if ($t1fdatos_publicos == 0) {

    $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

    $pdf->Cell(229,5,utf8_decode('EL DECLARANTE NO DESEA HACER PÚBLICOS SUS DATOS PATRIMONIALES.'),1,1,'L',0);

} else {

    $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

    $pdf->Cell(229,5,utf8_decode($t10observaciones),1,1,'L',0);

}

    }

$i++;

}



$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



    //CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_11_det

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' ORDER BY id_vehiculo DESC LIMIT 5;";

                //AND habilitado = 1

    $rst11 = $conf->consulta($consulta);



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

if($tipo== 1)

    $nuI='I-11. VEHÍCULOS (SITUACIÓN ACTUAL)';

if($tipo== 2)

    $nuI='I-10. VEHÍCULOS (ENTRE EL 1 DE ENERO Y EL 31 DE DICIEMBRE DEL AÑO ANTERIOR)';

if($tipo== 3)

    $nuI='I-11. VEHÍCULOS (SITUACIÓN ACTUAL)';

    

$pdf->Cell(239,5,utf8_decode($nuI),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->MultiCell(279,5,utf8_decode('TODOS LOS DATOS DE VEHÍCULOS DECLARADOS A NOMBRE DE LA PAREJA, DEPENDIENTES ECONÓMICOS Y/O TERCEROS O QUE SEA EN COPROPIEDAD CON EL DECLARANTE NO SERAN PÚBLICOS'),1,'L',1);



$i=0;

while ($i < 6) {



    //VARIABLES DE CONSULTA

    $t11baja_otro                   =   $rst11[$i]['baja_otro'];

    $t11baja                    =   $rst11[$i]['baja'];

    $t11lugar_registrado                    =   $rst11[$i]['lugar_registrado'];

    $t11observaciones_adquisicion                   =   $rst11[$i]['observaciones_adquisicion'];

    $t11fecha_adquisicion                   =   $rst11[$i]['fecha_adquisicion'];

    $t11tipo_moneda                     =   $rst11[$i]['tipo_moneda'];

    $t11valor_adquisicion                   =   $rst11[$i]['valor_adquisicion'];

    $t11forma_pago                  =   $rst11[$i]['forma_pago'];

    $t11forma_adquisicion                   =   $rst11[$i]['forma_adquisicion'];

    $t11pais                    =   $rst11[$i]['pais'];

    $t11entidad_federativa                  =   $rst11[$i]['entidad_federativa'];

    $t11no_serie                    =   $rst11[$i]['no_serie'];

    $t11ano                     =   $rst11[$i]['ano'];

    $t11modelo                  =   $rst11[$i]['modelo'];

    $t11marca                   =   $rst11[$i]['marca'];

    $t11otra_relacion                   =   $rst11[$i]['otra_relacion'];

    $t11relacion_transmisor                     =   $rst11[$i]['relacion_transmisor'];

    $t11rfc_transmisor                  =   $rst11[$i]['rfc_transmisor'];

    $t11nombre_transmisor                   =   $rst11[$i]['nombre_transmisor'];

    $t11tipo_transmisor                     =   $rst11[$i]['tipo_transmisor'];

    $t11titular_vehiculo                    =   $rst11[$i]['titular_vehiculo'];

    $t11otro_tipo                   =   $rst11[$i]['otro_tipo'];

    $t11tipo_vehiculo                   =   $rst11[$i]['tipo_vehiculo'];

    $t11id_vehiculo                     =   $rst11[$i]['id_vehiculo'];

    $t11id_declaracion                  =   $rst11[$i]['id_declaracion'];



    if($t11fecha_adquisicion=='1900-01-01'){$t11fecha_adquisicion='0000-00-00';}



// NO IMPRIMIR O DEFINIR NO HAY

if ($t11nombre_transmisor == null || $t11nombre_transmisor == '') {

    /*if ($t1fdatos_publicos == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('EL DECLARANTE NO DESEA HACER PÚBLICOS SUS DATOS PATRIMONIALES.'),1,1,'L',0);

        $i=12;

    } else*/if ($i == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

        $i=12;

    } else {

        //NO IMPRIMIR

    }

} else {

//IMPRIMIR

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(279,5,utf8_decode('VEHÍCULOS DEL DECLARANTE, PAREJA, Y / O DEPENDIENTES ECONÓMICOS'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



// $pdf->Cell(189,5,utf8_decode('VEHICULOS DEL DECLARANTE, PAREJA, Y / O DEPENDIENTES ECONÓMICOS'),1,1,'L',1);

$pdf->Cell(69.75,5,utf8_decode('TIPO DE VEHICULO'),1,0,'C',1);

$pdf->Cell(209.25,5,utf8_decode(''.$t11tipo_vehiculo.' '.$t11otro_tipo),1,1,'C',0);



    //CONSULTA RELACION TITULAR

    $consulta5 = "SELECT * FROM contraloria_declaracion_titular

                WHERE id_titular = '$t11titular_vehiculo';";

    $rst11rr = $conf->consulta($consulta5);



    $t11rrelacion = $rst11rr[0]['titular'];



    $pdf->Cell(69.75,5,utf8_decode('TITULAR DEL VEHÍCULO'),1,0,'C',1);

    $pdf->Cell(209.25,5,utf8_decode(''.$t11rrelacion),1,1,'C',0);



    //CONSULTA

    $consulta2 = "SELECT * FROM contraloria_declaracion_tab_11_terceros

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' AND id_vehiculo = '$t11id_vehiculo' ORDER BY id_vehiculo_ter DESC LIMIT 1;";

                // AND id_vehiculo_ter = '$t11id_vehiculo'

                //AND habilitado = 1

                $rst11t = $conf->consulta($consulta2);

//TERCERO

$j=0;

$pdf->Cell(69.75,5,utf8_decode('TERCERO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('NOMBRE DEL TERCERO O TERCEROS'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('RFC'),1,1,'C',1);

// while ($j < 11) {

    //VARIABLES TERCERO

    $t11tid_declaracion                     =   $rst11t[0]['id_declaracion'];

    $t11tid_vehiculo_ter                    =   $rst11t[0]['id_vehiculo_ter'];

    $t11trfc_tercero                    =   $rst11t[0]['rfc_tercero'];

    $t11tnombre_tercero                     =   $rst11t[0]['nombre_tercero'];

    $t11ttipo_tercero                   =   $rst11t[0]['tipo_tercero'];





if ($t11tnombre_tercero == null || $t11tnombre_tercero == '') {

    // NO IMPRIMIR O DEFINIR NO HAY

    if ($j == 0) {

        //NO TERCEROS POR REPORTAR

        $pdf->SetTextColor(0,0,0);

        $pdf->SetFillColor(122,215,163);

        $pdf->Cell(279,5,utf8_decode('SIN TERCEROS POR REPORTAR'),1,1,'C',0);

        $j=12;

    } else {

        // NO IMPRIMIR TERCERO

    }

} else {

    // IMPRIMIR

    $pdf->Cell(69.75,5,utf8_decode($t11ttipo_tercero),1,0,'C',0);

    $pdf->Cell(139.5,5,utf8_decode($t11tnombre_tercero),1,0,'C',0);

    $pdf->Cell(69.75,5,utf8_decode($t11trfc_tercero),1,1,'C',0);

    }

$j++;

// }

    //CONSULTA RELACION

    $consulta4 = "SELECT * FROM contraloria_declaracion_relacion

                WHERE id_relacion = '$t11relacion_transmisor';";

    $rst11r = $conf->consulta($consulta4);



    $t11rrelacion = $rst11r[0]['relacion'];



//IMPRIMIR 2

$pdf->Cell(93,5,utf8_decode('RELACIÓN DEL TRANSMISOR DE LA PROPIEDAD CON EL TITULAR'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode('TRANSMISOR'),1,0,'C',1);

$pdf->Cell(76.25,5,utf8_decode('NOMBRE DEL TERCERO O TERCEROS'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('RFC'),1,1,'C',1);

$pdf->Cell(93,5,utf8_decode(''.$t11rrelacion.' '.$t11otra_relacion),1,0,'C',0);

$pdf->Cell(40,5,utf8_decode(''.$t11tipo_transmisor),1,0,'C',0);

$pdf->Cell(76.25,5,utf8_decode($t11nombre_transmisor),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t11rfc_transmisor),1,1,'C',0);

$pdf->Cell(69.75,5,utf8_decode('MARCA'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('MODELO'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('AÑO'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('NÚMERO DE SERIE O REGISTRO'),1,1,'C',1);

$pdf->Cell(69.75,5,utf8_decode($t11marca),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t11modelo),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t11ano),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t11no_serie),1,1,'C',0);

$pdf->MultiCell(279,5,utf8_decode('¿DONDE SE ENCUENTRA REGISTRADO?'),1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('EN MÉXICO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('EN EL EXTRANJERO'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('ENTIDAD FEDERATIVA'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('PAIS'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t11entidad_federativa.''),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode($t11pais),1,1,'C',0);

$pdf->Cell(40,5,utf8_decode('FORMA DE ADQUISICIÓN'),1,0,'C',1);

$pdf->Cell(40,5,utf8_decode('FORMA DE PAGO'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('VALOR DE ADQUISICIÓN DEL VEHÍCULO'),1,0,'C',1);

$pdf->Cell(59.5,5,utf8_decode('TIPO DE MONEDA'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('FECHA DE ADQUISICIÓN DEL VEHÍCULO'),1,1,'C',1);

$pdf->Cell(40,5,utf8_decode($t11forma_adquisicion),1,0,'C',0);

$pdf->Cell(40,5,utf8_decode($t11forma_pago),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode(formatMoney($t11valor_adquisicion)),1,0,'C',0);

$pdf->Cell(59.5,5,utf8_decode($t11tipo_moneda),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t11fecha_adquisicion),1,1,'C',0);

$pdf->Cell(69.75,5,utf8_decode('EN CASO DE BAJA INDICAR MOTIVO'),1,0,'L',1);

$pdf->Cell(209.25,5,utf8_decode($t11baja.' '.$t11baja_otro),1,1,'L',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

if ($t1fdatos_publicos == 0) {

    $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

    $pdf->Cell(229,5,utf8_decode('EL DECLARANTE NO DESEA HACER PÚBLICOS SUS DATOS PATRIMONIALES.'),1,1,'L',0);

} else {

    $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

    $pdf->Cell(229,5,utf8_decode($t11observaciones),1,1,'L',0);

}

    }

$i++;

}



$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



//CONSULTA

if($tipo== 1)

    $nuI='I-12.BIENES MUEBLES (SITUACIÓN ACTUAL)';

if($tipo== 2)

    $nuI='I-11.BIENES MUEBLES (ENTRE EL 1 DE ENERO Y EL 31 DE DICIEMBRE DEL AÑO ANTERIOR)';

if($tipo== 3)

    $nuI='I-12.BIENES MUEBLES (SITUACIÓN ACTUAL)';

    

    $consulta = "SELECT * FROM contraloria_declaracion_tab_12_det

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' ORDER BY id_mueble DESC LIMIT 5;";

                //AND habilitado = 1

    $rst12 = $conf->consulta($consulta);



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(239,5,utf8_decode($nuI),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->MultiCell(279,5,utf8_decode('TODOS LOS DATOS DE LOS BIENES DECLARADOS A NOMBRE DE LA PAREJA, DEPENDIENTES ECONÓMICOS Y/O TERCEROS O QUE SEA EN COPROPIEDAD CON EL DECLARANTE NO SERAN PÚBLICOS'),1,'L',1);



$i=0;

while ($i < 6) {



    //VARIABLES DE CONSULTA

    $t12id_declaracion                  =   $rst12[$i]['id_declaracion'];

    $t12id_mueble                   =   $rst12[$i]['id_mueble'];

    $t12tipo_mueble                     =   $rst12[$i]['tipo_mueble'];

    $t12otro_tipo                   =   $rst12[$i]['otro_tipo'];

    $t12titular_mueble                  =   $rst12[$i]['titular_mueble'];

    $t12tipo_transmisor                     =   $rst12[$i]['tipo_transmisor'];

    $t12transmisor                  =   $rst12[$i]['transmisor'];

    $t12rfc_transmisor                  =   $rst12[$i]['rfc_transmisor'];

    $t12relacion_transmisor                     =   $rst12[$i]['relacion_transmisor'];

    $t12otra_relacion                   =   $rst12[$i]['otra_relacion'];

    $t12mueble_descripcion                  =   $rst12[$i]['mueble_descripcion'];

    $t12forma_adquisicion                   =   $rst12[$i]['forma_adquisicion'];

    $t12forma_pago                  =   $rst12[$i]['forma_pago'];

    $t12valor_adquisicion                   =   $rst12[$i]['valor_adquisicion'];

    $t12tipo_moneda                     =   $rst12[$i]['tipo_moneda'];

    $t12fecha_adquisicion                   =   $rst12[$i]['fecha_adquisicion'];

    $t12observaciones                   =   $rst12[$i]['observaciones'];

    $t12baja                    =   $rst12[$i]['baja'];

    $t12baja_otro                   =   $rst12[$i]['baja_otro'];



    if($t12fecha_adquisicion=='1900-01-01'){$t12fecha_adquisicion='0000-00-00';}



// NO IMPRIMIR O DEFINIR NO HAY

if ($t12transmisor == null || $t12transmisor == '') {

    /*if ($t1fdatos_publicos == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('EL DECLARANTE NO DESEA HACER PÚBLICOS SUS DATOS PATRIMONIALES.'),1,1,'L',0);

        $i=12;

    } else*/if ($i == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

        $i=12;

    } else {

        //NO IMPRIMIR

    }

} else {

    //IMPRIMIR

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(279,5,utf8_decode('BIENES DEL DECLARANTE, PAREJA, Y / O DEPENDIENTES ECONÓMICOS'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



// $pdf->Cell(189,5,utf8_decode('BIENES DEL DECLARANTE, PAREJA, Y / O DEPENDIENTES ECONÓMICOS'),1,1,'L',1);

$pdf->MultiCell(279,5,utf8_decode('TIPO DE BIEN

    '.$t12tipo_mueble.' '.$t12otro_tipo),1,'L',0);



    //CONSULTA RELACION TITULAR

    $consulta5 = "SELECT * FROM contraloria_declaracion_titular

                WHERE id_titular = '$t12titular_mueble';";

    $rst12rr = $conf->consulta($consulta5);



    $t12rrelacion = $rst12rr[0]['titular'];



$pdf->MultiCell(279,5,utf8_decode('TITULAR DEL BIEN:

    '.$t12rrelacion),1,'L',0);



    //CONSULTA

    $consulta2 = "SELECT * FROM contraloria_declaracion_tab_12_terceros

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' AND id_mueble = '$t12id_mueble' ORDER BY id_mueble_ter DESC LIMIT 1;";

                // AND id_mueble_ter = '$t12id_mueble'

                //AND habilitado = 1

                $rst12t = $conf->consulta($consulta2);

                

//TERCERO

$j=0;

$pdf->Cell(69.75,5,utf8_decode('TERCERO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('NOMBRE DEL TERCERO O TERCEROS'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('RFC'),1,1,'C',1);

// while ($j < 11) {

    //VARIABLES TERCERO

    $t12tid_declaracion                     =   $rst12t[0]['id_declaracion'];

    $t12tid_mueble_ter                  =   $rst12t[0]['id_mueble_ter'];

    $t12trfc_tercero                    =   $rst12t[0]['rfc_tercero'];

    $t12tnombre_tercero                     =   $rst12t[0]['nombre_tercero'];

    $t12ttipo_tercero                   =   $rst12t[0]['tipo_tercero'];



if ($t12tnombre_tercero == null || $t12tnombre_tercero == '') {

    // NO IMPRIMIR O DEFINIR NO HAY

    if ($j == 0) {

        //NO TERCEROS POR REPORTAR

        $pdf->SetTextColor(0,0,0);

        $pdf->SetFillColor(122,215,163);

        $pdf->Cell(279,5,utf8_decode('SIN TERCEROS POR REPORTAR'),1,1,'C',0);

        $j=12;

    } else {

        // NO IMPRIMIR TERCERO

    }

} else {

    // IMPRIMIR

    $pdf->Cell(69.75,5,utf8_decode($t12ttipo_tercero),1,0,'C',0);

    $pdf->Cell(139.5,5,utf8_decode($t12tnombre_tercero),1,0,'C',0);

    $pdf->Cell(69.75,5,utf8_decode($t12trfc_tercero),1,1,'C',0);

    }

$j++;

// }

    //CONSULTA RELACION

    $consulta4 = "SELECT * FROM contraloria_declaracion_relacion

                WHERE id_relacion = '$t12relacion_transmisor';";

    $rst12r = $conf->consulta($consulta4);



    $t12rrelacion = $rst12r[0]['relacion'];



//IMPRIMIR 2

$pdf->MultiCell(279,5,utf8_decode('RELACION DEL TRANSMISOR DE LA PROPIEDAD CON EL TITULAR

    '.$t12rrelacion.' '.$t12otra_relacion),1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('TRANSMISOR'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode(''.$t12tipo_transmisor),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('NOMBRE DEL TERCERO O TERCEROS'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t12transmisor),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('RFC'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t12rfc_transmisor),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('DESCRIPCION GENERAL DEL BIEN'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t12mueble_descripcion),1,1,'C',0);

$pdf->MultiCell(279,5,utf8_decode('FORMA DE ADQUISICIÓN

    '.$t12forma_adquisicion),1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('FORMA DE PAGO               '.$t12forma_pago),1,'L',0);

$pdf->Cell(69.75,5,utf8_decode('VALOR DE ADQUISICIÓN DEL MUEBLE'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode(formatMoney($t12valor_adquisicion)),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode('TIPO DE MONEDA'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode($t12tipo_moneda),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('FECHA DE ADQUISICIÓN'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t12fecha_adquisicion),1,1,'C',0);

$pdf->MultiCell(279,5,utf8_decode('EN CASO DE BAJA DEL MUEBLE INCLUIR MOTIVO               '.$t12baja.' '.$t12baja_otro),1,'L',0);

$pdf->Cell(79,5,utf8_decode('EN CASO DE BAJA INDICAR MOTIVO'),1,0,'L',1);

$pdf->Cell(200,5,utf8_decode($t12baja.' '.$t12baja_otro),1,1,'L',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

if ($t1fdatos_publicos == 0) {

    $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

    $pdf->Cell(229,5,utf8_decode('EL DECLARANTE NO DESEA HACER PÚBLICOS SUS DATOS PATRIMONIALES.'),1,1,'L',0);

} else {

    $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

    $pdf->Cell(229,5,utf8_decode($t12observaciones),1,1,'L',0);

}

    }

$i++;

}



$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



//CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_13_det

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' ORDER BY id_inversion DESC LIMIT 5;";

                //AND habilitado = 1

    $rst13 = $conf->consulta($consulta);



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);



if($tipo== 1)

    $nuI='I-13. INVERSIÓN, CUENTAS BANCARIAS Y OTROS VALORES/ACTIVOS (SITUACIÓN ACTUAL)';

if($tipo== 2)

    $nuI='I-12. INVERSIÓN, CUENTAS BANCARIAS Y OTROS VALORES/ACTIVOS (ENTRE EL 1 DE ENERO Y EL 31 DE DICIEMBRE DEL AÑO ANTERIOR)';

if($tipo== 3)

    $nuI='I-13. INVERSIÓN, CUENTAS BANCARIAS Y OTROS VALORES/ACTIVOS (SITUACIÓN ACTUAL)';

    

    

$pdf->Cell(239,5,utf8_decode($nuI),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->MultiCell(279,5,utf8_decode('TODOS LOS DATOS DE LAS INVERSIONES, CUENTAS BANCARIAS Y OTRO TIPO DE VALORES / ACTIVOS A NOMBRE DE LA PAREJA, DEPENDIENTES ECONÓMICOS Y/O TERCEROS O QUE SEA EN COPROPIEDAD CON EL DECLARANTE NO SERÁN PÚBLICOS'),1,'L',1);



$i=0;

while ($i < 6) {



    //VARIABLES DE CONSULTA

    $t13observaciones                   =   $rst13[$i]['observaciones'];

    $t13tipo_moneda                     =   $rst13[$i]['tipo_moneda'];

    $t13saldo_actual                    =   $rst13[$i]['saldo_actual'];

    $t13pais                    =   $rst13[$i]['pais'];

    $t13razon_social_rfc                    =   $rst13[$i]['razon_social_rfc'];

    $t13razon_social                    =   $rst13[$i]['razon_social'];

    $t13razon_social_loc                    =   $rst13[$i]['razon_social_loc'];

    $t13no_cuenta_poliza                    =   $rst13[$i]['no_cuenta_poliza'];

    $t13afores_otros                    =   $rst13[$i]['afores_otros'];

    $t13valor_bursatil                  =   $rst13[$i]['valor_bursatil'];

    $t13seguro                  =   $rst13[$i]['seguro'];

    $t13posesion_modena_metal                   =   $rst13[$i]['posesion_modena_metal'];

    $t13org_privado_mercantil                   =   $rst13[$i]['org_privado_mercantil'];

    $t13fondos_inversion                    =   $rst13[$i]['fondos_inversion'];

    $t13tipo_bancaria                   =   $rst13[$i]['tipo_bancaria'];

    $t13titular_inversion                   =   $rst13[$i]['titular_inversion'];

    $t13otro_tipo                   =   $rst13[$i]['otro_tipo'];

    $t13tipo_inversion                  =   $rst13[$i]['tipo_inversion'];

    $t13id_inversion                    =   $rst13[$i]['id_inversion'];

    $t13id_declaracion                  =   $rst13[$i]['id_declaracion'];



// NO IMPRIMIR O DEFINIR NO HAY

if ($t13saldo_actual == null || $t13saldo_actual == '') {

    /*if ($t1fdatos_publicos == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('EL DECLARANTE NO DESEA HACER PÚBLICOS SUS DATOS PATRIMONIALES.'),1,1,'L',0);

        $i=12;

    } else*/if ($i == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

        $i=12;

    } else {

        //NO IMPRIMIR

    }

} else {

    //IMPRIMIR

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(279,5,utf8_decode('INVERSIONES, CUENTAS BANCARIAS Y OTRO TIPO DE VALORES DEL DECLARANTE, PAREJA, Y / O DEPENDIENTES ECONÓMICOS'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



// $pdf->Cell(189,5,utf8_decode('INVERSIONES, CUENTAS BANCARIAS Y OTRO TIPO DE VALORES DEL DECLARANTE, PAREJA, Y / O DEPENDIENTES ECONOMICOS'),1,1,'L',1);

$pdf->MultiCell(279,5,utf8_decode('TIPO DE INVERSIÓN / ACTIVO

    '.$t13tipo_inversion.' '.$t13otro_tipo),1,'L',0);



    //CONSULTA RELACION TITULAR

    $consulta5 = "SELECT * FROM contraloria_declaracion_titular

                WHERE id_titular = '$t13titular_inversion';";

    $rst13rr = $conf->consulta($consulta5);



    $t13rrelacion = $rst13rr[0]['titular'];



$pdf->MultiCell(279,5,utf8_decode('TITULAR DE LA INVERSIÓN, CUENTA BANCARIA Y OTRO TIPO DE VALORES:

    '.$t13rrelacion),1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('BANCARIA

    '.$t13tipo_bancaria),1,'L',0);



    //CONSULTA

    $consulta2 = "SELECT * FROM contraloria_declaracion_tab_13_terceros

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' AND id_inversion = '$t13id_inversion' ORDER BY id_inversion_ter DESC LIMIT 1;";

                // AND id_inversion_ter = '$t13id_inversion'

                //AND habilitado = 1

                $rst13t = $conf->consulta($consulta2);



//TERCERO

$j=0;

$pdf->Cell(69.75,5,utf8_decode('TERCERO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('NOMBRE DEL TERCERO O TERCEROS'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('RFC'),1,1,'C',1);

// while ($j < 11) {

    //VARIABLES TERCERO

    $t13tid_declaracion                     =   $rst13t[0]['id_declaracion'];

    $t13tid_inversion_ter                   =   $rst13t[0]['id_inversion_ter'];

    $t13trfc_tercero                    =   $rst13t[0]['rfc_tercero'];

    $t13tnombre_tercero                     =   $rst13t[0]['nombre_tercero'];

    $t13ttipo_tercero                   =   $rst13t[0]['tipo_tercero'];





if ($t13tnombre_tercero == null || $t13tnombre_tercero == '') {

    // NO IMPRIMIR O DEFINIR NO HAY

    if ($j == 0) {

        //NO TERCEROS POR REPORTAR

        $pdf->SetTextColor(0,0,0);

        $pdf->SetFillColor(122,215,163);

        $pdf->Cell(279,5,utf8_decode('SIN TERCEROS POR REPORTAR'),1,1,'C',0);

        $j=13;

    } else {

        // NO IMPRIMIR TERCERO

    }

} else {

    // IMPRIMIR

    $pdf->Cell(69.75,5,utf8_decode($t13ttipo_tercero),1,0,'C',0);

    $pdf->Cell(139.5,5,utf8_decode($t13tnombre_tercero),1,0,'C',0);

    $pdf->Cell(69.75,5,utf8_decode($t13trfc_tercero),1,1,'C',0);

    }

$j++;

// }

//IMPRIMIR 2

$pdf->MultiCell(279,5,utf8_decode('FONDOS DE INVERSIÓN

    '.$t13fondos_inversion),1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('ORGANIZACIONES PRIVADAS Y/O MERCANTILES

    '.$t13org_privado_mercantil),1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('POSESIÓN DE MONEDAS Y/O METALES

    '.$t13posesion_modena_metal),1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('SEGUROS

    '.$t13seguro),1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('VALORES BURSATILES

    '.$t13valor_bursatil),1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('AFORES Y OTROS

    '.$t13afores_otros),1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('NUMERO DE CUENTA, CONTRATO O POLIZA'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t13no_cuenta_poliza),1,1,'C',0);

$pdf->Cell(279,5,utf8_decode('¿DONDE SE LOCALIZA LA INVERSION, CUENTA BANCARIA Y OTRO TIPO DE VALORES / ACTIVOS?'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('EN MÉXICO'),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode('EN EL EXTRANJERO'),1,1,'C',0);

$pdf->Cell(69.75,5,utf8_decode('INSTITUCIÓN O RAZÓN SOCIAL'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('RFC'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('INSTITUCIÓN O RAZÓN SOCIAL'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('RFC'),1,1,'C',1);

$pdf->Cell(69.75,5,utf8_decode($t13razon_social),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t13razon_social_rfc),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t13razon_social),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode($t13razon_social_rfc),1,1,'C',0);

if($tipo== 1)

    $saldook='SALDO A LA FECHA (SITUACIÓN ACTUAL)';

if($tipo== 2)

    $saldook='SALDO A AL 31 DE DICIEMBRE DEL AÑO ANTERIOR';

if($tipo== 3)

    $saldook='SALDO A LA FECHA (SITUACIÓN ACTUAL)';

    



$pdf->Cell(139.5,5,utf8_decode($saldook),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('TIPO DE MONEDA'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode(formatMoney($t13saldo_actual)),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode($t13tipo_moneda),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

if ($t1fdatos_publicos == 0) {

    $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

    $pdf->Cell(229,5,utf8_decode('EL DECLARANTE NO DESEA HACER PÚBLICOS SUS DATOS PATRIMONIALES.'),1,1,'L',0);

} else {

    $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

    $pdf->Cell(229,5,utf8_decode($t13observaciones),1,1,'L',0);

}

    }

$i++;

}



$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



//CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_14_det

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' ORDER BY id_adeudo DESC LIMIT 5;";

                //AND habilitado = 1

    $rst14 = $conf->consulta($consulta);



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);



if($tipo== 1)

    $nuI='I-14. ADEUDOS / PASIVOS (SITUACIÓN ACTUAL)';

if($tipo== 2)

    $nuI='I-13. ADEUDOS / PASIVOS (ENTRE EL 1 DE ENERO Y EL 31 DE DICIEMBRE DEL AÑO ANTERIOR)';

if($tipo== 3)

    $nuI='I-14. ADEUDOS / PASIVOS (SITUACIÓN ACTUAL)';





$pdf->Cell(239,5,utf8_decode($nuI),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->MultiCell(279,5,utf8_decode('TODOS LOS DATOS DE LOS ADEUDOS / PASIVOS A NOMBRE DE LA PAREJA, DEPENDIENTES ECONOMICOS Y/O TERCEROS O QUE SEA EN COPROPIEDAD CON EL DECLARANTE NO SERÁN PÚBLICOS'),1,'L',1);



$i=0;

while ($i < 6) {



    //VARIABLES DE CONSULTA

    $t14id_declaracion                  =   $rst14[$i]['id_declaracion'];

    $t14id_adeudo                   =   $rst14[$i]['id_adeudo'];

    $t14tipo_adeudo                     =   $rst14[$i]['tipo_adeudo'];

    $t14otro_tipo                   =   $rst14[$i]['otro_tipo'];

    $t14titular_adeudo                  =   $rst14[$i]['titular_adeudo'];

    $t14no_cuenta_contrato                  =   $rst14[$i]['no_cuenta_contrato'];

    $t14fecha_adquisicion                   =   $rst14[$i]['fecha_adquisicion'];

    $t14monto_original_adeudo                   =   $rst14[$i]['monto_original_adeudo'];

    $t14tipo_moneda                     =   $rst14[$i]['tipo_moneda'];

    $t14saldo_insoluto                  =   $rst14[$i]['saldo_insoluto'];

    $t14razon_social_loc                    =   $rst14[$i]['razon_social_loc'];

    $t14razon_social                    =   $rst14[$i]['razon_social'];

    $t14razon_social_rfc                    =   $rst14[$i]['razon_social_rfc'];

    $t14pais                    =   $rst14[$i]['pais'];

    $t14otorgante                   =   $rst14[$i]['otorgante'];

    $t14observaciones                   =   $rst14[$i]['observaciones'];



    if($t14fecha_adquisicion=='1900-01-01'){$t14fecha_adquisicion='0000-00-00';}



// NO IMPRIMIR O DEFINIR NO HAY

if ($t14razon_social == null || $t14razon_social == '') {

    if ($i == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

        $i=12;

    } else {

        //NO IMPRIMIR

    }

} else {

    //IMPRIMIR

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(279,5,utf8_decode('ADEUDOS DEL DECLARANTE, PAREJA Y / O DEPENDIENTES ECONÓMICOS'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



    //CONSULTA RELACION TITULAR

    $consulta5 = "SELECT * FROM contraloria_declaracion_titular

                WHERE id_titular = '$t14titular_adeudo';";

    $rst14rr = $conf->consulta($consulta5);



    $t14rrelacion = $rst14rr[0]['titular'];



// $pdf->Cell(189,5,utf8_decode('ADEUDOS DEL DECLARANTE, PAREJA Y / O DEPENDIENTES ECONOMICOS'),1,1,'L',1);

$pdf->MultiCell(279,5,utf8_decode('TITULAR DE LA INVERSIÓN, CUENTA BANCARIA Y OTRO TIPO DE VALORES:

    '.$t14rrelacion),1,'L',0);



    //CONSULTA

    $consulta2 = "SELECT * FROM contraloria_declaracion_tab_14_terceros

                WHERE id_declaracion > 0 AND id_declaracion = '$id_declaracion' AND id_adeudo = '$2t14id_adeudo' ORDER BY id_adeudo_ter DESC LIMIT 1;";

                // AND id_adeudo_ter = '$t14id_adeudo'

                //AND habilitado = 1

                $rst14t = $conf->consulta($consulta2);



//TERCERO

$j=0;

$pdf->Cell(69.75,5,utf8_decode('TERCERO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('NOMBRE DEL TERCERO O TERCEROS'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode('RFC'),1,1,'C',1);

// while ($j < 11) {

    //VARIABLES TERCERO

    $t14tid_declaracion                     =   $rst14t[0]['id_declaracion'];

    $t14tid_adeudo_ter                  =   $rst14t[0]['id_adeudo_ter'];

    $t14trfc_tercero                    =   $rst14t[0]['rfc_tercero'];

    $t14tnombre_tercero                     =   $rst14t[0]['nombre_tercero'];

    $t14ttipo_tercero                   =   $rst14t[0]['tipo_tercero'];



if ($t14tnombre_tercero == null || $t14tnombre_tercero == '') {

    // NO IMPRIMIR O DEFINIR NO HAY

    if ($j == 0) {

        //NO TERCEROS POR REPORTAR

        $pdf->SetTextColor(0,0,0);

        $pdf->SetFillColor(122,215,163);

        $pdf->Cell(279,5,utf8_decode('SIN TERCEROS POR REPORTAR'),1,1,'C',0);

        $j=13;

    } else {

        // NO IMPRIMIR TERCERO

    }

} else {

    // IMPRIMIR

    $pdf->Cell(69.75,5,utf8_decode($t14ttipo_tercero),1,0,'C',0);

    $pdf->Cell(139.5,5,utf8_decode($t14tnombre_tercero),1,0,'C',0);

    $pdf->Cell(69.75,5,utf8_decode($t14trfc_tercero),1,1,'C',0);

    }

$j++;

// }

// IMPRIMIR 2

$pdf->Cell(139.5,5,utf8_decode('OTORGANTE DEL CREDITO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t14otorgante),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('NOMBRE / INSTITUCIÓN O RAZÓN SOCIAL'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t14razon_social),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('RFC'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t14razon_social_rfc),1,1,'C',0);

$pdf->MultiCell(279,5,utf8_decode('TIPO DE ADEUDO

    '.$t14tipo_adeudo.' '.$t14otro_tipo),1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('NÚMERO DE CUENTA O CONTRATO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t14no_cuenta_contrato),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('FECHA DE ADQUISICIÓN DEL ADEUDO / PASIVO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t14fecha_adquisicion),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('MONTO ORIGINAL DEL ADEUDO / PASIVO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode(formatMoney($t14monto_original_adeudo)),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('TIPO DE MONEDA'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t14tipo_moneda),1,1,'C',0);

if($tipo== 1)

    $saldook='SALDO INSOLUTO (SITUACIÓN ACTUAL)';

if($tipo== 2)

    $saldook='SALDO INSOLUTO AL 31 DE DICIEMBRE DEL AÑO ANTERIOR)';

if($tipo== 3)

    $saldook='SALDO INSOLUTO A LA FECHA DE CONCLUSIÓN DEL EMPLEO';

    

$pdf->Cell(139.5,5,utf8_decode($saldook),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode(formatMoney($t14saldo_insoluto)),1,1,'C',0);

$pdf->Cell(279,5,utf8_decode('¿DONDE SE LOCALIZA EL ADEUDO?'),1,1,'C',1);

$pdf->Cell(279,5,utf8_decode(''.$t14razon_social_loc),1,1,'C',0);

// $pdf->Cell(139.5,5,utf8_decode($t14),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode('PAÍS DONDE SE LOCALIZA'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t14pais),1,1,'C',0);

// $pdf->Cell(139.5,5,utf8_decode($t14),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t14observaciones),1,1,'L',0);

    }

$i++;

}



$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



    //CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_15_det_inmueble

                WHERE id_declaracion > 0 AND habilitado = 1 AND id_declaracion = '$id_declaracion' ORDER BY id_inmueble DESC LIMIT 5;";

    $rst15 = $conf->consulta($consulta);



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);



if($tipo== 1)

    $nuI='I-15. PRESTAMO O COMODATO POR TERCEROS (SITUACIÓN ACTUAL)';

if($tipo== 2)

    $nuI='I-14. PRESTAMO O COMODATO POR TERCEROS (ENTRE EL 1 DE ENERO Y EL 31 DE DICIEMBRE DEL AÑO ANTERIOR)';

else

    $nuI='I-15. PRESTAMO O COMODATO POR TERCEROS (SITUACIÓN ACTUAL)';

    

$pdf->Cell(239,5,utf8_decode($nuI),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(239,5,utf8_decode($nuI.'1. INMUEBLES '.$t1rhtipo_declaracion4),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



$i=0;

while ($i < 6) {



    //VARIABLES DE CONSULTA

    $t15habilitado = $rst15[$i]['habilitado'];

    $t15observaciones = $rst15[$i]['observaciones'];

    $t15pais_ext = $rst15[$i]['pais_ext'];

    $t15estado_provincia_ext = $rst15[$i]['estado_provincia_ext'];

    $t15ciudad_localidad_ext = $rst15[$i]['ciudad_localidad_ext'];

    $t15codigo_ext = $rst15[$i]['codigo_ext'];

    $t15numExt_ext = $rst15[$i]['numExt_ext'];

    $t15numInt_ext = $rst15[$i]['numInt_ext'];

    $t15calle_ext = $rst15[$i]['calle_ext'];

    $t15entidad_mx = $rst15[$i]['entidad_mx'];

    $t15municipio_alcaldia_mx = $rst15[$i]['municipio_alcaldia_mx'];

    $t15colonia_localidad_mx = $rst15[$i]['colonia_localidad_mx'];

    $t15codigo_mx = $rst15[$i]['codigo_mx'];

    $t15numExt_mx = $rst15[$i]['numExt_mx'];

    $t15numInt_mx = $rst15[$i]['numInt_mx'];

    $t15calle_mx = $rst15[$i]['calle_mx'];

    $t15ubicacion = $rst15[$i]['ubicacion'];

    $t15otro_parentesco = $rst15[$i]['otro_parentesco'];

    $t15parentesco = $rst15[$i]['parentesco'];

    $t15rfc_titular = $rst15[$i]['rfc_titular'];

    $t15tipo_titular = $rst15[$i]['tipo_titular'];

    $t15nombre_titular = $rst15[$i]['nombre_titular'];

    $t15otro_tipo_inmueble = $rst15[$i]['otro_tipo_inmueble'];

    $t15tipo_inmueble = $rst15[$i]['tipo_inmueble'];

    $t15id_declaracion = $rst15[$i]['id_declaracion'];

    $t15id_inmueble = $rst15[$i]['id_inmueble'];

    



if ($t15nombre_titular == null || $t15nombre_titular == '') {

    // NO IMPRIMIR O DEFINIR NO HAY

    if ($i == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

        $i=12;

    } else {

        //NO IMPRIMIR

    }

} else {

    //IMPRIMIR

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(279,5,utf8_decode('INMUEBLE'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



$pdf->Cell(139.5,5,utf8_decode('TIPO DE BIEN INMUEBLE'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t15tipo_inmueble.' '.$t15otro_tipo_inmueble),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('UBICACIÓN DEL INMUEBLE'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t15ubicacion),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('CALLE - NÚMERO EXTERIOR - NÚMERO INTERIOR'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('CALLE - NÚMERO EXTERIOR - NÚMERO INTERIOR'),1,1,'C',1);

//CHECAR EL ACOMODO DE ESTAS VARIABLES

$pdf->Cell(139.5,5,utf8_decode(''.$t15calle_mx.' - '.$t15numExt_mx.' - '.$t15numInt_mx),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode(''.$t15calle_ext.' - '.$t15numExt_ext.' - '.$t15numInt_ext),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->Cell(139.5,5,utf8_decode('COLONIA/LOCALIDAD - MUNICIPIO/ALCALDÍA - ENTIDAD FEDERATIVA'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('COLONIA/LOCALIDAD - ESTADO PROVINCIA'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode(''.$t15colonia_localidad_mx.' - '.$t15numInt_mx.' - '.$t15entidad_mx),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode(''.$t15ciudad_localidad_ext.' - '.$t15estado_provincia_ext),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->Cell(139.5,5,utf8_decode('CÓDIGO POSTAL'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('PAÍS - CÓDIGO POSTAL'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t15codigo_mx),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode($t15pais_ext.' - '.$t15codigo_ext),1,1,'C',0);



    //CONSULTA RELACION

    $consulta4 = "SELECT * FROM contraloria_declaracion_relacion

                WHERE id_relacion = '$t15parentesco';";

    $rst15r = $conf->consulta($consulta4);



    $t15rrelacion = $rst15r[0]['relacion'];



$pdf->Cell(139.5,5,utf8_decode('RELACIÓN CON EL DUEÑO O EL TITULAR'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t15rrelacion.' '.$t15otro_parentesco),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t15observaciones),1,1,'L',0);

    }

$i++;

}



    //CONSULTA

    $consulta3 = "SELECT * FROM contraloria_declaracion_tab_15_det_vehiculos

                WHERE id_declaracion > 0 AND habilitado = 1 AND id_declaracion = '$id_declaracion' ORDER BY id_vehiculo DESC LIMIT 5;";

    $rst152 = $conf->consulta($consulta3);



$pdf->SetFont('helvetica','',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

if($tipo== 2)

    $nuI='I-14.';

else

    $nuI='I-15.';

    

$pdf->Cell(239,5,utf8_decode($nuI.'2 VEHICULOS '.$t1rhtipo_declaracion4),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



$i=0;

while ($i < 6) {



    //VARIABLES DE CONSULTA

    $t152habilitado = $rst152[$i]['habilitado'];

    $t152observaciones = $rst152[$i]['observaciones'];

    $t152pais_ext = $rst152[$i]['pais_ext'];

    $t152entidad_mx = $rst152[$i]['entidad_mx'];

    $t152ubicacion = $rst152[$i]['ubicacion'];

    $t152otro_parentesco = $rst152[$i]['otro_parentesco'];

    $t152parentesco = $rst152[$i]['parentesco'];

    $t152rfc_titular = $rst152[$i]['rfc_titular'];

    $t152tipo_titular = $rst152[$i]['tipo_titular'];

    $t152nombre_titular = $rst152[$i]['nombre_titular'];

    $t152no_serie = $rst152[$i]['no_serie'];

    $t152year = $rst152[$i]['year'];

    $t152modelo = $rst152[$i]['modelo'];

    $t152marca = $rst152[$i]['marca'];

    $t152otro_tipo_vehiculo = $rst152[$i]['otro_tipo_vehiculo'];

    $t152tipo_vehiculo = $rst152[$i]['tipo_vehiculo'];

    $t152id_declaracion = $rst152[$i]['id_declaracion'];

    $t152id_vehiculo = $rst152[$i]['id_vehiculo'];

    



if ($t152nombre_titular == null || $t152nombre_titular == '') {

    // NO IMPRIMIR O DEFINIR NO HAY

    if ($i == 0) {

        //NO HAY COSAS POR REPORTAR

        

        $i=12;

    } else {

        //NO IMPRIMIR

    }

} else {

    //IMPRIMIR

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(279,5,utf8_decode('VEHICULO'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



$pdf->Cell(139.5,5,utf8_decode('TIPO DE BIEN VEHICULO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t152tipo_vehiculo.' '.$t152otro_tipo_vehiculo),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('MARCA'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t152marca),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('MODELO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t152modelo),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('AÑO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t152year),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('NUMERO DE SERIE O REGISTRO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t152no_serie),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('¿DONDE SE ENCUENTRA REGISTRADO?'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t152ubicacion),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('ENTIDAD FEDERATIVA'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('PAIS'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t152entidad_mx),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode($t152pais_ext),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('DUEÑO O TITULAR'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t152tipo_titular),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('NOMBRE DEL DUEÑO O TITULAR'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t152nombre_titular),1,1,'C',0);

$pdf->Cell(139.5,5,utf8_decode('RFC'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t152rfc_titular),1,1,'C',0);



    //CONSULTA RELACION

    $consulta4 = "SELECT * FROM contraloria_declaracion_relacion

                WHERE id_relacion = '$t152parentesco';";

    $rst15r = $conf->consulta($consulta4);



    $t15rrelacion = $rst15r[0]['relacion'];



$pdf->Cell(139.5,5,utf8_decode('RELACIÓN CON EL DUEÑO O EL TITULAR'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t15rrelacion.' '.$t152otro_parentesco),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t152observaciones),1,1,'L',0);

    }

$i++;

}



$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



    //CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_16_det

                WHERE id_declaracion > 0 AND habilitado = 1 AND id_declaracion = '$id_declaracion' ORDER BY id_dependiente DESC LIMIT 5;";

    $rst16 = $conf->consulta($consulta);

$pdf->AddPage('L');

$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(239,5,utf8_decode('II- DECLARACIÓN DE INTERESES'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->Cell(239,5,utf8_decode('II-1. PARTICIPACION EN EMPRESAS, SOCIEDADES O ASOCIACIONES (HASTA LOS 2 ULTIMOS AÑOS)'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->MultiCell(279,5,utf8_decode('TODOS LOS DATOS DE LA PARTICIPACIÓN EN EMPRESAS, SOCIEDADES O ASOSIACIONES DE LA PAREJA O DEPENDIENTES ECONÓMICOS NO SERÁN PÚBLICOS'),1,'L',1);



$i=0;

while ($i < 6) {



    //VARIABLES DE CONSULTA

    $t16habilitado = $rst16[$i]['habilitado'];

    $t16observaciones = $rst16[$i]['observaciones'];

    $t16otro_sector_pertenece = $rst16[$i]['otro_sector_pertenece'];

    $t16sector_pertenece = $rst16[$i]['sector_pertenece'];

    $t16pais = $rst16[$i]['pais'];

    $t16entidad_federativa = $rst16[$i]['entidad_federativa'];

    $t16lugar_registrado = $rst16[$i]['lugar_registrado'];

    $t16monto_mensual = $rst16[$i]['monto_mensual'];

    $t16remuneracion = $rst16[$i]['remuneracion'];

    $t16porcentaje = $rst16[$i]['porcentaje'];

    $t16otro_participacion = $rst16[$i]['otro_participacion'];

    $t16tipo_participacion = $rst16[$i]['tipo_participacion'];

    $t16rfc_empresa = $rst16[$i]['rfc_empresa'];

    $t16nombre_empresa = $rst16[$i]['nombre_empresa'];

    $t16tipo_persona = $rst16[$i]['tipo_persona'];

    $t16id_declaracion = $rst16[$i]['id_declaracion'];

    $t16id_dependiente = $rst16[$i]['id_dependiente'];





if ($t16nombre_empresa == null || $t16nombre_empresa == '') {

    // NO IMPRIMIR O DEFINIR NO HAY

    if ($i == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

        $i=12;

    } else {

        //NO IMPRIMIR

    }

} else {

    //IMPRIMIR

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(279,5,utf8_decode('PARTICIPACIÓN'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



$pdf->Cell(279,5,utf8_decode($t16tipo_persona),1,1,'L',0);

$pdf->Cell(93,5,utf8_decode('NOMBRE DE LA EMPRESA, SOCIEDAD, ASOSIACIÓN'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('RFC'),1,0,'C',1);

$pdf->Cell(93,5,utf8_decode('PORCENTAJE DE PARTICIPACIÓN DE ACUERDO A ESCRITURA'),1,1,'C',1);

$pdf->Cell(93,5,utf8_decode($t16nombre_empresa),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode($t16rfc_empresa),1,0,'C',0);

$pdf->Cell(93,5,utf8_decode($t16porcentaje),1,1,'C',0);

$pdf->MultiCell(279,5,utf8_decode('TIPO DE PARTICIPACIÓN

    '.$t16tipo_participacion.' '.$t16otro_participacion),1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('¿RECIBE REMUNERACIÓN POR SU PARTICIPACIÓN?            '.$t16remuneracion),1,0,'L',0);

$pdf->Cell(34.875,5,utf8_decode('MONTO MENSUAL NETO'),1,0,'L',1);

$pdf->Cell(34.875,5,utf8_decode(formatMoney($t16monto_mensual)),1,1,'C',0);

$pdf->MultiCell(279,5,utf8_decode('LUGAR DONDE SE UBICA'),1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('EN MÉXICO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('EN EL EXTRANJERO'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('ENTIDAD FEDERATIVA'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('PAIS DONDE SE LOCALIZA'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t16entidad_federativa),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode($t16pais),1,1,'C',0);

$pdf->MultiCell(279,5,utf8_decode('SECTOR PRODUCTIVO AL QUE PERTENECE

    '.$t16sector_pertenece.' '.$t16otro_sector_pertenece),1,'L',0);

    $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t16observaciones),1,1,'L',0);

    }

$i++;

}



$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



//CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_17_det

                WHERE id_declaracion > 0 AND habilitado = 1 AND id_declaracion = '$id_declaracion' ORDER BY id_dependiente DESC LIMIT 5;";

    $rst17 = $conf->consulta($consulta);



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(239,5,utf8_decode('II-2. ¿PARTICIPA EN LA TOMA DE DECISIONES DE ALGUNA DE ESTAS INSTITUCIONES? (HASTA LOS 2 ULTIMOS AÑOS)'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->MultiCell(279,5,utf8_decode('TODOS LOS DATOS DE LA PARTICIPACION EN ALGUNA DE ESTAS INSTITUCIONES DE LA PAREJA O DEPENDIENTES ECONÓMICOS NO SERÁN PÚBLICOS'),1,'L',1);



$i=0;

while ($i < 6) {



    //VARIABLES DE CONSULTA

    $t17habilitado = $rst17[$i]['habilitado'];

    $t17observaciones = $rst17[$i]['observaciones'];

    $t17pais = $rst17[$i]['pais'];

    $t17entidad_federativa = $rst17[$i]['entidad_federativa'];

    $t17lugar_registrado = $rst17[$i]['lugar_registrado'];

    $t17monto_mensual = $rst17[$i]['monto_mensual'];

    $t17remuneracion = $rst17[$i]['remuneracion'];

    $t17fecha_inicio = $rst17[$i]['fecha_inicio'];

    $t17puesto_rol = $rst17[$i]['puesto_rol'];

    $t17rfc_empresa = $rst17[$i]['rfc_empresa'];

    $t17nombre_empresa = $rst17[$i]['nombre_empresa'];

    $t17otro_institucion = $rst17[$i]['otro_institucion'];

    $t17tipo_institucion = $rst17[$i]['tipo_institucion'];

    $t17tipo_persona = $rst17[$i]['tipo_persona'];

    $t17id_declaracion = $rst17[$i]['id_declaracion'];

    $t17id_dependiente = $rst17[$i]['id_dependiente'];



    if($t17fecha_inicio=='1900-01-01'){$t17fecha_inicio='0000-00-00';}



if ($t17nombre_empresa == null || $t17nombre_empresa == '') {

    // NO IMPRIMIR O DEFINIR NO HAY

    if ($i == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

        $i=12;

    } else {

        //NO IMPRIMIR

    }

} else {

    //IMPRIMIR

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(279,5,utf8_decode('PARTICIPACIÓN'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



$pdf->Cell(279,5,utf8_decode(''.$t17tipo_persona),1,1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('TIPO DE INSTITUCIÓN

    '.$t17tipo_institucion.' '.$t17otro_institucion),1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('NOMBRE DE LA INSTITUCIÓN'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t17nombre_empresa),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('RFC'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t17rfc_empresa),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('PUESTO / ROL'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t17puesto_rol),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('FECHA DE INICIO DE PARTICIPACION DENTRO DE LA INSTITUCIÓN'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t17fecha_inicio),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('¿RECIBE REMUNERACIÓN POR SU PARTICIPACION?            '.$t17remuneracion),1,0,'L',0);

$pdf->Cell(69.75,5,utf8_decode('MONTO MENSUAL NETO'),1,0,'L',1);

$pdf->Cell(69.75,5,utf8_decode(formatMoney($t17monto_mensual)),1,1,'C',0);

$pdf->MultiCell(279,5,utf8_decode('LUGAR DONDE SE UBICA'),1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('EN MÉXICO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('EN EL EXTRANJERO'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('ENTIDAD FEDERATIVA'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('PAIS DONDE SE LOCALIZA'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t17entidad_federativa),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode($t17pais),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t17observaciones),1,1,'L',0);

    }

$i++;

}



$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



//CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_18_det

                WHERE id_declaracion > 0 AND habilitado = 1 AND id_declaracion = '$id_declaracion' ORDER BY id_dependiente DESC LIMIT 5;";

    $rst18 = $conf->consulta($consulta);



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(239,5,utf8_decode('II-3. APOYO O BENEFICIOS PÚBLICOS (HASTA LOS 2 ULTIMOS AÑOS)'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);



$i=0;

while ($i < 6) {



    //VARIABLES DE CONSULTA

    $t18habilitado = $rst18[$i]['habilitado'];

    $t18observaciones = $rst18[$i]['observaciones'];

    $t18especifique_apoyo = $rst18[$i]['especifique_apoyo'];

    $t18monto_mensual = $rst18[$i]['monto_mensual'];

    $t18tipo_recepcion = $rst18[$i]['tipo_recepcion'];

    $t18otro_apoyo = $rst18[$i]['otro_apoyo'];

    $t18tipo_apoyo = $rst18[$i]['tipo_apoyo'];

    $t18tipo_institucion = $rst18[$i]['tipo_institucion'];

    $t18nombre_institucion = $rst18[$i]['nombre_institucion'];

    $t18nombre_programa = $rst18[$i]['nombre_programa'];

    $t18otro_beneficiario = $rst18[$i]['otro_beneficiario'];

    $t18tipo_beneficiario = $rst18[$i]['tipo_beneficiario'];

    $t18id_declaracion = $rst18[$i]['id_declaracion'];

    $t18id_dependiente = $rst18[$i]['id_dependiente'];



if ($t18nombre_programa == null || $t18nombre_programa == '') {

    // NO IMPRIMIR O DEFINIR NO HAY

    if ($i == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

        $i=12;

    } else {

        //NO IMPRIMIR

    }

} else {

    //IMPRIMIR

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(279,5,utf8_decode('APOYO'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



$pdf->MultiCell(279,5,utf8_decode('BENEFICIARIO DE ALGUN PROGRAMA PÚBLICO

    '.$t18tipo_beneficiario.' '.$t18otro_beneficiario),1,'L',0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(139.5,5,utf8_decode('NOMBRE DEL PROGRAMA'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t18nombre_programa),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('INSTITUCIÓN QUE ENTREGA EL APOYO'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t18nombre_institucion),1,1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('NIVEL U ORDEN DE GOBIERNO                     '.$t18tipo_institucion),1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('TIPO DE APOYO                     '.$t18tipo_apoyo.' '.$t18otro_apoyo),1,'L',0);

$pdf->Cell(279,5,utf8_decode('FORMA DE RECEPCIÓN DE APOYO                                                         '.$t18tipo_recepcion),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('MONTO APOROXIMADO DEL APOYO MENSUAL'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode(formatMoney($t18monto_mensual)),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('ESPECIFIQUE EL APOYO'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t18especifique_apoyo),1,1,'L',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t18observaciones),1,1,'L',0);

    }

$i++;

}



$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



//CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_19_det

                WHERE id_declaracion > 0 AND habilitado = 1 AND id_declaracion = '$id_declaracion' ORDER BY id_dependiente DESC LIMIT 5;";

    $rst19 = $conf->consulta($consulta);



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(239,5,utf8_decode('II-4. REPRESENTACIÓN (HASTA LOS 2 ULTIMOS AÑOS)'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->MultiCell(279,5,utf8_decode('TODOS LOS DATOS DE REPRESENTANTE DE LA PAREJA O DEPENDIENTES ECONÓMICOS NO SERÁN PÚBLICOS'),1,'L',1);



$i=0;

while ($i < 6) {



    //VARIABLES DE CONSULTA

    $t19habilitado                  =   $rst19[$i]['habilitado'];

    $t19observaciones                   =   $rst19[$i]['observaciones'];

    $t19otro_sector_pertenece                   =   $rst19[$i]['otro_sector_pertenece'];

    $t19sector_pertenece                    =   $rst19[$i]['sector_pertenece'];

    $t19pais                    =   $rst19[$i]['pais'];

    $t19entidad_federativa                  =   $rst19[$i]['entidad_federativa'];

    $t19lugar_registrado                    =   $rst19[$i]['lugar_registrado'];

    $t19monto_mensual                   =   $rst19[$i]['monto_mensual'];

    $t19remuneracion                    =   $rst19[$i]['remuneracion'];

    $t19rfc_representante                   =   $rst19[$i]['rfc_representante'];

    $t19nombre_representante                    =   $rst19[$i]['nombre_representante'];

    $t19tipo_representante                  =   $rst19[$i]['tipo_representante'];

    $t19fecha_inicio                    =   $rst19[$i]['fecha_inicio'];

    $t19tipo_representacion                     =   $rst19[$i]['tipo_representacion'];

    $t19tipo_persona                    =   $rst19[$i]['tipo_persona'];

    $t19id_declaracion                  =   $rst19[$i]['id_declaracion'];

    $t19id_dependiente                  =   $rst19[$i]['id_dependiente'];



    if($t19fecha_inicio=='1900-01-01'){$t19fecha_inicio='0000-00-00';}



if ($t19nombre_representante == null || $t19nombre_representante == '') {

    // NO IMPRIMIR O DEFINIR NO HAY

    if ($i == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

        $i=12;

    } else {

        //NO IMPRIMIR

    }

} else {

    //IMPRIMIR

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(279,5,utf8_decode('REPRESENTACIÓN'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



$pdf->Cell(279,5,utf8_decode($t19tipo_persona),1,1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('TIPO DE REPRESENTACIÓN                                                   '.$t19tipo_representacion),1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('FECHA DE INICIO DE LA REPRESENTACIÓN'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t19fecha_inicio),1,1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('REPRESENTANTE / REPRESENTADO                                                   '.$t19tipo_representante),1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('NOMBRE O RAZÓN SOCIAL DEL REPRESENTANTE / REPRESENTADO'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t19nombre_representante),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('RFC'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t19rfc_representante),1,1,'L',0);

$pdf->Cell(279,5,utf8_decode('¿RECIBE REMUNERACIÓN POR SU PARTICIPACIÓN?            '.$t19remuneracion),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('MONTO MENSUAL NETO DE SU REPRESENTACIÓN'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode(formatMoney($t19monto_mensual)),1,1,'C',0);

$pdf->MultiCell(279,5,utf8_decode('LUGAR DONDE SE UBICA'),1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('EN MÉXICO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('EN EL EXTRANJERO'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('ENTIDAD FEDERATIVA'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('PAIS DONDE SE LOCALIZA'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t19entidad_federativa),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode($t19pais),1,1,'C',0);

$pdf->MultiCell(279,5,utf8_decode('SECTOR PRODUCTIVO AL QUE PERTENECE

    '.$t19sector_pertenece.' '.$t19otro_sector_pertenece),1,'L',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t19observaciones),1,1,'L',0);

    }

$i++;

}



$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



//CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_20_det

                WHERE id_declaracion > 0 AND habilitado = 1 AND id_declaracion = '$id_declaracion' ORDER BY id_dependiente DESC LIMIT 5;";

    $rst20 = $conf->consulta($consulta);



    $antecedentes_dependientes                  =   $rst20[$i]['antecedentes_dependientes'];



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(239,5,utf8_decode('II-5. CLIENTES PRINCIPALES (HASTA LOS 2 ULTIMOS AÑOS)'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->MultiCell(279,5,utf8_decode('TODOS LOS DATOS DE CLIENTES PRINCIPALES DE LA PAREJA O DEPENDIENTES ECONÓMICOS NO SERÁN PÚBLICOS'),1,'L',1);

$pdf->MultiCell(279,5,utf8_decode('SE MANIFIESTARÁ EL BENEFICIARIO O GANANCIA DIRECTA DEL DECLARANTE SI SUPERA MENSUALMENTE 250 UNIDADES DE MEDIDA Y ACTUALIZACIÓN (UMA)'),1,'L',1);

$pdf->Cell(239,5,utf8_decode('¿REALIZA ALGUNA ACTIVIDAD LUCRATIVA INDEPENDIENTE AL EMPLEO, CARGO O COMISIÓN?'),1,0,'L',1);

if ($antecedentes_dependientes == 'SI') {

    $pdf->Cell(40,5,utf8_decode('SI'),1,1,'C',1);

} else {

    $pdf->Cell(40,5,utf8_decode('NO'),1,1,'C',1);

}



$i=0;

while ($i < 6) {



    //VARIABLES DE CONSULTA

    $t20habilitado                  =   $rst20[$i]['habilitado'];

    $t20observaciones                   =   $rst20[$i]['observaciones'];

    $t20pais                    =   $rst20[$i]['pais'];

    $t20entidad_federativa                  =   $rst20[$i]['entidad_federativa'];

    $t20lugar_registrado                    =   $rst20[$i]['lugar_registrado'];

    $t20monto_mensual                   =   $rst20[$i]['monto_mensual'];

    $t20otro_sector_pertenece                   =   $rst20[$i]['otro_sector_pertenece'];

    $t20sector_pertenece                    =   $rst20[$i]['sector_pertenece'];

    $t20rfc_cliente                     =   $rst20[$i]['rfc_cliente'];

    $t20nombre_cliente                  =   $rst20[$i]['nombre_cliente'];

    $t20tipo_cliente                    =   $rst20[$i]['tipo_cliente'];

    $t20rfc_empresa                     =   $rst20[$i]['rfc_empresa'];

    $t20nombre_empresa                  =   $rst20[$i]['nombre_empresa'];

    $t20tipo_persona                    =   $rst20[$i]['tipo_persona'];

    $t20id_declaracion                  =   $rst20[$i]['id_declaracion'];

    $t20id_dependiente                  =   $rst20[$i]['id_dependiente'];



if ($t20nombre_empresa == null || $t20nombre_empresa == '') {

    // NO IMPRIMIR O DEFINIR NO HAY

    if ($i == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

        $i=12;

    } else {

        //NO IMPRIMIR

    }

} else {

    //IMPRIMIR

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(279,5,utf8_decode('CLIENTE'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



$pdf->Cell(279,5,utf8_decode($t20tipo_persona),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('NOMBRE DE LA EMPRESA O SERVICIO QUE PROPORCIONA'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t20nombre_empresa),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('RFC'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t20rfc_empresa),1,1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('CLIENTE PRINCIPAL                                                   '.$t20tipo_cliente),1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('SEÑALE NOMBRE O RAZÓN SOCIAL DEL CLIENTE PRINCIPAL'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t20nombre_cliente),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('RFC'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t20rfc_cliente),1,1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('SECTOR PRODUCTIVO AL QUE PERTENECE

    '.$t20sector_pertenece.' '.$t20otro_sector_pertenece),1,'L',0);

$pdf->Cell(209.5,5,utf8_decode('MONTO APROXIMADO DEL BENEFICIO O GANANCIA MENSUAL QUE OBTIENE DEL CLIENTE PRINCIPAL'),1,0,'C',1);

$pdf->Cell(69.75,5,utf8_decode($t20monto_mensual),1,1,'C',0);

$pdf->MultiCell(279,5,utf8_decode('LUGAR DONDE SE UBICA'),1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('EN MÉXICO'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('EN EL EXTRANJERO'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode('ENTIDAD FEDERATIVA'),1,0,'C',1);

$pdf->Cell(139.5,5,utf8_decode('PAIS DONDE SE LOCALIZA'),1,1,'C',1);

$pdf->Cell(139.5,5,utf8_decode($t20entidad_federativa),1,0,'C',0);

$pdf->Cell(139.5,5,utf8_decode($t20pais),1,1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t20observaciones),1,1,'L',0);

    }

$i++;

}



$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



//CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_21_det

                WHERE id_declaracion > 0 AND habilitado = 1 AND id_declaracion = '$id_declaracion' ORDER BY id_dependiente DESC LIMIT 5;";

    $rst21 = $conf->consulta($consulta);



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(239,5,utf8_decode('II-6. BENEFICIOS PRIVADOS (HASTA LOS 2 ULTIMOS AÑOS)'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);



$i=0;

while ($i < 6) {



    //VARIABLES DE CONSULTA

    $t21habilitado                  =   $rst21[$i]['habilitado'];

    $t21observaciones                   =   $rst21[$i]['observaciones'];

    $t21otro_sector_pertenece                   =   $rst21[$i]['otro_sector_pertenece'];

    $t21sector_pertenece                    =   $rst21[$i]['sector_pertenece'];

    $t21tipo_moneda                     =   $rst21[$i]['tipo_moneda'];

    $t21monto_mensual                   =   $rst21[$i]['monto_mensual'];

    $t21tipo_pago                   =   $rst21[$i]['tipo_pago'];

    $t21rfc_otorgante                   =   $rst21[$i]['rfc_otorgante'];

    $t21nombre_otorgante                    =   $rst21[$i]['nombre_otorgante'];

    $t21otorgante                   =   $rst21[$i]['otorgante'];

    $t21otro_beneficiario                   =   $rst21[$i]['otro_beneficiario'];

    $t21tipo_beneficiario                   =   $rst21[$i]['tipo_beneficiario'];

    $t21otro_beneficio                  =   $rst21[$i]['otro_beneficio'];

    $t21tipo_beneficio                  =   $rst21[$i]['tipo_beneficio'];

    $t21id_declaracion                  =   $rst21[$i]['id_declaracion'];

    $t21id_dependiente                  =   $rst21[$i]['id_dependiente'];





if ($t21nombre_otorgante == null || $t21nombre_otorgante == '') {

    // NO IMPRIMIR O DEFINIR NO HAY

    if ($i == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

        $i=12;

    } else {

        //NO IMPRIMIR

    }

} else {

    //IMPRIMIR

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(279,5,utf8_decode('BENEFICIO'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



$pdf->MultiCell(279,5,utf8_decode('TIPO DE BENEFICIO                     '.$t21tipo_beneficio.''),1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('BENEFICIARIO                     '.$t21tipo_beneficiario.' '.$t21otro_beneficiario),1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('OTORGANTE                                                   '.$t21otorgante),1,'L',0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(139.5,5,utf8_decode('NOMBRE O RAZÓN SOCIAL DEL OTORGANTE'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t21nombre_otorgante),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('RFC'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t21rfc_otorgante),1,1,'L',0);

$pdf->Cell(279,5,utf8_decode('FORMA DE RECEPCIÓN DE APOYO                                                         '.$t21tipo_pago),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('ESPECIFIQUE EL BENEFICIO'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode(''.$t21otro_beneficio.''),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('MONTO MENSUAL APOROXIMADO DEL BENEFICIARIO'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode(formatMoney($t21monto_mensual)),1,1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('TIPO DE MONEDA'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t21tipo_moneda),1,1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('SECTOR PRODUCTIVO AL QUE PERTENECE

    '.$t21sector_pertenece.' '.$t21otro_sector_pertenece),1,'L',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t21observaciones),1,1,'L',0);

    }

$i++;

}



$pdf->WriteHTML('<br>');



// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



//CONSULTA

    $consulta = "SELECT * FROM contraloria_declaracion_tab_22_det

                WHERE id_declaracion > 0 AND habilitado = 1 AND id_declaracion = '$id_declaracion' ORDER BY id_dependiente DESC LIMIT 5;";

    $rst22 = $conf->consulta($consulta);



$pdf->SetFont('helvetica','B',10);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(239,5,utf8_decode('II-7. FIDECOMISOS (HASTA LOS 2 ULTIMOS AÑOS)'),1,0,'L',1);

$pdf->Cell(40,5,utf8_decode($t1rhtipo_declaracion2),1,1,'C',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->MultiCell(279,5,utf8_decode('TODOS LOS DATOS DE PARTICIPACION EN FIDEICOMISOS DE LA PAREJA O DEPENDIENTES ECONÓMICOS NO SERÁN PÚBLICOS'),1,'L',1);



$i=0;

while ($i < 6) {



    //VARIABLES DE CONSULTA

    $t22observaciones                   =   $rst22[$i]['observaciones'];

    $t22lugar_registrado                    =   $rst22[$i]['lugar_registrado'];

    $t22otro_sector_pertenece                   =   $rst22[$i]['otro_sector_pertenece'];

    $t22sector_pertenece                    =   $rst22[$i]['sector_pertenece'];

    $t22rfc_fideicomisario                  =   $rst22[$i]['rfc_fideicomisario'];

    $t22nombre_fideicomisario                   =   $rst22[$i]['nombre_fideicomisario'];

    $t22fideicomisario                  =   $rst22[$i]['fideicomisario'];

    $t22rfc_fiduciario                  =   $rst22[$i]['rfc_fiduciario'];

    $t22nombre_fiduciario                   =   $rst22[$i]['nombre_fiduciario'];

    $t22rfc_fideicomitente                  =   $rst22[$i]['rfc_fideicomitente'];

    $t22nombre_fideicomitente                   =   $rst22[$i]['nombre_fideicomitente'];

    $t22fideicomitente                  =   $rst22[$i]['fideicomitente'];

    $t22rfc_fideicomiso                     =   $rst22[$i]['rfc_fideicomiso'];

    $t22tipo_participacion                  =   $rst22[$i]['tipo_participacion'];

    $t22tipo_fideicomiso                    =   $rst22[$i]['tipo_fideicomiso'];

    $t22participante                    =   $rst22[$i]['participante'];

    $t22id_declaracion                  =   $rst22[$i]['id_declaracion'];

    $t22id_dependiente                  =   $rst22[$i]['id_dependiente'];





if ($t22nombre_fideicomitente == null || $t22nombre_fideicomitente == '') {

    // NO IMPRIMIR O DEFINIR NO HAY

    if ($i == 0) {

        //NO HAY COSAS POR REPORTAR

        $pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

        $pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

        $pdf->Cell(229,5,utf8_decode('SIN REGISTROS REPORTADOS.'),1,1,'L',0);

        $i=12;

    } else {

        //NO IMPRIMIR

    }

} else {

    //IMPRIMIR

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(255,255,255);

$pdf->SetFillColor(124,71,101);

$pdf->Cell(279,5,utf8_decode('FIDEICOMISO'),1,1,'L',1);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);



$pdf->MultiCell(279,5,utf8_decode('PARTICIPACIÓN EN FIDEICOMISOS                     '.$t22participante),1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('TIPO DE FIDEICOMISO                      '.$t22tipo_fideicomiso),1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('TIPO DE PARTICIPACION                     '.$t22tipo_participacion),1,'L',0);

$pdf->Cell(139.5,5,utf8_decode('RFC DEL FIDEICOMISO'),1,0,'L',1);

$pdf->Cell(139.5,5,utf8_decode($t22rfc_fideicomiso),1,1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('FIDEICOMITENTE                                                   '.$t22fideicomitente),1,'L',0);

$pdf->Cell(69.75,5,utf8_decode('NOMBRE O RAZÓN SOCIAL DEL FIDEICOMITENTE'),1,0,'L',1);

$pdf->Cell(69.75,5,utf8_decode($t22nombre_fideicomitente),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode('RFC'),1,0,'L',1);

$pdf->Cell(69.75,5,utf8_decode($t22rfc_fideicomitente),1,1,'C',0);

$pdf->Cell(69.75,5,utf8_decode('NOMBRE O RAZÓN SOCIAL DEL FIDUCIARIO'),1,0,'L',1);

$pdf->Cell(69.75,5,utf8_decode($t22nombre_fiduciario),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode('RFC'),1,0,'L',1);

$pdf->Cell(69.75,5,utf8_decode($t22rfc_fiduciario),1,1,'C',0);

$pdf->MultiCell(279,5,utf8_decode('FIDEICOMISARIO                                                   '.$t22fideicomisario),1,'L',0);

$pdf->Cell(69.75,5,utf8_decode('NOMBRE O RAZÓN SOCIAL DEL FIDEICOMISARIO'),1,0,'L',1);

$pdf->Cell(69.75,5,utf8_decode($t22nombre_fideicomisario),1,0,'C',0);

$pdf->Cell(69.75,5,utf8_decode('RFC'),1,0,'L',1);

$pdf->Cell(69.75,5,utf8_decode($t22rfc_fideicomisario),1,1,'C',0);

$pdf->MultiCell(279,5,utf8_decode('SECTOR PRODUCTIVO AL QUE PERTENECE

    '.$t22sector_pertenece.' '.$t22otro_sector_pertenece),1,'L',0);

$pdf->MultiCell(279,5,utf8_decode('¿DONDE SE LOCALIZA EL FIDEICOMISO?'),1,'C',1);

$pdf->MultiCell(279,5,utf8_decode(''.$t22lugar_registrado),1,'C',0);

$pdf->SetFont('helvetica','',8);

$pdf->SetTextColor(0,0,0);

$pdf->SetFillColor(122,215,163);

$pdf->Cell(50,5,utf8_decode('ACLARACIONES/OBSERVACIONES'),1,0,'L',1);

$pdf->Cell(229,5,utf8_decode($t22observaciones),1,1,'L',0);

    }

$i++;

}


$pdf->Output();



?>

Zerion Mini Shell 1.0