From da08ad54ca6a5c97eb7ddccaf0037e2875fbcb65 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Tue, 3 Dec 2024 11:10:43 +0200 Subject: [PATCH] Fixes comments --- app/pages/dashboard.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/app/pages/dashboard.php b/app/pages/dashboard.php index a9fe4d5..680f3e3 100644 --- a/app/pages/dashboard.php +++ b/app/pages/dashboard.php @@ -2,7 +2,7 @@ /** * Main dashboard file for displaying conference statistics. - * + * * This file connects to the database and displays various widgets: * 1. Monthly statistics for the past year. * 2. Conferences from the last 2 days. @@ -14,22 +14,20 @@ require '../app/classes/participant.php'; // connect to database $response = connectDB($config, 'jilo', $platformDetails[0]['jilo_database'], $platform_id); + +// if DB connection has error, display it and stop here if ($response['db'] === null) { $error = $response['error']; include '../app/templates/block-message.php'; + +// otherwise if DB connection is OK, go on } else { $db = $response['db']; - // - // dashboard widget listings - // - - - //// - // monthly usage $conferenceObject = new Conference($db); $participantObject = new Participant($db); + /** * Monthly usage statistics for the last year. * @@ -95,9 +93,6 @@ if ($response['db'] === null) { include '../app/templates/widget-monthly.php'; - //// - // conferences in last 2 days - /** * Conferences in the last 2 days. * @@ -160,9 +155,6 @@ if ($response['db'] === null) { include '../app/templates/widget.php'; - //// - // last 10 conferences - /** * Last 10 conferences. *