require_once __ROOT__ . '/Util/Reporte.php'; $submit = $_GET["submit"]; $fechaInicio = $_POST["fechaInicio"]; $fechaFin = $_POST["fechaFin"]; // Convertir fechas if ($submit == "Pedidos") { $pedidos = getReportePedidosByFechas($fechaInicio, $fechaFin); ob_start(); $reporte = new Reporte(); $reporte->setFecha($fechaInicio . " - " . $fechaFin); $reporte->setTitulo('Pedidos'); $header = array(utf8_decode("idPedido"), utf8_decode("Cliente"), utf8_decode("Mesa"), utf8_decode("Fecha"), utf8_decode("N° Productos"), utf8_decode("Importe Total")); $cols = array("idPedido", "nombreCompleto", "descripcion", "fecha", "productos", "importeTotal"); $w = array(20, 50, 30, 30, 20); $reporte->AddPage(); $reporte->Table($header, $cols, $pedidos, $w); $reporte->Output(); } if ($submit == "Consumo") { $pedidos = getReporteConsumoByFechas($fechaInicio, $fechaFin); ob_start(); $reporte = new Reporte(); $reporte->setFecha($fechaInicio . " - " . $fechaFin); $reporte->setTitulo('Consumo'); $header = array(utf8_decode("Producto"), utf8_decode("Tipo"), utf8_decode("Precio"), utf8_decode("Cantidad"), utf8_decode("Importe")); $cols = array("descripcion", "tipo", "precio", "cantidad", "importe"); $w = array(40, 40, 30, 30, 30); $reporte->AddPage(); $reporte->Table($header, $cols, $pedidos, $w); $reporte->Output(); }
<?php require_once './models/Reporte.php'; ob_start(); $reporte = new Reporte(); $reporte->setFecha(date('d/m/Y')); $reporte->setTitulo('Lista de Tipo de Equipos'); $header = array(utf8_decode('Código'), utf8_decode('Descripción'), utf8_decode('Nro. Modelos'), utf8_decode('Nro. Equipos')); $cols = array('idTipoEquipo', 'descripcion', 'nroModelos', 'nroEquipos'); $w = array(20, 80, 30, 30); $reporte->AddPage(); $reporte->Table($header, $cols, $tipoEquipos, $w); $reporte->Output();
} } if ($submit == "atender") { if (isset($_GET["idPedido"])) { atenderPedido($_GET["idPedido"]); header("Location: ../View/Pedidos/ListaPedidos.php?rpta=boleta&idPedido=" . $_GET["idPedido"]); } } if ($submit == "boleta") { if (isset($_GET["idPedido"])) { $idPedido = $_GET["idPedido"]; $pedido = getVwPedido($idPedido); $detallePedidos = getVwDetallePedidoByIdPedido($_GET["idPedido"]); ob_start(); $reporte = new Reporte(); $reporte->setFecha($pedido["fecha"]); $reporte->setTitulo("Boleta " . $pedido["idPedido"]); $reporte->AddPage(); // Generarndo Boleta $reporte->Ln(20); $reporte->SetFont('helvetica', 'B', 6); $reporte->Cell(20, 5, "ID:", 0, 0, 'B'); $reporte->SetFont('helvetica', '', 6); $reporte->Cell(20, 5, $pedido["idPedido"], 0, 0, 'C'); $reporte->Ln(5); $reporte->SetFont('helvetica', 'B', 6); $reporte->Cell(20, 5, "Cliente:", 0, 0, 'B'); $reporte->SetFont('helvetica', '', 6); $reporte->Cell(20, 5, $pedido["cliente"], 0, 0, 'C'); $reporte->Ln(5); $reporte->SetFont('helvetica', 'B', 6);