コード例 #1
0
     $_SESSION['billing_same_as_customer'] = $_POST['billing_same_as_customer'];
 }
 if (isset($_POST['shipping_same_as_billing'])) {
     $_SESSION['shipping_same_as_billing'] = $_POST['shipping_same_as_billing'];
 }
 // Update Order Info
 //figure out the new currency value
 $currency_value_query = vam_db_query("SELECT value \n\t\t                                      FROM " . TABLE_CURRENCIES . " \n\t\t\t\t\t\t\t\t\t\t\t  WHERE code = '" . $_POST['update_info_payment_currency'] . "'");
 $currency_value = vam_db_fetch_array($currency_value_query);
 //figure out the country, state
 $update_customer_state = vam_get_zone_name($_POST['update_customer_country_id'], $_POST['update_customer_zone_id'], $_POST['update_customer_state']);
 $update_customer_country = vam_get_country_name($_POST['update_customer_country_id']);
 $update_billing_state = vam_get_zone_name($_POST['update_billing_country_id'], $_POST['update_billing_zone_id'], $_POST['update_billing_state']);
 $update_billing_country = vam_get_country_name($_POST['update_billing_country_id']);
 $update_delivery_state = vam_get_zone_name($_POST['update_delivery_country_id'], $_POST['update_delivery_zone_id'], $_POST['update_delivery_state']);
 $update_delivery_country = vam_get_country_name($_POST['update_delivery_country_id']);
 $sql_data_array = array('customers_name' => vam_db_input(vam_db_prepare_input($_POST['update_customer_name'])), 'customers_company' => vam_db_input(vam_db_prepare_input($_POST['update_customer_company'])), 'customers_street_address' => vam_db_input(vam_db_prepare_input($_POST['update_customer_street_address'])), 'customers_suburb' => vam_db_input(vam_db_prepare_input($_POST['update_customer_suburb'])), 'customers_city' => vam_db_input(vam_db_prepare_input($_POST['update_customer_city'])), 'customers_state' => vam_db_input(vam_db_prepare_input($update_customer_state)), 'customers_postcode' => vam_db_input(vam_db_prepare_input($_POST['update_customer_postcode'])), 'customers_country' => vam_db_input(vam_db_prepare_input($update_customer_country)), 'customers_telephone' => vam_db_input(vam_db_prepare_input($_POST['update_customer_telephone'])), 'customers_email_address' => vam_db_input(vam_db_prepare_input($_POST['update_customer_email_address'])), 'billing_name' => vam_db_input(vam_db_prepare_input(isset($_POST['billing_same_as_customer']) && $_POST['billing_same_as_customer'] == 'on' ? $_POST['update_customer_name'] : $_POST['update_billing_name'])), 'billing_company' => vam_db_input(vam_db_prepare_input(isset($_POST['billing_same_as_customer']) && $_POST['billing_same_as_customer'] == 'on' ? $_POST['update_customer_company'] : $_POST['update_billing_company'])), 'billing_street_address' => vam_db_input(vam_db_prepare_input(isset($_POST['billing_same_as_customer']) && $_POST['billing_same_as_customer'] == 'on' ? $_POST['update_customer_street_address'] : $_POST['update_billing_street_address'])), 'billing_suburb' => vam_db_input(vam_db_prepare_input(isset($_POST['billing_same_as_customer']) && $_POST['billing_same_as_customer'] == 'on' ? $_POST['update_customer_suburb'] : $_POST['update_billing_suburb'])), 'billing_city' => vam_db_input(vam_db_prepare_input(isset($_POST['billing_same_as_customer']) && $_POST['billing_same_as_customer'] == 'on' ? $_POST['update_customer_city'] : $_POST['update_billing_city'])), 'billing_state' => vam_db_input(vam_db_prepare_input(isset($_POST['billing_same_as_customer']) && $_POST['billing_same_as_customer'] == 'on' ? $update_customer_state : $update_billing_state)), 'billing_postcode' => vam_db_input(vam_db_prepare_input(isset($_POST['billing_same_as_customer']) && $_POST['billing_same_as_customer'] == 'on' ? $_POST['update_customer_postcode'] : $_POST['update_billing_postcode'])), 'billing_country' => vam_db_input(vam_db_prepare_input(isset($_POST['billing_same_as_customer']) && $_POST['billing_same_as_customer'] == 'on' ? $update_customer_country : $update_billing_country)), 'delivery_name' => vam_db_input(vam_db_prepare_input(isset($_POST['shipping_same_as_billing']) && $_POST['shipping_same_as_billing'] == 'on' ? $_POST['billing_same_as_customer'] == 'on' ? $_POST['update_customer_name'] : $_POST['update_billing_name'] : $_POST['update_delivery_name'])), 'delivery_company' => vam_db_input(vam_db_prepare_input(isset($_POST['shipping_same_as_billing']) && $_POST['shipping_same_as_billing'] == 'on' ? $_POST['billing_same_as_customer'] == 'on' ? $_POST['update_customer_company'] : $_POST['update_billing_company'] : $_POST['update_delivery_company'])), 'delivery_street_address' => vam_db_input(vam_db_prepare_input(isset($_POST['shipping_same_as_billing']) && $_POST['shipping_same_as_billing'] == 'on' ? $_POST['billing_same_as_customer'] == 'on' ? $_POST['update_customer_street_address'] : $_POST['update_billing_street_address'] : $_POST['update_delivery_street_address'])), 'delivery_suburb' => vam_db_input(vam_db_prepare_input(isset($_POST['shipping_same_as_billing']) && $_POST['shipping_same_as_billing'] == 'on' ? $_POST['billing_same_as_customer'] == 'on' ? $_POST['update_customer_suburb'] : $_POST['update_billing_suburb'] : $_POST['update_delivery_suburb'])), 'delivery_city' => vam_db_input(vam_db_prepare_input(isset($_POST['shipping_same_as_billing']) && $_POST['shipping_same_as_billing'] == 'on' ? $_POST['billing_same_as_customer'] == 'on' ? $_POST['update_customer_city'] : $_POST['update_billing_city'] : $_POST['update_delivery_city'])), 'delivery_state' => vam_db_input(vam_db_prepare_input(isset($_POST['shipping_same_as_billing']) && $_POST['shipping_same_as_billing'] == 'on' ? $_POST['billing_same_as_customer'] == 'on' ? $update_customer_state : $update_billing_state : $update_delivery_state)), 'delivery_postcode' => vam_db_input(vam_db_prepare_input(isset($_POST['shipping_same_as_billing']) && $_POST['shipping_same_as_billing'] == 'on' ? $_POST['billing_same_as_customer'] == 'on' ? $_POST['update_customer_postcode'] : $_POST['update_billing_postcode'] : $_POST['update_delivery_postcode'])), 'delivery_country' => vam_db_input(vam_db_prepare_input(isset($_POST['shipping_same_as_billing']) && $_POST['shipping_same_as_billing'] == 'on' ? $_POST['billing_same_as_customer'] == 'on' ? $update_customer_country : $update_billing_country : $update_delivery_country)), 'payment_method' => vam_db_input(vam_db_prepare_input($_POST['update_info_payment_method'])), 'currency' => vam_db_input(vam_db_prepare_input($_POST['update_info_payment_currency'])), 'currency_value' => vam_db_input(vam_db_prepare_input($currency_value['value'])), 'cc_type' => vam_db_prepare_input($_POST['update_info_cc_type']), 'cc_owner' => vam_db_prepare_input($_POST['update_info_cc_owner']), 'cc_number' => vam_db_input(vam_db_prepare_input($_POST['update_info_cc_number'])), 'cc_expires' => vam_db_prepare_input($_POST['update_info_cc_expires']), 'last_modified' => 'now()');
 vam_db_perform(TABLE_ORDERS, $sql_data_array, 'update', 'orders_id = \'' . vam_db_input($oID) . '\'');
 $order_updated = true;
 // UPDATE STATUS HISTORY & SEND EMAIL TO CUSTOMER IF NECESSARY #####
 $check_status_query = vam_db_query("\n\t                      SELECT customers_name, customers_email_address, orders_status, date_purchased \n\t                      FROM " . TABLE_ORDERS . " \n\t\t\t\t\t\t  WHERE orders_id = '" . (int) $oID . "'");
 $check_status = vam_db_fetch_array($check_status_query);
 if ($check_status['orders_status'] != $_POST['status'] || vam_not_null($_POST['comments'])) {
     vam_db_query("UPDATE " . TABLE_ORDERS . " SET \n\t\t\t\t\t  orders_status = '" . vam_db_input($_POST['status']) . "', \n                      last_modified = now() \n                      WHERE orders_id = '" . (int) $oID . "'");
     // Notify Customer ?
     $customer_notified = '0';
     if (isset($_POST['notify']) && $_POST['notify'] == 'on') {
         $notify_comments = '';
         if (isset($_POST['notify_comments']) && $_POST['notify_comments'] == 'on') {
             $notify_comments = $_GET['comments'];
         }
コード例 #2
0
ファイル: general.php プロジェクト: nomadcomanche/zdorov_shop
function vam_address_format($address_format_id, $address, $html, $boln, $eoln)
{
    $address_format_query = vam_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . $address_format_id . "'");
    $address_format = vam_db_fetch_array($address_format_query);
    $company = addslashes($address['company']);
    $firstname = addslashes($address['firstname']);
    $cid = addslashes($address['csID']);
    $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 = vam_get_country_name($country_id);
    $state = vam_get_zone_code($country_id, $zone_id, $state);
    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 ($firstname == '') {
        $firstname = addslashes($address['name']);
    }
    if ($country == '') {
        $country = addslashes($address['country']);
    }
    if ($state != '') {
        $statecomma = $state . ', ';
    }
    $fmt = $address_format['format'];
    eval("\$address = \"{$fmt}\";");
    $address = stripslashes($address);
    if (ACCOUNT_COMPANY == 'true' && vam_not_null($company)) {
        $address = $company . $cr . $address;
    }
    return $address;
}
コード例 #3
0
    if ($entry_city_error == true) {
        $city_content = vam_draw_input_fieldNote(array('name' => 'a_city', 'text' => '&nbsp;' . ENTRY_CITY_ERROR));
    } else {
        $city_content = $a_city . vam_draw_hidden_field('a_city');
    }
} else {
    $city_content = vam_draw_input_fieldNote(array('name' => 'a_city', 'text' => '&nbsp;' . ENTRY_CITY_TEXT), $affiliate['affiliate_city']);
}
$module->assign('city_content', $city_content);
if ($is_read_only == true) {
    $country_id_content = vam_get_country_name($affiliate['affiliate_country_id']);
} elseif ($error == true) {
    if ($entry_country_error == true) {
        $country_id_content = vam_get_country_list(array('name' => 'a_country', 'text' => '&nbsp;' . ENTRY_COUNTRY_ERROR));
    } else {
        $country_id_content = vam_get_country_name($a_country) . vam_draw_hidden_field('a_country');
    }
} else {
    if (!isset($affiliate['affiliate_country_id'])) {
        $affiliate['affiliate_country_id'] = STORE_COUNTRY;
    }
    if (!isset($affiliate['affiliate_zone_id'])) {
        $affiliate['affiliate_zone_id'] = STORE_ZONE;
    }
    $country_id_content = vam_get_country_list('a_country', $affiliate['affiliate_country_id'], 'id="country"') . (vam_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="Requirement">' . ENTRY_COUNTRY_TEXT . '</span>' : '');
}
$module->assign('country_id_content', $country_id_content);
if (ACCOUNT_STATE == 'true') {
    if (!isset($affiliate['affiliate_country_id'])) {
        $affiliate['affiliate_country_id'] = STORE_COUNTRY;
    }