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
/
www
/
exam
/
Viewing: generate_certificate.php
<?php // Start output buffering at the very beginning ob_start(); require_once('tcpdf/tcpdf.php'); // Clean all output buffers ob_end_clean(); // Create new PDF document $pdf = new TCPDF('L', 'mm', 'A4', true, 'UTF-8', false); // Set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Certificate Generator'); $pdf->SetTitle('Certificate of Completion'); $pdf->SetSubject('Data Science Bootcamp'); // Remove default header/footer $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); // Set margins to zero to use full page for background $pdf->SetMargins(0, 0, 0); $pdf->SetAutoPageBreak(false, 0); // Add a page $pdf->AddPage(); // Get the page dimensions $pageWidth = $pdf->getPageWidth(); $pageHeight = $pdf->getPageHeight(); // Add background image $bgImage = 'bg_ertificate.png'; if (file_exists($bgImage)) { // Add background image that covers the entire page $pdf->Image($bgImage, 0, 0, $pageWidth, $pageHeight, '', '', '', false, 300, '', false, false, 0); } else { // Fallback design if image doesn't exist $pdf->SetFillColor(245, 245, 220); $pdf->Rect(0, 0, $pageWidth, $pageHeight, 'F'); $pdf->SetLineStyle(array('width' => 15, 'color' => array(139, 69, 19))); $pdf->Rect(0, 0, $pageWidth, $pageHeight); } // Get the dynamic student name from request $studentName = 'Student Name'; // Default value if (isset($_REQUEST['name']) && trim($_REQUEST['name']) !== '') { $studentName = trim($_REQUEST['name']); } // Log the student name to a file file_put_contents('certificate_log.txt', "Student Name: " . $studentName . " - Time: " . date('Y-m-d H:i:s') . "\n", FILE_APPEND); // Now create the certificate content with dynamic name // Title $pdf->SetFont('helvetica', 'B', 20); $pdf->SetTextColor(44, 62, 80); $pdf->SetY(60); $pdf->Cell(0, 0, 'CERTIFICATE OF COMPLETION', 0, 1, 'C'); // Subtitle $pdf->SetFont('helvetica', 'I', 14); $pdf->SetY(85); $pdf->Cell(0, 0, 'This certifies that', 0, 1, 'C'); // Student Name - DYNAMIC PART $pdf->SetFont('helvetica', 'B', 24); $pdf->SetY(105); $pdf->SetTextColor(255, 0, 0); // RED color for debugging $pdf->Cell(0, 0, $studentName, 0, 1, 'C'); // Reset text color $pdf->SetTextColor(0, 0, 0); // Main content $pdf->SetFont('helvetica', '', 14); $pdf->SetY(130); $content = "has completed all necessary tasks and demonstrated the skills required for the\nData Science Bootcamp. The successful completion of this program reflects\nher commitment to excellence and professional growth."; $pdf->MultiCell(0, 8, $content, 0, 'C', false, 1, '', '', true, 0, false, true, 0, 'T'); // Date $pdf->SetFont('helvetica', '', 14); $pdf->SetY(175); $pdf->Cell(0, 0, 'Given this 5th of November, 2025', 0, 1, 'C'); // Signatures $pdf->SetFont('helvetica', '', 12); // First signature - left side $pdf->SetY(220); $pdf->SetX(60); $pdf->Cell(80, 0, 'Arjun Singh', 0, 1, 'C'); $pdf->SetX(60); $pdf->SetFont('helvetica', 'I', 11); $pdf->Cell(80, 0, 'Senior Instructor', 0, 1, 'C'); // Second signature - right side $pdf->SetY(220); $pdf->SetX(160); $pdf->SetFont('helvetica', '', 12); $pdf->Cell(80, 0, 'Sunil Kumar', 0, 1, 'C'); $pdf->SetX(160); $pdf->SetFont('helvetica', 'I', 11); $pdf->Cell(80, 0, 'Program Director', 0, 1, 'C'); // Add signature lines $pdf->SetLineWidth(0.5); $pdf->Line(60, 215, 140, 215); $pdf->Line(160, 215, 240, 215); // Output PDF with student name in filename $safeFileName = preg_replace('/[^a-zA-Z0-9]/', '_', $studentName); $pdf->Output('certificate_' . $safeFileName . '.pdf', 'I'); exit; ?>
Coded With 💗 by
HanzOFC