   <?php require 'funcs/conexion.php';
   require 'funcs/funcs.php';
   require ('fpdf/fpdf.php');
   date_default_timezone_set('America/Mexico_City');
   header("Content-Type: text/html;charset=utf-8");

setlocale(LC_TIME,"es_ES");
date_default_timezone_set("America/Mexico_City");

  $sql="SELECT * FROM `productos` WHERE pro_activo = 1 and pro_tipo <> 'servicios' order by pro_nombre";
  $resultado = mysqli_query($mysqli, $sql);
  date_default_timezone_set("America/Mexico_City");
    $mes = ["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"][date("n") - 1];
  $fi=strftime("%A %d de ".$mes." del %Y a las %H:%M hrs.");
  
class PDF extends FPDF
{
   
   function Header()
   {
      //$this->Image("img/fi.jpg", 5, null, 200,30);
      $this->Image('img/logo.png', 150, 5, 40 );
      $this->Image('img/fondo.png', 10, 160, 180,90);
     
      $this->Ln(20);

   }
   function Footer()
   {
       $this->SetXY(120,238);
       $this->SetFont('Arial','B',10);
      $this->Cell(13,30, utf8_decode('Dra. Nelly Eugenia Robles Luján. C.P. 4412680'),0,0,'L');

      //Go to 1.5 cm from bottom
       $this->SetY(-40);
       //this->Image('img/fi.png', 5, 270, 200 );     
         

       $this->Image("img/fi.jpg", 5, null, 200,30);
       //Select Arial italic 8
       $this->SetFont('Arial','I',8);
       //Print current and total page numbers
       $this->Cell(0,10,utf8_decode('Página ').$this->PageNo().'/{nb}',0,0,'C');
   }
}

      $pdf = new PDF('P','mm','A4');
      
      $pdf->AliasNbPages();
      $pdf->AddPage();
      $pdf->SetAutoPageBreak(TRUE, 44);
      $pdf->SetXY(10,5);
       $pdf->SetFont('Arial','B',18);
      $pdf->Cell(45,30, utf8_decode('Inventario: '),0,0,'L');
      $pdf->SetXY(10,15);
      $pdf->SetFont('Arial','B',12);
      $pdf->Cell(50,30, 'Fecha ' . $fi ,0,1,'L');
      $pdf->SetXY(10,45);
      $pdf->SetFont('Arial','B',12);
      $pdf->Cell(10,10,'NUM',1,0,'L');
      $pdf->Cell(85,10,'Nombre',1,0,'L');
      $pdf->Cell(38,10,'Marca',1,0,'L');
      $pdf->Cell(22,10,'Serie',1,0,'L');
      $pdf->Cell(18,10,'Inv',1,0,'L');
      $pdf->Cell(18,10,'Min',1,1,'L');
      $pdf->SetFont('Arial','',10);
      $n=0;$L=0;while($row = mysqli_fetch_array($resultado)) { $l=$l+1;
      $n=$n+$row['num'];
      $pdf->Cell(10,10,$l,1,0,'L');
      $pdf->Cell(85,10,utf8_decode($row['pro_nombre']),1,0,'L');
      $pdf->Cell(38,10,utf8_decode($row['pro_marca']),1,0,'L');
      $pdf->Cell(22,10,utf8_decode($row['pro_num_serie']),1,0,'L');
      $pdf->Cell(18,10,utf8_decode($row['pro_cantidad']),1,0,'L');
      $pdf->Cell(18,10,utf8_decode($row['pro_minimo']),1,1,'L'); 
      
      }

     
      
       
   
       $pdf->Output();

   ?>