Current File : /home/inlingua/www/noida/icentex_noida/certificate_3_old.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_3 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="";
$content1.='
<p align="center"><em><u>GPP'.$num[level].' General English Language Course</u></em></p> ';
/* <p align="center"><em><u>8<sup>th</sup> February – 22<sup>nd</sup> November 2010</u></em></p>*/
$content1.='<p align="center"><em><u> '.$fdate1.' – '.$tdate1.' </u></em></p>';
$content1.='<table align="center" width="400" border="0"><tr><td width="15%"><img src="images/blank.png" height="92"></td><td valign="top">
<p>'.nl2br ($num[cerification_comment]).'</p></td><td width="15%"></td></tr></table> <br>';
$pdf->setXY(0,30);
$pdf->WriteHTML($content1);
$pdf->SetFillColor(255,255,102);
$content.='<table border="0" width="100%">
<tr> <td width="15%"><img src="images/blank.png" height="93"></td>
<td border="1" valign="top" >.'.$pdf->setXY(44.1,84.0).''.$pdf->MultiCell(50,5,'Use of Structures',1,'C',true).'<br><b><i>'.nl2br ($num[useStructures]).'</i></b></td><td width="15%"></td> </tr>
<tr> <td width="15%"><img src="images/blank.png" height="92"></td>
<td border="1" valign="top" >.'.$pdf->setXY(44.1,111.6).''.$pdf->MultiCell(50,5,'Pronunciation and Fluency',1,'C',true).'<br><b><i>'.nl2br ($num[pronFluency]).'</i></b></td><td width="15%"></td> </tr>
<tr> <td width="15%"><img src="images/blank.png" height="93"></td>
<td border="1" valign="top" >'.$pdf->setXY(44.1,139.0).'
'.$pdf->MultiCell(50,5,'Listening Skills',1,'C',true).'.<br><b><i>'.nl2br ($num[listening_skill]).'</i></b></td><td width="15%"></td> </tr>
<tr> <td width="15%"><img src="images/blank.png" height="92"></td>
<td border="1" valign="top" >
'.$pdf->setXY(44.1,166.6).'
'.$pdf->MultiCell(50,5,'Lexical Skills',1,'C',true).'.<br><b><i>'.nl2br ($num[lexical_skill]).'</i></b></td><td width="15%"></td> </tr>
<tr> <td width="15%"><img src="images/blank.png" height="100"></td>
<td border="1" valign="top" >'.$pdf->setXY(44.1,193.8).'
'.$pdf->MultiCell(50,5,'Comments',1,'C',true).'.<br><b><i>'.nl2br ($num[general_comment]).'</i></b></td><td width="15%"></td> </tr>
</table> ';
if($num[eligibility]=='Other')
{
$num[eligibility]=$num[othereligibility];
}
$content.="<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>";
$content.="<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,79.0);
$pdf->WriteHTML($content);
}
//$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");
?>