"/* Global Styles */ * { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: monospace; background-color: black; color: orange; padding: 20px; margin: 0; text-align: center; font-size: 18px; line-height: 1.6; } .container { max-width: 900px; margin: auto; padding: 20px; } input, textarea, select { background-color: orange; color: black; border: 2px solid black; padding: 12px; width: 100%; font-family: monospace; font-size: 18px; min-height: 40px; } input::placeholder, textarea::placeholder { color: black; font-size: 16px; } button, a { display: inline-block; background-color: orange; color: black; padding: 12px 18px; text-decoration: none; border: 2px solid black; font-weight: bold; cursor: pointer; text-align: center; transition: background-color 0.3s ease, color 0.3s ease; font-size: 18px; border-radius: 6px; min-width: 160px; } button:hover, a:hover { background-color: black; color: orange; border: 2px solid orange; } a { display: inline-block; width: fit-content; margin: 10px auto; } label { display: block; margin-bottom: 10px; font-size: 20px; } .admin-container { width: 95%; margin: auto; overflow-x: auto; } .admin-table { width: 100%; border-collapse: collapse; margin-top: 20px; } .admin-table th, .admin-table td { border: 2px solid orange; padding: 10px; text-align: left; font-size: 18px; } .admin-table th { background-color: black; color: orange; } .action-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; } .question-box { border: 2px solid orange; padding: 12px; margin-bottom: 12px; background-color: black; color: orange; display: flex; flex-direction: column; font-size: 18px; } .question-box p { text-align: left !important; margin: 0 0 12px 0; } .survey-intro { text-align: left; margin: 20px 0; } .survey-intro p { text-align: left !important; text-indent: 2em; margin: 0 0 1em 0; } @media (max-width: 1024px) { body { font-size: 22px; padding: 15px; } .admin-table, .admin-table th, .admin-table td { font-size: 22px; padding: 12px; } button, a { font-size: 22px; padding: 16px 20px; width: 100%; } .action-buttons { flex-direction: column; align-items: center; } input, textarea, select { font-size: 22px; min-height: 50px; } .survey-intro, .question-box { font-size: 22px; } } @media (max-width: 768px) { body { font-size: 24px; padding: 15px; } .admin-table, .admin-table th, .admin-table td { font-size: 24px; padding: 14px; } button, a { font-size: 24px; padding: 18px 22px; } input, textarea, select { font-size: 24px; min-height: 55px; } .survey-intro, .question-box { font-size: 24px; } } @media (max-width: 480px) { body { font-size: 26px; padding: 10px; } button, a { font-size: 26px; padding: 20px 24px; width: 100%; } .admin-table, .admin-table th, .admin-table td { font-size: 26px; padding: 16px; } input, textarea, select { font-size: 26px; min-height: 60px; } .survey-intro, .question-box { font-size: 26px; } } .styled-divider { border: 3px solid orange; margin: 20px 0; width: 80%; } .divider-label { font-size: 22px; font-weight: bold; color: orange; text-align: center; margin-bottom: 20px; }", 'js/admin.js' => "// Admin panel JavaScript can be added here\n", 'assets/favicon.ico' => "// Placeholder for favicon\n", 'assets/logo.png' => "// Placeholder for logo\n", 'index.php' => ' SurveyGram 2.13 by Page Telegram

Enter Your Survey Code

$error

"; ?>

', 'survey.php' => ' $q) { if ($q[\'type\'] !== \'divider\' && $q[\'type\'] !== \'link\') { $response_data["q$index"] = $_POST["q$index"] ?? ($q[\'type\'] === \'scale\' ? \'0\' : \'\'); } } $response_data[\'timestamp\'] = date(\'Y-m-d H:i:s\'); file_put_contents($responseFile, json_encode($response_data, JSON_PRETTY_PRINT)); if (!isset($survey[\'responses\'])) { $survey[\'responses\'] = []; } $survey[\'responses\'][$user] = $response_data; file_put_contents($surveyFile, json_encode($survey, JSON_PRETTY_PRINT)); header("Location: completed.php?code=$code&user=$user"); exit(); } $dividerCount = 0; $surveyURL = "survey.php?code=$code&user=$user"; ?> <?php echo htmlspecialchars($survey[\'title\']); ?>

\' . htmlspecialchars($para) . \'

\'; } } ?>

Bookmark Your Survey Progress:

$q): ?>

:

" required>
', 'completed.php' => ' Survey Completed

Survey Completed

Thank you for completing the survey!

Did you bookmark your progress?

If you did not, please go back and bookmark the survey link if you intend to make changes or add more later.

Click below to return to your survey session:

Go Back

', 'admin.php' => ' Admin Login

Admin Login

Admin Dashboard

SurveyGram Admin Dashboard

+ Create New Survey
Survey Title Survey Access Code Responses Actions
Preview Edit Download JSON Download CSV Delete

Edit CSS

', 'new_survey.php' => ' $q) { $base_sequence = intval($_POST[\'sequence\'][$index]); if ($q[\'type\'] === \'divider\') { $questions[] = [ "sequence" => $base_sequence, "type" => "divider", "label" => trim($_POST[\'questions\'][$index][\'label\'] ?? "Divider #$index") ]; $sequence_offset++; } elseif ($q[\'type\'] === \'link\') { $questions[] = [ "sequence" => $base_sequence, "type" => "link", "description" => trim($_POST[\'questions\'][$index][\'description\']), "url" => trim($_POST[\'questions\'][$index][\'url\']) ]; $sequence_offset++; } else { $question = [ "sequence" => $base_sequence, "text" => trim($q[\'text\']), "type" => $q[\'type\'], "has_comments" => isset($_POST[\'questions\'][$index][\'has_comments\']) ? true : false ]; if ($q[\'type\'] === \'scale\') { $question[\'scale_min\'] = intval($_POST[\'questions\'][$index][\'scale_min\']); $question[\'scale_max\'] = intval($_POST[\'questions\'][$index][\'scale_max\']); } $questions[] = $question; $sequence_offset++; if ($question[\'has_comments\']) { $questions[] = [ "sequence" => $base_sequence + 1, "text" => "Any comments or questions?", "type" => "comments" ]; $sequence_offset++; } } } usort($questions, fn($a, $b) => $a[\'sequence\'] - $b[\'sequence\']); $surveyCode = substr(bin2hex(random_bytes(4)), 0, 7); $surveyData = [ "title" => $title, "intro" => $intro, "questions" => $questions ]; file_put_contents("data/surveys/$surveyCode.json", json_encode($surveyData, JSON_PRETTY_PRINT)); header("Location: admin.php?launchcode=hackme"); exit(); } ?> Create New Survey

Create New Survey





Questions



', 'edit_survey.php' => ' $q) { $base_sequence = intval($_POST[\'sequence\'][$index]); if ($q[\'type\'] === \'divider\') { $questions[] = [ "sequence" => $base_sequence, "type" => "divider", "label" => trim($_POST[\'questions\'][$index][\'label\'] ?? "Divider #$index") ]; $sequence_offset++; } elseif ($q[\'type\'] === \'link\') { $questions[] = [ "sequence" => $base_sequence, "type" => "link", "description" => trim($_POST[\'questions\'][$index][\'description\']), "url" => trim($_POST[\'questions\'][$index][\'url\']) ]; $sequence_offset++; } else { $question = [ "sequence" => $base_sequence, "text" => trim($q[\'text\']), "type" => $q[\'type\'], "has_comments" => isset($_POST[\'questions\'][$index][\'has_comments\']) ? true : false ]; if ($q[\'type\'] === \'scale\') { $question[\'scale_min\'] = intval($_POST[\'questions\'][$index][\'scale_min\']); $question[\'scale_max\'] = intval($_POST[\'questions\'][$index][\'scale_max\']); } $questions[] = $question; $sequence_offset++; if ($question[\'has_comments\']) { $questions[] = [ "sequence" => $base_sequence + 1, "text" => "Any comments or questions?", "type" => "comments" ]; $sequence_offset++; } } } usort($questions, fn($a, $b) => $a[\'sequence\'] - $b[\'sequence\']); $survey[\'questions\'] = $questions; file_put_contents($surveyFile, json_encode($survey, JSON_PRETTY_PRINT)); header("Location: edit_survey.php?code=$code"); exit(); } ?> Edit Survey

Edit Survey:





Questions

$q): ?>
">


', 'export.php' => ' $response) { $row = array_merge([$user], array_values($response)); fputcsv($output, $row); } fclose($output); } else { die("Invalid export format."); } ?>', 'delete_survey.php' => '', 'changelog.html' => ' SurveyGram Changelog

SurveyGram Changelog

This changelog documents the updates and improvements made to SurveyGram, a flexible survey system by Page Telegram Volunteer Services.

Version 2.13 - August 2025

Version 2.12 - August 2025

Version 2.11 - August 2025

Version 2.10 - August 2025

Version 2.9 - August 2025

Version 2.8 - August 2025

Version 2.7 - August 2025

Version 2.6 - August 2025

Version 2.5 - August 2025

Version 1.13 - Initial Release

Return to SurveyGram

' ]; // Create all files foreach ($files as $filename => $content) { file_put_contents($filename, $content); } echo "Setup complete! SurveyGram structure has been created."; ?>