-$result_mem = SQL_QUERY("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `status`='NEW' ORDER BY payout_timestamp DESC", __FILE__, __LINE__);
-
-$display = true;
-if ((isPostRequestElementSet('edit')) && (countPostSelection() > 0)) {
- // Edit payout types
- if ((isGetRequestElementSet('ok')) && (getRequestElement('ok') == 'ok')) {
- // Init SQLs
- initSqls();
-
- // Edit entries
- foreach (postRequestElement('sel') as $id => $sel) {
- // Secure id
- $id = bigintval($id);
-
- // Edit only if something is entered
- if ((isPostRequestElementSet('title', $id)) && (postRequestElement('rate', $id) > 0)) {
- // Update entry
- addSql(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(
- postRequestElement('title', $id),
- convertCommaToDot(postRequestElement('rate', $id)),
- convertCommaToDot(postRequestElement('min_points' , $id)),
- postRequestElement('allow', $id),
- ),__FILE__, __LINE__, false));
- }
- }
+$result_mem = sqlQuery("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `status`='NEW' ORDER BY payout_timestamp DESC", __FILE__, __LINE__);
+
+$display = TRUE;
+if ((isFormSent('edit')) && (ifPostContainsSelections())) {
+ // Make payouts configurable
+ $display = FALSE; //Suppress any other outputs
+ $OUT = '';
+ foreach (postRequestElement('sel') as $id => $sel) {
+ // Load data
+ $result = sqlQueryEscaped("SELECT `id`, `type`, `rate`, `min_points`, `allow_url` FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE `id`=%s LIMIT 1",
+ array(bigintval($id)), __FILE__, __LINE__);
+ $content = sqlFetchArray($result);
+ sqlFreeResult($result);