Buscador
Código PHP:
Ver original
<center> Tabla De Pedidos <form name="form1" method="POST" action="panel.php" id="cdr"> <input name="busca" type="text" id="busqueda"> <input type="submit" name="submit" value="Buscar"> <input type="submit" href="reporte1.php" value="button>Exportar a PDF"> </form> <?php include_once('php/conexion.php'); $busca=""; $busca=$_POST['busca']; if ($busca!="") { $busqueda =mysqli_query($conexion,"SELECT * FROM pedidos INNER JOIN detalle ON pedidos.id_pedidos=detalle.id_pedidos WHERE empleado LIKE '%".$busca."%' or producto LIKE '%".$busca."%' or cantidad LIKE '%".$busca."%' or fecha_solicitud LIKE '%".$busca."%' or estado LIKE '%".$busca."%'"); } ?> <br> <div class="registros"> <table border="1" id="tab1"> <tr> <td width="19">Id</td> <td width="61">Empleado</td> <td width="120">Area</td> <td width="120">Producto</td> <td width="120">Marca</td> <td width="73">Cantidad</td> <td width="118">Fecha Solicitada</td> <td width="103">Fecha Entregada</td> <td width="67">Status</td> <td width="80" colspan="2">Operaciones</td> </tr> <?php # code... echo '<tr>'; echo '<td>'.$muestra['id_detalle'].'</td>'; echo '<td>'.$muestra['empleado'].'</td>'; echo '<td>'.$muestra['area'].'</td>'; echo '<td>'.$muestra['producto'].'</td>'; echo '<td>'.$muestra['marca'].'</td>'; echo '<td>'.$muestra['cantidad'].'</td>'; echo '<td>'.$muestra['fecha_solicitud'].'</td>'; echo '<td>'.$muestra['fecha_salida'].'</td>'; echo '<td>'.$muestra['estado'].'</td>'; ?> <td><a href="modificar.php?id=<?php echo $row['id_detalle']; ?>">Modificar</a> </td> <?php } ?> </table> </div> </form> </div> <br> <br> <br> <div> </center>
PDF "utilizo fpdf"
Código PHP:
Ver original
<?php include('fpdf/fpdf.php'); include('php/conexion.php'); $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial', '', 12); $pdf->image('img/logo1.png', 10, 8, 50, 13, 'png');/*==url de la image, x, y , ancho, altura, formato de img*/ $pdf->image('img/logo2.png', 60, 8, 50 ,13, 'png'); $pdf->Ln(15);/*==== Salto de*/ $pdf->Ln(15);/* Pagina====*/ $pdf->Cell(18, 10,"", 0);/*Largo, ancho, borde lo cual representa un espacio*/ $pdf->Cell(150, 10, "Reporte de los Pedidos", 0);/*titulo del reporte*/ $pdf->SetFont('Arial', "", '9');/**/ $pdf->Ln(15);/*salto de linea*/ $pdf->SetFont('Arial','', 11);/*Tipo de letra, negrita y tamaño 11*/ $pdf->Cell(70, 8,"", 0); $pdf->Cell(50, 8, "Listado De Los Pedidos", 0);/*para poder centrar el titulo*/ $pdf->Ln(8);/*Salto de pagina de 8*/ $pdf->Ln(15);/*Salto de pagina de 15*/ $pdf->SetFont('Arial', 'B', 8);/*Tipo de letra, negrita, tamaño 8*/ $pdf->Cell(15, 8, '', 0);/**/ $pdf->Ln(23); $pdf->SetFont('Arial','B', 8); $pdf->Cell(1, 1, '', 0); $pdf->Cell(5, 8, 'No.', 0); $pdf->Cell(25, 8, 'Empleado',0);/*====nombre de los campos========*/ $pdf->Cell(20, 8, 'Area',0);/*=======================*/ $pdf->Cell(20, 8, 'Producto', 0);/*============================*/ $pdf->Cell(25, 8, 'Marca', 0);/*==============================*/ $pdf->Cell(15, 8, 'Cantidad', 0);/*=======================*/ $pdf->Cell(25, 8, 'Fecha Solicitud', 0);/*=============================*/ $pdf->Cell(25, 8, 'Fecha Salida', 0);/*=============================*/ $pdf->Cell(25, 8, 'Status', 0);/*==================*/ $pdf->Ln(8); $pdf->SetFont('Arial', '', 8); //Consulta a la BD $productos = ('SELECT * FROM pedidos INNER JOIN detalle ON pedidos.id_pedidos=detalle.id_pedidos'); $item = 0; $productos=$conexion->query($productos); $item = $item+1; $pdf->Cell(1, 8, '', 0); $pdf->Cell(5, 8, $item,0); $pdf->Cell(25, 8, $row['empleado'], 0);/*===nombre de las campos de la tabla*/ $pdf->Cell(20, 8, $row['area'], 0);/*=======================================*/ $pdf->Cell(20, 8, $row['producto'], 0);/*====================================*/ $pdf->Cell(25, 8, $row['marca'], 0);/*=====================================*/ $pdf->Cell(15, 8, $row['cantidad'], 0);/*==================================*/ $pdf->Cell(25, 8, $row['fecha_solicitud'], 0);/*=================================*/ $pdf->Cell(25, 8, $row['fecha_salida'], 0);/*=================================*/ $pdf->Cell(25, 8, $row['estado'], 0);/*===================================*/ $pdf->Ln(8); } $pdf->Output(); ?>
y me preguntaba si poden ayudar y no se lo que esta mal, espero su ayuda