<?php

require('fpdf/fpdf.php');

class PDF extends FPDF
{


function colordia()
{
    //Colores, ancho de línea y fuente en negrita
    $this->SetFillColor(255,0,0);
    $this->SetTextColor(255);
    $this->SetDrawColor(128,0,0);
    $this->SetLineWidth(.3);
    $this->SetFont('','B');
}	


function ImprimirTabla($data,$x, $y, $h, $w,$alig)
{
    $this->SetFillColor(224,200,255);
    $this->SetTextColor(0);
    $this->SetDrawColor(128,0,0);
    $this->SetLineWidth(.3);
    $this->SetFont('','B');
	$this->SetXY($x,$y);
    //Datos
	$dib=false;
   	for($i=0;$i<count($data);$i++)
    {
	for($j=0;$j<count($w);$j++)
		{
        $this->Cell($w[$j],$h,$data[$i][$j],1,0,$alig[$j],$dib);
		$dib = !$dib;
        }
		$y = $y + $h;
		$this->SetXY($x,$y);
		
    }
}

function ImprimirTablaTitulo($data,$x, $y, $h, $w,$alig,$dib)
{
    $this->SetFillColor(224,200,255);
    $this->SetTextColor(0);
    $this->SetDrawColor(128,0,0);
    $this->SetLineWidth(.3);
    $this->SetFont('','B');
	$this->SetXY($x,$y);
    //Datos
	  	
	
        $this->Cell($w,$h,$data,1,0,$alig,$dib);
		//$dib = !$dib;
    
		//$this->SetXY($x,$y);
		
    
}

function ImprimirTablaSinColor($data,$x, $y, $h, $w,$alig)
{
    $this->SetFillColor(224,200,255);
    $this->SetTextColor(0);
    $this->SetDrawColor(128,0,0);
    $this->SetLineWidth(.3);
    $this->SetFont('','B');
	$this->SetXY($x,$y);
    //Datos
	$dib=false;
   	for($i=0;$i<count($data);$i++)
    {
	for($j=0;$j<count($w);$j++)
		{
        $this->Cell($w[$j],$h,$data[$i][$j],1,0,$alig[$j],$dib);
		//$dib = !$dib;
        }
		$y = $y + $h;
		$this->SetXY($x,$y);
		
    }

}

function ImprimirTablaSinColorLineal($data,$x, $y, $h, $w,$alig)
{
    $this->SetFillColor(224,200,255);
    $this->SetTextColor(0);
    $this->SetDrawColor(128,0,0);
    $this->SetLineWidth(.3);
    $this->SetFont('','B');
	$this->SetXY($x,$y);
    //Datos
	$dib=false;
   	for($i=0;$i<count($data);$i++)
    {
	        $this->Cell($w[$i],$h,$data[$i],1,0,$alig[$i],$dib);
		//$dib = !$dib;
    }
		//$y = $y + $h;
		//$this->SetXY($x,$y);
		
    //}

}

function ImprimirTablaSinColorFirma($data,$x, $y, $h, $w,$alig,$dibuja)
{
    $this->SetFillColor(224,200,255);
    $this->SetTextColor(0);
    $this->SetDrawColor(128,0,0);
    $this->SetLineWidth(.3);
    $this->SetFont('','B');
	$this->SetXY($x,$y);
    //Datos
	$dib=false;
   	for($i=0;$i<count($data);$i++)
    {
	        $this->Cell($w[$i],$h,$data[$i],$dibuja[$i],0,$alig[$i],$dib);
		//$dib = !$dib;
    }
		//$y = $y + $h;
		//$this->SetXY($x,$y);
		
    //}

}

function ImprimirTablaHorario($data,$x, $y, $h, $w,$alig)
{
    $this->SetFillColor(224,200,255);
    $this->SetTextColor(0);
    $this->SetDrawColor(128,0,0);
    $this->SetLineWidth(.3);
    $this->SetFont('','B');
	$this->SetXY($x,$y);
    //Datos
	$dib=false;
   		for($j=0;$j<count($w);$j++)
		{
        $this->Cell($w[$j],$h,$data[$j],1,0,$alig,$dib);
		//$dib = !$dib;
		$x = $x + $w[$j];
		$this->SetXY($x,$y);
        }
		
		
    

}

function ImprimirTablaJustificada($data,$x, $y, $h, $w,$alig,$d)
{
    $this->SetFillColor(224,200,255);
    $this->SetTextColor(0);
    $this->SetDrawColor(128,0,0);
    $this->SetLineWidth(.3);
    $this->SetFont('','B');
	$this->SetXY($x,$y);
    //Datos
	$dib=false;
	$h=$h/$d;
   	for($i=0;$i<count($data);$i++)
    {
	for($j=0;$j<count($w);$j++)
		{
		$this->MultiCell($w[$j],$h,$data[$i][$j],1,$alig[$j],$dib);
		$dib = !$dib;
        }
		$y = $y + $h;
		$this->SetXY($x,$y);
		
    }

}

function ImprimirTablaArea($data,$x, $y, $h, $w,$alig,$d,$horario)
{
    $this->SetFillColor(224,200,255);
    $this->SetTextColor(0);
    $this->SetDrawColor(128,0,0);
    $this->SetLineWidth(.3);
    $this->SetFont('','B');
	$this->SetXY($x,$y);
    //Datos
	$dib=false;
	//$h=($h/$d)*$horario;
	//$h = $h*$horario;
		$this->Cell($w,$h,$data,1,0,$alig,$dib);
		//$this->MultiCell($w,$h,$data,1,$alig,$dib);
		//$dib = !$dib;
        //$y = $y + $h;
		//$this->SetXY($x,$y);

}

function ImprimirDias($data,$x, $y, $h, $w,$alig,$pint)
{
    
    $this->SetTextColor(42,20,172);
    $this->SetDrawColor(128,0,0);
    $this->SetLineWidth(.3);
    $this->SetFont('','B');
	$this->SetXY($x,$y);
    //Datos
   	for($i=0;$i<count($data);$i++)
    {
	$this->SetFillColor($pint[$i][0],$pint[$i][1],$pint[$i][2]);
	
        $this->Cell($w[$i],$h,$data[$i],1,0,$alig[$i],true);
        //$y = $y + $h;
	}

}

function ImprimirDiasHoras($data,$x, $y, $h, $w,$alig,$pint)
{
    
    $this->SetTextColor(42,20,172);
    $this->SetDrawColor(128,0,0);
    $this->SetLineWidth(.3);
    $this->SetFont('','B');
	$this->SetXY($x,$y);
    //Datos
   	for($i=0;$i<count($data);$i++)
    {
	$this->SetFillColor($pint[$i][0],$pint[$i][1],$pint[$i][2]);
	
        $this->Cell($w[$i],$h,$data[$i],1,0,$alig[$i],true);
        //$x = $x + $w[$i];
		//$this->SetXY($x,$y);
	}

}

			


}

?>