Current File : /home/inlingua/public_html/faridabad/icentex/s_Certificate/certificate_4.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 * from level_4 where student_recNo='$_SESSION[id]'";
$result=mysqli_query($conn,$query);
$count=mysqli_num_rows($result);
// 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', '0', '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=mysqli_fetch_array($result))
{
$pdf->SetFont('times', '', 11);
$fromDate=$num[startDate];
$toDate=$num[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="";
$content.='<table border="0" align="center" width="100%"><tr><td width="30%"></td><td width="40%"><img src="../images/inlingua_top.JPG"></td><td width="30%"></td></tr>
<tr><td colspan="3" style="font-size:20;" align="center"><strong>Statement of Achievement</strong></td></tr>
</table>';
$content.='<table border="0" align="center" width="100%"><tr><td height="100"></td></tr>
</table>';
$content.='<table border="0" width="100%"><tr><td valign="center" align="center"><em><u>GPP'.$num[level].' General English Language Course</u></em></td></tr>';
$content.='<tr><td align="center"><em><u> '.$fdate1.' – '.$tdate1.' </u></em></td></tr><tr><td> </td></tr>';
$content.='<tr><td align="center" width="100%"><table border="0"><tr><td style="text-align:justify;font-size:11;">'.nl2br ($num[cerification_comment]).'<br></td></tr></table></td></tr>';
$content.='<tr><td align="center" width="100%">
<table align="left" border="1" cellspacing="0" cellpadding="0"><tr><td height="60"><table cellspacing="0" cellpadding="0"><tr><td bgcolor="#FFFF66" width="30%" border="1"> Use of Structures</td><td></td></tr></table> <table cellpadding="4" style="text-align:justify"><tr><td>'.nl2br ($num[useStructures]).' </td></tr></table> </td></tr>
<tr><td height="60"><table><tr><td bgcolor="#FFFF66" width="30%" border="1"> Pronunciation and Fluency</td><td></td></tr></table> <table cellpadding="4" style="text-align:justify"><tr><td>'.nl2br ($num[pronFluency]).' </td></tr></table></td></tr>
<tr><td height="60"><table><tr><td bgcolor="#FFFF66" width="30%" border="1"> Listening Skills</td><td></td></tr></table><table cellpadding="4" style="text-align:justify"><tr><td>'.nl2br ($num[listening_skill]).' </td></tr></table></td></tr>
<tr><td height="60"><table><tr><td bgcolor="#FFFF66" width="30%" border="1"> Lexical Skills</td><td></td></tr></table><table cellpadding="4" style="text-align:justify"><tr><td>'.nl2br ($num[lexical_skill]).' </td></tr></table></td></tr>
<tr><td height="60"><table><tr><td bgcolor="#FFFF66" width="30%" border="1"> Comments</td><td></td></tr></table><table cellpadding="4" style="text-align:justify"><tr><td>'.nl2br ($num[general_comment]).' </td></tr></table></td></tr>
</table>
</td></tr>
';
if($num[eligibility]=='Other')
{
$num[eligibility]=$num[othereligibility];
}
$content.="<tr><td> </td></tr>";
if($num[eligibility]=='Other')
{
$num[eligibility]=$num[othereligibility];
}
$content.='<tr><td><table border="0"><tr><td width="25%"></td><td width="18%" border="2" bgcolor="#FFFF66" align="center">Overall Grade</td><td width="20%"></td><td width="15%" border="2" bgcolor="#FFFF66" align="center"><b>'.nl2br ($num[overall_grade]).'</b></td></tr></table></td></tr>';
$content.="<tr><td> </td></tr>";
$content.='<tr><td><table border="0" ><tr><td width="32%"><b>Eligibility for the next level:</b></td><td width="35%">'.$num[eligibility].'</td><td width="13%"><b>Course ID:</b></td><td>'.$num[courseId].'</td></tr></table></td></tr>';
$content.="</table>";
$date=$num[createDate];
$date1=explode(" ",$date);
$date2=$date1[0];
$date3=explode("-",$date2);
//$cDate="".$date3[2]."-".$date3[1]."-".$date3[0]."";
$cDate= date("d M Y", mktime(0, 0, 0, $date3[1], $date3[2], $date3[0]));
$content.='<table border="0" align="center" width="100%"><tr><td height="120"></td></tr>
</table>
<table width="100%" align="center" border="0"><tr><td width="33%" align="left">________________<br><b> Director</b></td><td width="33%" align="center">________________<br><b>Course Instructor</b></td><td width="33%" align="right"><u> '.$cDate.' </u><br><b>Date Of Issue </b></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);
}
if($count>0)
{
//Close and output PDF document
$pdf->Output('example_002.pdf', 'I');
}
else
{
include("header.php");
echo"<br><b><font color='red'>Your Certificate is Under Process.Please Contact Administrator.</font></b>";
include("footer.php");
}
?>