403Webshell
Server IP : 172.67.187.206  /  Your IP : 172.71.28.156
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/certificate/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : E:/Inetpub/www/certificate/verify.php
<?php
require 'db.php';
require 'layout.php';
renderHeader("ตรวจสอบเลขเกียรติบัตร");

$search_code = isset($_POST['cert_code']) ? trim($_POST['cert_code']) : '';
$result_data = null;
$searched = false;

if ($_SERVER['REQUEST_METHOD'] == 'POST' && $search_code != '') {
    $searched = true;
    $safe_code = mysqli_real_escape_string($condb, $search_code);
    
    // ค้นหารายชื่อและกิจกรรมที่สัมพันธ์กับเลขที่เกียรติบัตร (cer_id)
    $query = "SELECT n.*, e.event_title, e.event_date, u.group_name 
              FROM cert_names n
              INNER JOIN cert_events e ON n.event_id = e.event_id
              LEFT JOIN users u ON e.user_id = u.user_id
              WHERE n.cer_id = '$safe_code' AND e.status = 1 
              LIMIT 1";
              
    $res = mysqli_query($condb, $query);
    if ($res && mysqli_num_rows($res) > 0) {
        $result_data = mysqli_fetch_assoc($res);
    }
}
?>

<div class="row justify-content-center mt-4 mb-5">
    <div class="col-lg-7 col-md-9">
        
        <div class="d-flex justify-content-between align-items-center mb-4">
            <h4 class="fw-bold text-dark m-0"><i class="fas fa-qrcode text-success"></i> ระบบตรวจสอบความถูกต้องของเกียรติบัตร</h4>
            <a href="index.php" class="btn btn-secondary btn-sm px-3 rounded-pill"><i class="fas fa-arrow-left"></i> กลับหน้าแรก</a>
        </div>

        <!-- การ์ดฟอร์มกรอกข้อมูล -->
        <div class="card p-4 shadow-sm border-0 bg-white rounded-4 mb-4">
            <form method="post" action="verify.php">
                <label class="form-label fw-bold text-secondary mb-2">กรอกเลขที่เกียรติบัตรที่ต้องการตรวจสอบ</label>
                <div class="input-group mb-2">
                    <span class="input-group-text bg-light text-muted"><i class="fas fa-search"></i></span>
                    <input type="text" name="cert_code" class="form-control form-control-lg fs-6" 
                           placeholder="ตัวอย่างเช่น: 001, สพม.รบ.025" required 
                           value="<?php echo htmlspecialchars($search_code); ?>">
                    <button type="submit" class="btn btn-success fw-bold px-4">ตรวจสอบข้อมูล</button>
                </div>
                <div class="form-text text-muted small">* ระบบจะตรวจสอบเลขที่พิมพ์ระบุอยู่บนใบเกียรติบัตรจริง</div>
            </form>
        </div>

        <!-- ส่วนแสดงผลลัพธ์การค้นหา -->
        <?php if ($searched): ?>
            <?php if ($result_data): ?>
                <!-- กรณีพบข้อมูล: แสดงรายละเอียดอย่างสวยงาม -->
                <div class="card shadow-sm border-0 rounded-4 overflow-hidden bg-white animate__animated animate__fadeIn">
                    <div class="bg-success p-3 text-white text-center fw-bold">
                        <i class="fas fa-check-circle"></i> ตรวจสอบพบข้อมูลในระบบ
                    </div>
                    <div class="card-body p-4">
                        <table class="table table-borderless m-0 fs-6">
                            <tbody>
                                <tr class="border-bottom">
                                    <td class="fw-bold text-muted py-3" width="30%">เลขที่เกียรติบัตร:</td>
                                    <td class="text-dark fw-bold py-3 text-success"><?php echo htmlspecialchars($result_data['cer_id']); ?></td>
                                </tr>
                                <tr class="border-bottom">
                                    <td class="fw-bold text-muted py-3">ออกให้แก่คุณ:</td>
                                    <td class="text-dark fw-bold py-3 fs-5"><?php echo htmlspecialchars($result_data['nm']); ?></td>
                                </tr>
                                <?php if(!empty($result_data['school'])): ?>
                                <tr class="border-bottom">
                                    <td class="fw-bold text-muted py-3">หน่วยงาน/โรงเรียน:</td>
                                    <td class="text-dark py-3"><?php echo htmlspecialchars($result_data['school']); ?></td>
                                </tr>
                                <?php endif; ?>
                                <tr class="border-bottom">
                                    <td class="fw-bold text-muted py-3">เนื่องในรายการ:</td>
                                    <td class="text-dark py-3 fw-bold text-primary"><?php echo htmlspecialchars($result_data['event_title']); ?></td>
                                </tr>
                                <tr class="border-bottom">
                                    <td class="fw-bold text-muted py-3">ออกให้ ณ วันที่:</td>
                                    <td class="text-dark py-3"><?php echo getThaiDate($result_data['event_date']); ?></td>
                                </tr>
                                <tr>
                                    <td class="fw-bold text-muted py-3">หน่วยงานผู้รับผิดชอบ:</td>
                                    <td class="text-muted small py-3"><?php echo !empty($result_data['group_name']) ? htmlspecialchars($result_data['group_name']) : 'ไม่ระบุหน่วยงาน'; ?></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            <?php else: ?>
                <!-- กรณีไม่พบข้อมูลในระบบ -->
                <div class="alert alert-danger text-center p-4 border-0 shadow-sm rounded-4 animate__animated animate__shakeX">
                    <i class="fas fa-times-circle fa-3x mb-3 text-danger"></i>
                    <h5 class="fw-bold">ไม่พบข้อมูลเลขที่เกียรติบัตรนี้</h5>
                    <p class="text-muted m-0 small">กรุณาตรวจสอบความถูกต้องของตัวเลข หรือ ตัวอักษรพิมพ์ใหญ่อีกครั้งหนึ่ง</p>
                </div>
            <?php endif; ?>
        <?php endif; ?>

    </div>
</div>

<?php renderFooter(); ?>

Youez - 2016 - github.com/yon3zu
LinuXploit