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/training/user/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : E:/Inetpub/www/training/user//certi222.php
<?php
function thainumDigit($num){
    return str_replace(array( '0' , '1' , '2' , '3' , '4' , '5' , '6' ,'7' , '8' , '9' ),
    array( "o" , "๑" , "๒" , "๓" , "๔" , "๕" , "๖" , "๗" , "๘" , "๙" ),
    $num);
};

include '../db.php';
include('../pdf1.84/fpdf.php');

// เริ่ม session ถ้ายังไม่ได้เริ่ม
if (session_status() == PHP_SESSION_NONE) {
    session_start();
}

// รับค่า id ที่ถูกเข้ารหัสมาจาก URL และทำการถอดรหัส
$encoded_id = $_REQUEST['id'];
$id = base64_decode($encoded_id);

// รับค่าชื่อจาก session
$user_id = $_SESSION['user_id'];
$user_query = mysqli_query($conn, "SELECT * FROM users WHERE id = $user_id");
$user = mysqli_fetch_assoc($user_query);

// ตรวจสอบว่ามีชื่อหรือไม่
if (empty($user_id)) {
    echo "ไม่พบข้อมูลชื่อผู้ใช้";
    exit;
}

// สร้างเลขที่เกียรติบัตร (เป็นตัวอย่าง - คุณอาจจะใช้ logic อื่น)
$cert_id = date('Y') . sprintf('%04d', $id);

$pdf = new FPDF('L', 'mm', 'A4');
$pdf->SetAutoPageBreak(false);
$pdf->AddPage();
$pdf->AddFont('sarabun','','THSarabun.php');
$pdf->AddFont('sarabunb','','THSarabunB.php');
$pdf->Image('img/angel68.png', 0, 0, 297, 210);

$pdf->SetXY(49, 44.5);
$pdf->SetFont('sarabunb', '', 48);
$pdf->SetTextColor(26, 35, 126);
$pdf->Cell(200, 84, iconv('utf-8', 'cp874', $user_id), 0, 1, 'C');

$pdf->SetXY(200, 13);
$pdf->SetFont('sarabun', '', 18);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(65, 40, iconv('utf-8', 'cp874', 'เลขที่ สพม.รบ. ' . thainumDigit($cert_id) . '/๒๕๖๘'), 0, 1, 'R');

$pdf->Output();
?>

Youez - 2016 - github.com/yon3zu
LinuXploit