From 909621e9be1c5913ea64f419f9edfdac29dc4e82 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Mon, 24 Nov 2025 22:27:36 +0000 Subject: [PATCH] Auto commit: 2025-11-24T22:27:36.668Z --- api.php | 17 +++++++ localizacion.php | 117 +++++++++++++++++++++++++++-------------------- 2 files changed, 85 insertions(+), 49 deletions(-) create mode 100644 api.php diff --git a/api.php b/api.php new file mode 100644 index 0000000..1f627bb --- /dev/null +++ b/api.php @@ -0,0 +1,17 @@ +query("SELECT t.matricula, t.modelo, lt.latitud, lt.longitud, lt.ultima_actualizacion + FROM localizacion_taxis lt + JOIN taxis t ON lt.id_taxi = t.id + ORDER BY lt.ultima_actualizacion DESC"); + $localizaciones = $stmt->fetchAll(PDO::FETCH_ASSOC); + echo json_encode($localizaciones); +} catch (PDOException $e) { + http_response_code(500); + echo json_encode(['error' => 'Error de base de datos: ' . $e->getMessage()]); +} +?> \ No newline at end of file diff --git a/localizacion.php b/localizacion.php index 435909c..2c0df26 100644 --- a/localizacion.php +++ b/localizacion.php @@ -64,25 +64,30 @@ try { $taxis_stmt = $pdo->query("SELECT id, matricula, modelo FROM taxis ORDER BY matricula"); $taxis = $taxis_stmt->fetchAll(PDO::FETCH_ASSOC); - // Fetch all locations - $stmt = $pdo->query("SELECT lt.id, t.matricula, t.modelo, lt.latitud, lt.longitud, lt.ultima_actualizacion - FROM localizacion_taxis lt - JOIN taxis t ON lt.id_taxi = t.id - ORDER BY lt.ultima_actualizacion DESC"); - $localizaciones = $stmt->fetchAll(PDO::FETCH_ASSOC); - } catch (PDOException $e) { die("Error de base de datos: " . $e->getMessage()); } ?> + +
-

Localización de Taxis

+

Localización de Taxis en Tiempo Real

+
+
+ + Mapa de Taxis +
+
+
+
+
+
@@ -150,48 +155,62 @@ try {
- -
-
- - Últimas Localizaciones Registradas -
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
IDTaxiLatitudLongitudÚltima Actualización
No hay localizaciones registradas.
-
-
+ + + +?> \ No newline at end of file