• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

payment/classes/class.ilGeneralSettings.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 class ilGeneralSettings
00025 {
00026         var $db;
00027 
00028         var $settings;
00029 
00030         function ilGeneralSettings()
00031         {
00032                 global $ilDB;
00033 
00034                 $this->db =& $ilDB;
00035 
00036                 $this->__getSettings();
00037         }
00038         
00039         function get($a_type)
00040         {
00041                 return $this->settings[$a_type];
00042         }
00043 
00044         function getAll()
00045         {
00046                 return $this->settings;
00047         }
00048 
00049         function clearAll()
00050         {
00051                 $query = "DELETE FROM payment_settings";
00052                 $this->db->query($query);
00053 
00054                 return true;
00055         }
00056                 
00057         function setAll($a_values)
00058         {
00059                 $query = "INSERT INTO payment_settings VALUES(";
00060                 $query .= "'', ";
00061                 $query .= "'" . $a_values["currency_unit"] . "', ";
00062                 $query .= "'" . $a_values["currency_subunit"] . "', ";
00063                 $query .= "'" . $a_values["address"] . "', ";
00064                 $query .= "'" . $a_values["bank_data"] . "', ";
00065                 $query .= "'" . $a_values["add_info"] . "', ";
00066                 $query .= "'" . $a_values["vat_rate"] . "', ";
00067                 $query .= "'" . $a_values["pdf_path"] . "')";
00068                 $this->db->query($query);
00069 
00070                 $this->__getSettings();
00071 
00072                 return true;
00073         }
00074 
00075         function __getSettings()
00076         {
00077                 $query = "SELECT * FROM payment_settings";
00078                 $result = $this->db->getrow($query);
00079 
00080                 $data = array();
00081                 if (is_object($result))
00082                 {
00083                         $data["currency_unit"] = $result->currency_unit;
00084                         $data["currency_subunit"] = $result->currency_subunit;
00085                         $data["address"] = $result->address;
00086                         $data["bank_data"] = $result->bank_data;
00087                         $data["add_info"] = $result->add_info;
00088                         $data["vat_rate"] = $result->vat_rate;
00089                         $data["pdf_path"] = $result->pdf_path;
00090                 }
00091 
00092                 $this->settings = $data;
00093         }
00094 
00095 }
00096 ?>

Generated on Fri Dec 13 2013 09:06:37 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1