[ Index ]
 

Code source de osCommerce 2.2ms2-060817

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/catalog/admin/includes/functions/ -> localization.php (source)

   1  <?php
   2  /*
   3    $Id: localization.php,v 1.12 2003/06/25 20:36:48 hpdl Exp $
   4  
   5    osCommerce, Open Source E-Commerce Solutions
   6    http://www.oscommerce.com
   7  
   8    Copyright (c) 2003 osCommerce
   9  
  10    Released under the GNU General Public License
  11  */
  12  
  13    function quote_oanda_currency($code, $base = DEFAULT_CURRENCY) {
  14      $page = file('http://www.oanda.com/convert/fxdaily?value=1&redirected=1&exch=' . $code .  '&format=CSV&dest=Get+Table&sel_list=' . $base);
  15  
  16      $match = array();
  17  
  18      preg_match('/(.+),(\w{3}),([0-9.]+),([0-9.]+)/i', implode('', $page), $match);
  19  
  20      if (sizeof($match) > 0) {
  21        return $match[3];
  22      } else {
  23        return false;
  24      }
  25    }
  26  
  27    function quote_xe_currency($to, $from = DEFAULT_CURRENCY) {
  28      $page = file('http://www.xe.net/ucc/convert.cgi?Amount=1&From=' . $from . '&To=' . $to);
  29  
  30      $match = array();
  31  
  32      preg_match('/[0-9.]+\s*' . $from . '\s*=\s*([0-9.]+)\s*' . $to . '/', implode('', $page), $match);
  33  
  34      if (sizeof($match) > 0) {
  35        return $match[1];
  36      } else {
  37        return false;
  38      }
  39    }
  40  ?>


Généré le : Mon Nov 26 19:48:25 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics