ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilPaymentCurrency.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
32 {
34  {
35  global $ilDB;
36 
37  $query = "SELECT * FROM payment_currencies ";
38  $res = $ilDB->query($query);
39 
40  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
41  {
42  $currencies[$row->currency_id]['currency_id'] = $row->currency_id;
43  $currencies[$row->currency_id]['unit'] = $row->unit;
44  $currencies[$row->currency_id]['subunit'] = $row->subunit;
45  }
46  return $currencies ? $currencies : array();
47  }
48  function _getCurrency($a_currency_id)
49  {
50  global $ilDB;
51 
52  $query = "SELECT * FROM payment_currencies ".
53  "WHERE currency_id = '".$a_currency_id."'";
54 
55  $res = $ilDB->query($query);
56  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
57  {
58  $currencies['currency_id'] = $row->currency_id;
59  $currencies['unit'] = $row->unit;
60  $currencies['sub_unit'] = $row->subunit;
61  }
62  return $currencies;
63  }
64  function _getUnit($a_currency_id)
65  {
66  global $ilDB;
67 
68  $query = "SELECT unit FROM payment_currencies ".
69  "WHERE currency_id = '".$a_currency_id."'";
70 
71  $res = $ilDB->query($query);
72  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
73  {
74  return $row->unit;
75  }
76  return false;
77  }
78  function _getSubUnit($a_currency_id)
79  {
80  global $ilDB;
81 
82  $query = "SELECT subunit FROM payment_currencies ".
83  "WHERE currency_id = '".$a_currency_id."'";
84 
85  $res = $ilDB->query($query);
86  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
87  {
88  return $row->subunit;
89  }
90  return false;
91  }
92 }
93 
94 ?>