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); }
} else { // if no shipping destination address was selected, use their own address as default if (!isset($_SESSION[$checkout_id_text])) { $_SESSION[$checkout_id_text] = $_SESSION['customer_default_address_id']; } if (!$process) { require_once DIR_FS_INC . 'olc_draw_radio_field.inc.php'; $checkout_id = $_SESSION[$checkout_id_text]; $smarty->assign('ADDRESS_LABEL', olc_address_label(CUSTOMER_ID, $checkout_id, true, BLANK, HTML_BR)); if ($addresses_count > 1) { $radio_buttons = 0; $addresses_query = olc_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname,\n\t\tentry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city,\n\t\tentry_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 = '" . CUSTOMER_ID . APOS); $address_content = ' <table border="0" width="100%" cellspacing="0" cellpadding="0">'; while ($addresses = olc_db_fetch_array($addresses_query)) { $format_id = olc_get_address_format_id($address['country_id']); $address_content .= ' <tr> <td width="10"> </td> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> '; $address_book_id = $addresses['address_book_id']; if ($address_book_id == $checkout_id) { $id = ' id="defaultSelected"'; $selected = 'Selected'; } else { $id = EMPTY_STRING; $selected = EMPTY_STRING; } $address_content .= '