13 if(!isset(self::$_instance))
37 $result = $this->db->query(
'SELECT settings_id FROM payment_settings');
46 $this->settings_id = $a_settings_id;
51 return $this->settings_id;
54 public function get($a_type)
56 return $this->settings[$a_type];
66 $statement = $this->db->manipulateF(
'
67 UPDATE payment_settings
68 SET currency_unit = %s,
69 currency_subunit = %s,
74 topics_sorting_type = %s,
75 topics_sorting_direction = %s,
76 topics_allow_custom_sorting = %s,
79 hide_advanced_search = %s,
80 objects_allow_custom_sorting = %s,
83 WHERE settings_id = %s',
128 if(!$a_values[
'currency_unit']) $a_values[
'currency_unit'] = NULL;
129 if(!$a_values[
'currency_subunit']) $a_values[
'currency_subunit'] = NULL;
130 if(!$a_values[
'address']) $a_values[
'address'] = NULL;
131 if(!$a_values[
'bank_data']) $a_values[
'bank_data'] = NULL;
132 if(!$a_values[
'add_info']) $a_values[
'add_info'] = NULL;
133 if(!$a_values[
'pdf_path']) $a_values[
'pdf_path'] = NULL;
135 if(!$a_values[
'topics_allow_custom_sorting']) $a_values[
'topics_allow_custom_sorting'] = 0;
136 if(!$a_values[
'topics_sorting_type']) $a_values[
'topics_sorting_type'] = 0;
137 if(!$a_values[
'topics_sorting_direction']) $a_values[
'topics_sorting_direction'] = NULL;
138 if(!$a_values[
'shop_enabled']) $a_values[
'shop_enabled'] = 0;
139 if(!$a_values[
'max_hits']) $a_values[
'max_hits'] = 0;
140 if(!$a_values[
'hide_advanced_search']) $a_values[
'hide_advanced_search'] = 0;
141 if(!$a_values[
'objects_allow_custom_sorting']) $a_values[
'objects_allow_custom_sorting'] = 0;
142 if(!$a_values[
'hide_coupons']) $a_values[
'hide_coupons'] = 0;
143 if(!$a_values[
'hide_news']) $a_values[
'hide_news'] = 0;
146 $statement = $this->db->manipulateF(
'
147 UPDATE payment_settings
148 SET currency_unit = %s,
149 currency_subunit = %s,
154 topics_sorting_type = %s,
155 topics_sorting_direction = %s,
156 topics_allow_custom_sorting = %s,
159 hide_advanced_search = %s,
160 objects_allow_custom_sorting = %s,
163 WHERE settings_id = %s',
181 $a_values[
'currency_unit'],
182 $a_values[
'currency_subunit'],
183 $a_values[
'address'],
184 $a_values[
'bank_data'],
185 $a_values[
'add_info'],
186 $a_values[
'pdf_path'],
187 $a_values[
'topics_sorting_type'],
188 $a_values[
'topics_sorting_direction'],
189 $a_values[
'topics_allow_custom_sorting'],
190 $a_values[
'max_hits'],
191 $a_values[
'shop_enabled'],
192 $a_values[
'hide_advanced_search'],
193 $a_values[
'objects_allow_custom_sorting'],
194 $a_values[
'hide_coupons'],
195 $a_values[
'hide_news'],
203 if(!$a_values[
'currency_unit']) $a_values[
'currency_unit'] = NULL;
204 if(!$a_values[
'currency_subunit']) $a_values[
'currency_subunit'] = NULL;
205 if(!$a_values[
'address']) $a_values[
'address'] = NULL;
206 if(!$a_values[
'bank_data']) $a_values[
'bank_data'] = NULL;
207 if(!$a_values[
'add_info']) $a_values[
'add_info'] = NULL;
209 if(!$a_values[
'pdf_path']) $a_values[
'pdf_path'] = NULL;
211 if(!$a_values[
'topics_allow_custom_sorting']) $a_values[
'topics_allow_custom_sorting'] = 0;
212 if(!$a_values[
'topics_sorting_type']) $a_values[
'topics_sorting_type'] = 0;
213 if(!$a_values[
'topics_sorting_direction']) $a_values[
'topics_sorting_direction'] = NULL;
214 if(!$a_values[
'shop_enabled']) $a_values[
'shop_enabled'] = 0;
215 if(!$a_values[
'max_hits']) $a_values[
'max_hits'] = 0;
216 if(!$a_values[
'hide_advanced_search']) $a_values[
'hide_advanced_search'] = 0;
217 if(!$a_values[
'objects_allow_custom_sorting']) $a_values[
'objects_allow_custom_sorting'] = 0;
218 if(!$a_values[
'hide_coupons']) $a_values[
'hide_coupons'] = 0;
219 if(!$a_values[
'hide_news']) $a_values[
'hide_news'] = 0;
222 $next_id = $ilDB->nextId(
'payment_settings');
223 $statement = $this->db->manipulateF(
'
224 INSERT INTO payment_settings
232 topics_allow_custom_sorting,
234 topics_sorting_direction,
237 hide_advanced_search,
238 objects_allow_custom_sorting,
242 VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)',
261 $a_values[
'currency_unit'],
262 $a_values[
'currency_subunit'],
263 $a_values[
'address'],
264 $a_values[
'bank_data'],
265 $a_values[
'add_info'],
266 $a_values[
'pdf_path'],
267 $a_values[
'topics_allow_custom_sorting'],
268 $a_values[
'topics_sorting_type'],
269 $a_values[
'topics_sorting_direction'],
270 $a_values[
'shop_enabled'],
271 $a_values[
'max_hits'],
272 $a_values[
'hide_advanced_search'],
273 $a_values[
'objects_allow_custom_sorting'],
274 $a_values[
'hide_coupons'],
275 $a_values[
'hide_news']
289 $result = $this->db->query(
'SELECT * FROM payment_settings');
294 $data[
'currency_unit'] =
$row->currency_unit;
295 $data[
'currency_subunit'] =
$row->currency_subunit;
300 $data[
'topics_allow_custom_sorting'] =
$row->topics_allow_custom_sorting;
301 $data[
'topics_sorting_type'] =
$row->topics_sorting_type;
302 $data[
'topics_sorting_direction'] =
$row->topics_sorting_direction;
304 $data[
'shop_enabled'] =
$row->shop_enabled;
305 $data[
'hide_advanced_search'] =
$row->hide_advanced_search;
306 $data[
'objects_allow_custom_sorting'] =
$row->objects_allow_custom_sorting;
307 $data[
'hide_coupons'] =
$row->hide_coupons;
310 $this->settings =
$data;
317 $res = $ilDB->query(
'SELECT shop_enabled FROM payment_settings');
320 return $row[
'shop_enabled'];