Example #1
0
function ordGetOrder($orderID)
{
    $q = db_query('select orderID, customerID, order_time, customer_ip, ' . ' shipping_type, payment_type, customers_comment, ' . ' statusID, shipping_cost, order_discount, order_amount, ' . ' currency_code, currency_value, customer_firstname, customer_lastname, ' . ' customer_email, shipping_firstname, shipping_lastname, ' . ' shipping_country, shipping_state, shipping_city, ' . ' shipping_address, billing_firstname, billing_lastname, billing_country, ' . ' billing_state, billing_city, billing_address, ' . ' cc_number, cc_holdername, cc_expires, cc_cvv, affiliateID, shippingServiceInfo, currency_round  from ' . ORDERS_TABLE . ' where orderID=' . (int) $orderID);
    $order = db_fetch_row($q);
    if ($order) {
        /*_setHyphen( $order['shipping_firstname'] );
          _setHyphen( $order['customer_lastname'] );
          _setHyphen( $order['customer_email'] );
          _setHyphen( $order['shipping_firstname'] );
          _setHyphen( $order['shipping_lastname'] );
          _setHyphen( $order['shipping_country'] );
          _setHyphen( $order['shipping_state'] );
          _setHyphen( $order['shipping_city'] );
          _setHyphen( $order['shipping_address'] );
          _setHyphen( $order['billing_firstname'] );
          _setHyphen( $order['billing_lastname'] );
          _setHyphen( $order['billing_country'] );
          _setHyphen( $order['billing_state'] );
          _setHyphen( $order['billing_city'] );
          _setHyphen( $order['billing_address'] );*/
        $order['shipping_address'] = chop($order['shipping_address']);
        $order['billing_address'] = chop($order['billing_address']);
        //CC data
        if (CONF_BACKEND_SAFEMODE) {
            $order['cc_number'] = ADMIN_SAFEMODE_BLOCKED;
            $order['cc_holdername'] = ADMIN_SAFEMODE_BLOCKED;
            $order['cc_expires'] = ADMIN_SAFEMODE_BLOCKED;
            $order['cc_cvv'] = ADMIN_SAFEMODE_BLOCKED;
        } else {
            if (strlen($order['cc_number']) > 0) {
                $order['cc_number'] = cryptCCNumberDeCrypt($order['cc_number'], null);
            }
            if (strlen($order['cc_holdername']) > 0) {
                $order['cc_holdername'] = cryptCCHoldernameDeCrypt($order['cc_holdername'], null);
            }
            if (strlen($order['cc_expires']) > 0) {
                $order['cc_expires'] = cryptCCExpiresDeCrypt($order['cc_expires'], null);
            }
            if (strlen($order['cc_cvv']) > 0) {
                $order['cc_cvv'] = cryptCCNumberDeCrypt($order['cc_cvv'], null);
            }
        }
        //additional reg fields
        $addregfields = GetRegFieldsValuesByOrderID($orderID);
        $order['reg_fields_values'] = $addregfields;
        $q_status_name = db_query('select status_name from ' . ORDER_STATUES_TABLE . ' where statusID=' . (int) $order['statusID']);
        $status_name = db_fetch_row($q_status_name);
        $status_name = $status_name[0];
        if ($order['statusID'] == ostGetCanceledStatusId()) {
            $status_name = STRING_CANCELED_ORDER_STATUS;
        }
        // clear cost ( without shipping, discount, tax )
        $q1 = db_query('select Price, Quantity from ' . ORDERED_CARTS_TABLE . ' where orderID=' . (int) $orderID);
        $clear_total_price = 0;
        while ($row = db_fetch_row($q1)) {
            $clear_total_price += $row['Price'] * $row['Quantity'];
        }
        $currency_round = $order['currency_round'];
        $order['clear_total_priceToShow'] = _formatPrice(roundf($order['currency_value'] * $clear_total_price), $currency_round) . ' ' . $order['currency_code'];
        $order['order_discount_ToShow'] = _formatPrice(roundf($order['currency_value'] * $clear_total_price * ((100 - $order['order_discount']) / 100)), $currency_round) . ' ' . $order['currency_code'];
        $order['shipping_costToShow'] = _formatPrice(roundf($order['currency_value'] * $order['shipping_cost']), $currency_round) . ' ' . $order['currency_code'];
        $order['order_amountToShow'] = _formatPrice(roundf($order['currency_value'] * $order['order_amount']), $currency_round) . ' ' . $order['currency_code'];
        $order['order_time_mysql'] = $order['order_time'];
        $order['order_time'] = format_datetime($order['order_time']);
        $order['status_name'] = $status_name;
    }
    return $order;
}
Example #2
0
function setting_TEXT_BOX_SECURE($dataType, $settingsID)
{
    $q = db_query("select settings_constant_name from " . SETTINGS_TABLE . " where settingsID=" . (int) $settingsID);
    $row = db_fetch_row($q);
    $settings_constant_name = $row["settings_constant_name"];
    if (isset($_POST["save"]) && isset($_POST["setting" . $settings_constant_name])) {
        if ($dataType == 0) {
            $value = $_POST["setting" . $settings_constant_name];
        } else {
            if ($dataType == 1) {
                $value = (double) $_POST["setting" . $settings_constant_name];
            } else {
                if ($dataType == 2) {
                    $value = (int) $_POST["setting" . $settings_constant_name];
                }
            }
        }
        _setSettingOptionValue($settings_constant_name, cryptCCNumberCrypt($value, NULL));
    }
    return "<input type=text value='" . cryptCCNumberDeCrypt(_getSettingOptionValue($settings_constant_name), NULL) . "' name='setting" . $settings_constant_name . "' >";
}