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: index.php
Close
<? include 'assets/php/db_config.php'; include 'assets/php/function.php'; include '../assets/php/validate.logged.php'; function checkQuizStatus($quiz_id) { global $conn, $gUserId; $query = "SELECT quiz_submition FROM quiz_status WHERE user_id=$gUserId AND quiz_id = $quiz_id"; $stmt = $conn->prepare($query); $stmt->execute(); // Get result set $result = $stmt->get_result(); // Fetch all rows as an associative array if ($result->num_rows > 0) { $row = $result->fetch_assoc(); if ($row['quiz_submition'] == 'Y') return true; } else { return false; } } function checkQuizReg($quiz_id) { global $conn, $gUserId; $query = "SELECT quiz_fee FROM quiz_status WHERE user_id=$gUserId AND quiz_id = $quiz_id"; $stmt = $conn->prepare($query); $stmt->execute(); // Get result set $result = $stmt->get_result(); // Fetch all rows as an associative array if ($result->num_rows > 0) { $row = $result->fetch_assoc(); if ($row['quiz_fee'] == 'Y') return true; } else { return true; } } function displayQuizes() { global $conn; date_default_timezone_set('Asia/Kolkata'); $query = "SELECT * FROM quizes where isCompleted='N' limit 1"; $stmt = $conn->prepare($query); $stmt->execute(); $result = $stmt->get_result(); $currentTime = new DateTime(); // Get current time // Fetch each quiz from the database if ($row = $result->fetch_assoc()) { if (checkQuizStatus($row['id'])) { ?> <div class="quiz_btn_quiz"> <div> <button class="btn btn-secondary btn-lg" style="background-color: green;" disabled><?= $row['quiz_name'] ?> </button> <div class="quiz_details"> <div> Description:<?= $row['description'] ?> <br> </div> <div>Last date to register: <bold> 15/02/2025</bold> </div> <div>Duration of the Quiz-<?= $row['duration'] ?>minutes</div> <div>Date of the Quiz-<?= $row['start_time'] ?></div> </div> <button class="btn btn-primary " style="background-color: green;" disabled>You have already attended the quiz</button> </div> </div> <? } else { $startTime = new DateTime($row['start_time']); $endTime = new DateTime($row['end_time']); if ($currentTime < $startTime) { // Quiz is not started yet $startTimestamp = $startTime->format('H:i Y-m-d '); // Format start time as a timestamp ?> <div class="quiz_btn_quiz current_quiz"> <div> <button class="btn btn-secondary btn-lg" disabled> <?= $row['quiz_name'] ?></button> <div class="quiz_details"> <div> Description:<?= $row['description'] ?> <br> </div> <div>Last date to register: <bold> 15/02/2025</bold> </div> <div>Duration of the Quiz-<?= $row['duration'] ?>minutes</div> <div>Date of the Quiz-<?= $row['start_time'] ?></div> </div> </div> <div> <!-- <h5>Payment Status</h5> --> <? if (checkQuizReg($row['id'])) { ?> <button class="btn btn-primary ">Registered</button> <? } else { ?> <!-- Payment has to be done --> <button class="btn btn-primary " onclick="window.location.href='payment.php?quizId=<?= $row['id'] ?>'">Pay Now</button> <? } ?> </div> </div> <? } elseif ($currentTime >= $startTime && $currentTime <= $endTime) { if (checkQuizReg($row['id'])) { ?> <div class="quiz_btn_quiz current_quiz"> <div> <button class="btn btn-primary btn-lg" disabled> <?= $row['quiz_name'] ?></button> <div class="quiz_details"> <div> Description:<?= $row['description'] ?> <br> </div> <div>Last date to register: <bold> 15/02/2025</bold> </div> <div>Duration of the Quiz-<?= $row['duration'] ?>minutes</div> <div>Date of the Quiz-<?= $row['start_time'] ?></div> </div> </div> <div> <button class="btn btn-primary" onclick="window.location.href='quiz.php?quiz=<?= $row['id'] ?>&end=<?= urlencode($row['end_time']) ?>'">Start</button> </div> <? if (checkQuizReg($row['id'])) { ?> <? } else { ?> <div> <button class="btn btn-primary" onclick="window.location.href='quiz.php?quiz=<?= $row['id'] ?>&end=<?= urlencode($row['end_time']) ?>'">Start</button> </div> <? } ?> </div> <? } else { ?> <div class="quiz_btn_quiz current_quiz"> <div><button id="quiz_<?= $row['id'] ?>" class="btn btn-primary btn-lg"> <?= $row['quiz_name'] ?> </button> <div>You have Not Registered for this Quiz</div> </div> <div> <button class="btn btn-primary" onclick="window.location.href='quiz.php?quiz=<?= $row['id'] ?>&end=<?= urlencode($row['end_time']) ?>'" disabled>Start</button> </div> </div> <? } } else { ?> <div class="quiz_btn_quiz"><button class="btn btn-danger btn-lg" disabled> <?= $row['quiz_name'] ?></button> - Is already completed</div> <? } } } else { ?> <div class="quiz_btn_quiz current_quiz"> <div><button id="quiz_<?= $row['id'] ?>" class="btn btn-primary btn-lg"> <?= $row['quiz_name'] ?> </button> <div>No quiz available</div> </div> <div> <button class="btn btn-primary" onclick="window.location.href='quiz.php?quiz=<?= $row['id'] ?>&end=<?= urlencode($row['end_time']) ?>'" disabled>Start</button> </div> </div><? } } function displayQuizes1() { global $conn; date_default_timezone_set('Asia/Kolkata'); $query = "SELECT * FROM quizes"; $stmt = $conn->prepare($query); $stmt->execute(); $result = $stmt->get_result(); $currentTime = new DateTime(); // Get current time ?><h1>Quiz</h1><? // Fetch each quiz from the database while ($row = $result->fetch_assoc()) { if (checkQuizStatus($row['id'])) { ?> <div class="quiz_btn_quiz"><button class="btn btn-secondary btn-lg" style="background-color: green;" disabled> <?= $row['quiz_name'] ?> </button> - You have already attended the quiz </div> <? } else { $startTime = new DateTime($row['start_time']); $endTime = new DateTime($row['end_time']); if ($currentTime < $startTime) { // Quiz is not started yet $startTimestamp = $startTime->format('H:i Y-m-d '); // Format start time as a timestamp ?> <div class="quiz_btn_quiz current_quiz"> <div> <button class="btn btn-secondary btn-lg" disabled> <?= $row['quiz_name'] ?></button> - Starts at <?= $startTimestamp ?> </div> <div> <!-- <h5>Payment Status</h5> --> <? if (checkQuizReg($row['id'])) { ?> <button class="btn btn-primary ">Registered</button> <? } else { ?> <!-- Payment has to be done --> <button class="btn btn-primary " onclick="window.location.href='payment.php?quizId=<?= $row['id'] ?>'">Pay Now</button> <? } ?> </div> </div> <? } elseif ($currentTime >= $startTime && $currentTime <= $endTime) { if (checkQuizReg($row['id'])) { ?> <div class="quiz_btn_quiz current_quiz"> <div><button id="quiz_<?= $row['id'] ?>" class="btn btn-primary btn-lg"> <?= $row['quiz_name'] ?> </button> - Start your quiz</div> <div> <button class="btn btn-primary" onclick="window.location.href='quiz.php?quiz=<?= $row['id'] ?>&end=<?= urlencode($row['end_time']) ?>'">Start</button> </div> </div> <? } } else { ?> <div class="quiz_btn_quiz"><button class="btn btn-danger btn-lg" disabled> <?= $row['quiz_name'] ?></button> - Is already completed</div> <? } } } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Dashboard</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script> <link rel="stylesheet" href="assets/css/styles.css"> <link href="assets/css/main.css" rel="stylesheet" /> <script> function startQuiz(quizId) { $.ajax({ url: 'quiz.php', // the URL where you want to send the request type: 'POST', // method to send the data data: { quiz: quiz }, // data to be sent in the request success: function(response) { // If the request is successful, handle the response here // For example, redirect to another page or display a message window.location.href = response.redirectUrl; // assuming the server returns a JSON with 'redirectUrl' }, error: function(xhr, status, error) { // If there was an error with the AJAX request console.error("Error:", error); } }); } </script> <style> body { padding: 0px; /* background-color: #fdedb638; */ } /* .navbar { background-color: #fdedb6 !important; } */ .dashboard-container { display: flex; flex-wrap: wrap; gap: 20px; } .left-panel, .right-panel { padding: 20px; border: 1px solid #ddd; border-radius: 10px; background-color: #f9f9f9; } .left-panel { flex: 1; min-width: 300px; } .right-panel { flex: 1; min-width: 300px; } .current_quiz { justify-content: space-between } .child-details { margin-bottom: 10px; padding: 10px; border: 1px solid #ccc; border-radius: 5px; } .quiz-button { height: 90%; margin-top: 20px; } .quiz_btn_quiz { height: 100%; border: 1px solid black; width: 90%; display: flex; flex-direction: column; border-radius: 10px; /* align-items: center; width: max-content; */ padding: 5px; margin: 5px } .quiz_details { margin-top: 10px; gap: 8px; display: flex; flex-direction: column; align-items: flex-start; } </style> </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"> <? include "navbar_login.php" ?> <? if( ($gUserId == 23) || ($gUserId == 418) ){ ?> <a href="quizControl.php" style="color: black;">Admin</a> <? } ?> </div> </header> <!-- <nav class="navbar navbar-light bg-light shadow-sm"> <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> </ul> <i class="mobile-nav-toggle d-xl-none bi bi-list"></i> </nav> <a style="padding-right: 10px;" class="btn btn-primary me-3" href='editData.php'>Your Profile</a> <? if ($gUserId == 7) { ?> <a href="admin.php" class="btn btn-primary me-3">Admin</a> <? } ?> </div> </nav> --> <div class="container"> <div class="dashboard-container"> <div class="left-panel"> <!-- Start Quiz Button --> <div class="text-center quiz-button"> <? displayQuizes(); ?> </div> </div> </div> </div> </body> </html>