Dashboard
+Across all surveys.
+diff --git a/admin/index.php b/admin/index.php new file mode 100644 index 0000000..e7c8bba --- /dev/null +++ b/admin/index.php @@ -0,0 +1,138 @@ +query("SELECT COUNT(*) FROM surveys")->fetchColumn(); +$total_responses = $pdo->query("SELECT COUNT(*) FROM responses")->fetchColumn(); +$total_users = $pdo->query("SELECT COUNT(*) FROM users")->fetchColumn(); + +// Fetch recent surveys +$recent_surveys_stmt = $pdo->query("SELECT id, title, created_at FROM surveys ORDER BY created_at DESC LIMIT 5"); + +?> + + +
+ + +Across all surveys.
+No questions have been added to this survey yet.
+ + $question): ?> + + + + +Total Responses:
+There are no responses to analyze for this survey yet.
+ + $question): ?> +| Option | Count | Percentage |
|---|---|---|
| " . htmlspecialchars($option_text) . " | {$count} | {$percentage}% |
| # | +Title | +Responses | +Created | +Actions | +
|---|---|---|---|---|
| No surveys found. | ||||
| " . htmlspecialchars($row['id']) . " | "; + echo "" . htmlspecialchars($row['title']) . " | "; + echo "" . htmlspecialchars($response_count) . " | "; + echo "" . htmlspecialchars(date('Y-m-d', strtotime($row['created_at']))) . " | "; + echo ""; + echo "Results "; + echo "Manage "; + echo "Edit "; + echo "Delete"; + echo " | "; + echo "
| Database error: " . htmlspecialchars($e->getMessage()) . " | ||||
| # | +Username | +Actions | +
|---|---|---|
| " . htmlspecialchars($row['id']) . " | "; + echo "" . htmlspecialchars($row['username']) . " | "; + echo ""; + echo "Edit "; + // Prevent user from deleting themselves + if ($_SESSION['user_id'] != $row['id']) { + echo "Delete"; + } + echo " | "; + echo "
| Database error: " . htmlspecialchars($e->getMessage()) . " | ||
= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.
-This page will update automatically as the plan is implemented.
-Runtime: PHP = htmlspecialchars($phpVersion) ?> — UTC = htmlspecialchars($now) ?>
The future of survey creation and data analysis.
+Below is a list of our publicly available surveys. Please choose one to begin.
Your survey has been submitted successfully.
+We appreciate your feedback.
+ Return to Homepage +