Click here to Skip to main content
14,979,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ob_start();
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Payment extends CI_Controller {

function __construct()
{
parent::__construct();
$this->load->library('form_validation');
$this->load->library('session');
$this->load->helper('form');
$this->load->helper('url');
$this->load->library('cart');
$this->load->database();
$this->load->model('user_model');
$this->load->helper('string');
$this->load->library('email');
$this->load->library("Pdf");
}


public function pdf(){
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 061');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');

// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 061', PDF_HEADER_STRING);

// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));

// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

// 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 (optional)
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
require_once(dirname(__FILE__).'/lang/eng.php');
$pdf->setLanguageArray($l);
}

// ---------------------------------------------------------

// set font
$pdf->SetFont('helvetica', '', 10);

// add a page
$pdf->AddPage();

$html = <<<eof>
<style>
body { margin: 0 auto; padding: 0; background: #f1f2f4; }
img {border: 0;}
.ie8 {backgound: #f1f2f4;}

.voucher {
font-family:Arial, Helvetica, sans-serif;
font-size:26px;
text-decoration:none;
font-weight:normal;
color:#000;
padding-left:20px;
text-shadow:1px 1px 1px #FFF;
}
.work {
float:left;
width:48%;
height:auto;
margin-right:20px;
}
.work1 {
float:left;
width:48%;
height:auto;
}
.work1_head {
float:left;
width:100%;
height:auto;
margin-bottom:10px;
}
.work1_head1 {
float:left;
width:auto;
height:auto;
margin-right:10px;
margin-top:10px;
}
.work1_head2 {
float:left;
width:230px;
height:auto;
font-size:13px;
font-family:Arial, Helvetica, sans-serif;
font-weight:normal;
color:#000;
line-height:20px;
}
.back {
background-color:#000;
color:#FFF;
text-align:center;
padding:5px 10px 5px 10px;
-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;
}
</style>
<body>


<!-- Start Top Line -->




<!-- End Top Line -->
<!-- Start Page -->

<!-- Start Logo -->

<!-- End Logo -->
<!-- Start Last News -->

<!-- Start Last News -->
<!-- Start Last News - Title -->

<img src="images/side.jpg" width="100%"/>

World of Bowling: 2 hours of bowling and pizza for two.

Voucher Number:

VFG – 2412536

Purchased by:

Ruaridh Kilgour

Expiry Date:

22/05/2013

Introduction

 



  1. Lorem Ipsum is simply dummy text of the
  2. Lorem Ipsum is simply dummy text
  3. Lorem Ipsum is simply dummy text of the printing and typesetting industry.
  4. Lorem Ipsum is simply dummy text
  5. Lorem Ipsum is simply dummy text of the printing and typesetting industry.
  6. Lorem Ipsum is simply dummy text.

Problem?

Get in contact:

help@studentsponge.com

<img src="images/logo.png" width="100%"/>

Voucher


Deal Information



Loremipsum sample text, loremipsum sample text loremipsum sample text.Loremipsum sample text, loremipsum sample text loremipsum sample text.Loremipsum sample text, loremipsum sample text loremipsum sample text.
Loremipsum sample text, loremipsum sample text loremipsum sample text.




  1. Loremipsum sample text.
  2. Loremipsum sample text.
  3. Loremipsum sample text.
  4. Loremipsum sample text.
  5. Loremipsum sample text.
  6. Loremipsum sample text.



Cancellation and Refund Policys



You may cancel your purchase of this deal within seven working days following the date on which we issued you the voucher provided that the voucher has not yet been redeemed with the merchant.



To cancel your voucher and receive your refund, please email help@studentsponge.com informing us of your decision and your reason behind cancellation.



Provided that the voucher has not been redeemed and you have requested your refund within 7 working days of the voucher being issued, we will happily give you a refund.





<!-- End Last News -->
!-- Start Our Store -->


<!-- Start Our Store - Title -->

  

<img src="images/line.png" alt="" style="display: block;"/>
<!-- End OurStore - Title -->
<!-- End Our Store -->

EOF;

$pdf->writeHTML($html, true, false, true, false, '');

$pdf->lastPage();

$pdf->Output('example_061.pdf', 'I');

}

}

?>
Posted
Updated 26-Jan-14 8:25am
v2

1 solution

CSS
A PHP Error was encountered

Severity: Notice

Message: Undefined index: rows

Filename: tcpdf/tcpdf.php

Line Number: 16749
A PHP Error was encountered

Severity: Warning

Message: array_push() expects parameter 1 to be array, null given

Filename: tcpdf/tcpdf.php

Line Number: 16751
A PHP Error was encountered

Severity: Warning

Message: array_push() expects parameter 1 to be array, null given

Filename: tcpdf/tcpdf.php

Line Number: 16751
A PHP Error was encountered

Severity: Warning

Message: array_push() expects parameter 1 to be array, null given

Filename: tcpdf/tcpdf.php

Line Number: 16751
A PHP Error was encountered

Severity: Notice

Message: Undefined index: thead

Filename: tcpdf/tcpdf.php

Line Number: 16340
A PHP Error was encountered

Severity: Notice

Message: Undefined index: cols

Filename: tcpdf/tcpdf.php

Line Number: 16761
A PHP Error was encountered

Severity: Notice

Message: Undefined index: thead

Filename: tcpdf/tcpdf.php

Line Number: 16340
A PHP Error was encountered

Severity: Notice

Message: Undefined index: cols

Filename: tcpdf/tcpdf.php

Line Number: 16312
A PHP Error was encountered

Severity: Notice

Message: Undefined index: thead

Filename: tcpdf/tcpdf.php

Line Number: 16340
A PHP Error was encountered

Severity: Notice

Message: Undefined index: cols

Filename: tcpdf/tcpdf.php

Line Number: 16312
A PHP Error was encountered

Severity: Notice

Message: Undefined index: rows

Filename: tcpdf/tcpdf.php

Line Number: 16749
A PHP Error was encountered

Severity: Warning

Message: array_push() expects parameter 1 to be array, null given

Filename: tcpdf/tcpdf.php

Line Number: 16751
A PHP Error was encountered

Severity: Notice

Message: Undefined index: thead

Filename: tcpdf/tcpdf.php

Line Number: 16340
A PHP Error was encountered

Severity: Notice

Message: Undefined index: cols

Filename: tcpdf/tcpdf.php

Line Number: 16312
A PHP Error was encountered

Severity: Notice

Message: Undefined index: thead

Filename: tcpdf/tcpdf.php

Line Number: 16340
A PHP Error was encountered

Severity: Notice

Message: Undefined index: cols

Filename: tcpdf/tcpdf.php

Line Number: 16312
A PHP Error was encountered

Severity: Notice

Message: Undefined index: thead

Filename: tcpdf/tcpdf.php

Line Number: 16340
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: cellspacingx

Filename: tcpdf/tcpdf.php

Line Number: 17895
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: table_colwidths

Filename: tcpdf/tcpdf.php

Line Number: 17959
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: cellspacing

Filename: tcpdf/tcpdf.php

Line Number: 17962
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: cellspacing

Filename: tcpdf/tcpdf.php

Line Number: 17988
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: cellspacingx

Filename: tcpdf/tcpdf.php

Line Number: 18043
TCPDF ERROR: Some data has already been output, ca
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900