34988-vm/survey_success.php
2025-10-15 18:14:20 +00:00

55 lines
2.3 KiB
PHP

<?php
$survey_id = isset($_GET['id']) ? htmlspecialchars($_GET['id']) : '#';
$survey_url = 'view_survey.php?id=' . $survey_id; // This page doesn't exist yet
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Survey Created! - survey-demo-app</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
<div class="container">
<a class="navbar-brand" href="/">SurveyBuilder</a>
</div>
</nav>
<main class="section">
<div class="container">
<div class="text-center py-5">
<?php if (isset($_GET['response'])): ?>
<h1 class="display-4">Thank You!</h1>
<p class="lead">Your response has been submitted successfully.</p>
<div class="mt-4">
<a href="/" class="btn btn-primary">Back to Home</a>
</div>
<?php else: ?>
<h1 class="display-4">🎉 Success!</h1>
<p class="lead">Your survey has been created successfully.</p>
<div class="mt-4">
<p>You can share this link with your respondents:</p>
<div class="input-group mb-3 mx-auto" style="max-width: 500px;">
<input type="text" class="form-control" id="surveyUrl" value="<?php echo htmlspecialchars($survey_url); ?>" readonly>
<button class="btn btn-outline-secondary" type="button" onclick="navigator.clipboard.writeText(document.getElementById('surveyUrl').value)">Copy</button>
</div>
<a href="<?php echo htmlspecialchars($survey_url); ?>" class="btn btn-primary">View Survey</a>
<a href="create_survey.php" class="btn btn-secondary">Create Another Survey</a>
</div>
<?php endif; ?>
</div>
</div>
</main>
<footer class="footer mt-auto">
<div class="container text-center">
<p>&copy; <?php echo date("Y"); ?> SurveyBuilder. All Rights Reserved.</p>
</div>
</footer>
</body>
</html>