X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_sponsor_pay.php;h=75dea69fb2d7431f5321fd923c246d5dcdcbb86b;hb=22f132c8d6314f76c69dff58ec0dac21f5ca3bf2;hp=eb33c3789fe549ea43347862383558a6c8ca7d7a;hpb=8f14df8c3232a31917df0ac57363dbd6e975c147;p=mailer.git diff --git a/inc/modules/admin/what-list_sponsor_pay.php b/inc/modules/admin/what-list_sponsor_pay.php index eb33c3789f..75dea69fb2 100644 --- a/inc/modules/admin/what-list_sponsor_pay.php +++ b/inc/modules/admin/what-list_sponsor_pay.php @@ -80,7 +80,7 @@ SET `pay_min_count`='%s', `pay_currency`='%s' WHERE - `id`='%s' + `id`=%s LIMIT 1", array( postRequestParameter('name', $id), @@ -92,17 +92,17 @@ LIMIT 1", } // Generate message - $message = getMessage('SPONSOR_PAY_ENTRIES_CHANGED'); + $message = '{--SPONSOR_PAY_ENTRIES_CHANGED--}'; } elseif (isFormSent('remove')) { // Remove entries here... foreach (postRequestParameter('id') as $id => $sel) { // Remove entry - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`='%s' LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); } // Generate message - $message = getMessage('SPONSOR_PAY_ENTRIES_REMOVED'); + $message = '{--SPONSOR_PAY_ENTRIES_REMOVED--}'; } if (!empty($message)) { @@ -139,25 +139,14 @@ if (isFormSent('add')) { loadTemplate('admin_settings_saved', false, $message); } elseif ((isFormSent('edit')) || (isFormSent('del'))) { // Load all data - $OUT = ''; $SW = 2; + $OUT = ''; foreach (postRequestParameter('id') as $id => $sel) { // Load entry - $result = SQL_QUERY_ESC("SELECT `pay_name`, `pay_rate`, `pay_min_count`, `pay_currency` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `id`, `pay_name`, `pay_rate`, `pay_min_count`, `pay_currency` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load data - list($name, $rate, $min, $curr) = SQL_FETCHROW($result); - SQL_FREERESULT($result); - - // Transfer data to array - $content = array( - 'id' => bigintval($id), - 'sw' => bigintval($SW), - 'name' => htmlspecialchars($name), - 'rate' => translateComma($rate), - 'min' => bigintval($min), - 'curr' => htmlspecialchars($curr) - ); + $content = SQL_FETCHARRAY($result); if (isFormSent('edit')) { // Edit entry @@ -171,8 +160,8 @@ if (isFormSent('add')) { $OUT .= loadTemplate('admin_list_sponsor_pay_404', true, $id); } - // Switch colors - $SW = 3 - $SW; + // Free result + SQL_FREERESULT($result); } // END - foreach // Load main template depending on mode (edit/delete) @@ -194,34 +183,21 @@ ORDER BY __FILE__, __LINE__); // Do we have some paytypes setup? - if (SQL_NUMROWS($result) > 0) { + if (!SQL_HASZERONUMS($result)) { // Prepare variables for listing - $OUT = ''; $SW = 2; + $OUT = ''; // List alle found payment types while ($content = SQL_FETCHARRAY($result)) { - // Remember data in array - $content = array( - 'sw' => $SW, - 'id' => $content['id'], - 'name' => $content['pay_name'], - 'rate' => translateComma($content['pay_rate']), - 'min' => $content['pay_min_count'], - 'currency' => $content['pay_currency'] - ); - // Add row $OUT .= loadTemplate('admin_list_sponsor_pay_row', true, $content); - - // Switch colors - $SW = 3 - $SW; } // END - while // Load list template $content['list_out'] = loadTemplate('admin_list_sponsor_pay', true, $OUT); } else { // Noting setup so far! - $content['list_out'] = loadTemplate('admin_settings_saved', true, getMessage('ADMIN_SPONSOR_NO_PAYTYPES')); + $content['list_out'] = loadTemplate('admin_settings_saved', true, '{--ADMIN_SPONSOR_NO_PAYTYPES--}'); } // Free memory