<?php

include('pdf/fpdf.php');
session_cache_limiter('private');
session_start();
include("DMMYSQLG.php");
include("DF80000.php");
class PDF extends FPDF{
//Cabecera de página
	function Header(){
	    //Logo
	         include("DYIM_VER.php");
	    //Arial bold 14
		$this->SetFont('Arial','B',18);
		//Título
		$this->Cell(225,5,'CATALOGO: TIPOS DE CUARsssTO'.$_REQUEST['fec'].'--'.$_POST['fec2'].'--'.$_REQUEST['r1'].'--',0,1,'C',0);
		//Salto de línea
		$this->Ln(8);
		$this->SetFont('Arial','B',9);//establece tamaño de letra
		$this->SetFillColor(192,192,192);
		$this->Cell(20,5,'',0,0,'C',0);
		$this->Cell(20,5,'FACTURA',1,0,'C',0);
		$this->Cell(20,5,'ARTICULO',1,0,'C',0);
		$this->cell(20,5,'CANTIDAD',1,0,'C',0);
		$this->cell(20,5,'PROM',1,0,'C',0);
		$this->cell(20,5,'AGRUPADOR',1,0,'C',0);
		$this->cell(20,5,'SUBTOTAL',1,0,'C',0);
		$this->cell(20,5,'DESCUENTO',1,0,'C',0);
		$this->cell(20,5,'IVA',1,0,'C',0);
		$this->cell(20,5,'TOTAL',1,1,'C',0);
	
	}	
	//Pie de página
	function Footer()
	{
	//Posición: a 1,5 cm del final
	$this->SetY(-15);
	//Arial italic 8
	$this->SetFont('Arial','I',8);
	//Número de página
	$this->Cell(0,10, $this->PageNo(),0,0,'C');
	}
}

$pdf=new PDF('P','mm','Letter');
$pdf->AddPage();

$pdf->SetFillColor(192,192,192);
$pdf->SetFont('Arial','',7);//establece tamaño de letra

$tbus=mysqli_real_escape_string($GLOBALS['con'],$_POST['tbus2']);

$fec = $_POST['fec'];
	  include('DF20000.php');
	  $fecha_inicial = $f_m;
	  
	  $fec = $_POST['fec2'];
	  include('DF20000.php');
	  $fecha_final = $f_m;

if($_POST['r1']=="clave")
	{
		echo '<input name="tip_bus" type="hidden" value="clave">';
	  	@$sql = mysqli_query($GLOBALS['con'] ,"SELECT * FROM dgreqdev where fec_ven between '$fecha_inicial' and '$fecha_final'");
		
	}elseif($_POST['r1']=="paso")
	{
		echo '<input name="tip_bus" type="hidden" value="paso">';
		@$sql = mysqli_query($GLOBALS['con'] ,"SELECT * FROM dgreqdev where fec_ven between '$fecha_inicial' and '$fecha_final'
				   
	               ");
				   
				   
	
	}
	
while($row = mysqli_fetch_array($sql)){
    $pdf-> Cell(30,5,'',0,0,'C',0);
	$pdf-> Cell(30,5, $row["fol_ven"],10,0,'C',0);
	$pdf-> Cell(60,5, $row["descripcion"],10,0,'C',0);
	$pdf-> Cell(40,5, $row["totalcuartos"],10,0,'C',0);
	//$pdf-> Cell(30,5, $row["t6"],10,0,'C',0);
	//$pdf-> Cell(40,5, $row["t7"],10,0,'C',0);
	$pdf-> Cell(30,5, $row["color"],10,1,'C',0);
	//$pdf-> Cell(20,5, $row["t9"],10,1,'C',0);
	
}
$pdf->Output("Catalogo Tipos De Cuarto.pdf","D");
?> 