Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

YePix

Members
  • Posts

    434
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by YePix

  1. Hello Reiner, that's exactly what it's about. I looked at the file and this function already exists. I can not say how the additional costs can be paid with points so that the bill is at 0.00 if ( tep_not_null(MODULE_HEADER_TAGS_POINTS_REWARDS_POINTS_RESTRICTION_PATH) && !tep_not_null(MODULE_HEADER_TAGS_POINTS_REWARDS_POINTS_RESTRICTION_PID) ) { $path_points = 0; for ($i=0; $i<sizeof($order->products); $i++) { $cat_ids = explode("[,]", MODULE_HEADER_TAGS_POINTS_REWARDS_POINTS_RESTRICTION_PATH); $sub_cat_ids = explode("[_]", tep_get_product_path($order->products[$i]['id'])); for ($iii = 0; $iii < count($sub_cat_ids); $iii++) { for ($ii = 0; $ii < count($cat_ids); $ii++) { if ($sub_cat_ids[$iii] == $cat_ids[$ii]) { $path_points = ($order->products[$i]['price']*$order->products[$i]['qty'])+($order->info['shipping_cost']+$order->info['tax']); $max_points = $path_points/MODULE_HEADER_TAGS_POINTS_REWARDS_POINTS_REDEEM_POINT_VALUE; } } } } }
  2. Unfortunately does not work. could it be that the module is loaded directly from the order_total directory?
  3. in contrast, I want that the island surcharge is also paid with points
  4. Ok, thanks Reiner that makes sense, too. This module is for island surcharges. That is, should this surcharge be calculated because the customer lives in a certain place where an extra flat rate is calculated so this flat rate will not be charged with points but remains on the bill as a cash payment
  5. Hello, what can it be, if the customer has selected to pay with points but wants later to use cash. The module can no longer switch to cash. you have to log out first and log in again so that the payment method can be changed Here I still have a module for delivery surcharge but in spite of payment with points is not included and is to be paid at the end total. did temand have a tip for me? <?php /* $Id: ot_inselzuschlag.php,v 2.07 2008/02/19 19:24:11 dabri Exp $ erstellt von: dabri - Daniel Brinkmann Forum: http://forums.oscommerce.de/index.php?showtopic=18397 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class ot_inselzuschlag { var $title, $output; function ot_inselzuschlag() { $this->code = 'ot_inselzuschlag'; $this->title = MODULE_ORDER_TOTAL_INSELZUSCHLAG_TITLE; $this->description = MODULE_ORDER_TOTAL_INSELZUSCHLAG_DESCRIPTION; $this->enabled = ((MODULE_ORDER_TOTAL_INSELZUSCHLAG_STATUS == 'true') ? true : false); $this->sort_order = MODULE_ORDER_TOTAL_INSELZUSCHLAG_SORT_ORDER; $this->output = array(); } function process() { global $order, $currencies, $cart; switch (MODULE_ORDER_TOTAL_INSELZUSCHLAG_DESTINATION) { case 'national': if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break; case 'international': if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break; case 'both': $pass = true; break; default: $pass = false; break; } // Variable f?r die Postleitzahl (PLZ) $qResult = tep_db_query("select insel_plz, insel_name, insel_country, insel_fee, insel_step from " . TABLE_INSELPLZ . " WHERE '" . $order->delivery['postcode'] . "' BETWEEN insel_plz AND insel_plz_end AND insel_country = '" . $order->delivery['country_id'] . "'"); $rec = tep_db_fetch_array($qResult); // get the first row of the result $plz_id = $rec['insel_plz']; /* if ( $plz_id == '' ){ $pass = false; } */ if (( $plz_id == '' ) || ($GLOBALS['shipping']['id'] == 'pickup_pickup')) { $pass = false; } if ( $pass == true ) { // Preis fuer Gewicht ermitteln $insel_cost = preg_split("/[:,]/" , $rec['insel_fee']); if ($cart->show_weight() > $insel_cost[count ($insel_cost)-2]) { $inselfee = ($cart->show_weight()-$insel_cost[count ($insel_cost)-2])* $rec['insel_step'] +$insel_cost[count ($insel_cost)-1]; } for ($i = 0; $i < count($insel_cost); $i+=2) { if ($cart->show_weight() <= $insel_cost[$i]) { $inselfee = $insel_cost[$i+1]; break; } } $tax = tep_get_tax_rate(MODULE_ORDER_TOTAL_INSELZUSCHLAG_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']); $tax_description = tep_get_tax_description(MODULE_ORDER_TOTAL_INSELZUSCHLAG_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']); $order->info['tax'] += tep_calculate_tax($inselfee, $tax); $order->info['tax_groups']["$tax_description"] += tep_calculate_tax($inselfee, $tax); $order->info['total'] += $inselfee + tep_calculate_tax($inselfee, $tax); $this->output[] = array('title' => $this->title . ':', 'text' => $currencies->format(tep_add_tax($inselfee, $tax), true, $order->info['currency'], $order->info['currency_value']), 'value' => tep_add_tax($inselfee, $tax)); } } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_INSELZUSCHLAG_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function keys() { return array('MODULE_ORDER_TOTAL_INSELZUSCHLAG_STATUS', 'MODULE_ORDER_TOTAL_INSELZUSCHLAG_SORT_ORDER', 'MODULE_ORDER_TOTAL_INSELZUSCHLAG_DESTINATION', 'MODULE_ORDER_TOTAL_INSELZUSCHLAG_TAX_CLASS'); } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Inselzuschlag anzeigen', 'MODULE_ORDER_TOTAL_INSELZUSCHLAG_STATUS', 'true', 'Wollen Sie den Inselzuschlag anzeigen lassen?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Reihenfolge', 'MODULE_ORDER_TOTAL_INSELZUSCHLAG_SORT_ORDER', '4', 'Reihenfolge bei den Order-Total Modulen.', '6', '2', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Inselzuschlag f?r Bestellungen aus folgenden Regionen', 'MODULE_ORDER_TOTAL_INSELZUSCHLAG_DESTINATION', 'both', 'Berechnung des Inselzuschlages bei folgenden Gebieten.', '6', '6', 'tep_cfg_select_option(array(\'national\', \'international\', \'both\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Steuerklasse', 'MODULE_ORDER_TOTAL_INSELZUSCHLAG_TAX_CLASS', '0', 'Folgende Steuerklasse fuer Inselzuschlag verwenden.', '6', '7', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } } ?>
  6. Hi @burt, give me more information about the module. I already have interest.
  7. Too bad but thanks anyway is a great contrib
  8. Hello everyone is there a possibility to enter the opening times in two stages? Monday 12:00 - 14:00 / 17:00 - 23:00
  9. Hi Chris, code is from here: KLICK HERE ... Problem wit this code you can insert text into DB and the invoice show text becose for all customers. I like text for single customer. I know in this SQL must customer_id and text_id for the query and the query look for text on invioce with customer_id and text_id and show this. DROP TABLE IF EXISTS `edit_invoice`; CREATE TABLE `edit_invoice` ( `edit_invoice_id` tinyint(3) unsigned NOT NULL default '0', `language_id` tinyint(3) unsigned NOT NULL default '1', `edit_invoice_text` text, PRIMARY KEY (`edit_invoice_id`,`language_id`), KEY `status_id` (`edit_invoice_id`) ) TYPE=MyISAM; I think ist very good for you Contribution. Sorry for my english ;-o).
  10. Hi, sorry for my english :-" can you say me how i become the osCsid out from the URL ? I have install teh sidkiller 1.2 becose the create_account is without function. Customer can not create account. Thanks
  11. Hi Chris, **** can you speak german? **** my english is not so good :rolleyes: a question for text to customer in pdfinvoice. Here is the code, text for all customers in the pdfinvoice: ************************************************* SQL: DROP TABLE IF EXISTS `edit_invoice`; CREATE TABLE `edit_invoice` ( `edit_invoice_id` tinyint(3) unsigned NOT NULL default '0', `language_id` tinyint(3) unsigned NOT NULL default '1', `edit_invoice_text` text, PRIMARY KEY (`edit_invoice_id`,`language_id`), KEY `status_id` (`edit_invoice_id`) ) TYPE=MyISAM; INSERT INTO `edit_invoice` (`edit_invoice_id`, `language_id`, `edit_invoice_text`) VALUES (1, 1, 'here is text in invoice'); ************************************************** Area for text: <?php require('includes/application_top.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"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> <!-- 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 class="pageHeading" valign="top"><?php echo HEADING_TITLE_EDIT_INVOICE; ?> <?php if ($REQUEST_METHOD=="POST") { mysql_query('REPLACE INTO edit_invoice VALUES (1, "' . $languages_id . '", "' . $text_1 .'")') or die(mysql_error()); } $sql=mysql_query("SELECT * FROM edit_invoice where edit_invoice_id = '1' and language_id = '" . $languages_id . "'") or die(mysql_error()); $row=mysql_fetch_array($sql); ?> <table width="98%" align="center" border="0" cellpadding="0" cellspacing="0"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '25'); ?></td> </tr> <form name="text_1_form" method="Post" action=""> <tr> <td width="75%" valign="top"><?php echo EORDER_TEXT_1; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td width="75%" valign="top"><textarea name="text_1" cols="75" rows="5"><?php echo $row['edit_invoice_text'] ?></textarea></td> </tr> <tr> <td align="left"></td> </tr> </form> </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'); ?> ******************************************************* pdfinvoice show text: query: $text_query = tep_db_query("SELECT * FROM edit_invoice where edit_invoice_id = '1' and language_id = '" . $languages_id . "'"); $text = tep_db_fetch_array($text_query); show text: $text['edit_invoice_text'] = str_replace("<br>",'',$text['edit_invoice_text']); $pdf->MultiCell(10, 220,$text['edit_invoice_text'],0,'L'); ******************************************************** How can i make this on orders.php I need text for single customer on the pdfinvoice. This code must in orders.php when i make status update must the text inside. Thanks.
  12. Hi Chris, vielen dank :rolleyes: pdfinvoice ist working now in admin area with the customer_id. I´m so happy :thumbsup: thank you.
  13. Hi Chris, thanks for you time to help me :rolleyes: Screen Shoot invoice in customer area: Screen Shoot invoice in admin area: You can see the customer_id is not correctly in admin :'( my account_history_info.php <?php /* $Id: account_history_info.php,v 1.100 2003/06/09 23:03:52 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); 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_ACCOUNT_HISTORY_INFO); $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL')); $breadcrumb->add(sprintf(NAVBAR_TITLE_3, $HTTP_GET_VARS['order_id']), tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $HTTP_GET_VARS['order_id'], 'SSL')); require(DIR_WS_CLASSES . 'order.php'); $order = new order($HTTP_GET_VARS['order_id']); ?> <!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> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr><!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><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_image(DIR_WS_IMAGES . 'table_background_history.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main" colspan="2"><b><?php echo sprintf(HEADING_ORDER_NUMBER, $HTTP_GET_VARS['order_id']) . ' <small>(' . $order->info['orders_status'] . ')</small>'; ?></b></td> </tr> <tr> <td class="smallText"><?php echo HEADING_ORDER_DATE . ' ' . tep_date_long($order->info['date_purchased']); ?></td> <td class="smallText" align="right"><?php echo HEADING_ORDER_TOTAL . ' ' . $order->info['total']; ?></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <?php if ($order->delivery != false) { ?> <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo HEADING_DELIVERY_ADDRESS; ?></b></td> </tr> <tr> <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></td> </tr> <?php if (tep_not_null($order->info['shipping_method'])) { ?> <tr> <td class="main"><b><?php echo HEADING_SHIPPING_METHOD; ?></b></td> </tr> <tr> <td class="main"><?php echo $order->info['shipping_method']; ?></td> </tr> <?php } ?> </table></td> <?php } ?> <td width="<?php echo (($order->delivery != false) ? '70%' : '100%'); ?>" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php if (sizeof($order->info['tax_groups']) > 1) { ?> <tr> <td class="main" colspan="2"><b><?php echo HEADING_PRODUCTS; ?></b></td> <td class="smallText" align="right"><b><?php echo HEADING_TAX; ?></b></td> <td class="smallText" align="right"><b><?php echo HEADING_TOTAL; ?></b></td> </tr> <?php } else { ?> <tr> <td class="main" colspan="3"><b><?php echo HEADING_PRODUCTS; ?></b></td> </tr> <?php } for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { echo ' <tr>' . "\n" . ' <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" . ' <td class="main" valign="top">' . $order->products[$i]['name']; if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) { for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>'; } } echo '</td>' . "\n"; if (sizeof($order->info['tax_groups']) > 1) { echo ' <td class="main" valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n"; } echo ' <td class="main" align="right" valign="top">' . $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']) . '</td>' . "\n" . ' </tr>' . "\n"; } ?> </table></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"><b><?php echo HEADING_BILLING_INFORMATION; ?></b></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo HEADING_BILLING_ADDRESS; ?></b></td> </tr> <tr> <td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br>'); ?></td> </tr> <tr> <td class="main"><b><?php echo HEADING_PAYMENT_METHOD; ?></b></td> </tr> <tr> <td class="main"><?php echo $order->info['payment_method']; ?></td> </tr> </table></td> <td width="70%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) { echo ' <tr>' . "\n" . ' <td class="main" align="right" width="100%">' . $order->totals[$i]['title'] . '</td>' . "\n" . ' <td class="main" align="right">' . $order->totals[$i]['text'] . '</td>' . "\n" . ' </tr>' . "\n"; } ?> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"><b><?php echo HEADING_ORDER_HISTORY; ?></b></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php $statuses_query = tep_db_query("select os.orders_status_name, osh.date_added, osh.comments from " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "' and osh.orders_status_id = os.orders_status_id and os.language_id = '" . (int)$languages_id . "' order by osh.date_added"); while ($statuses = tep_db_fetch_array($statuses_query)) { echo ' <tr>' . "\n" . ' <td class="main" valign="top" width="70">' . tep_date_short($statuses['date_added']) . '</td>' . "\n" . ' <td class="main" valign="top" width="70">' . $statuses['orders_status_name'] . '</td>' . "\n" . ' <td class="main" valign="top">' . (empty($statuses['comments']) ? ' ' : nl2br(tep_output_string_protected($statuses['comments']))) . '</td>' . "\n" . ' </tr>' . "\n"; } ?> </table></td> </tr> </table></td> </tr> <!-- start pdf //--> <?php // only display pdf invoice link if * latest * order status is 3 (delivered) $delivered_query = tep_db_query("select max(osh.date_added) as los, osh.orders_status_id from " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "' group by osh.orders_status_id order by los desc limit 1"); $delivered_status = tep_db_fetch_array($delivered_query); if ($delivered_status['orders_status_id'] == 3 || DISPLAY_PDF_DELIVERED_ONLY == 'false' ){ ?> <tr> <td class="main"><b><?php echo PDF_INVOICE; ?></b></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'pdf.gif', 'PDF invoice','','','style="vertical-align:middle"') . sprintf(PDF_DOWNLOAD_LINK, tep_href_link(FILENAME_CUSTOMER_PDF, 'order_id=' . $HTTP_GET_VARS['order_id'] , 'SSL')); ?></td> </tr> </table> </td> </tr> <?php } ?> <!-- end pdf //--> <?php if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php'); ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, tep_get_all_get_params(array('order_id')), 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> </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'); ?>
  14. 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 ?
×
×
  • Create New...