gmaps with restaurants

This commit is contained in:
Flatlogic Bot 2025-11-11 12:49:19 +00:00
parent 23725f3016
commit 9e5e0b2629
5 changed files with 44 additions and 12 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

View File

@ -1,16 +1,48 @@
<?php
require_once 'db/config.php';
try {
$pdo = db();
$stmt = $pdo->query('SELECT name, latitude, longitude, description FROM restaurants');
$restaurants = $stmt->fetchAll();
} catch (PDOException $e) {
// For development, you might want to log this error.
// For production, you could show a generic error message.
error_log('Database error: ' . $e->getMessage());
$restaurants = []; // Ensure restaurants is an empty array on error
}
$restaurants = [
[
"name" => "Restaurante D'Bacalhau",
"latitude" => 38.77124,
"longitude" => -9.09244,
"description" => "Specializing in codfish (bacalhau)."
],
[
"name" => "Cantinho do Avillez",
"latitude" => 38.7685,
"longitude" => -9.0953,
"description" => "Contemporary Portuguese cuisine with international influences."
],
[
"name" => "Fifty Seconds",
"latitude" => 38.774743,
"longitude" => -9.091382,
"description" => "A high-end dining experience with breathtaking views."
],
[
"name" => "Butchers",
"latitude" => 38.7685,
"longitude" => -9.0975,
"description" => "A prime destination for meat lovers."
],
[
"name" => "Capricciosa",
"latitude" => 38.7675,
"longitude" => -9.0897,
"description" => "A pizzeria with a pleasant terrace by the river."
],
[
"name" => "The Old House",
"latitude" => 38.77140277,
"longitude" => -9.09240424,
"description" => "A well-regarded Chinese restaurant."
],
[
"name" => "Honorato",
"latitude" => 38.7692,
"longitude" => -9.0958,
"description" => "A famous burger joint with a pleasant terrace."
]
];
?>
<!DOCTYPE html>
<html lang="en">