$print_packingslip = isset($_GET['print_packingslip']); $pdf_download = CURRENT_SCRIPT != FILENAME_CHECKOUT_PROCESS; //If checkout_process, Pdf needs to be stored in a file! } $print_invoice = !($print_packing_slip || $print_order); $lang_dir = ADMIN_PATH_PREFIX . 'lang' . SLASH . SESSION_LANGUAGE . SLASH; require $lang_dir . FILENAME_ORDERS_INVOICE_PDF; if (class_exists('order')) { $oID = $order->info['order_id']; } else { include_once DIR_WS_CLASSES . 'order.php'; $oID = $_GET['oID']; $orders_query = olc_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . $oID . APOS); $order = new order($oID); } $store_country = olc_get_country_name(STORE_COUNTRY); $billing_country = $order->billing['country']; $not_print_packing_slip = !$print_packing_slip; define('NOT_NO_TAX_RAISED', !NO_TAX_RAISED); define('ADD_TAX', CUSTOMER_SHOW_PRICE_TAX && NOT_NO_TAX_RAISED); define('IS_NATIONAL_ORDER', $billing_country == $store_country); $customers_order_reference = $order->info['customers_order_reference']; $customers_order_reference = str_replace(APOS, EMPTY_STRING, $customers_order_reference); $have_customers_order_reference = $customers_order_reference != EMPTY_STRING; //Build products elements table $x_width = array(); //$x_width[] will be calculated based on the text's width //but you can override it with a bigger(!) value, if desired $x_text = array(); //Column text $x_content = array();
if ($entry_city_error == true) { $city_content = olc_draw_input_field('a_city') . HTML_NBSP . ENTRY_CITY_ERROR; } else { $city_content = $a_city . olc_draw_hidden_field('a_city'); } } else { $city_content = olc_draw_input_field('a_city', $affiliate['affiliate_city']) . HTML_NBSP . ENTRY_CITY_TEXT; } $module_smarty->assign('city_content', $city_content); if ($is_read_only == true) { $country_id_content = olc_get_country_name($affiliate['affiliate_country_id']); } elseif ($error == true) { if ($entry_country_error == true) { $country_id_content = olc_get_country_list('a_country') . HTML_NBSP . ENTRY_COUNTRY_ERROR; } else { $country_id_content = olc_get_country_name($a_country) . olc_draw_hidden_field('a_country'); } } else { $country_id_content = olc_get_country_list('a_country', $affiliate['affiliate_country_id']) . HTML_NBSP . ENTRY_COUNTRY_TEXT; } $module_smarty->assign('country_id_content', $country_id_content); if (ACCOUNT_STATE == TRUE_STRING_S) { $module_smarty->assign('ACCOUNT_STATE', TRUE_STRING_S); $state = olc_get_zone_name($a_country, $a_zone_id, $a_state); if ($is_read_only == true) { $state_content = olc_get_zone_name($affiliate['affiliate_country_id'], $affiliate['affiliate_zone_id'], $affiliate['affiliate_state']); } elseif ($error == true) { if ($entry_state_error == true) { if ($entry_state_has_zones == true) { $zones_array = array(); $zones_query = olc_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . olc_db_input($a_country) . "' order by zone_name");
function olc_address_format($address_format_id, $address, $html, $boln, $eoln) { $address_format_query = olc_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . $address_format_id . APOS); $address_format = olc_db_fetch_array($address_format_query); $company = addslashes($address['company']); $firstname = addslashes($address['firstname']); $lastname = addslashes($address['lastname']); $street = addslashes($address['street_address']); $suburb = addslashes($address['suburb']); $city = addslashes($address['city']); $state = addslashes($address['state']); $country_id = $address['country_id']; $zone_id = $address['zone_id']; $postcode = addslashes($address['postcode']); $zip = $postcode; $country = olc_get_country_name($country_id); //$state = olc_get_zone_code($country_id, $zone_id, $state); $state = olc_get_zone_name($country_id, $zone_id, $state); if ($html) { // HTML Mode $HR = '<hr/>'; $hr = '<hr/>'; if ($boln == EMPTY_STRING && $eoln == NEW_LINE) { // Values not specified, use rational defaults $CR = HTML_BR; $cr = HTML_BR; $eoln = $cr; } else { // Use values supplied $CR = $eoln . $boln; $cr = $CR; } } else { // Text Mode $CR = $eoln; $cr = $CR; $HR = '----------------------------------------'; $hr = $HR; } $statecomma = EMPTY_STRING; $streets = $street; if ($suburb != EMPTY_STRING) { $streets = $street . $cr . $suburb; } if ($firstname == EMPTY_STRING) { $firstname = addslashes($address['name']); } if ($country == EMPTY_STRING) { $country = addslashes($address['country']); } if ($state != EMPTY_STRING) { $statecomma = $state . ', '; } $fmt = $address_format['format']; eval("\$address = \"{$fmt}\";"); if (ACCOUNT_COMPANY == TRUE_STRING_S) { if (olc_not_null($company)) { $address = $company . $cr . $address; } } //$address = stripslashes($address); return $address; }