<?php

include('pdf/fpdf.php');
session_cache_limiter('private');
session_start();
$com = "I";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DMMYSQLG.php"); 
class PDF extends FPDF
{
	//Cabecera de Página
	function Header()
	{
	    //Logotipo
	   include("DYIM_VER.php");
	    //Arial Bold (14)
	    $this->SetFont('Arial','B',12);
	    
	    //Título
	    $this->Cell(190,1,'PROCESOS ESPECIALES',0,1,'C');
	    //Salto de línea
	    $this->Ln(1);
		$this->SetFont('Arial','',7);
		$this->SetFillColor(192,192,192);
		$this->Cell(18,5,'',0,0,'C',0);
		$this->Cell(40,5,'CLAVE',1,0,'C',1);
		$this->Cell(40,5,'MODULO',1,0,'C',1);
		$this->Cell(40,5,'PROCESO',1,0,'C',1);		
		$this->Cell(40,5,'PERSONAL',1,1,'C',1);						

	}
	//Pie de Página
	function Footer()
	{
	    //Posición: 1,5 cm del Final
	    $this->SetY(-15);
	    //Arial Italic 8
	    $this->SetFont('Arial','I',8);
	    //Número de página
	    $this->Cell(0,0, $this->PageNo().'/{nb}',0,0,'C');
	}
}

/*if($_POST['bot']==""){
	if($_POST['tip_bus']=="clave"){
		$sql1 ="SELECT * FROM dxproesp WHERE id_proesp  = '".$_POST['txt_t1']."'";
	}elseif($_POST['tip_bus']=="nombre"){
		$sql1 ="SELECT * FROM dxproesp WHERE modulo LIKE '%".$_POST['txt_t1']."%'";
	}else{
		$sql1 = "SELECT * FROM dxproesp";
	}
}else{
	$sql1 = "SELECT * FROM dxproesp WHERE id_proesp = '".$_POST['bot']."'";
}

*/

if($_POST['r1']=="clave")
	{
		
	  	@$sql = mysqli_query($GLOBALS['con'] ,"SELECT * FROM dxproesp WHERE modulo = '".$_POST['tbus']."'");
		
	}elseif($_POST['r1']=="descripcion")
	{
			@$sql = mysqli_query($GLOBALS['con'] ,"SELECT * FROM dxproesp WHERE personal like '%".$_POST['tbus']."%'");
	}else {
				@$sql = mysqli_query($GLOBALS['con'] ,"SELECT * FROM dxproesp order by modulo,personal");
	}
	
	
	
/*$sql = mysqli_query ($sql1); 
while ($reg = mysqli_fetch_row($sql)) { 
    $data[] = $reg[0]; 
	$data1[] = $reg[1];
	}
$num_elementos=count($data);*/

$pdf=new PDF('P','mm','A4');
$pdf->AddPage();
$pdf->AliasNbPages();
$pdf->SetFont('Arial','',7);
	while($reg = mysqli_fetch_array($sql))
	{
	$pdf->Cell(18,5,'',0,'0','C');
	$pdf->Cell(40,5, $reg['id_proesp'],0,'0','L');
	$pdf->Cell(40,5, $reg['modulo'],0,'0','L');
	$pdf->Cell(40,5, $reg['proceso'],0,'0','L');		
	$pdf->Cell(40,5, $reg['personal'],0,'1','L');	
	}
$pdf->Output("PROCESOS ESPECIALES.pdf","D");
?> 
