function xtc_address_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = "\n")
{
    $address_query = xtc_db_query("select 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 = '" . xtc_db_input((int) $customers_id) . "' and address_book_id = '" . xtc_db_input((int) $address_id) . "'");
    $address = xtc_db_fetch_array($address_query);
    $format_id = xtc_get_address_format_id($address['country_id']);
    return xtc_address_format($format_id, $address, $html, $boln, $eoln);
}
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_CUSTOMER . '</b>');
     $contents = array('form' => xtc_draw_form('customers', FILENAME_CUSTOMERS, xtc_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=deleteconfirm'));
     $contents[] = array('text' => TEXT_DELETE_INTRO . '<br /><br /><b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
     if ($cInfo->number_of_reviews > 0) {
         $contents[] = array('text' => '<br />' . xtc_draw_checkbox_field('delete_reviews', 'on', true) . ' ' . sprintf(TEXT_DELETE_REVIEWS, $cInfo->number_of_reviews));
     }
     $contents[] = array('align' => 'center', 'text' => '<br /><input type="submit" class="btn btn-default" value="' . BUTTON_DELETE . '"><a class="btn btn-default" href="' . xtc_href_link(FILENAME_CUSTOMERS, xtc_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id) . '">' . BUTTON_CANCEL . '</a>');
     break;
 case 'address_book':
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ADRESS_BOOK . '</b>');
     $contents = array();
     require_once DIR_FS_INC . 'xtc_get_address_format_id.inc.php';
     require_once DIR_FS_INC . 'xtc_count_customer_address_book_entries.inc.php';
     $addresses_query = xtc_db_query("-- admin/customers.php\n                                                     select address_book_id,\n                                                            entry_firstname as firstname,\n                                                            entry_lastname as lastname,\n                                                            entry_company as company,\n                                                            entry_street_address as street_address,\n                                                            entry_suburb as suburb,\n                                                            entry_city as city,\n                                                            entry_postcode as postcode,\n                                                            entry_state as state,\n                                                            entry_zone_id as zone_id,\n                                                            entry_country_id as country_id\n                                                       FROM " . TABLE_ADDRESS_BOOK . "\n                                                      WHERE customers_id = '" . (int) $cInfo->customers_id . "'\n                                                   ORDER BY address_book_id\n                                                   ");
     while ($addresses = xtc_db_fetch_array($addresses_query)) {
         $format_id = xtc_get_address_format_id($addresses['country_id']);
         if (isset($_GET['delete']) && $_GET['delete'] != '') {
             if ($addresses['address_book_id'] == $_GET['delete']) {
                 if ($_GET['delete'] != $cInfo->customers_default_address_id) {
                     $contents[] = array('text' => '<br/>');
                     $contents[] = array('align' => 'left', 'text' => TEXT_INFO_DELETE);
                     $contents[] = array('text' => '<br/>');
                     $contents[] = array('text' => '<table style="font-size:11px; margin-left:20px;"><tr><td>' . xtc_address_format($format_id, $addresses, true, ' ', '<br />') . '</td></tr></table>');
                     $contents[] = array('text' => '<br/>');
                     $contents[] = array('align' => 'left', 'text' => '<a class="btn btn-default" href="' . xtc_href_link(FILENAME_CUSTOMERS, xtc_get_all_get_params(array('cID', 'delete')) . 'cID=' . $cInfo->customers_id) . '">' . BUTTON_CANCEL . '</a>&nbsp;<a class="btn btn-default" onclick="this.blur();" href="' . xtc_href_link(FILENAME_CUSTOMERS, xtc_get_all_get_params(array('cID', 'action', 'delete')) . 'cID=' . $cInfo->customers_id . '&action=delete_confirm_adressbook&address_book_id=' . $addresses['address_book_id']) . '">' . BUTTON_DELETE . '</a>');
                     $contents[] = array('text' => '<br/>');
                 } else {
                     $contents[] = array('text' => '<br/>');
                     $contents[] = array('align' => 'left', 'text' => TEXT_INFO_DELETE_DEFAULT);
                     $contents[] = array('text' => '<br/>');
                     $contents[] = array('align' => 'left', 'text' => '<a class="btn btn-default" href="' . xtc_href_link(FILENAME_CUSTOMERS, xtc_get_all_get_params(array('cID', 'delete')) . 'cID=' . $cInfo->customers_id) . '">' . BUTTON_BACK . '</a>');
require_once DIR_FS_INC . 'xtc_oe_get_options_values_name.inc.php';
require_once DIR_FS_INC . 'xtc_oe_customer_infos.inc.php';
require_once DIR_FS_INC . 'xtc_get_countries.inc.php';
require_once DIR_FS_INC . 'xtc_get_address_format_id.inc.php';
// Benötigte Funktionen und Klassen Ende
$action = isset($_GET['action']) ? $_GET['action'] : '';
// Adressbearbeitung Anfang
if ($action == 'address_edit') {
    $customers_country = xtc_get_countriesList(xtc_db_prepare_input($_POST['customers_country_id']));
    $delivery_country = xtc_get_countriesList(xtc_db_prepare_input($_POST['delivery_country_id']), true);
    $billing_country = xtc_get_countriesList(xtc_db_prepare_input($_POST['billing_country_id']), true);
    $lang_query = xtc_db_query("select languages_id from " . TABLE_LANGUAGES . " where directory = '" . $order->info['language'] . "'");
    $lang = xtc_db_fetch_array($lang_query);
    $status_query = xtc_db_query("select customers_status_name from " . TABLE_CUSTOMERS_STATUS . " where customers_status_id = '" . (int) $_POST['customers_status'] . "' and language_id = '" . (int) $lang['languages_id'] . "' ");
    $status = xtc_db_fetch_array($status_query);
    $sql_data_array = array('customers_vat_id' => xtc_db_prepare_input($_POST['customers_vat_id']), 'customers_status' => xtc_db_prepare_input($_POST['customers_status']), 'customers_status_name' => xtc_db_prepare_input($status['customers_status_name']), 'customers_company' => xtc_db_prepare_input($_POST['customers_company']), 'customers_firstname' => xtc_db_prepare_input($_POST['customers_firstname']), 'customers_lastname' => xtc_db_prepare_input($_POST['customers_lastname']), 'customers_name' => xtc_db_prepare_input($_POST['customers_firstname']) . ' ' . xtc_db_prepare_input($_POST['customers_lastname']), 'customers_street_address' => xtc_db_prepare_input($_POST['customers_street_address']), 'customers_suburb' => xtc_db_prepare_input($_POST['customers_suburb']), 'customers_city' => xtc_db_prepare_input($_POST['customers_city']), 'customers_postcode' => xtc_db_prepare_input($_POST['customers_postcode']), 'customers_country' => $customers_country['countries_name'], 'customers_telephone' => xtc_db_prepare_input($_POST['customers_telephone']), 'customers_email_address' => xtc_db_prepare_input($_POST['customers_email_address']), 'customers_address_format_id' => xtc_get_address_format_id($_POST['customers_country_id']), 'customers_cid' => xtc_db_prepare_input($_POST['customers_cid']), 'delivery_company' => xtc_db_prepare_input($_POST['delivery_company']), 'delivery_firstname' => xtc_db_prepare_input($_POST['delivery_firstname']), 'delivery_lastname' => xtc_db_prepare_input($_POST['delivery_lastname']), 'delivery_name' => xtc_db_prepare_input($_POST['delivery_firstname']) . ' ' . xtc_db_prepare_input($_POST['delivery_lastname']), 'delivery_street_address' => xtc_db_prepare_input($_POST['delivery_street_address']), 'delivery_suburb' => xtc_db_prepare_input($_POST['delivery_suburb']), 'delivery_city' => xtc_db_prepare_input($_POST['delivery_city']), 'delivery_postcode' => xtc_db_prepare_input($_POST['delivery_postcode']), 'delivery_country' => $delivery_country['countries_name'], 'delivery_country_iso_code_2' => $delivery_country['countries_iso_code_2'], 'delivery_address_format_id' => xtc_get_address_format_id($_POST['delivery_country_id']), 'billing_company' => xtc_db_prepare_input($_POST['billing_company']), 'billing_firstname' => xtc_db_prepare_input($_POST['billing_firstname']), 'billing_lastname' => xtc_db_prepare_input($_POST['billing_lastname']), 'billing_name' => xtc_db_prepare_input($_POST['billing_firstname']) . ' ' . xtc_db_prepare_input($_POST['billing_lastname']), 'billing_street_address' => xtc_db_prepare_input($_POST['billing_street_address']), 'billing_suburb' => xtc_db_prepare_input($_POST['billing_suburb']), 'billing_city' => xtc_db_prepare_input($_POST['billing_city']), 'billing_postcode' => xtc_db_prepare_input($_POST['billing_postcode']), 'billing_country' => $billing_country['countries_name'], 'billing_country_iso_code_2' => $billing_country['countries_iso_code_2'], 'billing_address_format_id' => xtc_get_address_format_id($_POST['billing_country_id']), 'last_modified' => 'now()');
    xtc_db_perform(TABLE_ORDERS, $sql_data_array, 'update', 'orders_id = \'' . (int) $_POST['oID'] . '\'');
    xtc_redirect(xtc_href_link(FILENAME_ORDERS_EDIT, 'edit_action=address&oID=' . (int) $_POST['oID']));
}
// Adressbearbeitung Ende
// Artikeldaten einfügen / bearbeiten Anfang:
// Artikel bearbeiten Anfang:
if ($action == 'product_edit') {
    $lang_query = xtc_db_query("select languages_id from " . TABLE_LANGUAGES . " where directory = '" . $order->info['language'] . "'");
    $lang = xtc_db_fetch_array($lang_query);
    $status = get_customers_taxprice_status();
    $product_query = xtc_db_query("select op.allow_tax,\n                                        op.products_tax,\n                                        p.products_tax_class_id,\n                                        pd.products_name,\n                                        pd.products_short_description,\n                                        pd.products_order_description\n                                   from " . TABLE_ORDERS_PRODUCTS . " op\n                              left join " . TABLE_PRODUCTS . " p ON op.products_id = p.products_id\n                              left join " . TABLE_PRODUCTS_DESCRIPTION . " pd ON op.products_id = pd.products_id AND pd.language_id = '" . (int) $lang['languages_id'] . "'\n                                  WHERE op.products_id = " . (int) $_POST['products_id'] . "\n                                    AND op.orders_products_id = " . (int) $_POST['opID']);
    $product = xtc_db_fetch_array($product_query);
    if (isset($_POST['products_tax'])) {
        $product['products_tax'] = $_POST['products_tax'];
    }