| 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 : /Inetpub/www/training/administration/ |
Upload File : |
<?php
$hostname="localhost";
$username="root";
$password="P@ssw0rdMySQL0";
$dbname="quiz";
$link = mysqli_connect($hostname,$username,$password,$dbname) or die('เชื่อมต่อฐานข้อมูลไม่ได้');
mysqli_query($link,'set names utf8');
include('pdf1.84/fpdf.php');
$pdf=new FPDF( 'L' , 'mm' , 'A4' );
$id = $_REQUEST['id'];
session_start();
$email = $_SESSION['email'] ;
$tel = $_SESSION['tel'] ;
$cer="SELECT * FROM `quiz_test` where id = '$id' AND email = '$email' AND tel = '$tel' AND status = 'ผ่าน'" ;
$query_cer=mysqli_query($link,$cer);
$rs_cer=mysqli_fetch_assoc($query_cer);
if($rs_cer['id']=='') {
echo "<script>window.parent.location=\"search.php\"</script>";
}else {
$pdf->SetAutoPageBreak(false);
$pdf->AddPage();
$pdf->AddFont('sarabun','','THSarabun.php');
$pdf->AddFont('sarabunb','','THSarabunB.php');
$pdf->Image('img/working.jpg',0,0,297,210);
$pdf->SetXY(90,70);
$pdf->SetFont('sarabunb','',44);
$pdf->SetTextColor(255,255,255);
$pdf->Cell(200,28,iconv('utf-8','cp874',$rs_cer['name']),0,1,'C');
$pdf->SetXY(240,195);
$pdf->SetFont('sarabun','',14);
$pdf->SetTextColor(255,255,255);
$pdf->Cell(50,10,iconv('utf-8','cp874','ID ผพ.สทร.สพฐ. '.$rs_cer['cer_id'].'/2565'),0,1,'R');
$pdf->Output();
}
?>