function olc_address_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = NEW_LINE)
{
    $address_query = olc_db_query("\n\t\tselect\n\t\tentry_firstname as firstname,\n\t\tentry_lastname as lastname,\n\t\tentry_company as company,\n\t\tentry_street_address as street_address,\n\t\tentry_suburb as suburb,\n\t\tentry_city as city,\n\t\tentry_postcode as postcode,\n\t\tentry_state as state,\n\t\tentry_zone_id as zone_id,\n\t\tentry_country_id as country_id\n\t\tfrom " . TABLE_ADDRESS_BOOK . "\n\t\twhere customers_id = '" . $customers_id . "' and address_book_id = '" . $address_id . APOS);
    $address = olc_db_fetch_array($address_query);
    $format_id = olc_get_address_format_id($address['country_id']);
    return olc_address_format($format_id, $address, $html, $boln, $eoln);
}
function sendemail($emailtext, $email)
{
    $usersql = SELECT_ALL . TABLE_CUSTOMERS . SQL_WHERE . "customers_email_address ='" . $email . APOS;
    $myuser = olc_db_query($usersql);
    $myuser_values = olc_db_fetch_array($myuser);
    $stack = explode(COLON, $myuser_values['customers_password']);
    $link0 = HTTP_CATALOG_SERVER . DIR_WS_CATALOG;
    $link = $link0 . FILENAME_CUSTOMER_DEFAULT;
    $smarty->assign('HOME_LINK', $link);
    $link = $link0 . FILENAME_LOGIN . "?action=auction&email_address=" . $email . "&password="******"stylesheet.css";
    $debug_output = "file: " . $file . HTML_BR;
    if (file_exists($file)) {
        $style = file_get_contents($file);
        $poss = strpos($style, "body");
        if (!($poss === false)) {
            $pose = strpos($style, "}", $poss);
            if (!($pose === false)) {
                $style_body = substr($style, 0, $pose + 1);
                $s = "\t\t\t";
                $style_body = str_replace("../../", HTTP_SERVER . DIR_WS_CATALOG, $style_body);
                $style_body = $s . str_replace(NEW_LINE, NEW_LINE . $s, $style_body);
                $smarty->assign('STYLE', $style_body);
            }
        }
    }
    $template = ADMIN_PATH_PREFIX . 'order_mail_ebay';
    $html_mail = $smarty->fetch($template . HTML_EXT);
    $firstname = $myuser_values['customers_firstname'];
    $lastname = $myuser_values['customers_lastname'];
    // create subject
    $order_subject = str_replace('{$nr}', $insert_id, EMAIL_BILLING_SUBJECT_ORDER);
    $order_subject = str_replace('{$date}', strftime(DATE_FORMAT_LONG), $order_subject);
    $order_subject = str_replace('{$firstname}', $firstname, $order_subject);
    $order_subject = str_replace('{$lastname}', $lastname, $order_subject);
    $eMail = $order->customer['email_address'];
    $name = trim($firstname . BLANK . $lastname);
    // send mail to admin
    olc_php_mail($email, $name, EMAIL_BILLING_FORWARDING_STRING, STORE_NAME, EMPTY_STRING, EMPTY_STRING, EMPTY_STRING, EMPTY_STRING, EMPTY_STRING, AUCTIONS_TEXT_AUCTION_SOLD_EMAIL_SUBJECT, $html_mail, EMPTY_STRING, EMAIL_TYPE_HTML);
    // send mail to customer
    olc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $email, $name, EMPTY_STRING, EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, EMPTY_STRING, EMPTY_STRING, AUCTIONS_TEXT_AUCTION_SOLD_EMAIL_SUBJECT, $html_mail, EMPTY_STRING, EMAIL_TYPE_HTML);
    /*
    $emailcontent = "Guten Tag ".trim($myuser_values['customers_firstname'].BLANK.$myuser_values['customers_lastname'])."!\n\n";
    $emailcontent .= "Sie haben folgende Artikel bei unserer Ebay-Auktion ersteigert:\n";
    $emailcontent .= $emailtext."\n\n";
    $emailcontent .= "Die Artikel warten bereits im Warenkorb unseres Onlineshops auf Sie.\n";
    $emailcontent .= "Über diesen Link ".$link." kommen sie direkt zu den ersteigerten Artikeln.\n\n";
    $emailcontent .= "Dankesfloskel\n";
    $emailcontent .= "Mit freundlichen Grüßen\n";
    $emailcontent .= STORE_NAME.NEW_LINE.STORE_OWNER;
    olc_mail($myuser_values['customers_firstname'].BLANK.$myuser_values['customers_lastname'],$email,
    "Ebay Auktion - Abwicklung", $emailcontent, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
    */
}
                }
                $address_content .= '
                	<tr' . $id . ' class="moduleRow' . $selected . '" onmouseover="rowOverEffect(this)"
                		onmouseout="rowOutEffect(this)" onclick="javascript:selectRowEffect(this, ' . $radio_buttons . ')">
			                <td width="10">&nbsp;</td>
		                  <td class="main">' . olc_draw_radio_field('address', $address_book_id, $address_book_id == $checkout_id) . '
		                  	<b>' . trim($addresses['firstname'] . BLANK . $addresses['lastname']) . '</b>
											</td>
										</tr>
										<tr>
											<td width="10">&nbsp;</td>
											<td>
												<table border="0" cellspacing="0" cellpadding="2">
													<tr>
														<td width="10">&nbsp;</td>
														<td class="main">' . olc_address_format($format_id, $addresses, true, BLANK, ', ') . '</td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>';
                $radio_buttons++;
            }
            $address_content .= '
						</table>';
            $smarty->assign('BLOCK_ADDRESS', $address_content);
        }
    }
    /*
        <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td colspan="2"><?php 
    echo olc_draw_separator();
    ?>
</td>
          </tr>
          <tr>
            <td valign="top"><table border="0" cellspacing="0" cellpadding="2">
              <tr>
                <td class="main" valign="top"><b><?php 
    echo TEXT_AFFILIATE;
    ?>
</b></td>
                <td class="main"><?php 
    echo olc_address_format($payments['affiliate_address_format_id'], $affiliate_address, 1, HTML_NBSP, HTML_BR);
    ?>
</td>
              </tr>
              <tr>
                <td colspan="2"><?php 
    echo olc_draw_separator('pixel_trans.gif', '1', '5');
    ?>
</td>
              </tr>
              <tr>
                <td colspan="2"><?php 
    echo olc_draw_separator('pixel_trans.gif', '1', '5');
    ?>
</td>
              </tr>
 $order = new order($_GET['oID']);
 if (INCLUDE_PDF_INVOICE) {
     $print_packing_slip = true;
     $is_admin_function = $_GET['admin'];
     include ADMIN_PATH_PREFIX . FILENAME_ORDERS_INVOICE_PDF;
 } else {
     // include needed functions
     require_once DIR_FS_INC . 'olc_get_products_price.inc.php';
     require_once DIR_FS_INC . 'olc_get_order_data.inc.php';
     require_once DIR_FS_INC . 'olc_get_attributes_model.inc.php';
     require_once DIR_FS_INC . 'olc_not_null.inc.php';
     require_once DIR_FS_INC . 'olc_format_price_order.inc.php';
     $format_id = 'format_id';
     $smarty->assign('address_label_customer', olc_address_format($order->customer[$format_id], $order->customer, 1, EMPTY_STRING, HTML_BR));
     $smarty->assign('address_label_shipping', olc_address_format($order->delivery[$format_id], $order->delivery, 1, EMPTY_STRING, HTML_BR));
     $smarty->assign('address_label_payment', olc_address_format($order->billing[$format_id], $order->billing, 1, EMPTY_STRING, HTML_BR));
     $smarty->assign('csID', $order->customer['csID']);
     // get products data
     $order_query = olc_db_query("SELECT\n        \t\t\t\tproducts_id,\n        \t\t\t\torders_products_id,\n        \t\t\t\tproducts_model,\n        \t\t\t\tproducts_name,\n        \t\t\t\tfinal_price,\n        \t\t\t\tproducts_quantity\n        \t\t\t\tFROM " . TABLE_ORDERS_PRODUCTS . "\n        \t\t\t\tWHERE orders_id='" . $oID . APOS);
     $order_data = array();
     while ($order_data_values = olc_db_fetch_array($order_query)) {
         $attributes_query = olc_db_query("SELECT\n        \t\t\t\tproducts_options,\n        \t\t\t\tproducts_options_values,\n        \t\t\t\tprice_prefix,\n        \t\t\t\toptions_values_price\n        \t\t\t\tFROM " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . "\n        \t\t\t\tWHERE orders_products_id='" . $order_data_values['orders_products_id'] . APOS);
         $attributes_data = EMPTY_STRING;
         $attributes_model = EMPTY_STRING;
         while ($attributes_data_values = olc_db_fetch_array($attributes_query)) {
             $attributes_data .= HTML_BR . $attributes_data_values['products_options'] . ': ' . $attributes_data_values['products_options_values'];
             $attributes_model .= HTML_BR . olc_get_attributes_model($order_data_values['products_id'], $attributes_data_values['products_options_values']);
         }
         $order_data[] = array('PRODUCTS_MODEL' => $order_data_values['products_model'], 'PRODUCTS_NAME' => $order_data_values['products_name'], 'PRODUCTS_ATTRIBUTES' => $attributes_data, 'PRODUCTS_ATTRIBUTES_MODEL' => $attributes_model, 'PRODUCTS_PRICE' => olc_format_price_order($order_data_values['final_price'], 1, $order->info['currency']), 'PRODUCTS_QTY' => $order_data_values['products_quantity']);
     }
     // get order_total data
    }
}
require DIR_WS_INCLUDES . 'header.php';
//
// Kunden-IP-Adresse
//
olc_get_ip_info($smarty);
//
// Kunden-IP-Adresse
//
$smarty->assign('DELIVERY_LABEL', olc_address_format($order->delivery['format_id'], $order->delivery, 1, BLANK, HTML_BR));
$smarty->assign('PRODUCTS_EDIT', olc_href_link(FILENAME_SHOPPING_CART, EMPTY_STRING, SSL));
//---PayPal WPP Modification START ---//
$use_ec_checkout = $ec_checkout && $ec_enabled;
if (!$credit_covers) {
    $smarty->assign('BILLING_LABEL', olc_address_format($order->billing['format_id'], $order->billing, 1, BLANK, HTML_BR));
    if ($use_ec_checkout) {
        $link_billing = $ec_checkout ? MODULE_PAYMENT_PAYPAL_EC_TEXT_TITLE : MODULE_PAYMENT_PAYPAL_DP_TEXT_TITLE;
    } else {
        $link_billing = olc_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, EMPTY_STRING, SSL);
    }
}
if ($use_ec_checkout) {
    $link_shipping = olc_href_link(FILENAME_EC_PROCESS, 'clearSess=1', SSL);
} else {
    $link_shipping = olc_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, EMPTY_STRING, SSL);
}
$smarty->assign('SHIPPING_ADDRESS_EDIT', $link_shipping);
$smarty->assign('BILLING_ADDRESS_EDIT', $link_billing);
//	---PayPal WPP Modification END ---//--
if (isset($_SESSION['sendto'])) {
 function Header()
 {
     global $oID, $order, $address_left, $address_top, $sender, $format_id_text, $have_customers_order_reference;
     global $Y_Fields_Name_position, $Y_Table_Position, $invoice_start_top, $info, $invoice_items_per_page;
     global $print_billing_address, $print_delivery_address, $invoice_items_per_page0, $invoice_items_per_page_next;
     global $use_line_break;
     $this->SetFont($this->font, NORMAL, 8);
     if (!$this->impressum) {
         $this->impressum = array();
         $store = nl2br(STORE_NAME_ADDRESS);
         $store = explode(HTML_BR, $store);
         $lines = sizeof($store) - 1;
         for ($i = 0; $i <= $lines; $i++) {
             $s = trim($store[$i]);
             if ($i == $lines) {
                 $this->impressum[] = EMPTY_STRING;
                 $l_s = strtolower($s);
                 if (strpos($l_s, strtolower(TEXT_FON)) === false) {
                     if (strpos($l_s, 'tel') === false) {
                         $s = TEXT_FON . DOT . COLON_BLANK . $s;
                     }
                 }
             }
             $this->store_impressum_string($s);
         }
         $this->store_impressum_string('eMail' . COLON_BLANK . STORE_OWNER_EMAIL_ADDRESS);
         $s = HTTP_SERVER;
         if (strpos($s, 'localhost') > 0) {
             $store = explode('@', STORE_OWNER_EMAIL_ADDRESS);
             $s = "http://www." . $store[1];
         }
         $this->store_impressum_string('Web' . COLON_BLANK . $s);
         $this->impressum_lines = sizeof($this->impressum);
         $this->impressum_left = ceil($this->w - $this->rMargin - $this->max_impressum_line_length);
     }
     $this->{$page}++;
     $is_firstpage = $this->page == 1;
     $top = $this->lMargin;
     //4
     $left = $this->impressum_left;
     $link = olc_href_link('index.php', $this->language_parameter, NONSSL, false, true, false, true);
     $image = CURRENT_TEMPLATE_IMG . 'invoice_logo.jpg';
     if (file_exists($image)) {
         $top = $this->tMargin;
         $this->Image($image, $this->lMargin, $top, EMPTY_STRING, EMPTY_STRING, EMPTY_STRING, $link);
     }
     for ($i = 0; $i < $this->impressum_lines; $i++) {
         $this->Text($left, $top, $this->impressum[$i]);
         $top += $this->lines_height;
     }
     $w = ($this->w - $this->lMargin - $this->lMargin) / 2;
     if ($is_firstpage) {
         //Sender info
         $this->SetFont($this->font, BOLD_UNDERLINE, 6);
         $this->SetY($address_top);
         $this->SetX($address_left);
         $this->Cell($w, 0, $sender, 0, LEFT);
         switch ($this->document) {
             case $this->document_order:
                 //Customer address
                 $address = $order->customer;
                 break;
             case $this->document_invoice:
                 //Delivery address
                 $address = $order->billing;
                 break;
             case $this->document_packingslip:
                 //Delivery address
                 $address = $order->delivery;
                 break;
         }
         $this->SetFont($this->font, NORMAL, 10);
         $this->SetY($address_top + $this->lines_height);
         $this->SetX($address_left);
         $this->MultiCell($w, $this->lines_height, olc_address_format($address[$format_id_text], $address, EMPTY_STRING, EMPTY_STRING, TILDE), 0, LEFT);
     }
     //Draw invoice type text text
     $this->SetFont($this->font, BOLD, 16);
     $this->SetY($invoice_start_top - 3);
     $x = $this->lMargin;
     $this->SetX($x - $this->cMargin);
     $this->MultiCell($w, $this->lines_height, $this->doc_type, 0, LEFT);
     $this->SetFont($this->font, NORMAL, 10);
     //Draw Order Number, Customer Number Date & Payment method
     $top = $invoice_start_top - $this->lines_height * 4;
     $info_items = sizeof($info) - 1;
     if ($have_customers_order_reference) {
         $cori = $info_items;
     } else {
         $cori = -1;
     }
     for ($i = 0; $i <= $info_items; $i++) {
         $set_bold = $i == 0 || $i == $cori;
         if ($set_bold) {
             $this->SetFont($this->font, BOLD, 10);
         }
         $max_info_len = max($max_info_len, $this->GetStringWidth($info[$i]));
         if ($set_bold) {
             $this->SetFont($this->font, NORMAL, 10);
         }
     }
     $top = $invoice_start_top - $this->lines_height * 4;
     $left = $this->w - $this->rMargin - $this->GetStringWidth(DATE);
     $this->Text($left, $top, DATE);
     $left = $this->w - $this->rMargin - $max_info_len;
     $top = $invoice_start_top;
     for ($i = 0; $i <= $info_items; $i++) {
         $set_bold = $i == 0 || $i == $cori;
         if ($set_bold) {
             $this->SetFont($this->font, BOLD, 10);
         }
         $this->Text($left, $top, $info[$i]);
         $top += $this->lines_height;
         if ($set_bold) {
             $this->SetFont($this->font, NORMAL, 10);
         }
     }
     //Invoice fields Name position
     $Y_Fields_Name_position = $top;
     //	+$this->lines_height;	//$invoice_start_top;
     if ($is_firstpage) {
         $standard_address_lines = 7;
         if ($print_billing_address || $print_delivery_address) {
             $print_it = array();
             $print_header = array();
             $print_address = array();
             switch ($this->document) {
                 case $this->document_order:
                     if ($print_billing_address) {
                         $print_it[0] = true;
                         $print_header[0] = PRINT_INVOICE_BILL_TO;
                         $print_address[0] = $order->billing;
                     }
                     if ($print_delivery_address) {
                         $print_it[1] = true;
                         $print_header[1] = PRINT_INVOICE_SHIP_TO;
                         $print_address[1] = $order->delivery;
                     }
                     break;
                 case $this->document_invoice:
                     if ($print_billing_address) {
                         $print_it[0] = true;
                         $print_header[0] = PRINT_INVOICE_SHIP_TO;
                         $print_address[0] = $order->delivery;
                     }
                     if ($print_delivery_address) {
                         $print_it[1] = true;
                         $print_header[1] = PRINT_INVOICE_SOLD_TO;
                         $print_address[1] = $order->customer;
                     }
                     break;
                 case $this->document_packingslip:
                     if ($print_billing_address) {
                         $print_it[0] = true;
                         $print_header[0] = PRINT_INVOICE_BILL_TO;
                         $print_address[0] = $order->billing;
                     }
                     if ($print_delivery_address) {
                         $print_it[1] = true;
                         $print_header[1] = PRINT_INVOICE_SOLD_TO;
                         $print_address[1] = $order->customer;
                     }
                     break;
             }
             $x = $this->lMargin;
             $Y_Fields_Name_position += $this->lines_height;
             for ($i = 0; $i < 2; $i++) {
                 $y = $Y_Fields_Name_position;
                 if ($print_it[$i]) {
                     $address = olc_address_format($print_address[$i][$format_id_text], $print_address[$i], EMPTY_STRING, EMPTY_STRING, TILDE);
                     $current_print_header = $print_header[$i];
                     $address_line = explode(TILDE, $address);
                     $lines = sizeof($address_line) - 1;
                     $max_address_lines = max($max_address_lines, $lines);
                     if ($i) {
                         if ($printed) {
                             if ($right_justify_3rd_address) {
                                 $this->SetFont($this->font, NORMAL, 10);
                                 $address_line = explode(TILDE, $address);
                                 $lines = sizeof($address_line) - 1;
                                 $max_address_lines = max($max_address_lines, $lines);
                                 for ($j = 0; $j <= $lines; $j++) {
                                     $s = $address_line[$j];
                                     $l_w = max($l_w, $this->GetStringWidth($s));
                                 }
                             }
                             $this->SetFont($this->font, BOLD, 10);
                             $l_w = max($l_w, $this->GetStringWidth($current_print_header));
                             $x = $this->w - $this->rMargin - $l_w;
                         }
                         $this->SetY($y);
                         $this->SetX($x);
                         $this->SetFont($this->font, BOLD, 10);
                         $this->Cell($w, 0, $current_print_header);
                         $this->SetFont($this->font, NORMAL, 10);
                         $y += $this->lines_height / 2;
                         $this->SetY($y);
                         $this->SetX($x);
                         $this->MultiCell($w, $this->lines_height, $address, 0, LEFT);
                         $max_y = max($max_y, $this->GetY());
                         $x += $w;
                         $printed = true;
                     }
                 }
             }
             $print_billing_address = false;
             $print_delivery_address = false;
             $Y_Fields_Name_position = $max_y + $this->lines_height * 2;
         } else {
             $max_address_lines = 0;
         }
         $invoice_items_per_page += $standard_address_lines - $max_address_lines;
         //Next page can hold more items, as the delivery/billing/order-addresses will not be repeated!
         $invoice_items_per_page_next = $invoice_items_per_page0 + $standard_address_lines;
         $invoice_items_per_page0 = $invoice_items_per_page;
     } else {
         $Y_Fields_Name_position += $this->lines_height;
     }
     $Y_Table_Position = $Y_Fields_Name_position + $this->lines_height;
     output_invoice_header();
     if ($use_line_break) {
         $Y_Table_Position += $this->lines_height;
     }
     //Table position, under Fields Name
 }
if (!isset($_SESSION['customer_id'])) {
    olc_redirect(olc_href_link(FILENAME_LOGIN, EMPTY_STRING, SSL));
}
$breadcrumb->add(NAVBAR_TITLE_1_ADDRESS_BOOK, olc_href_link(FILENAME_ACCOUNT, EMPTY_STRING, SSL));
$breadcrumb->add(NAVBAR_TITLE_2_ADDRESS_BOOK, olc_href_link(FILENAME_ADDRESS_BOOK, EMPTY_STRING, SSL));
require DIR_WS_INCLUDES . 'header.php';
if (is_object($messageStack)) {
    if ($messageStack->size('addressbook') > 0) {
        $smarty->assign('error', $messageStack->output('addressbook'));
    }
}
$smarty->assign('ADDRESS_DEFAULT', olc_address_label($_SESSION['customer_id'], $_SESSION['customer_default_address_id'], true, BLANK, HTML_BR));
$addresses_data = array();
$addresses_query = olc_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $_SESSION['customer_id'] . "' order by firstname, lastname");
$customer_default_address_id = $_SESSION['customer_default_address_id'];
while ($addresses = olc_db_fetch_array($addresses_query)) {
    $format_id = olc_get_address_format_id($addresses['country_id']);
    $address_book_id = $addresses['address_book_id'];
    $primary = $address_book_id == $customer_default_address_id;
    $addresses_data[] = array('NAME' => trim($addresses['firstname'] . BLANK . $addresses['lastname']), 'BUTTON_EDIT' => HTML_A_START . olc_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $address_book_id, SSL) . '">' . olc_image_button('small_edit.gif', SMALL_IMAGE_BUTTON_EDIT) . HTML_A_END, 'BUTTON_DELETE' => HTML_A_START . olc_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $address_book_id, SSL) . '">' . olc_image_button('small_delete.gif', SMALL_IMAGE_BUTTON_DELETE) . HTML_A_END, 'ADDRESS' => olc_address_format($format_id, $addresses, true, BLANK, HTML_BR), 'PRIMARY' => $primary);
}
$smarty->assign('addresses_data', $addresses_data);
$smarty->assign('BUTTON_BACK', HTML_A_START . olc_href_link(FILENAME_ACCOUNT, EMPTY_STRING, SSL) . '">' . olc_image_button('button_back.gif', IMAGE_BUTTON_BACK) . HTML_A_END);
if (olc_count_customer_address_book_entries() < MAX_ADDRESS_BOOK_ENTRIES) {
    $smarty->assign('BUTTON_NEW', HTML_A_START . olc_href_link(FILENAME_ADDRESS_BOOK_PROCESS, EMPTY_STRING, SSL) . '">' . olc_image_button('button_add_address.gif', IMAGE_BUTTON_ADD_ADDRESS) . HTML_A_END);
}
$smarty->assign('ADDRESS_COUNT', sprintf(TEXT_MAXIMUM_ENTRIES, MAX_ADDRESS_BOOK_ENTRIES));
$main_content = $smarty->fetch(CURRENT_TEMPLATE_MODULE . 'address_book' . HTML_EXT, SMARTY_CACHE_ID);
$smarty->assign(MAIN_CONTENT, $main_content);
require BOXES;
$smarty->display(INDEX_HTML);
Ejemplo n.º 9
0
    ?>
</b></td>
                <td class="main"><?php 
    echo olc_address_format($order->delivery['format_id'], $order->delivery, 1, EMPTY_STRING, HTML_BR);
    ?>
</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 olc_address_format($order->billing['format_id'], $order->billing, 1, EMPTY_STRING, HTML_BR);
    ?>
</td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td>
        	<table border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td class="main"><b><?php 
    echo IP;
    ?>
</b></td>
    $title_id = '@';
    if (INCLUDE_PDF_INVOICE) {
        $url0 = str_replace(strtolower(HTTPS), strtolower(HTTP), $url0);
        $smarty->assign('PDF_FORMAT', PDF_FORMAT);
    }
    $image0 = '<img src="' . CURRENT_TEMPLATE_BUTTONS . 'button_print.gif" style="cursor:hand" onclick=javascript:ShowInfo("#",\'\') title="' . $title_id . '">';
    include_once DIR_FS_INC . 'olc_get_smarty_config_variable.inc.php';
    create_document_print_button('order');
    if ($order->billing['billing_invoice_number']) {
        create_document_print_button('invoice');
    }
    if ($order->delivery) {
        if ($order->delivery['delivery_packingslip_number']) {
            create_document_print_button('packingslip');
        }
        $smarty->assign('DELIVERY_LABEL', olc_address_format($order->delivery[$format_id_text], $order->delivery, 1, BLANK, HTML_BR));
        $shipping_method = $order->info['shipping_method'];
        if ($shipping_method) {
            $smarty->assign('SHIPPING_METHOD', $shipping_method);
        }
    }
    $data_products = '				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td>&nbsp;</td>
						<td class="main" align="center" valign="top"><b>' . TEXT_PRICE_SINGLE . '</b></td>
						<td class="main" align="center" valign="top"><b>' . TEXT_PRICE_TOTAL . '</b></td>
					</tr>
';
    for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
        $order_products = $order->products[$i];
        $products_qty = $order_products['qty'];
 function Header()
 {
     global $oID, $order, $address_left, $address_top, $sender, $format_id_text, $invoice_start_left;
     global $Y_Fields_Name_position, $Y_Table_Position;
     if (!$this->page) {
         $this->impressum = array();
         //$image_width=$this->info['w']/$this->k;
         //$image_height=$this->info['h']/$this->k;
         $store = nl2br(STORE_NAME_ADDRESS);
         $store = explode(HTML_BR, $store);
         $lines = sizeof($store) - 1;
         for ($i = 0; $i <= $lines; $i++) {
             $s = trim($store[$i]);
             if ($i == $lines) {
                 $this->impressum[] = EMPTY_STRING;
                 $l_s = strtolower($s);
                 if (strpos($l_s, strtolower(TEXT_FON)) === false) {
                     if (strpos($l_s, 'tel') === false) {
                         $s = TEXT_FON . '.: ' . $s;
                     }
                 }
             }
             $this->store_impressum_string($s);
         }
         $this->store_impressum_string('eMail: ' . STORE_OWNER_EMAIL_ADDRESS);
         $s = HTTP_SERVER;
         if (strpos($s, 'localhost') > 0) {
             $store = explode('@', STORE_OWNER_EMAIL_ADDRESS);
             $s = "http://www." . $store[1];
         }
         $this->store_impressum_string('Web: ' . $s);
         $this->impressum_lines = sizeof($this->impressum);
         $this->impressum_left = ceil($this->w - $this->rMargin - $this->max_impressum_line_length);
     }
     $this->{$page}++;
     $this->SetFont($this->font, NO_FORMAT, 8);
     $top = $this->lMargin;
     //4
     $left = $this->wc[0];
     $link = olc_href_link('index.php', $this->language_parameter, NONSSL, false, true, false, true);
     $image = CURRENT_TEMPLATE_IMG . 'invoice_logo.jpg';
     $top = $this->tMargin;
     $this->Image($image, $this->lMargin, $top, EMPTY_STRING, EMPTY_STRING, EMPTY_STRING, $link);
     for ($i = 0; $i < $this->impressum_lines; $i++) {
         $this->Text($left, $top, $this->impressum[$i]);
         $top += $this->lines_height;
     }
     if ($this->page == 1) {
         //Sender info
         $this->SetFont($this->font, BOLD_UNDERLINE, 8);
         $this->SetX($address_left);
         $this->SetY($address_top);
         $this->MultiCell(85, $this->lines_height, $sender, 0, LEFT);
         if ($this->print_invoice) {
             //Billing address
             $format_id = $order->billing[$format_id_text];
             $address = $order->billing;
         } else {
             //Billing address
             $format_id = $order->delivery[$format_id_text];
             $address = $order->delivery;
         }
         $this->SetFont($this->font, NO_FORMAT, 10);
         $this->SetX($address_left);
         $this->SetY($address_top);
         $this->MultiCell(85, 45, olc_address_format($format_id, $address, EMPTY_STRING, EMPTY_STRING, NEW_LINE), 0, LEFT);
     }
     //Draw invoice type text text
     $this->SetFont($this->font, BOLD_UNDERLINE, 16);
     $this->SetX($address_left);
     $this->SetY($invoice_start_left);
     $this->MultiCell(85, $this->lines_height, $this->doc_type, 0, LEFT);
     $this->SetFont($this->font, NO_FORMAT, 10);
     if ($this->page > 1) {
         $page_text = str_replace(HASH, $this->PageNo(), PRINT_INVOICE_PAGE);
         $this->Text($left, $address_left, $this->GetY() + $this->lines_height);
     }
     //Draw Order Number, Customer Number Date & Payment method
     $info = array();
     $info[] = PRINT_INVOICE_ORDERNR . olc_db_input($oID);
     $info[] = PRINT_INVOICE_CUSTOMERNR . $order->customers['customers_cid'];
     $info[] = PRINT_INVOICE_DATE . olc_date_short($order->info['date_purchased']);
     $info[] = PRINT_INVOICE_PAYMENT_METHOD . $order->info['payment_method'];
     for ($i = 0; $i < sizeof($info); $i++) {
         $max_info_len = max($max_info_len, $this->GetStringWidth($info[$i]));
     }
     $left = $this->w - $this->lMargin - $max_info_len;
     $top = $invoice_start_top;
     for ($i = 0; $i < sizeof($info); $i++) {
         $this->Text($left, $top, $info[$i]);
         $top += $this->lines_height;
     }
     //Invoice fields Name position
     $Y_Fields_Name_position = $top;
     //Table position, under Fields Name
     $Y_Table_Position = $Y_Fields_Name_position + $this->lines_height;
     output_invoice_header($Y_Fields_Name_position);
 }