Participants page: Stop if there is DB connection error

main
Yasen Pramatarov 2024-11-16 13:08:56 +02:00
parent 8c37fea093
commit 43148d3f17
2 changed files with 148 additions and 143 deletions

View File

@ -10,7 +10,7 @@ if ($response['db'] === null) {
$error = $response['error']; $error = $response['error'];
include '../app/templates/block-message.php'; include '../app/templates/block-message.php';
// otherwise if DB connectio is OK, go on // otherwise if DB connection is OK, go on
} else { } else {
$db = $response['db']; $db = $response['db'];

View File

@ -4,12 +4,15 @@ require '../app/classes/participant.php';
// connect to database // connect to database
$response = connectDB($config, 'jilo', $platformDetails[0]['jilo_database'], $platform_id); $response = connectDB($config, 'jilo', $platformDetails[0]['jilo_database'], $platform_id);
// if DB connection has error, display it and stop here
if ($response['db'] === null) { if ($response['db'] === null) {
$error = $response['error']; $error = $response['error'];
include '../app/templates/block-message.php'; include '../app/templates/block-message.php';
// otherwise if DB connection is OK, go on
} else { } else {
$db = $response['db']; $db = $response['db'];
}
// specify time range // specify time range
include '../app/helpers/time_range.php'; include '../app/helpers/time_range.php';
@ -158,4 +161,6 @@ if (!empty($participants['records'])) {
// display the widget // display the widget
include '../app/templates/widget.php'; include '../app/templates/widget.php';
}
?> ?>