diff --git a/dashboard.php b/dashboard.php index f640c5e..3ae3842 100644 --- a/dashboard.php +++ b/dashboard.php @@ -1,86 +1,43 @@ prepare('SELECT s.name, s.description FROM services s JOIN user_services us ON s.id = us.service_id WHERE us.user_id = ?'); +$p->execute([$user_id]); +$services = $p->fetchAll(); + ?> -
- " . $_SESSION['message'] . "
"; - unset($_SESSION['message']); - } - if (isset($_SESSION['error'])) { - echo "
" . $_SESSION['error'] . "
"; - unset($_SESSION['error']); - } - ?> -
-
-

Welcome to your Dashboard, !

-

This is your central hub to manage your account and services. More features will be added soon.

-
-
- -
-
-

Your Subscribed Services

- prepare("SELECT s.name, s.description, us.id as user_service_id FROM services s JOIN user_services us ON s.id = us.service_id WHERE us.user_id = ? AND us.status = 'active'"); - $stmt->execute([$_SESSION['user_id']]); - $user_services = $stmt->fetchAll(PDO::FETCH_ASSOC); - - if (count($user_services) > 0) { - echo ""; - } else { - echo "

You are not subscribed to any services yet.

"; - } - ?> -
-
- -
-
-

Available Services

-
-
+
+

Dashboard

+

Welcome to your dashboard. Here are the services you are subscribed to:

- query("SELECT * FROM services"); - $services = $stmt->fetchAll(PDO::FETCH_ASSOC); - - foreach ($services as $service) { - ?> -
-
-
-
-

-

$ /

- Subscribe + +
+

You are not subscribed to any services yet.

+
+ + +
+
+
+
+

+ Go to service +
-
- + +
- + \ No newline at end of file diff --git a/includes/header.php b/includes/header.php index 766de5b..b0d496b 100644 --- a/includes/header.php +++ b/includes/header.php @@ -68,6 +68,9 @@ +