Пример #1
0
                 $smarty->assign('state_in_out_values', xos_draw_pull_down_menu('entry_state', $zones_array) . ' ' . ENTRY_STATE_ERROR);
             } else {
                 $smarty->assign('state_in_out_values', xos_draw_input_field('entry_state', xos_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state)) . ' ' . ENTRY_STATE_ERROR);
             }
         } else {
             $smarty->assign('state_in_out_values', $entry_state . xos_draw_hidden_field('entry_zone_id') . xos_draw_hidden_field('entry_state'));
         }
     } else {
         $smarty->assign('state_in_out_values', xos_draw_input_field('entry_state', xos_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state)));
     }
 }
 if ($error == true) {
     if ($entry_country_error == true) {
         $smarty->assign('country_in_out_values', xos_draw_pull_down_menu('entry_country_id', xos_get_countries(), $cInfo->entry_country_id) . ' ' . ENTRY_COUNTRY_ERROR);
     } else {
         $smarty->assign('country_in_out_values', xos_get_country_name($cInfo->entry_country_id) . xos_draw_hidden_field('entry_country_id'));
     }
 } else {
     $smarty->assign('country_in_out_values', xos_draw_pull_down_menu('entry_country_id', xos_get_countries(), $cInfo->entry_country_id));
 }
 if ($error == true) {
     if ($entry_telephone_error == true) {
         $smarty->assign('telephone_in_out_values', xos_draw_input_field('customers_telephone', $cInfo->customers_telephone, 'maxlength="32"') . ' ' . ENTRY_TELEPHONE_NUMBER_ERROR);
     } else {
         $smarty->assign('telephone_in_out_values', $cInfo->customers_telephone . xos_draw_hidden_field('customers_telephone'));
     }
 } else {
     $smarty->assign('telephone_in_out_values', xos_draw_input_field('customers_telephone', $cInfo->customers_telephone, 'maxlength="32"', true));
 }
 if ($processed == true) {
     $smarty->assign('fax_in_out_values', $cInfo->customers_fax . xos_draw_hidden_field('customers_fax'));
Пример #2
0
function xos_address_format($address_format_id, $address, $html, $boln, $eoln)
{
    $address_format_query = xos_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . (int) $address_format_id . "'");
    $address_format = xos_db_fetch_array($address_format_query);
    $company = xos_output_string_protected($address['company']);
    if (isset($address['firstname']) && xos_not_null($address['firstname'])) {
        $firstname = xos_output_string_protected($address['firstname']);
        $lastname = xos_output_string_protected($address['lastname']);
    } elseif (isset($address['name']) && xos_not_null($address['name'])) {
        $firstname = xos_output_string_protected($address['name']);
        $lastname = '';
    } else {
        $firstname = '';
        $lastname = '';
    }
    $street = xos_output_string_protected($address['street_address']);
    $suburb = xos_output_string_protected($address['suburb']);
    $city = xos_output_string_protected($address['city']);
    $state = xos_output_string_protected($address['state']);
    if (isset($address['country_id']) && xos_not_null($address['country_id'])) {
        $country = xos_get_country_name($address['country_id']);
        if (isset($address['zone_id']) && xos_not_null($address['zone_id'])) {
            $state = xos_get_zone_code($address['country_id'], $address['zone_id'], $state);
        }
    } elseif (isset($address['country']) && xos_not_null($address['country'])) {
        $country = xos_output_string_protected($address['country']);
    } else {
        $country = '';
    }
    $postcode = xos_output_string_protected($address['postcode']);
    $zip = $postcode;
    if ($html) {
        // HTML Mode
        $HR = '<hr />';
        $hr = '<hr />';
        if ($boln == '' && $eoln == "\n") {
            // Values not specified, use rational defaults
            $CR = '<br />';
            $cr = '<br />';
            $eoln = $cr;
        } else {
            // Use values supplied
            $CR = $eoln . $boln;
            $cr = $CR;
        }
    } else {
        // Text Mode
        $CR = $eoln;
        $cr = $CR;
        $HR = '----------------------------------------';
        $hr = '----------------------------------------';
    }
    $statecomma = '';
    $streets = $street;
    if ($suburb != '') {
        $streets = $street . $cr . $suburb;
    }
    if ($state != '') {
        $statecomma = $state . ', ';
    }
    $fmt = $address_format['format'];
    eval("\$address = \"{$fmt}\";");
    if (ACCOUNT_COMPANY == 'true' && xos_not_null($company)) {
        $address = $company . $cr . $address;
    }
    return $address;
}