| 103 |
- |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/***************************************************************************
|
|
|
4 |
* Copyright (C) 2009-2011 by Geo Varghese(www.seopanel.in) *
|
|
|
5 |
* sendtogeo@gmail.com *
|
|
|
6 |
* *
|
|
|
7 |
* This program is free software; you can redistribute it and/or modify *
|
|
|
8 |
* it under the terms of the GNU General Public License as published by *
|
|
|
9 |
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
10 |
* (at your option) any later version. *
|
|
|
11 |
* *
|
|
|
12 |
* This program is distributed in the hope that it will be useful, *
|
|
|
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
15 |
* GNU General Public License for more details. *
|
|
|
16 |
* *
|
|
|
17 |
* You should have received a copy of the GNU General Public License *
|
|
|
18 |
* along with this program; if not, write to the *
|
|
|
19 |
* Free Software Foundation, Inc., *
|
|
|
20 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
21 |
***************************************************************************/
|
|
|
22 |
|
|
|
23 |
# class defines all currency controller functions
|
|
|
24 |
class CurrencyController extends Controller{
|
|
|
25 |
|
|
|
26 |
# func to get all currency
|
|
|
27 |
function __getAllCurrency($where = ''){
|
|
|
28 |
$sql = "select * from currency where 1=1";
|
|
|
29 |
if (!empty($where)) $sql .= $where;
|
|
|
30 |
$sql .= " order by name";
|
|
|
31 |
$currencyList = $this->db->select($sql);
|
|
|
32 |
return $currencyList;
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
# func to get currency info
|
|
|
36 |
function __getCurrencyInfo($currencyCode) {
|
|
|
37 |
$sql = "select * from currency where iso_code='".addslashes($currencyCode)."'";
|
|
|
38 |
$currencyInfo = $this->db->select($sql, true);
|
|
|
39 |
return $currencyInfo;
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
# function get currency code map list
|
|
|
43 |
function getCurrencyCodeMapList() {
|
|
|
44 |
$allList = $this->__getAllCurrency();
|
|
|
45 |
$currencyList = array();
|
|
|
46 |
|
|
|
47 |
// loop through currency
|
|
|
48 |
foreach ($allList as $currInfo) {
|
|
|
49 |
$isoCode = $currInfo['iso_code'];
|
|
|
50 |
$currencyList[$isoCode]['symbol'] = $currInfo['symbol'];
|
|
|
51 |
$currencyList[$isoCode]['unicode'] = $currInfo['unicode'];
|
|
|
52 |
$currencyList[$isoCode]['position'] = $currInfo['position'];
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
return $currencyList;
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
}
|
|
|
59 |
?>
|