Current File : /home/inlingua/public_html/noida/icentex/certificate_Private_old_18_9_19.php
<?php
session_start();
require('dbConnection.php');

// Include common functions
require('commonFunc.php');

// Include common functions
require('globalVars.php');
require('dbHandler.class.php');
$dbObject = new dbHandler();
$dbObject->connect();
//ob_start();
//include("header.php");
?>
<?php
require_once('tcpdf/config/lang/eng.php');
require_once('tcpdf/tcpdf.php');
$query="select a.*, s.studentName from level_Private a left join ingl_student s on  s.recNo=a.student_recNo where a.courseId='$_SESSION[courseId]'";
//$query="select * from level_5 where courseId='$_SESSION[courseId]'";
$result=mysql_query($query);

// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Inlingua');
$pdf->SetTitle('Inlingua');
$pdf->SetSubject('Inlingua');
$pdf->SetKeywords('Inlingua Certificates');

// remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);

// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

//set margins
$pdf->SetMargins('25', '100', '25');

//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

//set some language-dependent strings
$pdf->setLanguageArray($l);

// ---------------------------------------------------------






while($num=mysql_fetch_array($result))
{
$queryCourse="select courseid,startdate,enddate,branch,language,level from ingl_course where courseid='".$num[courseId]."'";
$resultCourse=mysql_query($queryCourse) or die("Error:There is some ploblem");
$numCourse=mysql_fetch_array($resultCourse);

$pdf->SetFont('times', '', 11);
$fromDate=$numCourse[startdate];
$toDate=$numCourse[enddate];

//$fromDate="2009-03-10";
//$toDate="2009-03-10";

$fromdate1=explode("-",$fromDate);
$todate1=explode("-",$toDate);
$fdate1= date("d F Y", mktime(0, 0, 0, $fromdate1[1], $fromdate1[2], $fromdate1[0]));
$tdate1= date("d F Y", mktime(0, 0, 0, $todate1[1], $todate1[2], $todate1[0]));


$content="";

if($numCourse[branch]=="S.Extn")
{
    $numCourse[branch]="South Extension";
}
else{
    $numCourse[branch]=$numCourse[branch];
}

$content.='<table border="0" width="100%"><tr><td valign="center" align="center" style="font-size:80px;"><i>Certificate</i></td></tr></table>';

$content.='<table border="0" width="100%"><tr><td valign="center" align="center">for</td></tr></table>';

$content.='<table border="0" width="100%"><tr><td valign="center" align="center" style="font-size:80px;" ><b><i>'.$numCourse[courseid].'</i></b></td></tr></table>';

$content.='<table border="0" width="100%"><tr><td valign="center" align="center">conducted</td></tr></table>';

$content.='<table border="0" width="100%"><tr><td valign="center" align="center">at <span style="font-size:80px;" ><b><i>inlingua '.$numCourse[branch].'</b></i></span></td></tr></table>';

//$content.='<table border="0" width="100%"><tr><td valign="center" align="center"><em><u>GPP'.$numCourse[level].' General English Language Course</u></em></td></tr>';
	
  
   
   $content.='<table border="0" width="100%" ><tr><td valign="center" align="center" height="30px;">&nbsp;</td></tr></table>';
   
   $content.='<table border="0" width="100%"><tr><td align="center">from <b><i> '.$fdate1.' &ndash; '.$tdate1.' </i></b></td></tr></table>';
   
   $content.='<table border="0" width="100%" ><tr><td valign="center" align="center" height="40px;">&nbsp;</td></tr></table>';
   
	$cer_comment='This is to certify that <span style="font-size:80px;"><i><b>'.ucfirst($num[studentName]).'</b></i></font><br> attended and completed the program';
        
        $content.='<table border="0" width="100%"><tr><td valign="center" align="center" style="font-size:60px;">'.$cer_comment.'</td></tr></table>';
        
         $content.='<table border="0" width="100%" ><tr><td valign="center" align="center" height="200px;">&nbsp;</td></tr></table>';
         
         $content.='<table border="0" width="100%" ><tr><td valign="center" align="center" width="33%"><i>inlingua</i> New Delhi</td>
        <td valign="center" align="center" width="33%">'.date("d M Y").'</td>
        <td valign="center" align="center" width="34%">&nbsp;</td>
        </tr></table>';
        
	$content.='<table border="0" width="100%" ><tr><td valign="center" align="center" width="33%">Place</td>
        <td valign="center" align="center" width="33%">Date</td>
        <td valign="center" align="center" width="34%">Director</td>
        </tr></table>';


// add a page
$pdf->AddPage();


// set some text to print
$html = <<<EOD
 $content
EOD;
$pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);

}
				
//Close and output PDF document
$pdf->Output('example_002.pdf', 'I');
?>