- // Get message
- $message = '{--ADMIN_PAYOUT_ENTRIES_CHANGED--}';
- } else {
- $display = false; //Suppress any other outputs
- $OUT = '';
- foreach (postRequestParameter('sel') as $id => $sel) {
- // Load data
- $result = SQL_QUERY_ESC("SELECT type, rate, min_points, allow_url FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE `id`=%s LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
- list($title, $rate, $min_points, $allow) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
-
- // Prepare data for the row template
- $content = array(
- 'id' => $id,
- 'title' => $title,
- 'rate' => translateComma($rate),
- 'min_points' => translateComma($min_points),
- 'allow' => addSelectionBox('yn', $allow, 'allow[' . $id . ']'),
- );
-
- // Load row template and switch color
- $OUT .= loadTemplate('admin_config_payouts_edit_row', true, $content);
- } // END - foreach
-
- // Load main template
- loadTemplate('admin_config_payouts_edit', false, $OUT);
- }
-} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
- // Delete payout types
- if ((isGetRequestParameterSet('ok')) && (getRequestParameter('ok') == 'ok')) {
- // Init SQLs
- initSqls();
-
- // Delete entries
- foreach (postRequestParameter('sel') as $id => $sel) {
- addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE `id`=%s LIMIT 1",
+ // Get message
+ $message = '{--ADMIN_PAYOUT_ENTRIES_CHANGED--}';
+} elseif ((isFormSent('delete')) && (ifPostContainsSelections())) {
+ $display = false; //Suppress any other outputs
+ $OUT = '';
+ foreach (postRequestElement('sel') as $id => $sel) {
+ // Secure id number
+ $id = bigintval($id);
+
+ // Load data
+ $result = SQL_QUERY_ESC("SELECT `id`,`type`,`rate`,`min_points` FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE `id`=%s LIMIT 1",
+ array($id), __FILE__, __LINE__);
+ $content = SQL_FETCHARRAY($result);
+ SQL_FREERESULT($result);
+
+ // Load row template and switch color
+ $OUT .= loadTemplate('admin_delete_payouts_row', true, $content);
+ } // END - foreach
+
+ // Load main template
+ loadTemplate('admin_delete_payouts', false, $OUT);
+} elseif ((isFormSent('do_delete')) && (ifPostContainsSelections())) {
+ // Init SQLs
+ initSqls();
+
+ // Delete entries
+ foreach (postRequestElement('sel') as $id => $sel) {
+ addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE `id`=%s LIMIT 1",