update to use single html with dynamic div

This commit is contained in:
2025-04-16 09:31:36 +02:00
parent 0dcdfa7e76
commit 1d3febeec1
21 changed files with 794 additions and 179 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
include 'db_connection.php';
$stmt = $db->prepare("SELECT id, name, maps_link FROM Restaurant");
$stmt->execute();
$restaurants = $stmt->fetchAll(PDO::FETCH_ASSOC);
if ($restaurants) {
$output = "<ul>";
foreach ($restaurants as $restaurant) {
$output .= "<li>Name: {$restaurant['name']}";
if ($restaurant['maps_link']) {
$output .= " - <a href='{$restaurant['maps_link']}' target='_blank'>View on Maps</a>";
}
$output .= "</li>";
}
$output .= "</ul>";
echo $output;
} else {
echo "<p>No restaurants available.</p>";
}
?>