| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package VikBooking |
| 4 |
* @subpackage mod_vikbooking_currencyconverter |
| 5 |
* @author Alessio Gaggii - E4J s.r.l |
| 6 |
* @copyright Copyright (C) 2018 E4J s.r.l. All rights reserved. |
| 7 |
* @license GNU General Public License version 2 or later; see LICENSE |
| 8 |
* @link https://vikwp.com |
| 9 |
*/ |
| 10 |
|
| 11 |
// No direct access |
| 12 |
defined('ABSPATH') or die('No script kiddies please!'); |
| 13 |
|
| 14 |
class modVikbooking_CurConvHelper { |
| 15 |
|
| 16 |
public static function getAllCurrencies($params) { |
| 17 |
$pcur = $params->get('currencies', array()); |
| 18 |
$currencies = array(); |
| 19 |
if (is_array($pcur) && count($pcur)) { |
| 20 |
foreach ($pcur as $c) { |
| 21 |
if (!in_array($c, $currencies)) |
| 22 |
$currencies[] = $c; |
| 23 |
} |
| 24 |
} |
| 25 |
|
| 26 |
return $currencies; |
| 27 |
} |
| 28 |
|
| 29 |
public static function getCurrencyName() { |
| 30 |
$dbo = JFactory::getDBO(); |
| 31 |
$q = "SELECT `setting` FROM `#__vikbooking_config` WHERE `param`='currencyname';"; |
| 32 |
$dbo->setQuery($q); |
| 33 |
$dbo->execute(); |
| 34 |
|
| 35 |
return $dbo->loadResult(); |
| 36 |
} |
| 37 |
|
| 38 |
} |
| 39 |
|