hpdl
|
1
|
1
|
<?php
|
|
2
|
/*
|
mattice
|
151
|
3
|
$Id: configuration.php 758 2006-08-23 12:30:07Z hpdl $
|
hpdl
|
1
|
4
|
|
|
5
|
osCommerce, Open Source E-Commerce Solutions
|
|
6
|
http://www.oscommerce.com
|
|
7
|
|
hpdl
|
410
|
8
|
Copyright (c) 2006 osCommerce
|
hpdl
|
1
|
9
|
|
|
10
|
Released under the GNU General Public License
|
|
11
|
*/
|
|
12
|
|
|
13
|
require('includes/application_top.php');
|
|
14
|
|
|
15
|
$action = (isset($_GET['action']) ? $_GET['action'] : '');
|
|
16
|
|
|
17
|
if (!isset($_GET['gID']) || (isset($_GET['gID']) && !is_numeric($_GET['gID']))) {
|
|
18
|
$_GET['gID'] = 1;
|
|
19
|
}
|
|
20
|
|
|
21
|
if (!empty($action)) {
|
|
22
|
switch ($action) {
|
|
23
|
case 'save':
|
|
24
|
if (isset($_GET['cID']) && is_numeric($_GET['cID'])) {
|
|
25
|
$Qupdate = $osC_Database->query('update :table_configuration set configuration_value = :configuration_value, last_modified = now() where configuration_id = :configuration_id');
|
|
26
|
$Qupdate->bindTable(':table_configuration', TABLE_CONFIGURATION);
|
|
27
|
$Qupdate->bindValue(':configuration_value', $_POST['configuration_value']);
|
|
28
|
$Qupdate->bindInt(':configuration_id', $_GET['cID']);
|
|
29
|
$Qupdate->execute();
|
|
30
|
|
|
31
|
if ($Qupdate->affectedRows()) {
|
|
32
|
osC_Cache::clear('configuration');
|
|
33
|
|
|
34
|
$osC_MessageStack->add_session('header', SUCCESS_DB_ROWS_UPDATED, 'success');
|
|
35
|
} else {
|
|
36
|
$osC_MessageStack->add_session('header', WARNING_DB_ROWS_NOT_UPDATED, 'warning');
|
|
37
|
}
|
|
38
|
}
|
|
39
|
|
hpdl
|
758
|
40
|
osc_redirect(osc_href_link_admin(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $_GET['cID']));
|
hpdl
|
1
|
41
|
break;
|
|
42
|
}
|
|
43
|
}
|
|
44
|
|
|
45
|
$page_contents = 'configuration.php';
|
|
46
|
|
|
47
|
require('templates/default.php');
|
|
48
|
|
|
49
|
require('includes/application_bottom.php');
|
|
50
|
?>
|