<?php

include('pdf/fpdf.php');
session_cache_limiter('private');
session_start();
include("DMMYSQLG.php");
class PDF extends FPDF{
//Cabecera de página
	function Header(){
	    //Logo
	         include("DYIM_VER.php");
	    //Arial bold 14
		$this->SetFont('Arial','B',12);
		//Título
		$this->Cell(225,5,'----->PROMOTORES<-----',0,1,'C',0);
		//Salto de línea
		$this->Ln(8);
		$this->SetFont('Arial','',5);//establece tamaño de letra
		$this->SetFillColor(192,192,192);
		$this->Cell(30,5,'',0,0,'C',0);
		$this->Cell(30,5,'ID',1,0,'C',1);
		$this->Cell(30,5,'NOMBRE',1,0,'C',1);
		$this->cell(30,5,'APELLIDO P',1,0,'C',1);
		$this->cell(30,5,'APELLIDO M',1,0,'C',1);
		$this->cell(20,5,'RFC',1,0,'C',1);
		$this->cell(20,5,'TELEFONO',1,0,'C',1);
		$this->cell(40,5,'E_MAIL',1,1,'C',1);
		
	}	
	//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('L','mm','Letter');
$pdf->AddPage();

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

$tbus=mysqli_real_escape_string($GLOBALS['con'],$_POST['tbus']);
if($_POST['bot']=="")
	$sql = mysqli_query($GLOBALS['con'] ,$_POST['tbus']);
else
	@$sql = mysqli_query($GLOBALS['con'] ,"select * from dacatprom where id_catprom = '".$_POST['bot']."'") ;
	
while($row = mysqli_fetch_array($sql)){
    $pdf-> Cell(30,5,'',0,0,'C',0);
	$pdf-> Cell(30,5, $row["id_catprom"],1,0,'C',0);
	$pdf-> Cell(30,5, $row["nom"],1,0,'C',0);
	$pdf-> Cell(30,5, $row["ape_pat"],1,0,'C',0);
	$pdf-> Cell(30,5, $row["ape_mat"],1,0,'C',0);
	$pdf-> Cell(20,5, $row["rfc"],1,0,'C',0);
	$pdf-> Cell(20,5, $row["tel"],1,0,'C',0);
	$pdf-> Cell(40,5, $row["e_mail"],1,1,'C',0);
}
$pdf->Output("TIPO DE CUENTA.pdf","D");
?> 