33 if(!isset(self::$_instance))
57 $result = $this->db->query(
'SELECT settings_id FROM payment_settings');
66 $this->settings_id = $a_settings_id;
71 return $this->settings_id;
76 return $this->settings[$a_type];
86 $statement = $this->db->manipulateF(
'
87 UPDATE payment_settings
88 SET currency_unit = %s,
89 currency_subunit = %s,
94 topics_sorting_type = %s,
95 topics_sorting_direction = %s,
96 topics_allow_custom_sorting = %s,
99 hide_advanced_search = %s,
103 WHERE settings_id = %s',
148 if(!$a_values[
'currency_unit']) $a_values[
'currency_unit'] = NULL;
149 if(!$a_values[
'currency_subunit']) $a_values[
'currency_subunit'] = NULL;
150 if(!$a_values[
'address']) $a_values[
'address'] = NULL;
151 if(!$a_values[
'bank_data']) $a_values[
'bank_data'] = NULL;
152 if(!$a_values[
'add_info']) $a_values[
'add_info'] = NULL;
153 if(!$a_values[
'pdf_path']) $a_values[
'pdf_path'] = NULL;
155 if(!$a_values[
'topics_allow_custom_sorting']) $a_values[
'topics_allow_custom_sorting'] = 0;
156 if(!$a_values[
'topics_sorting_type']) $a_values[
'topics_sorting_type'] = 0;
157 if(!$a_values[
'topics_sorting_direction']) $a_values[
'topics_sorting_direction'] = NULL;
158 if(!$a_values[
'shop_enabled']) $a_values[
'shop_enabled'] = 0;
159 if(!$a_values[
'max_hits']) $a_values[
'max_hits'] = 0;
160 if(!$a_values[
'hide_advanced_search']) $a_values[
'hide_advanced_search'] = 0;
161 if(!$a_values[
'hide_filtering']) $a_values[
'hide_filtering'] = 0;
162 if(!$a_values[
'hide_coupons']) $a_values[
'hide_coupons'] = 0;
163 if(!$a_values[
'hide_news']) $a_values[
'hide_news'] = 0;
166 $statement = $this->db->manipulateF(
'
167 UPDATE payment_settings
168 SET currency_unit = %s,
169 currency_subunit = %s,
174 topics_sorting_type = %s,
175 topics_sorting_direction = %s,
176 topics_allow_custom_sorting = %s,
179 hide_advanced_search = %s,
183 WHERE settings_id = %s',
201 $a_values[
'currency_unit'],
202 $a_values[
'currency_subunit'],
203 $a_values[
'address'],
204 $a_values[
'bank_data'],
205 $a_values[
'add_info'],
206 $a_values[
'pdf_path'],
207 $a_values[
'topics_sorting_type'],
208 $a_values[
'topics_sorting_direction'],
209 $a_values[
'topics_allow_custom_sorting'],
210 $a_values[
'max_hits'],
211 $a_values[
'shop_enabled'],
212 $a_values[
'hide_advanced_search'],
213 $a_values[
'hide_filtering'],
214 $a_values[
'hide_coupons'],
215 $a_values[
'hide_news'],
223 if(!$a_values[
'currency_unit']) $a_values[
'currency_unit'] = NULL;
224 if(!$a_values[
'currency_subunit']) $a_values[
'currency_subunit'] = NULL;
225 if(!$a_values[
'address']) $a_values[
'address'] = NULL;
226 if(!$a_values[
'bank_data']) $a_values[
'bank_data'] = NULL;
227 if(!$a_values[
'add_info']) $a_values[
'add_info'] = NULL;
229 if(!$a_values[
'pdf_path']) $a_values[
'pdf_path'] = NULL;
231 if(!$a_values[
'topics_allow_custom_sorting']) $a_values[
'topics_allow_custom_sorting'] = 0;
232 if(!$a_values[
'topics_sorting_type']) $a_values[
'topics_sorting_type'] = 0;
233 if(!$a_values[
'topics_sorting_direction']) $a_values[
'topics_sorting_direction'] = NULL;
234 if(!$a_values[
'shop_enabled']) $a_values[
'shop_enabled'] = 0;
235 if(!$a_values[
'max_hits']) $a_values[
'max_hits'] = 0;
236 if(!$a_values[
'hide_advanced_search']) $a_values[
'hide_advanced_search'] = 0;
237 if(!$a_values[
'hide_filtering']) $a_values[
'hide_filtering'] = 0;
238 if(!$a_values[
'hide_coupons']) $a_values[
'hide_coupons'] = 0;
239 if(!$a_values[
'hide_news']) $a_values[
'hide_news'] = 0;
242 $next_id = $ilDB->nextId(
'payment_settings');
243 $statement = $this->db->manipulateF(
'
244 INSERT INTO payment_settings
252 topics_allow_custom_sorting,
254 topics_sorting_direction,
257 hide_advanced_search,
262 VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)',
281 $a_values[
'currency_unit'],
282 $a_values[
'currency_subunit'],
283 $a_values[
'address'],
284 $a_values[
'bank_data'],
285 $a_values[
'add_info'],
286 $a_values[
'pdf_path'],
287 $a_values[
'topics_allow_custom_sorting'],
288 $a_values[
'topics_sorting_type'],
289 $a_values[
'topics_sorting_direction'],
290 $a_values[
'shop_enabled'],
291 $a_values[
'max_hits'],
292 $a_values[
'hide_advanced_search'],
293 $a_values[
'hide_filtering'],
294 $a_values[
'hide_coupons'],
295 $a_values[
'hide_news']
309 $result = $this->db->query(
'SELECT * FROM payment_settings');
314 $data[
'currency_unit'] =
$row->currency_unit;
315 $data[
'currency_subunit'] =
$row->currency_subunit;
320 $data[
'topics_allow_custom_sorting'] =
$row->topics_allow_custom_sorting;
321 $data[
'topics_sorting_type'] =
$row->topics_sorting_type;
322 $data[
'topics_sorting_direction'] =
$row->topics_sorting_direction;
324 $data[
'shop_enabled'] =
$row->shop_enabled;
325 $data[
'hide_advanced_search'] =
$row->hide_advanced_search;
326 $data[
'hide_filtering'] =
$row->hide_filtering;
327 $data[
'hide_coupons'] =
$row->hide_coupons;
330 $this->settings =
$data;