Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00031 class ilPaymentCurrency
00032 {
00033 function _getAvailableCurrencies()
00034 {
00035 global $ilDB;
00036
00037 $query = "SELECT * FROM payment_currencies ";
00038 $res = $ilDB->query($query);
00039
00040 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
00041 {
00042 $currencies[$row->currency_id]['currency_id'] = $row->currency_id;
00043 $currencies[$row->currency_id]['unit'] = $row->unit;
00044 $currencies[$row->currency_id]['subunit'] = $row->subunit;
00045 }
00046 return $currencies ? $currencies : array();
00047 }
00048 function _getCurrency($a_currency_id)
00049 {
00050 global $ilDB;
00051
00052 $query = "SELECT * FROM payment_currencies ".
00053 "WHERE currency_id = '".$a_currency_id."'";
00054
00055 $res = $ilDB->query($query);
00056 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
00057 {
00058 $currencies['currency_id'] = $row->currency_id;
00059 $currencies['unit'] = $row->unit;
00060 $currencies['sub_unit'] = $row->subunit;
00061 }
00062 return $currencies;
00063 }
00064 function _getUnit($a_currency_id)
00065 {
00066 global $ilDB;
00067
00068 $query = "SELECT unit FROM payment_currencies ".
00069 "WHERE currency_id = '".$a_currency_id."'";
00070
00071 $res = $ilDB->query($query);
00072 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
00073 {
00074 return $row->unit;
00075 }
00076 return false;
00077 }
00078 function _getSubUnit($a_currency_id)
00079 {
00080 global $ilDB;
00081
00082 $query = "SELECT subunit FROM payment_currencies ".
00083 "WHERE currency_id = '".$a_currency_id."'";
00084
00085 $res = $ilDB->query($query);
00086 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
00087 {
00088 return $row->subunit;
00089 }
00090 return false;
00091 }
00092 }
00093
00094 ?>