Current File : /home/inlingua/public_html/noida/icentex_noida/certificate_2_o1.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("html2fpdf.php");
$query="select * from level_2 where courseId='$_SESSION[courseId]'";
$result=mysql_query($query);
class PDF extends HTML2FPDF
{
//Page header
function Header()
{
$this->SetFont('Arial','B',10);
//$this->SetTextColor(0,0,128);
//$this->setXY(44.2,84.0);
//$this->SetFillColor(200,220,255);
//$this->MultiCell(50,5,'Use of Structures',1,'C',true);
//$this->setXY(44.2,111.5);
//$this->MultiCell(50,5,'Pronunciation and Fluency',1,'C',true);
//$this->setXY(44.2,139.0);
//$this->MultiCell(50,5,'Listening Skills',1,'C',true);
//$this->setXY(44.2,166.5);
//$this->MultiCell(50,5,'Lexical Skills',1,'C',true);
//$this->setXY(44.2,194.0);
//$this->MultiCell(50,5,'Comments',1,'C',true);
}
//Page footer
function Footer()
{
//Position at 1.5 cm from bottom
$this->SetY(-15);
//Arial italic 8
$this->SetFont('Arial','I',8);
//Page number
//$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
function PrintChapter()
{
$this->AddPage();
//$this->Cell(0,10,'Printing line number '.$i,0,1);
}
function SetCol($col)
{
//Set position at a given column
$this->col=$col;
$x=10+$col*65;
$this->SetLeftMargin($x);
$this->SetX($x);
}
}
//Instanciation of inherited class
$pdf=new PDF();
$pdf->AliasNbPages();
while($num=mysql_fetch_array($result))
{
$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]));
$pdf->PrintChapter();
$content="";
$content1="";
$content.='<table width="100%"><tr><td align="center">
<p align="center"><em><u>GPP'.$num[level].' General English Language Course</u></em></p> </td></tr>';
/* <p align="center"><em><u>8<sup>th</sup> February – 22<sup>nd</sup> November 2010</u></em></p>*/
$content.='<tr><td align="center"><p align="center"><em><u> '.$fdate1.' – '.$tdate1.' </u></em></p></td></tr></table>';
$content.='<table align="center" width="400" border="0"><tr><td width="10%"><img src="images/blank.png" height="10"></td><td valign="top">
<p>'.nl2br ($num[cerification_comment]).'</p></td><td width="10%"></td></tr></table>';
//$pdf->WriteHTML($content1);
//echo $num[listening];
//echo imageselection($num[clarityandquality],"Excellent" );
//echo "<img src='images/images.jpg' height='20' width='20'";
/*$pdf->SetFont('Arial','B',9);
$pdf->setXY(96.5,85.0);
$pdf->SetFillColor(255,255,102);
$pdf->MultiCell(19.5,8,'Excellent',1,'C',true);
$pdf->setXY(116,85.0);
$pdf->MultiCell(19.5,8,'Very Good',1,'C',true);
$pdf->setXY(135.5,85.0);
$pdf->MultiCell(19.2,8,'Good',1,'C',true);
$pdf->setXY(154.7,85.0);
$pdf->MultiCell(19.3,8,'Quite Good',1,'C',true);
$pdf->setXY(174.0,85.0);
$pdf->MultiCell(19.7,8,'Fair',1,'C',true);
$pdf->setXY(193.7,85.0);
$pdf->MultiCell(19.5,8,'Poor',1,'C',true);*/
$content1.='<table border="0" width="100%">
<tr> <td width="10%"></td>
<td border="0" valign="top" width="27%" align="center"></td><td border="1" valign="top" width="8%" align="center" bgcolor="#FFFF66"><b>Excellent</b></td>
<td border="1" valign="top" width="8%" bgcolor="#FFFF66" align="center"><b>Very Good</b></td>
<td border="1" valign="top" width="8%" bgcolor="#FFFF66" align="center"><b>Good</b></td>
<td border="1" valign="top" width="8%" bgcolor="#FFFF66" align="center"><b>Quite Good</b></td>
<td border="1" valign="top" width="8%" bgcolor="#FFFF66" align="center"><b>Fair</b></td>
<td border="1" valign="top" width="8%" bgcolor="#FFFF66" align="center"><b>Poor</b></td>
<td width="10%"></td> </tr>
<tr> <td width="10%"></td>
<td border="1" valign="top" width="27%" align="center" bgcolor="#FFFF66">Clarity and Quality of Pronunciation</td><td border="1" valign="top" width="8%" align="center" >'.imageselection($num[clarityandquality],"Excellent" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[clarityandquality],"Very Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[clarityandquality],"Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[clarityandquality],"Quite Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[clarityandquality],"Fair" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[clarityandquality],"Poor" ).'</td>
<td width="10%"></td> </tr>
<tr> <td width="10%"></td>
<td border="1" width="22%" align="center" bgcolor="#FFFF66">Fluency<br>.</td><td border="1" valign="top" width="8%" align="center" >'.imageselection($num[fluency],"Excellent" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[fluency],"Very Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[fluency],"Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[fluency],"Quite Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[fluency],"Fair" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[fluency],"Poor" ).'</td>
<td width="10%"></td> </tr>
<tr> <td width="10%"></td>
<td border="1" valign="top" width="22%" align="center" bgcolor="#FFFF66">Accuracy of English Grammar and Structures</td><td border="1" valign="top" width="8%" align="center" >'.imageselection($num[accuracyenglish],"Excellent" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[accuracyenglish],"Very Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[accuracyenglish],"Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[accuracyenglish],"Quite Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[accuracyenglish],"Fair" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[accuracyenglish],"Poor" ).'</td>
<td width="10%"></td> </tr>
<tr> <td width="10%"></td>
<td border="1" valign="top" width="22%" align="center" bgcolor="#FFFF66">Knowledge and Use of Vocabulary</td><td border="1" valign="top" width="8%" align="center" >'.imageselection($num[knowledge],"Excellent" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[knowledge],"Very Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[knowledge],"Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[knowledge],"Quite Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[knowledge],"Fair" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[knowledge],"Poor" ).'</td>
<td width="10%"></td> </tr>
<tr> <td width="10%"></td>
<td border="1" valign="top" width="22%" align="center" bgcolor="#FFFF66">Ability to Understand and React to Spoken English</td><td border="1" valign="top" width="8%" align="center" >'.imageselection($num[abilityunder],"Excellent" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[abilityunder],"Very Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[abilityunder],"Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[abilityunder],"Quite Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[abilityunder],"Fair" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[abilityunder],"Poor" ).'</td>
<td width="10%"></td> </tr>
<tr> <td width="10%"></td>
<td border="1" valign="top" width="22%" align="center" bgcolor="#FFFF66">Listening<br>.</td><td border="1" valign="top" width="8%" align="center" >'.imageselection($num[listening],"Excellent" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[listening],"Very Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[listening],"Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[listening],"Quite Good" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[listening],"Fair" ).'</td>
<td border="1" valign="top" width="8%" align="center">'.imageselection($num[listening],"Poor" ).'</td>
<td width="10%"></td> </tr>
<tr> <td width="10%"></td>
<td border="1" valign="top" width="22%" align="center" bgcolor="#FFFF66">General Comments and Advice for Future Study</td><td border="1" valign="top" colspan="6">'.$num[general_comment].'
</td>
<td width="10%"></td> </tr>
</table>';
if($num[eligibility]=='Other')
{
$num[eligibility]=$num[othereligibility];
}
$content1.="<table ><tr><td width='30%'></td><td width='15%' border='1' bgcolor='#FFFF66' align='center'>Overall Grade</td><td width='10%'></td><td width='15%' border='1' bgcolor='#FFFF66' align='center'><b>".nl2br ($num[overall_grade])."</b></td></tr></table><br>";
$content1.="<table border='0' ><tr><td width='15%'></td><td>Eligibility for the next level:</td><td width='33%'>".$num[eligibility]."</td><td>Course ID:</td><td>".$num[courseId]."</td></tr></table>";
$pdf->setXY(0,50.0);
$pdf->WriteHTML($content);
$pdf->setXY(44.1,88.0);
$pdf->WriteHTML($content1);
}
//$content.='<div style="clear:both;font-size:2%;border :1px;">This document was generated with trial version of <a href="http://word-to-html.com/">Word to HTML</a> conversion software from <a href="http://maluke.com/software/">Maluke Software</a>.</div>';
$outfile="certificate_".$_SESSION[courseId].".pdf";
$pdf->Output("certificate/".$outfile."");
require("header.php");
echo"<br><br>";
echo' <a href="certificate/'.$outfile.'" target="_blank"><b>Click Here to download</b></a>';
require("footer-certificate.php");
function imageselection($value, $selection)
{
switch ($value) {
case "Excellent":
$return ="<img src='images/check.jpg' height='30' width='55'>";
$checkselect='Excellent';
break;
case "Excellent Towards Very Good":
$return ="<img src='images/check_right.jpg' height='30' width='55'>";
$checkselect='Excellent';
break;
case "Very Good Towards Excellent":
$return ="<img src='images/check_left.jpg' height='30' width='55'>";
$checkselect='Very Good';
break;
case "Very Good":
$return ="<img src='images/check.jpg' height='30' width='55'>";
$checkselect='Very Good';
break;
case "Very Good Towards Good":
$return ="<img src='images/check_right.jpg' height='30' width='55'>";
$checkselect='Very Good';
break;
case "Good Towards Very Good":
$return ="<img src='images/check_left.jpg' height='30' width='55'>";
$checkselect='Good';
break;
case "Good":
$return ="<img src='images/check.jpg' height='30' width='55'>";
$checkselect='Good';
break;
case "Good Towards Quite Good":
$return ="<img src='images/check_right.jpg' height='30' width='55'>";
$checkselect='Good';
break;
case "Quite Good Towards Good":
$return ="<img src='images/check_left.jpg' height='30' width='55'>";
$checkselect='Quite Good';
break;
case "Quite Good":
$return ="<img src='images/check.jpg' height='30' width='55'>";
$checkselect='Quite Good';
break;
case "Quite Good Towards Fair":
$return ="<img src='images/check_right.jpg' height='30' width='55'>";
$checkselect='Quite Good';
break;
case "Fair Towards Quite Good":
$return ="<img src='images/check_left.jpg' height='30' width='55'>";
$checkselect='Fair';
break;
case "Fair":
$return ="<img src='images/check.jpg' height='30' width='55'>";
$checkselect='Fair';
break;
case "Fair Towards Poor":
$return ="<img src='images/check_right.jpg' height='30' width='55'>";
$checkselect='Fair';
break;
case "Poor Towards Fair":
$return ="<img src='images/check_left.jpg' height='30' width='55'>";
$checkselect='Poor';
break;
case "Poor":
$return ="<img src='images/check.jpg' height='30' width='55'>";
$checkselect='Poor';
break;
}
if($selection==$checkselect)
{
//$return=$value;
return $return;
}
else return false;
}
?>