OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
quiz
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/17/2025 10:17:24 AM
rwxrwxr-x
📄
admin.php
2.97 KB
05/19/2025 10:07:16 AM
rw-r--r--
📁
adminProcess
-
05/19/2025 10:07:16 AM
rwxr-xr-x
📁
assets
-
02/15/2025 11:20:33 AM
rwxr-xr-x
📁
backup
-
05/19/2025 10:07:16 AM
rwxr-xr-x
📄
editData.php
16.75 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
editQuestion.php
8.03 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
editQuiz.php
8.3 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
footer.php
1.86 KB
05/19/2025 10:07:16 AM
rw-r--r--
📁
forms
-
05/19/2025 10:07:16 AM
rwxr-xr-x
📄
go_back.php
2.96 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
index.php
12.68 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
login.php
4.34 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
nav_scripts.php
1.96 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
navbar.php
2.41 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
navbar_login.php
2.34 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
payment.php
12.06 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
quiz.php
20.67 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
quizControl.php
8.4 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
quizQuestions.php
8.85 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
quizSubmitPage.php
39 bytes
05/19/2025 10:07:16 AM
rw-r--r--
📄
register.php
21.65 KB
05/19/2025 10:07:16 AM
rw-r--r--
📁
test
-
02/15/2025 11:20:34 AM
rwxr-xr-x
📁
test1
-
05/19/2025 10:07:16 AM
rwxr-xr-x
📁
yt_subscription
-
05/19/2025 10:07:16 AM
rwxr-xr-x
Editing: editQuestion.php
Close
<?php include('assets/php/db_config.php'); include('assets/php/validate.logged.php'); if (isset($_GET['queId'])) { $queId = $_GET['queId']; $quizId = $_GET['quizId']; } else { echo "Invalid question Selected"; } function editQuiz() { global $queId, $conn, $quizId; $query = "SELECT * FROM questions WHERE id = ?"; $stmt = $conn->prepare($query); $stmt->bind_param("i", $queId); $stmt->execute(); $result = $stmt->get_result(); $que_data = $result->fetch_assoc(); ?> <form id="queForm"> <h5>Question Details</h5> <div class="row" hidden> <div class="col-md-6 mb-3"> <input type="text" class="form-control" name="act" value="update" required> </div> </div> <div class="row" hidden> <div class="col-md-6 mb-3"> <label for="queId" class="form-label">Que Id</label> <input type="number" class="form-control" name="queId" value="<?= $que_data['id']; ?>" required> </div> </div> <div class="row"> <div class="mb-3"> <label for="que" class="form-label">Question</label> <input type="text" class="form-control" name="que" value="<?= $que_data['question']; ?>" required> </div> </div> <div class="row"> <div class="col-md-6 mb-3"> <label for="option1" class="form-label">Option 1</label> <input type="text" class="form-control" id="option1" name="option1" value="<?= $que_data['option1']; ?>" required> </div> <div class="col-md-6 mb-3"> <label for="option2" class="form-label">Option 2</label> <input type="text" class="form-control" id="option2" name="option2" value="<?= $que_data['option2']; ?>" required> </div> </div> <div class="row"> <div class="col-md-6 mb-3"> <label for="option3" class="form-label">Option 3</label> <input type="text" class="form-control" id="option3" name="option3" value="<?= $que_data['option3']; ?>" required> </div> <div class="col-md-6 mb-3"> <label for="option4" class="form-label">Option 4</label> <input type="text" class="form-control" id="option4" name="option4" value="<?= $que_data['option4']; ?>" required> </div> </div> <div class="col-md-6 mb-3"> <label for="answer" class="form-label">Answer</label> <input type="text" class="form-control" id="answer" name="answer" value="<?= $que_data['answer']; ?>" required> </div> <button id="updateDetails" onclick="submitForm(<? $quizId ?>)" class="btn btn-success">Update Question</button> </form> <? // Close the database connection $stmt->close(); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Quiz Edit</title> <link href="assets/img/favicon.png" rel="icon" /> <link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon" /> <!-- Fonts --> <link href="https://fonts.googleapis.com" rel="preconnect" /> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin /> <link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Raleway:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet" /> <!-- Vendor CSS Files --> <link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" /> <link href="assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet" /> <link href="assets/vendor/aos/aos.css" rel="stylesheet" /> <link href="assets/vendor/glightbox/css/glightbox.min.css" rel="stylesheet" /> <link href="assets/vendor/swiper/swiper-bundle.min.css" rel="stylesheet" /> <!-- Main CSS File --> <link href="assets/css/main.css" rel="stylesheet" /> <link rel="stylesheet" href="assets/css/styles.css"> <!-- Bootstrap JS and Popper.js --> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.min.js"></script> <!-- jQuery (required for some Bootstrap components like modals, etc.) --> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <!-- Additional Vendor JS Files --> <script src="assets/vendor/php-email-form/validate.js"></script> <script src="assets/vendor/aos/aos.js"></script> <script src="assets/vendor/glightbox/js/glightbox.min.js"></script> <script src="assets/vendor/purecounter/purecounter_vanilla.js"></script> <script src="assets/vendor/swiper/swiper-bundle.min.js"></script> <style> #queForm { margin: 10px; } </style> <script> // Submit the form using AJAX function submitForm(quizId) { $('#queForm').on('submit', function(e) { e.preventDefault(); // Prevent the default form submission var formData = $(this).serialize(); // Serialize the form data $.ajax({ url: 'adminProcess/updateQuestion.php', // PHP script to process the form data type: 'POST', data: formData, // Send the serialized form data success: function(response) { try { // Ensure the response is a JSON object var res = JSON.parse(response); // Check if the response contains a success flag if (res.success) { alert('Updated Successfully'); // Handle any post-registration actions, like redirecting or displaying a message window.history.back(); // You can customize the redirect } else { alert('Failed to update the quiz. ' + res.message); } } catch (error) { alert('Error: Response is not in valid JSON format'); } }, error: function(xhr, status, error) { alert('An error occurred during form submission. Please try again.'); } }); }); } </script> </head> <body> <header id="header" class="header d-flex align-items-center sticky-top"> <div class="container-fluid container-xl position-relative d-flex align-items-center"> <a href="index.php" class="logo d-flex align-items-center me-auto"> <img src="assets/img/logo_new.png" alt="" width="173" height="97" /></a> <nav id="navmenu" class="navmenu"> <ul> <li> <a href="index.php">Home<br /></a> </li> <li><a href="about_quiz.php">About</a></li> <li><a href="contact.php">Contact</a></li> <li><a href="dashboard.php">Dashboard</a></li> </ul> <i class="mobile-nav-toggle d-xl-none bi bi-list"></i> </nav> </div> </header> <button onclick="window.location.href='quizQuestions.php?quizId=<?=$quizId?>'" style="border-radius: 10px;">Back</button> <br><br> <? editQuiz() ?> </body> <script src="assets/js/main.js"></script> </html>