<?php
/* --------------------------------------------------------------
$Id: currencies.php 950 2005-05-14 16:45:21Z mz $
XT-Commerce - community made shopping
http://www.xt-commerce.com
Copyright (c) 2003 XT-Commerce
--------------------------------------------------------------
based on:
(c) 2000-2001 The Exchange Project (earlier name of osCommerce)
(c) 2002-2003 osCommerce(currencies.php,v 1.2 2002/09/01); www.oscommerce.com
(c) 2003 nextcommerce (currencies.php,v 1.5 2003/08/18); www.nextcommerce.org
Released under the GNU General Public License
--------------------------------------------------------------*/
defined( '_VALID_XTC' ) or die( 'Direct Access to this location is not allowed.' );
////
// Class to handle currencies
// TABLES: currencies
class currencies {
var $currencies;
// class constructor
function currencies() {
$this->currencies = array();
$currencies_query = xtc_db_query("select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from " . TABLE_CURRENCIES);
while ($currencies = xtc_db_fetch_array($currencies_query)) {
$this->currencies[$currencies['code']] = array('title' => $currencies['title'],
'symbol_left' => $currencies['symbol_left'],
'symbol_right' => $currencies['symbol_right'],
'decimal_point' => $currencies['decimal_point'],
'thousands_point' => $currencies['thousands_point'],
'decimal_places' => $currencies['decimal_places'],
'value' => $currencies['value']);
}
}
// class methods
function format($number, $calculate_currency_value = true, $currency_type = DEFAULT_CURRENCY, $currency_value = '') {
if ($calculate_currency_value) {
$rate = ($currency_value) ? $currency_value : $this->currencies[$currency_type]['value'];
$format_string = $this->currencies[$currency_type]['symbol_left'] . number_format((double)$number * $rate, (double)$this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];
// if the selected currency is in the european euro-conversion and the default currency is euro,
// the currency will displayed in the national currency and euro currency
if ( (DEFAULT_CURRENCY == 'EUR') && ($currency_type == 'DEM' || $currency_type == 'BEF' || $currency_type == 'LUF' || $currency_type == 'ESP' || $currency_type == 'FRF' || $currency_type == 'IEP' || $currency_type == 'ITL' || $currency_type == 'NLG' || $currency_type == 'ATS' || $currency_type == 'PTE' || $currency_type == 'FIM' || $currency_type == 'GRD') ) {
$format_string .= ' <small>[' . $this->format($number, true, 'EUR') . ']</small>';
}
} else {
$format_string = $this->currencies[$currency_type]['symbol_left'] . number_format((double)$number, (double)$this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];
}
return $format_string;
}
function get_value($code) {
return $this->currencies[$code]['value'];
}
function display_price($products_price, $products_tax, $quantity = 1) {
return $this->format(xtc_add_tax($products_price, $products_tax) * $quantity);
}
}
?>| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| box.php | 2013-11-12 20:54 | 2.49 KB | 76129f60960:kunden | -xw-x----- | |
| campaigns.php | 2013-11-12 20:54 | 11.88 KB | 76129f60960:kunden | -xw-x----- | |
| categories.php | 2013-11-12 20:54 | 91.35 KB | 76129f60960:kunden | -xw-x----- | |
| class.paypal.php | 2013-11-12 20:54 | 17.41 KB | 76129f60960:kunden | -xw-x----- | |
| currencies.php | 2013-11-12 20:54 | 3.79 KB | 76129f60960:kunden | -xw-x----- | |
| image_manipulator_GD1.php | 2013-11-12 20:54 | 14.45 KB | 76129f60960:kunden | -xw-x----- | |
| image_manipulator_GD2.php | 2013-11-12 20:54 | 14.7 KB | 76129f60960:kunden | -xw-x----- | |
| import.php | 2013-11-12 20:54 | 50.53 KB | 76129f60960:kunden | -xw-x----- | |
| language.php | 2013-11-12 20:54 | 6.31 KB | 76129f60960:kunden | -xw-x----- | |
| logger.php | 2013-11-12 20:54 | 1.86 KB | 76129f60960:kunden | -xw-x----- | |
| message_stack.php | 2013-11-12 20:54 | 2.67 KB | 76129f60960:kunden | -xw-x----- | |
| object_info.php | 2013-11-12 20:54 | 1 KB | 76129f60960:kunden | -xw-x----- | |
| order.php | 2013-11-12 20:54 | 12.19 KB | 76129f60960:kunden | -xw-x----- | |
| payment_module_info.php | 2013-11-12 20:54 | 1.59 KB | 76129f60960:kunden | -xw-x----- | |
| pclzip.lib.php | 2013-11-12 20:54 | 266.23 KB | 76129f60960:kunden | -xw-x----- | |
| phplot.php | 2013-11-12 20:54 | 313.95 KB | 76129f60960:kunden | -xw-x----- | |
| phpmailer.lang-de.php | 2013-11-12 20:54 | 1.21 KB | 76129f60960:kunden | -xw-x----- | |
| phpmailer.lang-en.php | 2013-11-12 20:54 | 1.04 KB | 76129f60960:kunden | -xw-x----- | |
| sales_report.php | 2013-11-12 20:54 | 10.94 KB | 76129f60960:kunden | -xw-x----- | |
| sessions.php | 2013-11-12 20:54 | 13.33 KB | 76129f60960:kunden | -xw-x----- | |
| shopping_cart.php | 2013-11-12 20:54 | 14 KB | 76129f60960:kunden | -xw-x----- | |
| split_page_results.php | 2013-11-12 20:54 | 4.77 KB | 76129f60960:kunden | -xw-x----- | |
| table_block.php | 2013-11-12 20:54 | 3.72 KB | 76129f60960:kunden | -xw-x----- | |
| upload.php | 2013-11-12 20:54 | 5.56 KB | 76129f60960:kunden | -xw-x----- | |