<?php
require_once('config/lang/eng.php');
require_once('tcpdf.php');

// extend TCPF with custom functions
class CDPDF extends TCPDF {

    


    public function Header() {

        
        
        
            $this->SetRightMargin(15);
            $this->SetTopMargin(2);
            $this->SetFont('helvetica', '', 7);
            $html = '<table border="0" cellpadding="2" width="100%"><tr><td width="100%" rowspan="2"><img width="70px" height="50px" src="images/LogoEmpresa.png" /></td>';
            $html.='</tr></table>';
            $this->writeHTML($html);
            $this->Ln(8);
            $this->SetMargins(20, 25, 20);
            $this->SetMargins(20, 25, 20);
            $this->Ln(8);
        
    }

    public function Footer() {
        $html="";
        
	
	$date = date('d-M-y  h:m');
            $time = time();
            $html="";
            $this->SetRightMargin(15);
            $this->SetLeftMargin(15);
            $this->SetFont('helvetica', '', 7);
            $this->SetY(-20);
           
             $html= '<table style="width:600px">
                            <tr>
                                <td style="color: #999"></td>';
             $html.='<td style="color: #999"></td>
	             <td style="color: #999">Fecha de Impresion: ' . $date . '</td></tr>
			    
                        </table>';
          
            $this->writeHTML($html);

	
    }
    function fechaEspanol($fecha){


                    $transf = strtotime($fecha);
                   $dia = date("d", $transf);
                    $mes = date("F", $transf);

                    if ($mes == "January")
                        $mes = "Enero";
                    if ($mes == "February")
                        $mes = "Febrero";
                    if ($mes == "March")
                        $mes = "Marzo";
                    if ($mes == "April")
                        $mes = "Abril";
                    if ($mes == "May")
                        $mes = "Mayo";
                    if ($mes == "June")
                        $mes = "Junio";
                    if ($mes == "July")
                        $mes = "Julio";
                    if ($mes == "August")
                        $mes = "Agosto";
                    if ($mes == "September")
                        $mes = "Septiembre";
                    if ($mes == "October")
                        $mes = "Octubre";
                    if ($mes == "November")
                        $mes = "Noviembre";
                    if ($mes == "December")
                        $mes = "Diciembre";
                    $ano = date("Y", $transf);
                    $fecha_resol=$dia." ".$mes." ".$ano;
                    return $fecha_resol;

    }


}

