diff --git a/configuracion.php b/configuracion.php index 2371eed..86eccbb 100644 --- a/configuracion.php +++ b/configuracion.php @@ -54,7 +54,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['sync_shalom'])) { $count = 0; foreach ($sedes as $sede) { $id = $sede['ter_id']; - $nombre = $sede['lugar']; + // Usamos el campo 'nombre' que es más completo (Departamento / Provincia / Distrito / Lugar) + $nombre = $sede['nombre']; $stmt = $conn->prepare("INSERT INTO sedes_shalom (id_terminal, nombre_sede, activo, permite_origen, permite_destino) VALUES (?, ?, 1, 1, 1) ON DUPLICATE KEY UPDATE nombre_sede = VALUES(nombre_sede)"); diff --git a/download_shalom.php b/download_shalom.php new file mode 100644 index 0000000..217eee9 --- /dev/null +++ b/download_shalom.php @@ -0,0 +1,72 @@ +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="masivo_shalom.xls"'); + header('Pragma: no-cache'); + header('Expires: 0'); + + $output = '
'; + $output .= '| DESTINATARIO (DOC) | '; + $output .= 'TELF. DESTINATARIO | '; + $output .= 'CONTACTO (DOC) | '; + $output .= 'TELF. CONTACTO | '; + $output .= 'NRO GRR | '; + $output .= 'ORIGEN | '; + $output .= 'DESTINO | '; + $output .= '
|---|---|---|---|---|---|---|
| ' . $destinatario . ' | '; + $output .= '' . $celular . ' | '; + $output .= '' . $destinatario . ' | '; + $output .= '' . $celular . ' | '; + $output .= ''; // NRO GRR + $output .= ' | '; // ORIGEN + $output .= ' | ' . $destino . ' | '; + $output .= '