X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-config_rallye_prices.php;h=d2d36055e7ff346c00c9473bda1b28554e68dd42;hb=e1235e719b767d6693976c3d24489beaa38a3667;hp=7b606ece565a664b7d8dd8a4c4b27c9094833e32;hpb=f2a8b20c4b6feeda4362d6b2c7c17839d23599a8;p=mailer.git
diff --git a/inc/modules/admin/what-config_rallye_prices.php b/inc/modules/admin/what-config_rallye_prices.php
index 7b606ece56..d2d36055e7 100644
--- a/inc/modules/admin/what-config_rallye_prices.php
+++ b/inc/modules/admin/what-config_rallye_prices.php
@@ -1,7 +1,7 @@
0) {
+ if (countPostSelection() > 0) {
// Delete selected entries
foreach (postRequestElement('sel') as $id => $sel) {
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
@@ -93,14 +92,23 @@ VALUES ('%s','%s','%s','%s')",
$id = bigintval($id);
// Update entry
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_prices` SET rallye_id=%s, price_`level`='%s', points='%s', info='%s' WHERE `id`=%s LIMIT 1",
- array(
- postRequestElement('rallye_id', $id),
- bigintval($level),
- postRequestElement('points', $id),
- postRequestElement('infos', $id),
- $id
- ), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE
+ `{?_MYSQL_PREFIX?}_rallye_prices`
+SET
+ `rallye_id`=%s,
+ `price_level`=%d,
+ `points`=%s,
+ `info`='%s'
+WHERE
+ `id`=%s
+LIMIT 1",
+ array(
+ postRequestElement('rallye_id', $id),
+ bigintval($level),
+ postRequestElement('points', $id),
+ postRequestElement('infos', $id),
+ $id
+ ), __FILE__, __LINE__);
}
// Output message
@@ -109,14 +117,13 @@ VALUES ('%s','%s','%s','%s')",
if (isPostRequestElementSet('edit')) {
// Check if at last one line is selected
- $SEL = countPostSelection();
- if ($SEL > 0) {
+ if (countPostSelection() > 0) {
// Make selected editable
$OUT = ''; $SW = 2;
foreach (postRequestElement('sel') as $id => $sel) {
// Load data to selected rallye
$result = SQL_QUERY_ESC("SELECT rallye_id, price_level, points, info FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
+ array(bigintval($id)), __FILE__, __LINE__);
list($rallye, $level, $points, $infos) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
@@ -124,7 +131,7 @@ VALUES ('%s','%s','%s','%s')",
$content = array(
'sw' => $SW,
'id' => $id,
- 'rallyes' => generateOptionList("rallye_data", 'id', "title", $rallye),
+ 'rallyes' => generateOptionList('rallye_data', 'id', 'title', $rallye),
'level' => $level,
'points' => $points,
'infos' => $infos,
@@ -143,19 +150,18 @@ VALUES ('%s','%s','%s','%s')",
loadTemplate('admin_config_rallye_edit', false, $content);
} else {
// Nothing selected
- $content = sprintf(getMessage('RALLYE_NO_PRICES_SELECTED'), "", "");
+ $content = sprintf(getMessage('RALLYE_NO_PRICES_SELECTED'), "", "");
loadTemplate('admin_settings_saved', false, $content);
}
} elseif (isPostRequestElementSet('del')) {
// Check if at last one line is selected
- $SEL = countPostSelection();
- if ($SEL > 0) {
+ if (countPostSelection() > 0) {
// List all prices
$OUT = ''; $SW = 2;
foreach (postRequestElement('sel') as $id => $sel) {
// Load data to selected rallye
- $result = SQL_QUERY_ESC("SELECT rallye_id, price_level, points, info FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `rallye_id`, `price_level`, `points`, `info` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
+ array(bigintval($id)), __FILE__, __LINE__);
list($rallye, $level, $points, $infos) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
@@ -183,7 +189,7 @@ VALUES ('%s','%s','%s','%s')",
loadTemplate('admin_config_rallye_del', false, $content);
} else {
// Nothing selected
- $content = "{--RALLYE_NO_PRICES_SELECTED_1--}{--RALLYE_NO_PRICES_SELECTED_2--}{--RALLYE_NO_PRICES_SELECTED_3--}";
+ $content = "{--RALLYE_NO_PRICES_SELECTED_1--}{--RALLYE_NO_PRICES_SELECTED_2--}{--RALLYE_NO_PRICES_SELECTED_3--}";
loadTemplate('admin_settings_saved', false, $content);
}
} else {