// Inventory POST $app->post('/inventory/query', function ($request, $response, $args) { $data = $request->getParsedBody(); $this->logger->info("Inventory POST query"); $date = filter_var($data['myInput'], FILTER_SANITIZE_STRING); $mapper = new InventoryQueryMapper($this->db); $inventory = $mapper->processQuery($date); return $this->renderer->render($response, 'queries/query_inventory.phtml', [$args, "inventory" => $inventory]); }); // Invoices $app->get('/invoices/query', function ($request, $response, $args) { $this->logger->info("invoice GET Query Page"); return $this->renderer->render($response, 'queries/query_invoices.phtml'); }); // Invoices POST $app->post('/invoices/query', function ($request, $response, $args) { $data = $request->getParsedBody(); $this->logger->info("invoices POST query"); $name = filter_var($data['customerName'], FILTER_SANITIZE_STRING); $orderId = (int) filter_var($data['orderId'], FILTER_SANITIZE_STRING); $mapper = new InvoicesQueryMapper($this->db); $invoices = $mapper->processQuery($name, $orderId); return $this->renderer->render($response, 'queries/query_invoices.phtml', [$args, "invoices" => $invoices]); }); // Payment $app->get('/payments/query', function ($request, $response, $args) { $this->logger->info("Payments GET Query Page"); $mapper = new PaymentMapper($this->db); $payments = $mapper->processQuery(); return $this->renderer->render($response, 'queries/query_payments.phtml', [$args, "payments" => $payments]); });