File size: 1,027 Bytes
dbf1813 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
<?php
require_once __DIR__ . "../../config/DataAccess.php";
require_once __DIR__ . "../../models/Locate.php";
class ControllerLocate
{
private $queryLocate;
public function __construct()
{
$this->queryLocate = "SELECT latitud, altitud, longitud FROM lugar_turistico";
}
public function getPlaceLocate($id_place)
{
$this->queryLocate = "$this->queryLocate WHERE id_lugar = $id_place;";
try {
$conAcc = new DataAccess();
$results = $conAcc->executeQueryGet($this->queryLocate);
if (!$results->num_rows) {
return ["message" => "Localizacion no disponible"];
}
$row = $results->fetch_assoc();
$arrLocate = [new Locate($row["latitud"], $row["altitud"], $row["longitud"])];
$conAcc->closeConection();
$conAcc = null;
return $arrLocate;
} catch (\Throwable $th) {
return ["message" => "Error al optener informacion"];
}
}
} |