}
// 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) {
}
// Generate message
- $message = getMessage('SPONSOR_PAY_ENTRIES_REMOVED');
+ $message = '{--SPONSOR_PAY_ENTRIES_REMOVED--}';
}
if (!empty($message)) {
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
$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)
__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