Current File : /home/inlingua/public_html/noida/icentex_noida/pg/rcpt_pdf_05072017.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,(Select course_id from ingl_invoice_detail d where b.recNo=d.main_id limit 1) as RegNo 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']."'";*/
$qureyreg="SELECT TA.recNo, TA.Product1, TA.Product2, main2.bill_details AS Product3 FROM (
SELECT T.recNo, T.Product1, main1.bill_details AS Product2, T.reg_product3 FROM (
SELECT reg.recNo, main.bill_details AS Product1, reg.reg_product2, reg.reg_product3
FROM ingl_invoice_reg reg INNER JOIN ingl_billing_main main ON reg.reg_product1 = main.recNo )T
INNER JOIN ingl_billing_main main1 ON T.reg_product2 = main1.recNo )TA
INNER JOIN ingl_billing_main main2 ON TA.reg_product3 = main2.recNo where TA.recNo='".$_REQUEST['recNo']."' ";
//echo $qureyreg;
//exit;
$resultreg=mysql_query($qureyreg);
$rowreg=mysql_fetch_array($resultreg);
$query="select a.*,b.createDate as cdate,b.centre,b.invoice_no,c.ref_No,c.firstName,c.lastName, d.course_id as RegNo ,Cat.bill_category,BMain.bill_details,d.amount,d.remarks as DatRemarks,user.name,b.status_delete from ingl_invoice_payment a inner join ingl_invoice_main b on a.rcpt_id=b.invoice_no inner join ingl_admission c on student_id=c.ref_No inner join ingl_invoice_detail d on b.invoice_no=d.invoice_no inner join ingl_billing_cat Cat on d.category_id=Cat.recNo inner join ingl_billing_main BMain on d.product_id=BMain.recNo inner join timesheet_user user on b.createdBy=user.recNo where a.invice_no='".$_REQUEST['recNo']."'";
$result=mysql_query($query);
$num=mysql_fetch_array($result);
//print_r($num);exit;
//echo $query;exit;
$querydt="select Cat.bill_category,BMain.bill_details from ingl_invoice_detail d inner join ingl_billing_cat Cat on d.category_id=Cat.recNo inner join ingl_billing_main BMain on d.product_id=BMain.recNo where d.main_id='".$_REQUEST['recNo']."'";
$resultdt=mysql_query($querydt);
while($numdt=mysql_fetch_array($resultdt))
{
$Cate.=$numdt['bill_category']." / ".$numdt['bill_details'].",";
}
//echo $Cate;
//exit;
$queryA="select * from timesheet_location where recNo='".$num['centre']."'";
$resultA=mysql_query($queryA);
$numA=mysql_fetch_array($resultA);
$queryTam="select amount from ingl_invoice_detail where main_id='".$_REQUEST['recNo']."'";
$resultTam=mysql_query($queryTam);
while($Row=mysql_fetch_array($resultTam))
{
$totalamt +=$Row['amount'];
}
//echo $totalamt;
//exit;
// 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', '', 9);
$content="";
$content.='
<table border="0" width="100%">
<tr><td width="33%" align="left"> </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 | CIN : U72900UP2001PLC026110</td></tr>
</table>
<table width="100%" border="0"><tr><td height="5"> </td></tr></table>
<table border="0" width="100%">
<tr><td align="right">Date:'.date("d-M-Y",strtotime($num['cdate'])).'</td></tr>
</table>
<table border="0" width="100%">
<tr><td width="23%" align="left"><strong>R.No.:'.$num['rcpt_id'].'</strong></td> <td align="center"><b><u>Receipt cum Invoice</u></b></td>';
if($num['status_delete']=="1"){
$content.=" <td align='center'><h1 style=\"color:#CCC;\">Cancle Receipt</h1></td>";
}
if($num['status_delete']=="2")
{
$content.=" <td align='center'><h1 style=\"color:#CCC;\">Refund Receipt</h1></td>";
}
$content.="
</tr>
</table>";
$obj = new intToWord();
//$valinput = $num['amount'];
$text = $obj->getAmountInWords($totalamt);
$content.='<table width="100%" border="0"><tr><td height="10"> </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 if($num['payment_mode']=="Card")
{
$content.=' Card Transaction Id. <b>'.$num['cheque_no'].'</b> drawn on <b>'.$num['favour_of'].'</b>';
}
else if($num['payment_mode']=="Net Banking")
{
$content.=' Net Banking Transaction Id. <b>'.$num['cheque_no'].'</b> drawn on <b>'.$num['favour_of'].'</b>';
}
else
{
$content.=' '.$num['payment_mode'].'';
}
$content.=' account of <b>'/*.$num['bill_category'].' / '.$num['bill_details'].*/.$Cate.'</b>.</td></tr>
</table>
<table width="100%" border="0"><tr><td height="10"> </td></tr></table>
<table width="100%" border="0"><tr><td width="30%"><table border="1" style="padding:3px;"><tr><td>Rs. '.$totalamt.'</td></tr></table><br>
<table border="1" style="padding:2px;"><tr><td>ID No. '.$num['ref_No'].'</td></tr></table>
<br><table border="1" style="padding:2px;"><tr><td>Registration ID. '.$num['RegNo'].'</td></tr></table>
</td>';
/*if($num['bill_category']=="Registration")
{
$content.=' <td width="30%"><table border="1" style="padding:3px;"><tbody><tr><td>'.$rowreg['Product1'].'</td></tr></tbody></table><br>
<table border="1" style="padding:2px;"><tbody><tr><td>'.$rowreg['Product2'].'</td></tr></tbody></table>
<br><table border="1" style="padding:2px;"><tbody><tr><td>'.$rowreg['Product3'].'</td></tr></tbody></table>
</td>';
//$content.='<td width="30%">'.$rowreg['Product1'].'</td><td>'.$rowreg['Product2'].'</td><td>'.$rowreg['Product3'].'</td>';
}
else
{
$content.='<td width="30%"> </td>';
}*/
$content.='<td align="right" width="70%">
<table border="0" style="padding:3px;">
<tr><td> </td></tr>
<tr><td><br>On behalf of STUDY CENTRE NEW DELHI</td></tr>
<tr><td align="left">Remarks:-'.$num['DatRemarks'].' |For '.$rowreg['Product1'].' ,'.$rowreg['Product2'].','.$rowreg['Product3'].' </td></tr>
</table> </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>
<tr><td width="30%"> </td><td width="30%"> </td><td align="center" width="40%"><b>'.$num['name'].'</b></td></tr></table>
<table width="100%" border="0"><tr><td height="5"> </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> The fees is inclusive of service tax.</i></td></tr>
<tr><td align="center"><b><i>Fees once paid will not be refunded after course confirmation.</b></i></td></tr>
<tr><td>--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
</table>
';
$content.='
<table border="0" width="100%">
<tr><td width="33%" align="left"> </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 | CIN : U72900UP2001PLC026110</td></tr>
</table>
<table width="100%" border="0"><tr><td height="5"> </td></tr></table>
<table border="0" width="100%">
<tr><td align="right">Date:'.date("d-M-Y",strtotime($num['cdate'])).'</td></tr>
</table>
<table border="0" width="100%">
<tr><td width="23%" align="left"><strong>R.No.:'.$num['rcpt_id'].'</strong></td> <td align="center"><b><u>Receipt cum Invoice</u></b></td>';
if($num['status_delete']=="1"){
$content.=" <td align='center'><h1 style=\"color:#CCC;\">Cancle Receipt</h1></td>";
}
if($num['status_delete']=="2")
{
$content.=" <td align='center'><h1 style=\"color:#CCC;\">Refund Receipt</h1></td>";
}
$content.="
</tr>
</table>";
$obj = new intToWord();
// $valinput = $num['amount'];
$text = $obj->getAmountInWords($totalamt);
$content.='<table width="100%" border="0"><tr><td height="10"> </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 if($num['payment_mode']=="Card"||$num['payment_mode']=="Net Banking")
{
$content.=' Card Transaction Id. <b>'.$num['cheque_no'].'</b> drawn on <b>'.$num['favour_of'].'</b>';
}
else if($num['payment_mode']=="Net Banking")
{
$content.=' Net Banking Transaction Id. <b>'.$num['cheque_no'].'</b> drawn on <b>'.$num['favour_of'].'</b>';
}
else
{
$content.=' '.$num['payment_mode'].'';
}
$content.=' account of <b>'/*.$num['bill_category'].' / '.$num['bill_details'].*/.$Cate.'</b>.</td></tr>
</table>
<table width="100%" border="0"><tr><td height="5"> </td></tr></table>
<table width="100%" border="0"><tr><td width="30%"><table border="1" style="padding:2px;"><tr><td>Rs. '.$totalamt.'</td></tr></table><br>
<table border="1" style="padding:2px;"><tr><td>ID No. '.$num['ref_No'].'</td></tr></table>
<br><table border="1" style="padding:2px;"><tr><td>Registration ID. '.$num['RegNo'].'</td></tr></table>
</td>';
/*if($num['bill_category']=="Registration")
{
$content.=' <td width="30%"><table border="1" style="padding:2px;"><tbody><tr><td>'.$rowreg['Product1'].'</td></tr></tbody></table><br>
<table border="1" style="padding:0px;"><tbody><tr><td>'.$rowreg['Product2'].'</td></tr></tbody></table>
<br><table border="1" style="padding:0px;"><tbody><tr><td>'.$rowreg['Product3'].'</td></tr></tbody></table>
</td>';
//$content.='<td width="30%">'.$rowreg['Product1'].'</td><td>'.$rowreg['Product2'].'</td><td>'.$rowreg['Product3'].'</td>';
}
else
{
$content.='<td width="30%"> </td>';
}
*/
$content.='<td align="right" width="70%">
<table border="0" style="padding:3px;">
<tr><td> </td></tr>
<tr><td><br>On behalf of STUDY CENTRE NEW DELHI</td></tr>
<tr><td align="left">Remarks:-'.$num['DatRemarks'].' |For '.$rowreg['Product1'].' ,'.$rowreg['Product2'].','.$rowreg['Product3'].' </td></tr>
</table> </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>
<tr><td width="30%"> </td><td width="30%"> </td><td align="center" width="40%"><b>'.$num['name'].'</b></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> The fees is inclusive of service tax.</i></td></tr>
<tr><td align="center"><b><i>Fees once paid will not be refunded after course confirmation.</b></i></td></tr>
<tr><td>--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
</table>
';
$content.='
<table border="0" width="100%">
<tr><td width="33%" align="left"> </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 | CIN : U72900UP2001PLC026110</td></tr>
</table>
<table width="100%" border="0"><tr><td height="5"> </td></tr></table>
<table border="0" width="100%">
<tr><td align="right">Date:'.date("d-M-Y",strtotime($num['cdate'])).'</td></tr>
</table>
<table border="0" width="100%">
<tr><td width="23%" align="left"><strong>R.No.:'.$num['rcpt_id'].'</strong></td> <td align="center"><b><u>Receipt cum Invoice</u></b></td>';
if($num['status_delete']=="1"){
$content.=" <td align='center'><h1 style=\"color:#CCC;\">Cancle Receipt</h1></td>";
}
if($num['status_delete']=="2")
{
$content.=" <td align='center'><h1 style=\"color:#CCC;\">Refund Receipt</h1></td>";
}
$content.="
</tr>
</table>";
$obj = new intToWord();
// $valinput = $num['amount'];
$text = $obj->getAmountInWords($totalamt);
$content.='<table width="100%" border="0"><tr><td height="10"> </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 if($num['payment_mode']=="Card"||$num['payment_mode']=="Net Banking")
{
$content.=' Card Transaction Id. <b>'.$num['cheque_no'].'</b> drawn on <b>'.$num['favour_of'].'</b>';
}
else if($num['payment_mode']=="Net Banking")
{
$content.=' Net Banking Transaction Id. <b>'.$num['cheque_no'].'</b> drawn on <b>'.$num['favour_of'].'</b>';
}
else
{
$content.=' '.$num['payment_mode'].'';
}
$content.=' account of <b>'/*.$num['bill_category'].' / '.$num['bill_details'].*/.$Cate.'</b>.</td></tr>
</table>
<table width="100%" border="0"><tr><td height="5"> </td></tr></table>
<table width="100%" border="0"><tr><td width="30%"><table border="1" style="padding:2px;"><tr><td>Rs. '.$totalamt.'</td></tr></table><br>
<table border="1" style="padding:2px;"><tr><td>ID No. '.$num['ref_No'].'</td></tr></table>
<br><table border="1" style="padding:2px;"><tr><td>Registration ID. '.$num['RegNo'].'</td></tr></table>
</td>';
$content.='<td align="right" width="70%">
<table border="0" style="padding:3px;">
<tr><td> </td></tr>
<tr><td><br>On behalf of STUDY CENTRE NEW DELHI</td></tr>
<tr><td align="left">Remarks:-'.$num['DatRemarks'].' |For '.$rowreg['Product1'].' ,'.$rowreg['Product2'].','.$rowreg['Product3'].'</td></tr>
</table> </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>
<tr><td width="30%"> </td><td width="30%"> </td><td align="center" width="40%"><b>'.$num['name'].'</b></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> The fees is inclusive of service tax.</i></td></tr>
<tr><td align="center"><b><i>Fees once paid will not be refunded after course confirmation.</b></i></td></tr>
<tr><td>--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
</table>
';
//echo "$content";
//exit;
/*
$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');
//ob_end_clean();
ob_clean()
?>