diff --git a/results.php b/results.php index 4f0c0d4..724ff41 100644 --- a/results.php +++ b/results.php @@ -1,30 +1,42 @@ exec('TRUNCATE TABLE votes'); $message = 'All votes have been cleared.'; } else { - if (!isset($_SESSION['loggedin']) || !$_SESSION['loggedin']) { - $error = 'Invalid password'; - } + // Optional: handle unauthorized cleanup attempt } } +// Handle logout if (isset($_GET['logout'])) { session_destroy(); header('Location: results.php'); exit; } + +$is_loggedin = isset($_SESSION['loggedin']) && $_SESSION['loggedin']; ?> @@ -37,7 +49,7 @@ if (isset($_GET['logout'])) {
No votes yet.
- + if (empty($results)): + echo "No votes yet for this category.
"; + else: + ?>No votes yet.
- + if (empty($results)): + echo "No votes yet for this category.
"; + else: + ?>No votes have been cast yet.
"; + else: + ?> +| ID | +Voter Name | +Category | +Website Number | +Timestamp | +
|---|---|---|---|---|
| + | + | + | + | + |