Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] PDF Customer Invoice


chris23

Recommended Posts

Hola.

Al poner sólo los atributos que están activos, gano espacio para nuevos productos y no hay descuadre en las páginas posteriores. El valor "---" es el que pongo como atributo sin valor. Obviamente, se puede elegir cualquiera, yo elegí este. Se que es una solución un tanto rara, porque no solucionamos el problema del overflow, ya que si el cliente elige todos los atributos, volveremos a tener overflow y descuadre. He intentado implementar un salto de página cuando el número de atributos es determinado, pero no funciona correctamente y sigo teniendo descuadre.

Saludos.

 

Jose,

I see why you've chosen the solution you have. It's my intention to fix the overflow problem. It's an issue with the overflow function not accounting for the number of lines taken up by attributes. I'm sure I'll get it fixed eventually.

Saludos

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

One of the things is now fixed, namely position of VAT-No and so on, but I have still trouble showing alle the digits of my ordernumber. Pasted below is the code from my pdfinvoice.php where it draws order number. As you can see I have chaged it to the format which I am using else where on my site. Please advise how to display this also in pdfinvoice.php. I tried to SetFont to 6, but I still see only 5 digits of total 16. I have made a link to another pdf created using pdf-software to show how I want the pdfinvoice to look in the order-number area.

 

 

//Draw Order Number Text
 $pdf->SetFont(PDF_INV_CORE_FONT,'B',6);
$pdf->Text(10,113, tep_html_entity_decode(PRINT_INVOICE_ORDERNR) . [b](int)tep_trans_id($order->info['date_purchased'], $HTTP_GET_VARS['order_id'])[/b]);

 

PDF Invoice - Order No, as I want it to look

 

Hope you can help solve this.

Edited by Zahoor
Link to comment
Share on other sites

This is really odd Dave. I used the code you sent me and tried it against a sample order in my db of 12 lines - split fine and the payment details stayed together. I can't immediately see why each order->total line is going on a separate page.

 

I'll have another look.

 

C

 

Hi Chris,

 

I have no idea how or why, but my overflow problem is fixed. Last weekend I changed a lot of things, your suggestions, downloaded fpdf again and overwrote what was on my server and then overwrote with what is included with the contribution, and although nothing appeared to work at the time, it does now.

 

Maybe, as I was constantly pulling the same large order to test things, it was being pulled from the cache on my machine rather than the server?? Who knows.

 

Anyway, its working ok now :)

 

Cheers

 

Dave

Link to comment
Share on other sites

Hi Chris!

I wonder how i can use your contribution without having it on account_history_info i would like it to be on checkout_success beacuse a lot of my customer dont sign up a account

 

any idea how i should code that?

 

Regards Tony

Link to comment
Share on other sites

Hi Chris!

I wonder how i can use your contribution without having it on account_history_info i would like it to be on checkout_success beacuse a lot of my customer dont sign up a account

 

any idea how i should code that?

 

Regards Tony

 

Hi Tony,

 

I'm not sure this is as easy as it sounds. I assume you're using some contribution like PWA.

 

The issue is how to have an invoice displayed without displaying other customers' invoices. With the PDF contribution, the script checks to see whether you're the owner of the

order in question.

 

Having not used PWA or similar contributions, I'm not sure how you'd implement the security needed.

 

Any PWA experts have any thoughts?

 

Cheers

 

Chris

Edited by chris23

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

Hi Dave,

There's no easy way to do this.

The information in pdfinvoice.php is taken from the class classes/order.php class and has access to its standard properties.

The comments field is not part of this code, so isn't pulled out.

The class would need modifying to include this information. How desperate are you to have this?

Regards,

Chris

 

 

Chris,

 

Hello. I just installed your contribution today and it is a most excellent. Thank you! I was wondering though, if you had been able to get the comments into the pdf working? We include notes on some products in the comment section and it would be a nice feature to have. Thanks!

 

 

Peter

Link to comment
Share on other sites

Chris,

 

Hello. I just installed your contribution today and it is a most excellent. Thank you! I was wondering though, if you had been able to get the comments into the pdf working? We include notes on some products in the comment section and it would be a nice feature to have. Thanks!

Peter

 

Hi Peter,

 

Thanks for the nudge! This is something that needs doing. I'll post something here when I have it working.

 

Regards,

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

To those of you wanting a "Comments" box adding, I've uploaded a howto file to the contribution area.

Enjoy.

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

Hi Cris!

How can i get the <B> in payment method to go away?

now it look like this on the invoice:

Payment Method: <B> Förskottsbetalning

 

/Tony

 

If your payment module is returning html tags, edit pdfinvoice.php

 

FIND:

 

$pdf->Text(130,113, tep_html_entity_decode(ENTRY_PAYMENT_METHOD) . ' ' . tep_html_entity_decode($temp))

;

 

REPLACE with:

 

$pdf->Text(130,113, tep_html_entity_decode(ENTRY_PAYMENT_METHOD) . ' ' . tep_html_entity_decode(strip_tags($temp)));

 

That should fix it.

 

Cheers,

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

Thanks Chris!

that fixed it, but i have other problems like this on invoice:

Invoice to:

Test1 Test1 nTest10n13333

HaningenSverige

 

should say like this:

Invoice to:

Test1 Test1

Test10

13333 Haninge

Sverige

 

any idea how to fix it

 

like you see it puts n before Test10 and 13333 and Sverige also it put´s them together

 

Regards Tony

Link to comment
Share on other sites

Thanks Chris!

that fixed it, but i have other problems like this on invoice:

Invoice to:

Test1 Test1 nTest10n13333

HaningenSverige

 

should say like this:

Invoice to:

Test1 Test1

Test10

13333 Haninge

Sverige

 

any idea how to fix it

 

like you see it puts n before Test10 and 13333 and Sverige also it put´s them together

 

Regards Tony

 

Hmm,

 

Those n characters should be \n, a newline character. Something is removing your backslash. Have you any other contribution installed that modifies STORE_NAME_ADDRESS?

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

1st: Very cool contrib... Many Thanks!

 

I added a little dirty hack adding the invoices status at view/print time (checkout below test invoice, lower left corner).

test_invoice.jpg

If anybody wants to add this....

Add this line to catalog/includes/language/your_lang_folder/pdfinvoice.php

define('PDF_INV_INVOICE_STATUS','Order Status at View/Print: ');

 

Add these two lines to your catalog/pdfinvoice.php (edit the the x,y positions where you would like the actual status to appear)

// Draw order status language
$pdf->Text(7,280.5, tep_html_entity_decode(PDF_INV_INVOICE_STATUS));

 

$pdf->Text(54,281,strip_tags(tep_html_entity_decode($order->info["orders_status"])));

 

I added the above just under....

$pdf->Text(22,61.5,tep_html_entity_decode(PRINT_INVOICE_HEADING));

 

This then takes on the "Invoice" italic and font but you don't have to add it there if you don't like the bold-italic font

 

Cheers!

How do i fix my fonts at the status text? i want it to be like yours. but my is bold and large i want it to be small and only the real status to be large like yours?

 

Regards Tony

Link to comment
Share on other sites

Hmm,

 

Those n characters should be \n, a newline character. Something is removing your backslash. Have you any other contribution installed that modifies STORE_NAME_ADDRESS?

really dont know!

but can i use the strip_tags? for that problem?

Link to comment
Share on other sites

Hmm,

 

Those n characters should be \n, a newline character. Something is removing your backslash. Have you any other contribution installed that modifies STORE_NAME_ADDRESS?

shouldn´t it be customer_address? or is it store_name_address?

 

Regards Tony

Link to comment
Share on other sites

Hmm,

 

Those n characters should be \n, a newline character. Something is removing your backslash. Have you any other contribution installed that modifies STORE_NAME_ADDRESS?

I find in orders.php that the separator say "n" not "/n" but i dont know what contribution needs that but can i change something in your contribution so it can reed n insteed of /n or do you have any idea how i can fix this

 

Regards Tony

Link to comment
Share on other sites

Hi,

 

I really like this mod (for as far as I can see), but I've got a problem.

 

The PDF Invoice option doesn't show up in the admin menu... I've already tried the fix when only 1 option shows (but with mine it shows none though)..., but I had no luck.

I only have the Ultimate SEO mod installed besides the standard install.

What did I forget? SQL is added and all files are uploaded as far as I can tell!

Link to comment
Share on other sites

Hi,

sorry for my english.

 

i have a big problem with the customer_id.

 

on the customer area is the invoice with customer_id and in the admin area is customer_id = 0

 

I have all to read in this forum becose no find solution.

 

My pdfinvoice:

 

<?php

/*

$Id: create_customer_pdf,v 1.1 2007/07/25 clefty (osc forum id chris23)

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

 

Based on create_pdf , originally written by Neil Westlake ([email protected]

 

Rewritten to display a PDF invoice for the customer to print / download within account_history_info.php

 

This version supports access from admin panel.

 

*/

 

define('FPDF_FONTPATH','fpdf/font/');

require('fpdf/fpdf.php');

require('includes/application_top.php');

 

// see if admin passthru is set and valid

$admin_access = false;

$pass_phrase="heuzJhZTefdvGfreokHnHHzddfaf";

$pass_phrase_hash=md5($pass_phrase);

if(isset($HTTP_GET_VARS['passthruID'])){

if($HTTP_GET_VARS['passthruID'] === $pass_phrase_hash){

$admin_access = true;

}

}

 

// perform security check to prevent "get" tampering to view other customer's invoices

 

if(!$admin_access){

 

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot();

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

 

if (!isset($HTTP_GET_VARS['order_id']) || (isset($HTTP_GET_VARS['order_id']) && !is_numeric($HTTP_GET_VARS['order_id']))) {

tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));

}

 

$customer_info_query = tep_db_query(" select customers_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "'");

$customer_info = tep_db_fetch_array($customer_info_query);

if ($customer_info['customers_id'] != $customer_id) {

tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));

}

}

 

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CUSTOMER_PDF);

 

// function to return rgb value for fpdf from supplied hex (#abcdef)

 

function html2rgb($color){

if ($color[0] == '#')

$color = substr($color, 1);

 

if (strlen($color) == 6)

list($r, $g, $B) = array($color[0].$color[1],

$color[2].$color[3],

$color[4].$color[5]);

elseif (strlen($color) == 3)

list($r, $g, $B) = array($color[0], $color[1], $color[2]);

else

return false;

 

$r = hexdec($r); $g = hexdec($g); $b = hexdec($B);

 

return array($r,$g,$B);

}

 

// function to decode html entities

function tep_html_entity_decode($text, $quote_style = ENT_QUOTES){

return html_entity_decode($text, $quote_style);

}

 

// find image type

function findextension ($filename)

{

$filename = strtolower($filename);

$extension= split("\.", $filename);

$n = count($extension)-1;

$extension = $extension[$n];

return $extension;

}

 

$border_color = html2rgb(PDF_INV_BORDER_COLOR);

$cell_color = html2rgb(PDF_INV_CELL_COLOR);

$invoice_line = html2rgb(PDF_INV_INVLINE_COLOR);

$highlight_color = html2rgb(PDF_INV_HIGHLIGHT_COLOR);

$standard_color = html2rgb(PDF_INV_STANDARD_COLOR);

$watermark_color = html2rgb(PDF_INV_WATERMARK_COLOR);

 

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_HISTORY_INFO);

 

require(DIR_WS_CLASSES . 'order.php');

$order = new order($HTTP_GET_VARS['order_id']);

 

// set invoice date - today or day ordered. set in config

$date = (PDF_INV_DATE_TODAY == 'today') ? strftime(DATE_FORMAT_LONG) : tep_date_long($order->info['date_purchased']);

 

class PDF extends FPDF

{

 

//Page header

function RoundedRect($x, $y, $w, $h,$r, $style = '')

{

$k = $this->k;

$hp = $this->h;

if($style=='F')

$op='f';

elseif($style=='FD' or $style=='DF')

$op='B';

else

$op='S';

$MyArc = 4/3 * (sqrt(2) - 1);

$this->_out(sprintf('%.2f %.2f m',($x+$r)*$k,($hp-$y)*$k ));

$xc = $x+$w-$r ;

$yc = $y+$r;

$this->_out(sprintf('%.2f %.2f l', $xc*$k,($hp-$y)*$k ));

 

$this->_Arc($xc + $r*$MyArc, $yc - $r, $xc + $r, $yc - $r*$MyArc, $xc + $r, $yc);

$xc = $x+$w-$r ;

$yc = $y+$h-$r;

$this->_out(sprintf('%.2f %.2f l',($x+$w)*$k,($hp-$yc)*$k));

$this->_Arc($xc + $r, $yc + $r*$MyArc, $xc + $r*$MyArc, $yc + $r, $xc, $yc + $r);

$xc = $x+$r ;

$yc = $y+$h-$r;

$this->_out(sprintf('%.2f %.2f l',$xc*$k,($hp-($y+$h))*$k));

$this->_Arc($xc - $r*$MyArc, $yc + $r, $xc - $r, $yc + $r*$MyArc, $xc - $r, $yc);

$xc = $x+$r ;

$yc = $y+$r;

$this->_out(sprintf('%.2f %.2f l',($x)*$k,($hp-$yc)*$k ));

$this->_Arc($xc - $r, $yc - $r*$MyArc, $xc - $r*$MyArc, $yc - $r, $xc, $yc - $r);

$this->_out($op);

}

 

function _Arc($x1, $y1, $x2, $y2, $x3, $y3)

{

$h = $this->h;

$this->_out(sprintf('%.2f %.2f %.2f %.2f %.2f %.2f c ', $x1*$this->k, ($h-$y1)*$this->k,

$x2*$this->k, ($h-$y2)*$this->k, $x3*$this->k, ($h-$y3)*$this->k));

}

 

function Header()

{

global $HTTP_GET_VARS, $highlight_color, $date, $image_function, $customer_id;

 

 

//Logo

$size =getimagesize(PDF_INVOICE_IMAGE);

$this->$image_function(PDF_INVOICE_IMAGE,7,10,($size[0]*PDF_INV_IMG_CORRECTION),($size[1]*PDF_INV_IMG_CORRECTION),'', FILENAME_DEFAULT);

 

// Invoice Number, customer reference and date

$this->SetFont(PDF_INV_CORE_FONT,'B',10);

$this->SetTextColor($highlight_color[0],$highlight_color[1],$highlight_color[2]);

$this->SetY(43);

$this->Cell(100,6, tep_html_entity_decode(PRINT_INVOICE_TITLE) . (int)$HTTP_GET_VARS['order_id'],0,'L');

$this->SetY(48);

$this->Cell(100,6, $date ,0,'L');

 

// Company name

$this->SetX(0);

$this->SetY(12);

$this->SetFont(PDF_INV_CORE_FONT,'B',12);

$this->SetTextColor($highlight_color[0],$highlight_color[1],$highlight_color[2]);

$this->Ln(0);

$this->Cell(149);

$this->MultiCell(50, 3.5, tep_html_entity_decode(STORE_NAME),0,'L');

 

// Company Address

$this->SetX(0);

$this->SetY(16);

$this->SetFont(PDF_INV_CORE_FONT,'B',10);

$this->SetTextColor($highlight_color[0],$highlight_color[1],$highlight_color[2]);

$this->Ln(0);

$this->Cell(149);

$this->MultiCell(50, 3.5, tep_html_entity_decode(STORE_NAME_ADDRESS),0,'L');

 

//Email

$this->SetX(0);

$this->SetY(43);

$this->SetFont(PDF_INV_CORE_FONT,'B',10);

$this->SetTextColor($highlight_color[0],$highlight_color[1],$highlight_color[2]);

$this->Ln(0);

$this->Cell(88);

$this->MultiCell(100, 6, tep_html_entity_decode(PDF_INV_EMAIL) . STORE_OWNER_EMAIL_ADDRESS,0,'R');

 

//Website

$this->SetX(0);

$this->SetY(48);

$this->SetFont(PDF_INV_CORE_FONT,'B',10);

$this->SetTextColor($highlight_color[0],$highlight_color[1],$highlight_color[2]);

$this->Ln(0);

$this->Cell(88);

$this->MultiCell(100, 6, tep_html_entity_decode(PDF_INV_WEB) . HTTP_SERVER,0,'R');

 

// VAT / Tax number (if enabled)

if (DISPLAY_PDF_TAX_NUMBER == 'true'){

$this->SetX(0);

$this->SetY(53);

$this->SetFont(PDF_INV_CORE_FONT,'B',10);

$this->SetTextColor($highlight_color[0],$highlight_color[1],$highlight_color[2]);

$this->Ln(0);

$this->Cell(88);

$this->MultiCell(100, 6, tep_html_entity_decode(PDF_TAX_NAME) . " " . PDF_TAX_NUMBER,0,'R');

}

}

 

// function taken and modified from $Id: pdf_datasheet_functions v1.40 2005/06/16 13:46:29 ip chilipepper.it Exp $

 

function RotatedText($x,$y,$txt,$angle)

{

//Text rotated around its origin

$this->Rotate($angle,$x,$y);

$this->Text($x,$y,$txt);

$this->Rotate(0);

}

 

 

function Watermark()

{

global $watermark_color;

$this->SetFont(PDF_INV_CORE_FONT,'B',60);

$this->SetTextColor($watermark_color[0], $watermark_color[1], $watermark_color[2]);

$ang=30;

$cos=cos(deg2rad($ang));

$wwm=($this->GetStringWidth(tep_html_entity_decode(PDF_INV_WATERMARK_TEXT))*$cos);

$this->RotatedText(($this->w-$wwm)/2,$this->w,PDF_INV_WATERMARK_TEXT,$ang);

}

 

function Footer()

{

global $highlight_color, $invoice_line;

 

// insert horiz line

$this->SetY(-19);

$this->SetDrawColor($invoice_line[0],$invoice_line[1],$invoice_line[2]);

$this->Cell(198,.1,'',1,1,'L',1);

 

//Position at 1.5 cm from bottom

$this->SetY(-17);

$this->SetFont(PDF_INV_CORE_FONT,'',8);

$this->SetTextColor($highlight_color[0],$highlight_color[1],$highlight_color[2]);

$this->Cell(0,10, tep_html_entity_decode(PDF_INV_FOOTER_TEXT), 0,0,'C');

}

}

 

/***************************

* Software: FPDF_EPS

* Version: 1.3

* Date: 2006-07-28

* Author: Valentin Schmidt

****************************/

class PDF_EPS extends PDF{

 

function PDF_EPS($orientation='P',$unit='mm',$format='A4'){

parent::FPDF($orientation,$unit,$format);

}

 

function ImageEps ($file, $x, $y, $w=0, $h=0, $link='', $useBoundingBox=true){

$data = file_get_contents($file);

if ($data===false) $this->Error('EPS file not found: '.$file);

 

# strip binary bytes in front of PS-header

$start = strpos($data, '%!PS-Adobe');

if ($start>0) $data = substr($data, $start);

 

# find BoundingBox params

ereg ("%%BoundingBox:([^\r\n]+)", $data, $regs);

if (count($regs)>1){

list($x1,$y1,$x2,$y2) = explode(' ', trim($regs[1]));

}

else $this->Error('No BoundingBox found in EPS file: '.$file);

 

$start = strpos($data, '%%EndSetup');

if ($start===false) $start = strpos($data, '%%EndProlog');

if ($start===false) $start = strpos($data, '%%BoundingBox');

 

$data = substr($data, $start);

 

$end = strpos($data, '%%PageTrailer');

if ($end===false) $end = strpos($data, 'showpage');

if ($end) $data = substr($data, 0, $end);

 

# save the current graphic state

$this->_out('q');

 

$k = $this->k;

 

if ($useBoundingBox){

$dx = $x*$k-$x1;

$dy = $y*$k-$y1;

}else{

$dx = $x*$k;

$dy = $y*$k;

}

 

# translate

$this->_out(sprintf('%.3f %.3f %.3f %.3f %.3f %.3f cm', 1,0,0,1,$dx,$dy+($this->hPt - 2*$y*$k - ($y2-$y1))));

 

if ($w>0){

$scale_x = $w/(($x2-$x1)/$k);

if ($h>0){

$scale_y = $h/(($y2-$y1)/$k);

}else{

$scale_y = $scale_x;

$h = ($y2-$y1)/$k * $scale_y;

}

}else{

if ($h>0){

$scale_y = $h/(($y2-$y1)/$k);

$scale_x = $scale_y;

$w = ($x2-$x1)/$k * $scale_x;

}else{

$w = ($x2-$x1)/$k;

$h = ($y2-$y1)/$k;

}

}

 

# scale

if (isset($scale_x))

$this->_out(sprintf('%.3f %.3f %.3f %.3f %.3f %.3f cm', $scale_x,0,0,$scale_y, $x1*(1-$scale_x), $y2*(1-$scale_y)));

 

# handle pc/unix/mac line endings

$lines = split ("\r\n|[\r\n]", $data);

 

$u=0;

$cnt = count($lines);

for ($i=0;$i<$cnt;$i++){

$line = $lines[$i];

if ($line=='' || $line{0}=='%') continue;

$len = strlen($line);

if ($len>2 && $line{$len-2}!=' ') continue;

$cmd = $line{$len-1};

 

switch ($cmd){

case 'm':

case 'l':

case 'v':

case 'y':

case 'c':

 

case 'k':

case 'K':

case 'g':

case 'G':

 

case 's':

case 'S':

 

case 'J':

case 'j':

case 'w':

case 'M':

case 'd' :

 

case 'n' :

case 'v' :

$this->_out($line);

break;

 

case 'x': # custom colors

list($c,$m,$y,$k) = explode(' ', $line);

$this->_out("$c $m $y $k k");

break;

 

case 'Y':

$line{$len-1}='y';

$this->_out($line);

break;

 

case 'N':

$line{$len-1}='n';

$this->_out($line);

break;

 

case 'V':

$line{$len-1}='v';

$this->_out($line);

break;

 

case 'L':

$line{$len-1}='l';

$this->_out($line);

break;

 

case 'C':

$line{$len-1}='c';

$this->_out($line);

break;

 

case 'b':

case 'B':

$this->_out($cmd . '*');

break;

 

case 'f':

case 'F':

if ($u>0){

$isU = false;

$max = min($i+5,$cnt);

for ($j=$i+1;$j<$max;$j++)

$isU = ($isU || ($lines[$j]=='U' || $lines[$j]=='*U'));

if ($isU) $this->_out("f*");

}else

$this->_out("f*");

break;

 

case 'u':

if ($line{0}=='*') $u++;

break;

 

case 'U':

if ($line{0}=='*') $u--;

break;

 

#default: echo "$cmd<br>"; #just for debugging

}

 

}

 

# restore previous graphic state

$this->_out('Q');

if ($link)

$this->Link($x,$y,$w,$h,$link);

}

 

}# END CLASS

 

# for backward compatibility

if (!function_exists('file_get_contents')){

function file_get_contents($filename, $use_include_path = 0){

$file = @fopen($filename, 'rb', $use_include_path);

if ($file){

if ($fsize = @filesize($filename))

$data = fread($file, $fsize);

else {

$data = '';

while (!feof($file)) $data .= fread($file, 1024);

}

fclose($file);

return $data;

}else

return false;

}

}

 

// Instanciation of inherited class - choose according to logo supplied, vector or raster

if(findextension(PDF_INVOICE_IMAGE) == 'ai' || findextension(PDF_INVOICE_IMAGE) == 'eps'){

$pdf=new PDF_EPS();

$image_function = "ImageEps";

}

else{

$pdf=new PDF();

$image_function = "Image";

}

 

// Set the Page Margins

$pdf->SetMargins(6,2,6);

 

// Add the first page

$pdf->AddPage();

 

// add watermark if required

 

if(PDF_SHOW_WATERMARK == 'true'){

$pdf->Watermark();

}

 

//Draw the top line with invoice text Kopflinie links +rechts

$pdf->Cell(50);

$pdf->SetY(60);

$pdf->SetDrawColor($invoice_line[0],$invoice_line[1],$invoice_line[2]);

$pdf->Cell(15,.1,'',1,1,'L',1);

$pdf->SetFont(PDF_INV_CORE_FONT,'BI',15);

$pdf->SetTextColor($invoice_line[0],$invoice_line[1],$invoice_line[2]);

$pdf->Text(22,61.5,tep_html_entity_decode(PRINT_INVOICE_HEADING));

$pdf->SetY(60);

$pdf->SetDrawColor($invoice_line[0],$invoice_line[1],$invoice_line[2]);

$pdf->Cell(44);

$pdf->Cell(150,.1,'',1,1,'L',1);

 

//Draw Box for Invoice Address

$pdf->SetDrawColor($border_color[0],$border_color[1],$border_color[2]);

$pdf->SetLineWidth(0.2);

$pdf->SetFillColor($cell_color[0],$cell_color[1],$cell_color[2]);

$pdf->RoundedRect(6, 67, 90, 35, 2, 'DF');

 

//Draw the invoice address text

$pdf->SetFont(PDF_INV_CORE_FONT,'B',10);

$pdf->SetTextColor($standard_color[0],$standard_color[1],$standard_color[2]);

$pdf->Text(11,77, tep_html_entity_decode(ENTRY_SOLD_TO));

$pdf->SetX(0);

$pdf->SetY(80);

$pdf->Cell(9);

$pdf->MultiCell(70, 3.9, tep_html_entity_decode(tep_address_format($order->customer['format_id'], $order->customer, '', '', "\n")),0,'L');

 

//Draw Box for Delivery Address

$pdf->SetDrawColor($border_color[0],$border_color[1],$border_color[2]);

$pdf->SetLineWidth(0.2);

$pdf->SetFillColor(255);

$pdf->RoundedRect(108, 67, 90, 35, 2, 'DF');

 

//Draw the invoice delivery address text

$pdf->SetFont(PDF_INV_CORE_FONT,'B',10);

$pdf->SetTextColor($standard_color[0],$standard_color[1],$standard_color[2]);

$pdf->Text(113,77,tep_html_entity_decode(ENTRY_SHIP_TO));

$pdf->SetX(0);

$pdf->SetY(80);

$pdf->Cell(111);

$pdf->MultiCell(70, 3.9, tep_html_entity_decode(tep_address_format($order->delivery['format_id'], $order->delivery, '', '', "\n")),0,'L');

 

//Draw Box for Order Number, Date & Payment method

$pdf->SetDrawColor($border_color[0],$border_color[1],$border_color[2]);

$pdf->SetLineWidth(0.2);

$pdf->SetFillColor($cell_color[0],$cell_color[1],$cell_color[2]);

$pdf->RoundedRect(6, 107, 192, 14, 2, 'DF');

 

//Draw Order Number Text

$pdf->Text(10,113, tep_html_entity_decode(PRINT_INVOICE_ORDERNR) . (int)$HTTP_GET_VARS['order_id']);

//Draw Date of Order Text

$pdf->Text(60,113, tep_html_entity_decode(PRINT_INVOICE_DATE) . tep_date_short($order->info['date_purchased']));

//Draw Payment Method Text

$temp = substr ($order->info['payment_method'] , 0, 23);

$pdf->Text(120,113, tep_html_entity_decode(ENTRY_PAYMENT_METHOD) . ' ' . tep_html_entity_decode($temp));

 

// Draw customer reference

$pdf->Text(10,117, tep_html_entity_decode(PDF_INV_CUSTOMER_REF) . (int)$customer_id);

 

 

//Fields Name position

$Y_Fields_Name_position = 125;

//Table position, under Fields Name

$Y_Table_Position = 131;

 

 

function output_table_heading($Y_Fields_Name_position){

global $pdf, $cell_color;

//First create each Field Name

// Config color filling each Field Name box

$pdf->SetFillColor($cell_color[0],$cell_color[1],$cell_color[2]);

//Bold Font for Field Name

$pdf->SetFont(PDF_INV_CORE_FONT,'B',10);

$pdf->SetY($Y_Fields_Name_position);

$pdf->SetX(6);

$pdf->Cell(9,6,tep_html_entity_decode(PDF_INV_QTY_CELL),1,0,'C',1);

$pdf->SetX(15);

$pdf->Cell(27,6,tep_html_entity_decode(TABLE_HEADING_PRODUCTS_MODEL),1,0,'C',1);

$pdf->SetX(40);

$pdf->Cell(78,6,tep_html_entity_decode(TABLE_HEADING_PRODUCTS),1,0,'C',1);

$pdf->SetX(118);

$pdf->Cell(20,6,tep_html_entity_decode(TABLE_HEADING_PRICE_EXCLUDING_TAX),1,0,'C',1);

$pdf->SetX(138);

$pdf->Cell(20,6,tep_html_entity_decode(TABLE_HEADING_PRICE_INCLUDING_TAX),1,0,'C',1);

$pdf->SetX(158);

$pdf->Cell(20,6,tep_html_entity_decode(TABLE_HEADING_TOTAL_EXCLUDING_TAX),1,0,'C',1);

$pdf->SetX(178);

$pdf->Cell(20,6,tep_html_entity_decode(TABLE_HEADING_TOTAL_INCLUDING_TAX),1,0,'C',1);

$pdf->Ln();

}

 

output_table_heading($Y_Fields_Name_position);

//Show the products information line by line

for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {

$pdf->SetFont(PDF_INV_CORE_FONT,'',10);

$pdf->SetY($Y_Table_Position);

$pdf->SetX(6);

$pdf->MultiCell(9,6,$order->products[$i]['qty'],1,'C');

$pdf->SetY($Y_Table_Position);

$pdf->SetX(40);

 

$prod_attribs='';

 

//get attribs and concat

if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {

for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {

$prod_attribs .= " - " .$order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];

}

}

 

$product_name_attrib_contact = $order->products[$i]['name'] . $prod_attribs;

 

if (strlen($product_name_attrib_contact) > 40 && strlen($product_name_attrib_contact) < 50){

$pdf->SetFont(PDF_INV_CORE_FONT,'',6);

$pdf->MultiCell(78,6,tep_html_entity_decode($product_name_attrib_contact),1,'L');

}

 

else if (strlen($product_name_attrib_contact) > 50){

$pdf->SetFont(PDF_INV_CORE_FONT,'',6);

$pdf->MultiCell(78,6,tep_html_entity_decode(substr($product_name_attrib_contact,0,60)) ." .. ",1,'L');

}

 

 

else{

$pdf->SetFont(PDF_INV_CORE_FONT,'',6);

$pdf->MultiCell(78,6,tep_html_entity_decode($product_name_attrib_contact),1,'L');

$pdf->Ln();

}

 

$pdf->SetFont(PDF_INV_CORE_FONT,'',10);

$pdf->SetY($Y_Table_Position);

$pdf->SetX(15);

$pdf->SetFont(PDF_INV_CORE_FONT,'',8);

$pdf->MultiCell(25,6,tep_html_entity_decode($order->products[$i]['model']),1,'C');

$pdf->SetY($Y_Table_Position);

$pdf->SetX(118);

$pdf->SetFont(PDF_INV_CORE_FONT,'',10);

$pdf->MultiCell(20,6,$currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']),1,'C');

$pdf->SetY($Y_Table_Position);

$pdf->SetX(138);

$pdf->MultiCell(20,6,$currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']),1,'C');

$pdf->SetY($Y_Table_Position);

$pdf->SetX(158);

$pdf->MultiCell(20,6,$currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']),1,'C');

$pdf->SetY($Y_Table_Position);

$pdf->SetX(178);

$pdf->MultiCell(20,6,$currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']),1,'C');

//Rechnungsauflistung unter der Tabelle

$Y_Table_Position += 15;

 

//Check for product line overflow

$item_count++;

if ((is_long($item_count / 32) && $i >= 20) || ($i == 20)){

$pdf->AddPage();

//Fields Name position

$Y_Fields_Name_position = 125;

//Table position, under Fields Name

$Y_Table_Position = 70;

output_table_heading($Y_Table_Position-6);

if ($i == 20) $item_count = 1;

}

}

for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {

$pdf->SetY($Y_Table_Position + 5);

$pdf->SetX(102);

$temp = substr ($order->totals[$i]['text'],0 ,3);

if ($temp == '<b>')

{

$pdf->SetFont(PDF_INV_CORE_FONT,'B',10);

$temp2 = substr($order->totals[$i]['text'], 3);

$order->totals[$i]['text'] = substr($temp2, 0, strlen($temp2)-4);

}

$pdf->MultiCell(94,6,$order->totals[$i]['title'] . ' ' . $order->totals[$i]['text'],0,'R');

$Y_Table_Position += 5;

}

 

 

// set PDF metadata

$pdf->SetTitle(PDF_META_TITLE);

$pdf->SetSubject(PDF_META_SUBJECT . $HTTP_GET_VARS['order_id']);

$pdf->SetAuthor(STORE_OWNER);

 

// PDF created

 

function safe_filename ($filename) {

$search = array(

'/ß/',

'/ä/','/Ä/',

'/ö/','/Ö/',

'/ü/','/Ü/',

'([^[:alnum:]._])'

);

$replace = array(

'ss',

'ae','Ae',

'oe','Oe',

'ue','Ue',

'_'

);

 

// return a safe filename, lowercased and suffixed with invoice number.

 

return strtolower(preg_replace($search,$replace,$filename));

}

$file_name = safe_filename(STORE_NAME);

$file_name .= "_invoice_" . $HTTP_GET_VARS['order_id'] . ".pdf";

$mode = (FORCE_PDF_INVOICE_DOWNLOAD == 'true') ? 'D' : 'I';

// what do we do? display inline or force download

$pdf->Output($file_name , $mode);

?>

 

 

can you help me ?

Link to comment
Share on other sites

Hi Chris!

I have a problem with the admin part of the contrib i follow the instructions and this happens when i klick on orders in admin:

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /usr/www-root/kunder/foretag/xxxx/xxxxxx/www.xxxx.com/admin/orders.php on line 231

 

this is the line 231

 '			<td class="dataTableContent" valign="top" align="right"><a href="java script: updateProduct('' . $oID . '', '' . $order->products[$i]['id'] . '', '', 'eliminate', '', '');"><font color="red"><b>X</b></font></a> <a href="java script: updateProduct('' . $oID . '', '' . $order->products[$i]['id'] . '', 'products_quantity', 'update', '', '' . $order->products[$i]['qty'] . '');"><u>' . $order->products[$i]['qty'] . ' x</u></a></td>' . "n" .

 

this is admin/orders.php

 

<?php
 require('includes/application_top.php');

 $pass_phrase="testartestartestar";
 $pass_phrase_hash=md5($pass_phrase);

 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

 $orders_statuses = array();
 $orders_status_array = array();
 $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
 while ($orders_status = tep_db_fetch_array($orders_status_query)) {
$orders_statuses[] = array('id' => $orders_status['orders_status_id'],
						   'text' => $orders_status['orders_status_name']);
$orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
 }

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 if (tep_not_null($action)) {
switch ($action) {
  case 'update_order':
	$oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
	$status = tep_db_prepare_input($HTTP_POST_VARS['status']);
	$comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
	$track_num = tep_db_prepare_input($HTTP_POST_VARS['track_num']);

	$order_updated = false;
//fast easy checkout start
	$check_status_query = tep_db_query("select customers_name, customers_email_address,customers_id, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
	$check_status = tep_db_fetch_array($check_status_query);
	$cust_id = $check_status['customers_id'];
//fast easy checkout end

	if ( ($check_status['orders_status'] != $status) || tep_not_null($comments)) {
	  tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");

	  $customer_notified = '0';
	  if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) {
		$notify_comments = '';
		if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {
		  $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "nn";
		}

		$email = STORE_NAME . "n" . EMAIL_SEPARATOR . "n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "nn" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
		if ((isset($HTTP_POST_VARS['notify_tracking']) && ($HTTP_POST_VARS['notify_tracking'] == 'on')) && (tep_not_null($track_num))) {
		  $notify_tracking = sprintf(EMAIL_TEXT_TRACKING_NUMBER) . "n" . URL_TO_TRACK . $track_num . "nn";
		}
		$email = STORE_NAME . "n" . EMAIL_SEPARATOR . "n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "nn" . $notify_tracking . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

		tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

		$customer_notified = '1';
	  }

	  //tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "')");
	  tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments, track_num) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "', '" . tep_db_input($track_num) . "')");

	  $order_updated = true;
	}

	if ($order_updated == true) {
	 $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
	} else {
	  $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
	}

	tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit'));
	break;
  case 'deleteconfirm':
	$oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

	tep_remove_order($oID, $HTTP_POST_VARS['restock']);

	tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action'))));
	break;
}
 }

 if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) {
$oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
$order_exists = true;
if (!tep_db_num_rows($orders_query)) {
  $order_exists = false;
  $messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
}
 }

 require(DIR_WS_CLASSES . 'order.php');
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
<script language="javascript" src="includes/ajax.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<div id="add-Product" class="addProduct">
<div><?php echo DIV_ADD_PRODUCT_HEADING; ?></div>
<div id="add-product-product" class="addProductContents"><?php echo ADD_PRODUCT_SELECT_PRODUCT; ?></div>
<div id="addProductSearch" class="addProductContentsSearch"><?php require (DIR_WS_INCLUDES . 'advanced_search.php'); ?></div>
<div id="addProductFind"> </div>
<div id="ProdAttr"> </div>
<a href="java script: hideAddProducts();"><?php echo tep_image(DIR_WS_LANGUAGES . $language  . '/images/buttons/button_cancel.gif'); ?></a></div>
<!-- header //-->
<?php
 require(DIR_WS_INCLUDES . 'header.php');
?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
 if (($action == 'edit') && ($order_exists == true)) {
$order = new order($oID);
?>
  <tr>
	<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
		<td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><table width="100%" border="0" cellspacing="0" cellpadding="2">
	  <tr>
		<td colspan="3"><?php echo tep_draw_separator(); ?></td>
	  </tr>
	  <tr>
		<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
		  <tr>
			<td class="main" valign="top"><b><?php echo ENTRY_CUSTOMER; ?></b></td>
			<td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>', 'customers_', $oID); ?></td>
		  </tr>
		  <tr>
			<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
		  </tr>
		  <tr>
			<td class="main"><b><?php echo ENTRY_TELEPHONE_NUMBER; ?></b></td>
			<td class="main"><a href="java script: updateOrderField('<?php echo $oID; ?>', 'orders', 'customers_telephone', '<?php echo $order->customer['telephone']; ?>');" class="ajaxLink"><?php echo $order->customer['telephone']; ?></a></td>
		  </tr>
		  <tr>
			<td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>
			<td class="main"><a href="java script: updateOrderField('<?php echo $oID; ?>', 'orders', 'customers_email_address', '<?php echo $order->customer['email_address']; ?>');" class="ajaxLink"><?php echo $order->customer['email_address'] . '</a>'; ?></td>
		  </tr>
		</table></td>
		<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
		  <tr>
			<td class="main" valign="top"><b><?php echo ENTRY_SHIPPING_ADDRESS; ?></b></td>
			<td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>', 'delivery_', $oID); ?></td>
		  </tr>
		</table></td>
		<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
		  <tr>
			<td class="main" valign="top"><b><?php echo ENTRY_BILLING_ADDRESS; ?></b></td>
			<td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, '', '<br>', 'billing_', $oID); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
		<td class="main"><a href="java script: updateOrderField('<?php echo $oID; ?>', 'orders', 'payment_method', '<?php echo addslashes($order->info['payment_method']); ?>');" class="ajaxLink"><?php echo $order->info['payment_method']; ?></a></td>
	  </tr>
<?php
if (tep_not_null($order->info['cc_type']) || tep_not_null($order->info['cc_owner']) || tep_not_null($order->info['cc_number'])) {
?>
	  <tr>
		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>
	  <tr>
		<td class="main"><a href="java script: updateOrderField('<?php echo $oID; ?>', 'orders', 'cc_type', '<?php echo $order->info['cc_type']; ?>');" class="ajaxLink"><?php echo ENTRY_CREDIT_CARD_TYPE; ?></a></td>
		<td class="main"><?php echo $order->info['cc_type']; ?></td>
	  </tr>
	  <tr>
		<td class="main"><a href="java script: updateOrderField('<?php echo $oID; ?>', 'orders', 'cc_owner', '<?php echo $order->info['cc_owner']; ?>');" class="ajaxLink"><?php echo ENTRY_CREDIT_CARD_OWNER; ?></a></td>
		<td class="main"><?php echo $order->info['cc_owner']; ?></td>
	  </tr>
	  <tr>
		<td class="main"><a href="java script: updateOrderField('<?php echo $oID; ?>', 'orders', 'cc_number', '<?php echo $order->info['cc_number']; ?>');" class="ajaxLink"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></a></td>
		<td class="main"><?php echo $order->info['cc_number']; ?></td>
	  </tr>
	  <tr>
		<td class="main"><a href="java script: updateOrderField('<?php echo $oID; ?>', 'orders', 'cc_expires', '<?php echo $order->info['cc_expires']; ?>');" class="ajaxLink"><?php echo ENTRY_CREDIT_CARD_EXPIRES; ?></a></td>
		<td class="main"><?php echo $order->info['cc_expires']; ?></td>
	  </tr>
<?php
}
?>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr class="dataTableHeadingRow">
		<td class="dataTableHeadingContent" colspan="2"><?php echo sprintf(TABLE_HEADING_PRODUCTS, $oID); ?></td>
		<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
		<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>
		<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>
		<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>
		<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>
		<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>
	  </tr>
<?php
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
  echo '		  <tr class="dataTableRow">' . "n" .
	   '			<td class="dataTableContent" valign="top" align="right"><a href="java script: updateProduct('' . $oID . '', '' . $order->products[$i]['id'] . '', '', 'eliminate', '', '');"><font color="red"><b>X</b></font></a> <a href="java script: updateProduct('' . $oID . '', '' . $order->products[$i]['id'] . '', 'products_quantity', 'update', '', '' . $order->products[$i]['qty'] . '');"><u>' . $order->products[$i]['qty'] . ' x</u></a></td>' . "n" .

	   '			<td class="dataTableContent" valign="top">' . $order->products[$i]['name'];

  if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
	for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
	  echo '<br><nobr><small> <i> - <a href="java script: updateProduct('' . $oID . '', '' . $order->products[$i]['id'] . '', 'options', 'update', '' . $order->products[$i]['attributes'][$j]['option'] . '', '' . $order->products[$i]['attributes'][$j]['value'] . '');"><u>' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
	  if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
	  echo '</u></a></i></small></nobr>';
	}
  }

  echo '			</td>' . "n" .
	   '			<td class="dataTableContent" valign="top"><a href="java script: updateProduct('' . $oID . '', '' . $order->products[$i]['id'] . '', 'products_model', 'update', '', '' . $order->products[$i]['model'] . '');"><u>' . $order->products[$i]['model'] . '</u></a></td>' . "n" .
	   '			<td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "n" .
	   '			<td class="dataTableContent" align="right" valign="top"><b><a href="java script: updateProduct('' . $oID . '', '' . $order->products[$i]['id'] . '', 'products_price_excl', 'update', '', '' . $order->products[$i]['final_price'] . '');"><u>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</u></a></b></td>' . "n" .
	   '			<td class="dataTableContent" align="right" valign="top"><b><a href="java script: updateProduct('' . $oID . '', '' . $order->products[$i]['id'] . '', 'products_price_incl', 'update', '', '' . tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) . '');"><u>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true), true, $order->info['currency'], $order->info['currency_value']) . '</u></a></b></td>' . "n" .
	   '			<td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "n" .
	   '			<td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "n";
  echo '		  </tr>' . "n";
}
?>
	  <tr>
		<td align="right" colspan="8"><table border="0" cellspacing="0" cellpadding="2">
<?php
for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
	if (($order->totals[$i]['class'] != 'ot_subtotal') && ($order->totals[$i]['class'] != 'ot_total') && ($order->totals[$i]['class'] != 'ot_tax')) {
		echo '			  <tr>' . "n" .
			 '				<td align="right" class="smallText"><a href="java script: updateOrdersTotal('' . $oID . '', '' . $order->totals[$i]['class'] . '', '' . addslashes(htmlspecialchars($order->totals[$i]['title'])) . '', 'title')"><u>' . $order->totals[$i]['title'] . '</u></a></td>' . "n" .
			 '				<td align="right" class="smallText"><a href="java script: updateOrdersTotal('' . $oID . '', '' . $order->totals[$i]['class'] . '', '' . $order->totals[$i]['value'] . '', 'value')"><u>' . $order->totals[$i]['text'] . '</u></a></td>' . "n" .
			 '			  </tr>' . "n";
	} else {
		echo '			  <tr>' . "n" .
			 '				<td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "n" .
			 '				<td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "n" .
			 '			  </tr>' . "n";
	}
}
//link to create a new order_total
echo '			  <tr>' . "n" .
	 '			  <td align="right" class="smallText" colspan="2"><a href="java script: createOrdersTotal('' . $oID . '')"><u>Lägg till extra rad</u></a></td>' . "n" .
	 '			  </tr>' . "n";
?></table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><table border="1" cellspacing="0" cellpadding="5">
	  <tr>
		<td class="smallText" align="center"><b><?php echo TABLE_HEADING_DATE_ADDED; ?></b></td>
		<td class="smallText" align="center"><b><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></b></td>
		<td class="smallText" align="center"><b><?php echo TABLE_HEADING_STATUS; ?></b></td>
		<td class="smallText" align="center"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
		<td class="smallText" align="center"><b><?php echo TABLE_HEADING_TRACKING; ?></b></td>
	  </tr>
<?php
//$orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
$orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments, track_num from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
$tracknumber = '';
if (tep_db_num_rows($orders_history_query)) {
  while ($orders_history = tep_db_fetch_array($orders_history_query)) {
	if ($orders_history['track_num']!='') $tracknumber = $orders_history['track_num'];
	echo '		  <tr>' . "n" .
		 '			<td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "n" .
		 '			<td class="smallText" align="center">';
	if ($orders_history['customer_notified'] == '1') {
	  echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>n";
	} else {
	  echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>n";
	}
	echo '			<td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "n" .
		 '			<td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "n" .
		 '			<td class="smallText">' . ( empty( $orders_history['track_num'] ) ? ' ' : '<a href="' . URL_TO_TRACK . nl2br(tep_output_string_protected(nl2br(tep_db_output($orders_history['track_num'])))) . '" target="_blank">' . nl2br(tep_output_string_protected(nl2br(tep_db_output($orders_history['track_num'])))) . '</a>  ') . '</td>' . "n" .
		 '		  </tr>' . "n";
  }
} else {
	echo '		  <tr>' . "n" .
		 '			<td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "n" .
		 '		  </tr>' . "n";
}
?>
	</table></td>
  </tr>
  <tr>
	<td class="main"><br><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
  </tr>
  <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=update_order'); ?>
	<td class="main"><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>
  </tr>
  <tr>
	<td class="main"><br><b><?php echo TABLE_HEADING_TRACKING; ?></b></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
  </tr>
  <tr>
	<td class="smallText"><b><?php echo TABLE_HEADING_TRACK; ?></b> <?php echo tep_draw_input_field('track_num', $tracknumber, 'size=/"20/"'); ?>  </td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" cellspacing="0" cellpadding="2">
	  <tr>
		<td><table border="0" cellspacing="0" cellpadding="2">
		  <tr>
			<td class="main"><b><?php echo ENTRY_STATUS; ?></b> <?php echo tep_draw_pull_down_menu('status', $orders_statuses, $order->info['orders_status']); ?></td>
		  </tr>
		  <tr>
			<td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '', true); ?></td>
			<td class="main"><b><?php echo ENTRY_NOTIFY_COMMENTS; ?></b> <?php echo tep_draw_checkbox_field('notify_comments', '', true); ?></td>
			<td class="main"><b><?php echo ENTRY_NOTIFY_TRACKING; ?></b> <?php echo tep_draw_checkbox_field('notify_tracking', '', true); ?></td>
		  </tr>
		</table></td>
		<td valign="top"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td>
	  </tr>
	</table></td>
  </form></tr>
  <tr>
	<td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link('../pdfinvoice.php', 'order_id=' . $HTTP_GET_VARS['oID'] . '&passthruID=' . $pass_phrase_hash, 'SSL') . '" TARGET="_blank">' . tep_image_button('button_invoice_pdf.gif', IMAGE_ORDERS_PDF_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
  </tr>
<?php
 } else {
?>
  <tr>
	<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
		<td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
		  <tr><?php echo tep_draw_form('orders', FILENAME_ORDERS, '', 'get'); ?>
			<td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('oID', '', 'size="12"') . tep_draw_hidden_field('action', 'edit'); ?></td>
		  </form></tr>
		  <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, '', 'get'); ?>
			<td class="smallText" align="right"><?php echo HEADING_TITLE_STATUS . ' ' . tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();"'); ?></td>
		  </form></tr>			
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr class="dataTableHeadingRow">
			<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
			<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td>
			<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>
			<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
			<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
		  </tr>
<?php
if (isset($HTTP_GET_VARS['cID'])) {
  $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
} elseif (isset($HTTP_GET_VARS['status'])) {
  $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";
} else {
  $orders_query_raw = "select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";
}
$orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);
$orders_query = tep_db_query($orders_query_raw);
while ($orders = tep_db_fetch_array($orders_query)) {
if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']))) && !isset($oInfo)) {
	$oInfo = new objectInfo($orders);
  }

  if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
	echo '			  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . ''">' . "n";
  } else {
	echo '			  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . ''">' . "n";
  }
?>
			<td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . ( $orders['customers_id']=='0' ? '** ' : '') . $orders['customers_name']; ?></td>
			<td class="dataTableContent" align="right"><?php echo strip_tags($orders['order_total']); ?></td>
			<td class="dataTableContent" align="center"><?php echo tep_datetime_short($orders['date_purchased']); ?></td>
			<td class="dataTableContent" align="right"><?php echo $orders['orders_status_name']; ?></td>
			<td class="dataTableContent" align="right"><?php if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
		  </tr>
<?php
}
?>
		  <tr>
			<td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
			  <tr>
				<td class="smallText" valign="top"><?php echo $orders_split->display_count($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
				<td class="smallText" align="right"><?php echo $orders_split->display_links($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'oID', 'action'))); ?></td>
			  </tr>
			</table></td>
		  </tr>
		</table></td>
<?php
 $heading = array();
 $contents = array();

 switch ($action) {
case 'delete':
  $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ORDER . '</b>');

  $contents = array('form' => tep_draw_form('orders', FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=deleteconfirm'));
  $contents[] = array('text' => TEXT_INFO_DELETE_INTRO . '<br><br><b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
  $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('restock') . ' ' . TEXT_INFO_RESTOCK_PRODUCT_QUANTITY);
  $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  break;
default:
  if (isset($oInfo) && is_object($oInfo)) {
	$heading[] = array('text' => '<b>[' . $oInfo->orders_id . ']  ' . tep_datetime_short($oInfo->date_purchased) . '</b>');

	$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
	$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link('../pdfinvoice.php', 'order_id=' . $oInfo->orders_id . '&passthruID=' . $pass_phrase_hash, 'SSL') . '" TARGET="_blank">' . tep_image_button('button_invoice_pdf.gif', IMAGE_ORDERS_PDF_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');
	$contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));
	if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));
	$contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_METHOD . ' '  . $oInfo->payment_method);
  }
  break;
 }

 if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
echo '			<td width="25%" valign="top">' . "n";

$box = new box;
echo $box->infoBox($heading, $contents);

echo '			</td>' . "n";
 }
?>
	  </tr>
	</table></td>
  </tr>
<?php
 }
?>
</table></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

any idea how i can fix this?

 

Regards Tony

Link to comment
Share on other sites

I'm sorry to post my problem again but the poster above me posted such a large php file so that my message has almost dissappeared ;):

 

I really like this mod (for as far as I can see), but I've got a problem.

 

The PDF Invoice option doesn't show up in the admin menu... I've already tried the fix when only 1 option shows (but with mine it shows none though)..., but I had no luck.

I only have the Ultimate SEO mod installed besides the standard install.

What did I forget? SQL is added and all files are uploaded as far as I can tell!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...