V1rus Private
User / IP
:
216.73.217.108
Host / Server
:
190.92.174.125 / aerosofthealthcare.com
System
:
Linux s3739.bom1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64
Cmd
|
Upload
|
Mass Deface
|
Create
|
Sym
:
/
home
/
aerosoft
/
public_html
/
exam
/
Viewing: admin_dashboard (2).php
<?php require_once('tcpdf/tcpdf.php'); include 'config.php'; if (!isset($_SESSION['student_id'])) { header("Location: login.php"); exit(); } $exam_id = $_GET['exam_id'] ?? null; if (!$exam_id) { header("Location: student_dashboard.php"); exit(); } // Get exam and certificate details $stmt = $pdo->prepare("SELECT e.*, c.name as category_name, s.name as student_name, s.email, cert.certificate_code, cert.issued_date, cert.expiry_date FROM exams e JOIN categories c ON e.category_id = c.id JOIN students s ON e.student_id = s.id LEFT JOIN certificates cert ON cert.exam_id = e.id WHERE e.id = ? AND e.student_id = ? AND e.status = 'passed'"); $stmt->execute([$exam_id, $_SESSION['student_id']]); $data = $stmt->fetch(); if (!$data) { die("Certificate not available for this exam."); } // Create new PDF document $pdf = new TCPDF('L', 'mm', 'A4', true, 'UTF-8', false); // Set document information $pdf->SetCreator('CertiPro System'); $pdf->SetAuthor('CertiPro'); $pdf->SetTitle('Certificate of Completion'); $pdf->SetSubject('Professional Certification'); // Remove default header/footer $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); // Set margins $pdf->SetMargins(15, 15, 15); // Add a page $pdf->AddPage(); // Set background $pdf->SetFillColor(255, 255, 255); // Add border $pdf->Rect(5, 5, 287, 200, 'D', array(), array(128, 128, 128)); // Add decorative elements $pdf->SetLineWidth(1); $pdf->Rect(10, 10, 277, 190, 'D', array(), array(240, 240, 240)); // Certificate Header $pdf->SetFont('helvetica', 'B', 24); $pdf->SetTextColor(41, 128, 185); $pdf->Cell(0, 20, 'CERTIFICATE OF ACHIEVEMENT', 0, 1, 'C'); // Subtitle $pdf->SetFont('helvetica', 'I', 16); $pdf->SetTextColor(52, 73, 94); $pdf->Cell(0, 10, 'This is to Certify That', 0, 1, 'C'); // Student Name $pdf->SetFont('helvetica', 'B', 32); $pdf->SetTextColor(231, 76, 60); $pdf->Cell(0, 25, strtoupper($data['student_name']), 0, 1, 'C'); // Achievement Text $pdf->SetFont('helvetica', '', 16); $pdf->SetTextColor(52, 73, 94); $pdf->MultiCell(0, 10, "has successfully completed all requirements and demonstrated exceptional proficiency in", 0, 'C'); // Course Name $pdf->SetFont('helvetica', 'B', 20); $pdf->SetTextColor(41, 128, 185); $pdf->Cell(0, 15, $data['category_name'], 0, 1, 'C'); // Score Information $pdf->SetFont('helvetica', '', 14); $pdf->SetTextColor(52, 73, 94); $pdf->Cell(0, 10, "with an outstanding score of " . $data['percentage'] . "%", 0, 1, 'C'); // Date Section $pdf->SetFont('helvetica', '', 14); $pdf->SetTextColor(52, 73, 94); $pdf->Cell(0, 20, "Awarded this " . date('jS \of F, Y', strtotime($data['issued_date'])), 0, 1, 'C'); // Signature Area $pdf->SetY(-60); $pdf->SetFont('helvetica', 'B', 12); // Left Signature $pdf->Cell(95, 10, 'Arjun Singh', 0, 0, 'C'); $pdf->Cell(95, 10, 'Sunil Kumar', 0, 1, 'C'); $pdf->SetFont('helvetica', 'I', 10); $pdf->Cell(95, 5, 'Senior Instructor', 0, 0, 'C'); $pdf->Cell(95, 5, 'Program Director', 0, 1, 'C'); // Certificate Code $pdf->SetY(-30); $pdf->SetFont('helvetica', '', 10); $pdf->SetTextColor(149, 165, 166); $pdf->Cell(0, 10, 'Certificate ID: ' . $data['certificate_code'], 0, 0, 'C'); // Add QR Code (optional) $qrData = "Certificate ID: " . $data['certificate_code'] . "\n"; $qrData .= "Student: " . $data['student_name'] . "\n"; $qrData .= "Course: " . $data['category_name'] . "\n"; $qrData .= "Score: " . $data['percentage'] . "%\n"; $qrData .= "Issue Date: " . $data['issued_date']; $style = array( 'border' => 0, 'vpadding' => 'auto', 'hpadding' => 'auto', 'fgcolor' => array(0,0,0), 'bgcolor' => false, 'module_width' => 1, 'module_height' => 1 ); $pdf->write2DBarcode($qrData, 'QRCODE,L', 240, 20, 40, 40, $style, 'N'); // Output PDF $pdf->Output('certificate_' . $data['certificate_code'] . '.pdf', 'D'); ?>
Coded With 💗 by
HanzOFC