-if ((REQUEST_ISSET_POST('edit')) && (countPostSelection() > 0)) {
- // Edit payout types
- if ((REQUEST_ISSET_GET('ok')) && (REQUEST_GET('ok') == 'ok')) {
- // Init SQLs
- INIT_SQLS();
-
- // Edit entries
- foreach (REQUEST_POST('sel') as $id => $sel) {
- // Secure ID
- $id = bigintval($id);
-
- // Edit only if something is entered
- if ((REQUEST_ISSET_POST('title', $id)) && (REQUEST_POST('rate', $id) > 0)) {
- // Update entry
- ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_payout_types` SET
-type='%s',
-rate=%s,
-min_points=%s,
-allow_url='%s'
-WHERE `id`='".$id."' LIMIT 1",
- array(
- REQUEST_POST('title', $id),
- convertCommaToDot(REQUEST_POST('rate', $id)),
- convertCommaToDot(REQUEST_POST('mpoi' , $id)),
- REQUEST_POST('allow', $id),
- ),__FILE__, __LINE__, false));
- }
- }
-
- // Run all SQLs
- runFilterChain('run_sqls');
-
- // Get message
- $message = getMessage('ADMIN_PAYOUT_ENTRIES_CHANGED');
- } else {
- $display = false; //Suppress any other outputs
- $OUT = ''; $SW = 2;
- foreach (REQUEST_POST('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",
+if ((isFormSent('edit')) && (ifPostContainsSelections())) {
+ // Make payouts configurable
+ $display = false; //Suppress any other outputs
+ $OUT = '';
+ foreach (postRequestElement('sel') as $id => $sel) {
+ // Load data
+ $result = SQL_QUERY_ESC("SELECT `id`,`type`,`rate`,`min_points`,`allow_url` FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE `id`=%s LIMIT 1",