<?php
/*****************************************************************************************************************************************
 * DEV: CONTRALORIA DE ESTADOS
 * PROYECTO: SISTEMA INTEGRAL ADMINISTRATIVO DE CONTRALORIAS DE ESTADOS
 * MODULO: index
 * PROCESO: index del sistema
 * PROGRAMADORES:
 * | # |          NOMBRES Y APELLIDOS              |               CORREO               |          TELEFONO              |
 * | 1 |          Daniel Muñoz                     |d.munoz@contraloriamonagas.gob.ve   |         0412-8358676           |
 * |   |                                           |                                    |                                |
 * |___|___________________________________________|____________________________________|________________________________|
 *
 * VERSION
 *
 * |          PROGRAMADOR                  |          FECHA          |       VERSION      |
 * |               #1                      |        27-08-2015       |         1.0        |
 * |                                       |                         |                    |
 * |_______________________________________|_________________________|____________________|
 *
 *****************************************************************************************************************************************/
require_once ROOT . 'librerias' . DS . 'modCD' . DS . 'tcpdf' . DS . 'tcpdf.php';
//require_once LIBRERIA_FPDF;

class pdf extends TCPDF
{
    function Header()
    {


        $this->SetFillColor(255, 255, 255);
        $this->SetDrawColor(0, 0, 0);
        $this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."CES.jpg", 35, 17, 24);
        $this->SetFont('Helvetica', ' ', 11);
        $this->SetXY(75, 12); $this->Cell(60, 22, 'REPÚBLICA BOLIVARIANA DE VENEZUELA', 0, 1, 'C');
        $this->SetXY(75, 12); $this->Cell(60, 30, APP_ORGANISMO, 0, 1, 'C');
        $this->SetXY(55, 29); $this->MultiCell(100, 5,DEPENDENCIA_REMITENTE, 0, 'C');
        $this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."SNCF_GRIS.jpg", 155, 18, 20, 20);
        $this->Ln(5);

    }

    //Page footer
    function Footer()
    {

        //Position at 1.5 cm from bottom
        $this->SetXY(227,24.5);
        //Arial italic 8

        $this->SetFont('Helvetica','',7);
        //Page number

        $this->SetFont('Helvetica','',6);
        //Page number
      //  $this->SetXY(95, 200); $this->Cell(35, 115, '_________________________________________________________________________________________________________________', 0, 1, 'C', 0);
        $anio_actual=date("Y");
        $anio_fundadoCES=1966;
        $aniversarios=$anio_actual-$anio_fundadoCES;
        $this->SetFont('Helvetica','I',8);

        $this->SetXY(42, 252); $this->MultiCell(150, 200, ' Dirección: Avenida Arismendi, Edificio Palacio Legislativo, Cumaná, Edo. Sucre Teléfonos: (0293) 4320708, 4323658. Directo: Tele Fax 4323447, Correo Electrónico: despacho@cgesucre.gob.ve',0, 'C');
        
        $this->SetFont('Helvetica','BI',9);
        $this->SetXY(100, 210); $this->Cell(35, 103, utf8_decode('¡Todos los Sucrenses Somos Contralores!'), 0, 1, 'C', 0);
        $this->SetFont('Helvetica','BI',7);
        $this->SetXY(156, 215); $this->Cell(35, 103, utf8_decode( $aniversarios.' Aniversario'), 0, 1, 'R', 0);
        $this->SetXY(156, 218); $this->Cell(35, 103, utf8_decode( $anio_fundadoCES.'-'.$anio_actual), 0, 1, 'R', 0);

        // IMPRIMIR LOGO ANIVERSARIO DEPENDIENDO DE LA FECHA DE CREACION DOCUMENTO INTERNO
        if ( (ANIO < 2019) || (ANIO == 2019 && MES == 01 && DIA < 07) )
        {
            $this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."52Anv.jpg", 12, 254, 21, 12);
        }
        elseif( (ANIO == 2023 && MES == 01 && DIA >= 07) || (ANIO == 2023 && MES >= 02)  )
        {
            $this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."57Aniv.jpeg", 12, 255, 18, 16);
        }
        elseif ( (ANIO == 2024 && MES == 01 && DIA >= 07) || (ANIO == 2024 && MES >= 02) )
        {
            $this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."58Aniv.jpg", 12, 255, 18, 16);
        }
        elseif ( (ANIO == 2025 && MES == 01 && DIA >= 07) || (ANIO == 2025 && MES >= 02) )
        {
            $this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."59Aniv.jpg", 12, 255, 18, 16);
        }
        elseif ( (ANIO == 2026 && MES == 01 && DIA >= 07) || (ANIO == 2026 && MES >= 02) )
        {
            $this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."60AnivBN.jpg", 26, 252, 17, 17);
        }

        //Page number
        $this->Cell(0,10,' '.$this->PageNo().'/{nb}',0,0,'C');
    }
}

class circular extends TCPDF
{
    function Header()
    {


        $this->SetFillColor(255, 255, 255);
        $this->SetDrawColor(0, 0, 0);
        $this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."CES.jpg", 35, 17, 24);
        $this->SetFont('Helvetica', ' ', 11);
        $this->SetXY(80, 12); $this->Cell(60, 22, 'REPÚBLICA BOLIVARIANA DE VENEZUELA', 0, 1, 'C');
        $this->SetXY(80, 12); $this->Cell(60, 30, APP_ORGANISMO, 0, 1, 'C');
        $this->SetXY(63, 30); $this->MultiCell(100, 10,DEPENDENCIA_REMITENTE, 0, 'C');
        //$this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."LOGOSNCF.jpg", 170, 18, 10, 18);
        $this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."SNCF_GRIS.jpg", 155, 18, 20, 20);
        $this->Ln(5);

    }

    //Page footer
    function Footer()
    {

        //Position at 1.5 cm from bottom
        $this->SetXY(227,24.5);
        //Arial italic 8

        $this->SetFont('Helvetica','',7);
        //Page number


        $this->SetFont('Helvetica','',6);
        //Page number
     //   $this->SetXY(95, 200); $this->Cell(35, 115, '_________________________________________________________________________________________________________________', 0, 1, 'C', 0);

        $this->SetFont('Helvetica','I',6);
        //Page number
        $this->SetXY(42, 252); $this->MultiCell(150, 200, ' Dirección: Avenida Arismendi, Edificio Palacio Legislativo, Cumaná, Edo. Sucre Teléfonos: (0293) 4320708, 4323658. Directo: Tele Fax 4323447, Correo Electrónico: despacho@cgesucre.gob.ve, www.cgesucre.gob.ve',0, 'C');
        /*$this->SetXY(50, 200); $this->Cell(35, 100, '
        Dirección: Avenida Arismendi, Edificio Palacio Legislativo, Cumaná, Edo. Sucre Teléfonos: (0293) 4320708,', 0, 1, 'L', 0);

        $this->SetXY(95, 201); $this->Cell(65, 105, '
4323658. Directo: Tele Fax 4323447, Correo Electrónico: despacho@cgesucre.gob.ve, www.cgesucre.gob.ve
        ', 0, 1, 'C', 0);//*/
        $anio_actual=date("Y");
        $anio_fundadoCES=1966;
        $aniversarios=$anio_actual-$anio_fundadoCES;
        $this->SetFont('Helvetica','BI',9);
        $this->SetXY(100, 210); $this->Cell(35, 103, utf8_decode('"Todos los Sucrenses Somos Contralores, '.$aniversarios.' Aniversario '.$anio_fundadoCES.'-'.$anio_actual.'"'), 0, 1, 'C', 0);

        // IMPRIMIR LOGO ANIVERSARIO DEPENDIENDO DE LA FECHA DE CREACION DOCUMENTO INTERNO
        if ( (ANIO < 2019) || (ANIO == 2019 && MES == 01 && DIA < 07) )
        {
            $this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."52Anv.jpg", 12, 235, 21, 12);
        }
        elseif( (ANIO == 2022 && MES == 01 && DIA >= 07) || (ANIO == 2022 && MES >= 02) )
        {
            $this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."56Aniv.jpeg", 12, 235, 18, 16);
        }
        elseif ( (ANIO == 2023 && MES == 01 && DIA >= 07) || (ANIO == 2023 && MES >= 02) )
        {
            $this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."57Aniv.jpeg", 12, 235, 18, 16);
        }
        elseif ( (ANIO == 2024 && MES == 01 && DIA >= 07) || (ANIO == 2024 && MES >= 02) )
        {
            $this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."58Aniv.jpg", 12, 235, 18, 16);
        }
        elseif ( (ANIO == 2025 && MES == 01 && DIA >= 07) || (ANIO == 2025 && MES >= 02) )
        {
            $this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."59Aniv.jpg", 12, 235, 18, 16);
        }
        elseif ( (ANIO == 2026 && MES == 01 && DIA >= 07) || (ANIO == 2026 && MES >= 02) )
        {
            $this->Image(ROOT.'publico'.DS.'imagenes'.DS.'logos'.DS."60Aniv.jpg", 26, 252, 17, 17);
        }

        $this->Cell(0,10,' '.$this->PageNo().'/{nb}',0,0,'C');
    }
}
