Exemplo n.º 1
0
 /**
  * get currencies
  */
 function getCurrencies($currency_code = 'conf')
 {
     require_once 'models/international/international_currency.php';
     $Currency = new international_currency();
     $international_currency_conf = international_currency::initConfiguration();
     if ($currency_code == 'conf') {
         $cs = $Currency->conf['allowed'];
         $count = count($cs);
         for ($i = 0; $i < $count; $i++) {
             $where .= "code = '{$cs[$i]}'";
             if ($i + 1 < $count) {
                 $where .= " OR ";
             }
         }
     } else {
         if ($currency_code != 'all') {
             $where = "code = '{$currency_code}'";
         } else {
             $where = '';
         }
     }
     $curs = $Currency->listing($where);
     foreach ($curs as $cur) {
         if ($cur['symbol_left'] == '' && $cur['symbol_right'] == '') {
             $cur['symbol_right'] = "&nbsp;" . $cur['code'];
         }
         $result[$cur['code']] = $cur;
     }
     return $result;
 }