Leitgedanken/msd2/myoos/admin/includes/functions/function_localization.php
2023-01-23 11:03:31 +01:00

52 lines
1.6 KiB
PHP

<?php
/* ----------------------------------------------------------------------
MyOOS [Shopsystem]
https://www.oos-shop.de
Copyright (c) 2003 - 2019 by the MyOOS Development Team.
----------------------------------------------------------------------
Based on:
File: localization.php,v 1.12 2003/06/25 20:36:48 hpdl
----------------------------------------------------------------------
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
----------------------------------------------------------------------
Released under the GNU General Public License
---------------------------------------------------------------------- */
/** ensure this file is being included by a parent file */
defined( 'OOS_VALID_MOD' ) or die( 'Direct Access to this location is not allowed.' );
function quote_oanda_currency($code, $base = DEFAULT_CURRENCY) {
$page = file('http://www.oanda.com/convert/fxdaily?value=1&redirected=1&exch=' . $code . '&format=CSV&dest=Get+Table&sel_list=' . $base);
$match = array();
preg_match('/(.+),(\w{3}),([0-9.]+),([0-9.]+)/i', implode('', $page), $match);
if (count($match) > 0) {
return $match[3];
} else {
return false;
}
}
function quote_xe_currency($to, $from = DEFAULT_CURRENCY) {
$page = file('http://www.xe.net/ucc/convert.cgi?Amount=1&From=' . $from . '&To=' . $to);
$match = array();
preg_match('/[0-9.]+\s*' . $from . '\s*=\s*([0-9.]+)\s*' . $to . '/', implode('', $page), $match);
if (count($match) > 0) {
return $match[1];
} else {
return false;
}
}