El caso es que quiero mandar una tabla que contiene datos de una base de datos a un pdf, estoy usando FPDF pero resulta que cuando mando la variable me pone UNDIFINE
Este es parte de mi código espero y me ayuden
Código PHP:
Ver original
<?php require ('../Scripts/fpdf/fpdf.php'); require_once('../Connections/conexion.php'); $domingo_mp_tlx = "0"; $domingo_mp_tlx = $_GET["domingo"]; } $query_mp_tlx = sprintf("SELECT * FROM asistencia_minuta WHERE asistencia_minuta.fecha = 'domingo' AND asistencia_minuta.iglesias_nombre_iglesia='NUMERO 1'", GetSQLValueString($domingo_mp_tlx, "text")); class PDF extends FPDF{ $this->Image('../images/elrio_banner.JPG'); $this-> SetFont ('Arial','B',18); $this->Ln(5); $this->SetTextColor(0,0,139); $this->Cell(190,10,'TOTAL '.$_GET["domingo"],0,0,'C'); /*$this-> Cell(190,10,'PIE DE PAGINA',0,0,'C');*/ $this-> Ln(10); } //Tabla coloreada function TablaColores($header) { //Colores, ancho de línea y fuente en negrita $this->SetFillColor(25,25,112); $this->SetTextColor(255); $this->SetDrawColor(0,0,0); $this->SetLineWidth(.3); $this->SetFont('Arial','B',14); //Cabecera $this->Cell(45,7,$header[$i],1,0,'C',1); $this->Ln(); //Restauración de colores y fuentes $this->SetFillColor(224,235,255); $this->SetTextColor(0,0,0); $this->SetFont('Courier','',12); //Datos $fill=false; $this->Cell(45,6,"Adultos",'LR',0,'L',$fill); $this->Cell(45,6,''.$row_mp_tlx['num_adultos'],'LR',0,'C',$fill); $this->Cell(45,6,"Adultos",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Ln(); $fill=!$fill; $this->Cell(45,6,"Niños",'LR',0,'L',$fill); $this->Cell(45,6,"".$row_mp_tlx['num_ninios'],'LR',0,'C',$fill); $this->Cell(45,6,"Niños",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $fill=true; $this->Ln(); $fill=!$fill; $this->Cell(45,6,"Visitas",'LR',0,'L',$fill); $this->Cell(45,6,"".$row_mp_tlx['num_visitas'],'LR',0,'C',$fill); $this->Cell(45,6,"Visitas",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $fill=false; $this->Ln(); $fill=!$fill; $this->Cell(45,6,"Total",'LR',0,'L',$fill); $this->Cell(45,6,"".$row_mp_tlx['total'],'LR',0,'C',$fill); $this->Cell(45,6,"Total",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $fill=true; $this->Ln(); $this->Cell(180,0,'','T'); } function TablaColores1($header1) { //Colores, ancho de línea y fuente en negrita $this->SetFillColor(25,25,112); $this->SetTextColor(255); $this->SetDrawColor(0,0,0); $this->SetLineWidth(.3); $this->SetFont('Arial','B',14); //Cabecera $this->Cell(45,7,$header1[$i],1,0,'C',1); $this->Ln(); //Restauración de colores y fuentes $this->SetFillColor(224,235,255); $this->SetTextColor(0,0,0); $this->SetFont('Courier','',12); //Datos $fill=false; $this->Cell(45,6,"Adultos",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Cell(45,6,"Adultos",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Ln(); $fill=!$fill; $this->Cell(45,6,"Niños",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Cell(45,6,"Niños",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $fill=true; $this->Ln(); $fill=!$fill; $this->Cell(45,6,"Visitas",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Cell(45,6,"Visitas",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $fill=false; $this->Ln(); $fill=!$fill; $this->Cell(45,6,"Total",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Cell(45,6,"Total",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $fill=true; $this->Ln(); $this->Cell(180,0,'','T'); } function TablaColores2($header2) { //Colores, ancho de línea y fuente en negrita $this->SetFillColor(25,25,112); $this->SetTextColor(255); $this->SetDrawColor(0,0,0); $this->SetLineWidth(.3); $this->SetFont('Arial','B',14); //Cabecera $this->Cell(45,7,$header2[$i],1,0,'C',1); $this->Ln(); //Restauración de colores y fuentes $this->SetFillColor(224,235,255); $this->SetTextColor(0,0,0); $this->SetFont('Courier','',12); //Datos $fill=false; $this->Cell(45,6,"Adultos",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Cell(45,6,"Adultos",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Ln(); $fill=!$fill; $this->Cell(45,6,"Niños",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Cell(45,6,"Niños",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $fill=true; $this->Ln(); $fill=!$fill; $this->Cell(45,6,"Visitas",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Cell(45,6,"Visitas",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $fill=false; $this->Ln(); $fill=!$fill; $this->Cell(45,6,"Total",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Cell(45,6,"Total",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $fill=true; $this->Ln(); $this->Cell(180,0,'','T'); } function TablaColores3($header3) { //Colores, ancho de línea y fuente en negrita $this->SetFillColor(25,25,112); $this->SetTextColor(255); $this->SetDrawColor(0,0,0); $this->SetLineWidth(.3); $this->SetFont('Arial','B',14); //Cabecera $this->Cell(45,7,$header3[$i],1,0,'C',1); $this->Ln(); //Restauración de colores y fuentes $this->SetFillColor(224,235,255); $this->SetTextColor(0,0,0); $this->SetFont('Courier','',12); //Datos $fill=false; $this->Cell(45,6,"Adultos",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Cell(45,6,"Adultos",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Ln(); $fill=!$fill; $this->Cell(45,6,"Niños",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Cell(45,6,"Niños",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $fill=true; $this->Ln(); $fill=!$fill; $this->Cell(45,6,"Visitas",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Cell(45,6,"Visitas",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $fill=false; $this->Ln(); $fill=!$fill; $this->Cell(45,6,"Total",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Cell(45,6,"Total",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $fill=true; $this->Ln(); $this->Cell(180,0,'','T'); } function TablaColores4($header4) { //Colores, ancho de línea y fuente en negrita $this->SetFillColor(25,25,112); $this->SetTextColor(255); $this->SetDrawColor(0,0,0); $this->SetLineWidth(.3); $this->SetFont('Arial','B',14); //Cabecera $this->Cell(45,7,$header4[$i],1,0,'C',1); $this->Ln(); //Restauración de colores y fuentes $this->SetFillColor(224,235,255); $this->SetTextColor(0,0,0); $this->SetFont('Courier','',12); //Datos $fill=false; $this->Cell(45,6,"Adultos",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $this->Ln(); $fill=!$fill; $this->Cell(45,6,"Niños",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $fill=true; $this->Ln(); $fill=!$fill; $this->Cell(45,6,"Visitas",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $fill=false; $this->Ln(); $fill=!$fill; $this->Cell(45,6,"Total",'LR',0,'L',$fill); $this->Cell(45,6,"",'LR',0,'C',$fill); $fill=true; $this->Ln(); $this->Cell(90,0,'','T'); } } $pdf = new PDF (); $pdf-> AddPage(); //Títulos de las columnas $pdf->SetFont('Arial','B',18); $pdf->SetTextColor(255,255,0); $pdf->AliasNbPages(); //Primera página $pdf->SetY(50); //$pdf->AddPage(); $pdf->TablaColores($header); $pdf->Ln(10); $pdf->TablaColores1($header1); $pdf->Ln(10); $pdf->TablaColores2($header2); $pdf->Ln(10); $pdf->TablaColores3($header3); $pdf->Ln(10); $pdf->TablaColores4($header4); $pdf->Output(); ?>