Current File : /home/inlingua/public_html/noida/icentex/in-centre/rcpt_pdf.php |
<?php
error_reporting(0);
session_start();
// Include the database connection details
require('../dbConnection.php');
// Include common functions
require('../commonFunc.php');
// Include common functions
require('../globalVars.php');
// Include the table handler class
require('../dbHandler.class.php');
//require_once('amount.php');
include_once("wordsClass.php");
// Init and connect to database
$dbObject = new dbHandler();
$dbObject->connect();
?>
<?php
require_once('../../tcpdf/config/lang/eng.php');
require_once('../../tcpdf/tcpdf.php');
$query="select a.*,b.centre,b.invoice_no,c.ref_No,c.firstName,c.lastName from ingl_invoice_payment a left join ingl_invoice_main b on a.invice_no=b.recNo left join ingl_admission c on student_id=c.recNo where a.recNo='".$_REQUEST['kV']."'";
$result=mysqli_query($conn,$query);
$num=mysqli_fetch_array($result);
$queryA="select * from timesheet_location where recNo='".$num['centre']."'";
$resultA=mysqli_query($conn,$queryA);
$numA=mysqli_fetch_array($resultA);
// Extend the TCPDF class to create custom Header and Footer
class MYPDF extends TCPDF {
//Page header
/* public function Header() {
// Logo
$image_file = K_PATH_IMAGES.'logo_example.jpg';
$this->Image($image_file, 10, 10, 15, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);
// Set font
$this->SetFont('helvetica', 'B', 20);
// Title
$this->Cell(0, 15, '<< TCPDF Example 003 >>', 0, false, 'C', 0, '', 0, false, 'M', 'M');
}
*/
// Page footer
public function Footer() {
// Position at 15 mm from bottom
$this->SetY(-10);
// Set font
$this->SetFont('helvetica', 'I', 10);
// Page number
//$this->Line(0,12,80,12);
//$this->Cell(0, 10, 'Regd Office :A- 95, Sector - 65, Noida - 201305 (U.P.)', 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}
// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('pispltd');
$pdf->SetTitle('pispltd');
$pdf->SetSubject('pispltd');
$pdf->SetKeywords('pispltd soft');
// remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(true);
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins('10', '1', '10');
//set auto page breaks
//$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->SetAutoPageBreak(TRUE, -5);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$email=", ".$numA['email']."";
$pdf->SetFont('Helvetica', '', 10);
$content="";
$content.='
<table border="0" width="100%">
<tr><td width="33%" align="left">R.No.:'.$num['rcpt_id'].'</td><td width="34%" align="center"><img src="../images/logo_certificate.JPG"></td><td width="33%" align="right"> Customer Copy </td></tr>
<tr><td colspan="3" align="center">'.$numA['address'].' Tel:'.$numA['contact'].'</td></tr>
<tr><td colspan="3" align="center">Website: www.inlinguanewdelhi.com E-mail:'.$numA['email'].'</td></tr>
<tr><td colspan="3" align="center">Service Tax No.: AADCA6897R-ST001</td></tr>
</table>
<table width="100%" border="0"><tr><td height="10"> </td></tr></table>
<table border="0" width="100%">
<tr><td align="right">Date:'.date("d-M-Y",strtotime($num['createDate'])).'</td></tr>
</table>
<table border="0" width="100%">
<tr><td align="center"><b><u>RECEIPT</u></b></td></tr>
</table>
';
$obj = new intToWord();
$valinput = $num['amount'];
$text = $obj->getAmountInWords($valinput);
$content.='<table width="100%" border="0"><tr><td height="20"> </td></tr></table>
<table border="0" width="100%">
<tr><td style="text-align:justify;fondt-size:50px;">Received with thanks from Mr./Mrs./Ms. <b>'.ucfirst($num['firstName']).' '.ucfirst($num['lastName']).'</b> <b>'.$text.'</b>';
if($num['payment_mode']=="Cheque")
{
$content.=' Cheque No. <b>'.$num['cheque_no'].'</b> Date________________ drawn on <b>'.$num['favour_of'].'</b>';
}
else
{
$content.=' '.$num['payment_mode'].'';
}
$content.=' on account of Registration / Fees.</td></tr>
</table>
<table width="100%" border="0"><tr><td height="20"> </td></tr></table>
<table width="100%" border="0"><tr><td width="30%"><table border="1" style="padding:3px;"><tr><td>Rs. '.$num['amount'].'</td></tr></table><br>
<table border="1" style="padding:3px;"><tr><td>ID No. '.$num['ref_No'].'</td></tr></table>
<br><table border="1" style="padding:3px;"><tr><td>INVOICE No. '.$num['invoice_no'].'</td></tr></table>
</td>
<td width="30%"> </td>
<td align="center" width="40%">
<table border="0" style="padding:3px;"><tr><td> </td></tr></table><br>
On behalf of STUDY CENTRE NEW DELHI</td></tr></table>
<table width="100%" border="0"><tr><td width="30%"> </td><td width="30%"> </td><td align="center" width="40%">Authorised Signatory</td></tr></table>
<table width="100%" border="0"><tr><td height="10"> </td></tr></table>
<table width="100%" border="0"><tr><td align="center"><i>Cheques to be drawn in favour of <b>Amrit Learning Ltd.</b></i></td></tr></table>
<table border="0" style="padding:3px;"><tr><td>-----------------------------------------------------------------------------------------------------------------------------------------------------------</td></tr></table>
';
$content.='
<table border="0" width="100%">
<tr><td width="33%" align="left">R.No.:'.$num['rcpt_id'].'</td><td width="34%" align="center"><img src="../images/logo_certificate.JPG"></td>
<td width="33%" align="right"> Office Copy </td></tr>
<tr><td colspan="3" align="center">'.$numA['address'].' Tel:'.$numA['contact'].'</td></tr>
<tr><td colspan="3" align="center">Website: www.inlinguanewdelhi.com E-mail:'.$numA['email'].'</td></tr>
<tr><td colspan="3" align="center">Service Tax No.: AADCA6897R-ST001</td></tr>
</table>
<table width="100%" border="0"><tr><td height="10"> </td></tr></table>
<table border="0" width="100%">
<tr><td align="right">Date:'.date("d-M-Y",strtotime($num['createDate'])).'</td></tr>
</table>
<table border="0" width="100%">
<tr><td align="center"><b><u>RECEIPT</u></b></td></tr>
</table>
';
$obj = new intToWord();
$valinput = $num['amount'];
$text = $obj->getAmountInWords($valinput);
$content.='<table width="100%" border="0"><tr><td height="20"> </td></tr></table>
<table border="0" width="100%">
<tr><td style="text-align:justify;fondt-size:50px;">Received with thanks from Mr./Mrs./Ms. <b>'.ucfirst($num['firstName']).' '.ucfirst($num['lastName']).'</b> <b>'.$text.'</b>';
if($num['payment_mode']=="Cheque")
{
$content.=' Cheque No. <b>'.$num['cheque_no'].'</b> Date________________ drawn on <b>'.$num['favour_of'].'</b>';
}
else
{
$content.=' '.$num['payment_mode'].'';
}
$content.=' on account of Registration / Fees.</td></tr>
</table>
<table width="100%" border="0"><tr><td height="20"> </td></tr></table>
<table width="100%" border="0"><tr><td width="30%"><table border="1" style="padding:3px;"><tr><td>Rs. '.$num['amount'].'</td></tr></table><br>
<table border="1" style="padding:3px;"><tr><td>ID No. '.$num['ref_No'].'</td></tr></table>
<br><table border="1" style="padding:3px;"><tr><td>INVOICE No. '.$num['invoice_no'].'</td></tr></table>
</td>
<td width="30%"> </td>
<td align="center" width="40%">
<table border="0" style="padding:3px;"><tr><td> </td></tr></table><br>
On behalf of STUDY CENTRE NEW DELHI</td></tr></table>
<table width="100%" border="0"><tr><td width="30%"> </td><td width="30%"> </td><td align="center" width="40%">Authorised Signatory</td></tr></table>
<table border="0" style="padding:3px;"><tr><td>-----------------------------------------------------------------------------------------------------------------------------------------------------------</td></tr></table>
';
$content.='
<table border="0" width="100%">
<tr><td width="33%" align="left">R.No.:'.$num['rcpt_id'].'</td><td width="34%" align="center"><img src="../images/logo_certificate.JPG"></td>
<td width="33%" align="right"> Accounts Copy </td></tr>
<tr><td colspan="3" align="center">'.$numA['address'].' Tel:'.$numA['contact'].'</td></tr>
<tr><td colspan="3" align="center">Website: www.inlinguanewdelhi.com E-mail:'.$numA['email'].'</td></tr>
<tr><td colspan="3" align="center">Service Tax No.: AADCA6897R-ST001</td></tr>
</table>
<table width="100%" border="0"><tr><td height="10"> </td></tr></table>
<table border="0" width="100%">
<tr><td align="right">Date:'.date("d-M-Y",strtotime($num['createDate'])).'</td></tr>
</table>
<table border="0" width="100%">
<tr><td align="center"><b><u>RECEIPT</u></b></td></tr>
</table>
';
$obj = new intToWord();
$valinput = $num['amount'];
$text = $obj->getAmountInWords($valinput);
$content.='<table width="100%" border="0"><tr><td height="20"> </td></tr></table>
<table border="0" width="100%">
<tr><td style="text-align:justify;fondt-size:50px;">Received with thanks from Mr./Mrs./Ms. <b>'.ucfirst($num['firstName']).' '.ucfirst($num['lastName']).'</b> <b>'.$text.'</b>';
if($num['payment_mode']=="Cheque")
{
$content.=' Cheque No. <b>'.$num['cheque_no'].'</b> Date________________ drawn on <b>'.$num['favour_of'].'</b>';
}
else
{
$content.=' '.$num['payment_mode'].'';
}
$content.=' on account of Registration / Fees.</td></tr>
</table>
<table width="100%" border="0"><tr><td height="20"> </td></tr></table>
<table width="100%" border="0"><tr><td width="30%"><table border="1" style="padding:3px;"><tr><td>Rs. '.$num['amount'].'</td></tr></table><br>
<table border="1" style="padding:3px;"><tr><td>ID No. '.$num['ref_No'].'</td></tr></table>
<br><table border="1" style="padding:3px;"><tr><td>INVOICE No. '.$num['invoice_no'].'</td></tr></table>
</td>
<td width="30%"> </td>
<td align="center" width="40%">
<table border="0" style="padding:3px;"><tr><td> </td></tr></table><br>
On behalf of STUDY CENTRE NEW DELHI</td></tr></table>
<table width="100%" border="0"><tr><td width="30%"> </td><td width="30%"> </td><td align="center" width="40%">Authorised Signatory</td></tr></table>
';
/*
$content.='<table><tr><td height="20"></td></tr></table>
<table border="0" width="100%">
<tr><td width="100%" align="center" style="font-size:30px;"><u><b>Regd Office :</b>A- 95, Sector - 65, Noida - 201305 (U.P.)</u></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);
$pdf->Output('pispltd_'.$num['po_id'].'.pdf', 'I');
?>