/* Decoded by unphp.net */ ?> 0", " AND m.doc <> 0 AND m.cod in ($cods) ", $sql); } $rs = mysql_query($sql); class ListaCK extends FPDF { var $ProcessingTable; //Es la propiedad que indica si se esta procesando la tabla, para repetir nuevamente el encabezado. var $anchos; // Son los anchos de las diferentes columnas var $left; //Margen izquierdo inicial var $ultimoDia; function Header() { //0 1 2 3 4 5 $this->anchos = array(15,18,18, 100,25, 20);//los anchos de las columnas $this->left = 10; $this->ProcessingTable = true; //Print the table header if necessary } function TableHeader($dia='x', $y=38, $c=false) { $alto = 4; //Es el alto de la linea $this->SetFillColor(180,180,180); $this->SetFont('Arial','',9); $this->SetXY($this->left,$y); $ancho = $this->anchos[0] + $this->anchos[1] + $this->anchos[2] + $this->anchos[3] + $this->anchos[4] + $this->anchos[5]; $this->Cell($ancho,$alto,"", 'LRT',0,'L',1); $this->SetXY($this->left,$y+4); $this->Cell($this->anchos[0],$alto,"Codigo", 'LRB',0,'C',1); $this->Cell($this->anchos[1],$alto,"Fecha", 'RB',0,'C',1); $this->Cell($this->anchos[2],$alto,"Doc.", 'RB',0,'C',1); $this->Cell($this->anchos[3],$alto,"Nombre", 'RB',0,'C',1); $this->Cell($this->anchos[4],$alto,"Fondo", 'RB',0,'C',1); $this->Cell($this->anchos[5],$alto,"Monto", 'RB',0,'C',1); } function agregarDatos($rs) { $inicioDeTabla = 34; ///////////////////// Indica donde va iniciar la tabla a nivel de top $y = $inicioDeTabla; $alto = 6; $dia=''; $cant = 0; $total = 0; $color = true; $inicio = true; while ($row = mysql_fetch_array($rs)) { if($inicio==true) { $y += 2; $this->TableHeader($row["fecha"], $y); $y+=8; $inicio = false; } $this->SetFont('Arial','B',8); $this->SetXY($this->left,$y); $ancho = $this->anchos[0] + $this->anchos[1]+ $this->anchos[2] + $this->anchos[3] + $this->anchos[4]; $this->SetFillColor(209,211,223); //$y += $alto; $cant +=1; $total += $row["monto"]; $this->SetFont('Arial','',7); $this->SetXY($this->left,$y); $nombre = substr($row['detalle'], 0 , 65); if ($row['stad']==0) { $nombre = substr($nombre, 0, 55) . " (ANULADO) "; } $this->Cell($this->anchos[0],$alto,$row['cod'], 1,0,'C'); //Codigo $this->Cell($this->anchos[1],$alto,fechareporte($row['fecha']), 1,0,'C'); //Fecha $this->Cell($this->anchos[2],$alto,$row['doc'], 1,0,'C'); //Doc Pago $this->Cell($this->anchos[3],$alto,utf8_decode($nombre), 1,0,'L'); //Nombre $this->Cell($this->anchos[4],$alto,$row['fondo'], 1,0,'C'); //Fondo $this->Cell($this->anchos[5],$alto,number_format($row['monto'],2), 1,0,'R'); //Monto $y += $alto; $alto = 6; if($y > 255) { $this->AddPage(); $y = $inicioDeTabla; $inicio = true; } } ///la linea del total $this->SetFont('Arial','B',8); $this->SetXY($this->left,$y); $ancho = $this->anchos[0] + $this->anchos[1]+ $this->anchos[2] ; $this->SetFillColor(209,211,223); $this->Cell($ancho,$alto,"", 1,0,'R',1); // $this->Cell($this->anchos[3],$alto,"Cantidad de Cheques: ". $cant, 1,0,'R',1); // $this->Cell($this->anchos[4],$alto,"Total General: ", 1,0,'R',1); // $this->Cell($this->anchos[5],$alto,number_format($total,2), 1,0,'R',1); // $y += $alto; } } class PDF extends ListaCK { var $trimestre; function Header() { $muni = utf8_decode($_SESSION["sistemVARS"]["nombre"]); $clave = $_SESSION["sistemVARS"]["cod"]; $alto = 5; $titulo = 'nada nada'; //Title $this->SetFont('Arial','',12); //$this->SetXY(80,20); $this->Cell(0,$alto,$muni,0,1,'L'); $this->Cell(0,$alto,'Clave Municipal: '. $clave,0,1,'L'); $this->Cell(0,$alto,"".$_SESSION["sqlDataPDF"]["titulo"],0,1,'L'); $this->Cell(0,$alto,$_SESSION["sqlDataPDF"]["titulo1"],0,1,'L'); $this->Line(10, 32, 205, 32); //Ensure table header is output parent::Header(); } //Pie de página function Footer() { $fecha = date("d/m/Y, h:i A"); //Posición: a 1,5 cm del final $this->Line(10, 265, 205, 265); $this->SetY(-15); //Arial italic 8 $this->SetFont('Arial','I',6); //fecha y hora $this->Cell(10,10,$fecha,0,0); //Número de página $this->Cell(0,10,'Página '.$this->PageNo().' de {nb}',0,0,'R'); $this->SetY(-12); $this->Cell(65,$alto-2,'Impreso '.strtoupper($_SESSION['muniUser'] ['nombre']),'',0,'L'); $this->Cell(0,10,'Powered by Municipia',0,0,'R'); } } $pdf=new PDF('P', 'mm', 'Letter'); $pdf->AliasNbPages(); $pdf->SetAutoPageBreak(false); $pdf->AddPage(); $pdf->agregarDatos($rs); //unset($_SESSION["sqlDataPDF"]); $pdf->Output(); ?>