prepare($query); $stmt->execute(); $pedidos = $stmt->fetchAll(PDO::FETCH_ASSOC); header('Content-Type: application/vnd.ms-excel; charset=utf-8'); header('Content-Disposition: attachment; filename="rotulados.xls"'); header('Pragma: no-cache'); header('Expires: 0'); $output = '
'; $output .= '| DNI | '; $output .= 'Cliente | '; $output .= 'Sede de Envío | '; $output .= 'Numero | '; $output .= 'Producto | '; $output .= 'Cantidad | '; $output .= 'Numero de Orden | '; $output .= '
|---|---|---|---|---|---|---|
| ' . htmlspecialchars($pedido['dni_cliente'] ?? '') . ' | '; $output .= '' . htmlspecialchars($pedido['nombre_completo'] ?? '') . ' | '; $output .= '' . htmlspecialchars($pedido['sede_envio'] ?? '') . ' | '; $output .= '' . htmlspecialchars($pedido['celular'] ?? '') . ' | '; $output .= '' . htmlspecialchars($pedido['producto'] ?? '') . ' | '; $output .= '' . htmlspecialchars($pedido['cantidad'] ?? '') . ' | '; $output .= '' . $numero_orden . ' | '; $output .= '