Shell File Manager

Current Path : /home/camscanae/www/downloads/Certificate/Class1/
Upload File :
Current File : /home/camscanae/www/downloads/Certificate/Class1/Certificate.php





<?php
require('../fpdf/fpdf.php');





include_once('../../../include/config.php');
$log_status = $_GET['log_status'];
$user_id = $_GET['user_id'];

$certificat = "SELECT * FROM certifications where user_id=$user_id ";
$certificat_run = mysqli_query($connection, $certificat);

if (mysqli_num_rows($certificat_run) > 0) {
    foreach ($certificat_run as $certificatfor) {
        // print_r($pritems1);
        $name = $certificatfor['name'];
        $certificate_date = $certificatfor['certificate_date'];

        $date = strtotime($certificatfor['certificate_date']);
        $certificate_exp = date('20y-m-d', strtotime("+3 year", $date));

        // print_r( $result);

    }
}

//$name = text to be added, $x= x cordinate, $y = y coordinate, $a = alignment , $f= Font Name, $t = Bold / Italic, $s = Font Size, $r = Red, $g = Green Font color, $b = Blue Font Color
function AddText($pdf, $text, $x, $y, $a, $f, $t, $s, $r, $g, $b)
{
    $pdf->SetFont($f, $t, $s);
    $pdf->SetXY($x, $y);
    $pdf->SetTextColor(22, 139, 139);
    $pdf->Cell(0, 10, $text, 0, 0, $a);
}

function AddText2($pdf, $text, $x, $y, $a, $f, $t, $s, $r, $g, $b)
{
    $pdf->SetFont($f, $t, $s);
    $pdf->SetXY($x, $y);
    $pdf->SetTextColor(91, 91, 87);
    $pdf->Cell(0, 10, $text, 0, 0, $a);
}
//Create A 4 Landscape page
$pdf = new FPDF('L', 'mm', 'A4');
$pdf->AddPage();
$pdf->SetFont('Times');
$pdf->SetCreator('CamScan FZCO');
// Add background image for PDF
$pdf->Image('../template.jpg', 0, 0, 0);

//Add a Name to the certificatev
AddText($pdf, ucwords("`` $name ``"), 18, 80, 'L', 'Helvetica', 'B', 30, 3, 84, 156);

$pdf->setFontSize(14);
AddText2($pdf, ucwords('Date Certified: ' . "$certificate_date"), 80, 172, 'C', 'Helvetica', '', 0, 0, 0, 0);

$pdf->setFontSize(14);
AddText2($pdf, ucwords('Valid Through: ' . "$certificate_exp"), 80, 179, 'C', 'Helvetica', '', 0, 0, 0, 0);

$pdf->Output();
?>

Shell File Manager Version 1.1, Coded By Shell
Email: [email protected]