-
-
-
+
+
Metro lines
+
+
Explore available Paris metro lines in the IDFM network
+
+
+
+
+
\ No newline at end of file
+
+
+
+
diff --git a/components/navigate/stop_list.php b/components/navigate/stop_list.php
index 0fa2a3c..bf488e2 100644
--- a/components/navigate/stop_list.php
+++ b/components/navigate/stop_list.php
@@ -1,10 +1,7 @@
@@ -20,7 +17,13 @@
|
- |
+
+
+
+
+
+
+ |
diff --git a/config_example.php b/config_example.php
new file mode 100644
index 0000000..f1f7163
--- /dev/null
+++ b/config_example.php
@@ -0,0 +1,7 @@
+
\ No newline at end of file
diff --git a/endpoints/updateFavorite.php b/endpoints/updateFavorite.php
new file mode 100644
index 0000000..560bf92
--- /dev/null
+++ b/endpoints/updateFavorite.php
@@ -0,0 +1,25 @@
+prepare("INSERT INTO favorites (userId, stopId, lineId) VALUES (?, ?, ?)");
+ $stmt->execute([$userId, $stopId, $lineId]);
+ } elseif ($action === 'remove') {
+ $stmt = $conn->prepare("DELETE FROM favorites WHERE userId = ? AND stopId = ? AND lineId = ?");
+ $stmt->execute([$userId, $stopId, $lineId]);
+ }
+ echo json_encode(['success' => true]);
+ } catch (PDOException $e) {
+ echo json_encode(['error' => $e->getMessage()]);
+ }
+ exit();
+}
+?>
diff --git a/services/db.php b/services/db.php
index 6d6d18b..9975cdd 100644
--- a/services/db.php
+++ b/services/db.php
@@ -1,9 +1,9 @@
exec("CREATE DATABASE IF NOT EXISTS subwaySchedule");
- $conn->exec("USE subwaySchedule");
+ $conn = new PDO("mysql:host=$db_host", $db_user, $db_password);
+ $conn->exec("CREATE DATABASE IF NOT EXISTS $db_name");
+ $conn->exec("USE $db_name");
$conn->exec("CREATE TABLE IF NOT EXISTS users (
id INT AUTO_INCREMENT PRIMARY KEY,
@@ -14,6 +14,14 @@ try {
is_admin BOOLEAN NOT NULL DEFAULT 0
)");
+ $conn->exec("CREATE TABLE IF NOT EXISTS favorites (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ userId INT NOT NULL,
+ stopId INT NOT NULL,
+ lineId INT NOT NULL,
+ FOREIGN KEY (userId) REFERENCES users(id)
+ )");
+
} catch(PDOException $e) {
diff --git a/services/stop_service.php b/services/stop_service.php
deleted file mode 100644
index ba2e1f6..0000000
--- a/services/stop_service.php
+++ /dev/null
@@ -1,5 +0,0 @@
-
\ No newline at end of file
diff --git a/structure/footer.php b/structure/footer.php
index e4aafad..40b1df4 100644
--- a/structure/footer.php
+++ b/structure/footer.php
@@ -1 +1,2 @@
-
\ No newline at end of file
+
+
diff --git a/structure/header.php b/structure/header.php
index 85c391d..86f0f2d 100644
--- a/structure/header.php
+++ b/structure/header.php
@@ -11,4 +11,4 @@
}
?>
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/structure/main.php b/structure/main.php
index d87d71b..a821d8a 100644
--- a/structure/main.php
+++ b/structure/main.php
@@ -1,6 +1,8 @@
-
+
+
+
+
\ No newline at end of file
diff --git a/structure/navbar.php b/structure/navbar.php
index d219a8a..1b6c855 100644
--- a/structure/navbar.php
+++ b/structure/navbar.php
@@ -1,35 +1,35 @@
-