]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_payouts.php
fooRequestElementBar() functions renamed, adding of request parameters added:
[mailer.git] / inc / modules / admin / what-list_payouts.php
index 2ae26ae9ca5d9528c1e8c2dbb6a551f6756ef3ce..2c5e9ee051f41c803982418b1593b7a1e48bd321 100644 (file)
@@ -44,15 +44,15 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 // Add description as navigation point
 addMenuDescription('admin', __FILE__);
 
-if (isGetRequestElementSet(('pid'))) {
+if (isGetRequestParameterSet(('pid'))) {
        // First let's get the member's id
        $result = SQL_QUERY_ESC("SELECT userid, target_account, payout_total, payout_timestamp, password FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `id`=%s LIMIT 1",
-       array(getRequestElement('pid')), __FILE__, __LINE__);
+       array(getRequestParameter('pid')), __FILE__, __LINE__);
        list($userid, $tuserid, $points, $tstamp, $tpass) = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
 
        // Obtain some data
-       if (!isGetRequestElementSet(('task')) && (!empty($userid)) && ($userid > 0)) {
+       if (!isGetRequestParameterSet(('task')) && (!empty($userid)) && ($userid > 0)) {
                // Get task id from database
                $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `userid`=%s AND `task_type`='PAYOUT_REQUEST' AND task_created='".$tstamp."' LIMIT 1",
                array(bigintval($userid)), __FILE__, __LINE__);
@@ -64,7 +64,7 @@ if (isGetRequestElementSet(('pid'))) {
                loadTemplate('admin_settings_saved', false, getMessage('PAYOUT_FAILED_OBTAIN_USERID'));
        } else {
                // Get task id from URL
-               $task = getRequestElement('task');
+               $task = getRequestParameter('task');
        }
 
        if ((!empty($task)) && (!empty($userid)) && ($userid > 0)) {
@@ -74,12 +74,12 @@ if (isGetRequestElementSet(('pid'))) {
                        debug_report_bug('No user account ' . $userid . ' found.');
                } // END - if
 
-               if ((getRequestElement('do') == 'accept') && (!empty(getUserData('email')))) {
+               if ((getRequestParameter('do') == 'accept') && (!empty(getUserData('email')))) {
                        // Ok, now we can output the form or execute accepting
                        if (isFormSent()) {
                                // Obtain payout type and other data
                                $result = SQL_QUERY_ESC("SELECT `payout_id` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `id`=%s LIMIT 1",
-                                       array(bigintval(getRequestElement('pid'))), __FILE__, __LINE__);
+                                       array(bigintval(getRequestParameter('pid'))), __FILE__, __LINE__);
                                list($ptype) = SQL_FETCHROW($result);
                                SQL_FREERESULT($result);
 
@@ -132,10 +132,10 @@ LIMIT 1",
 
                                                // Clear payout request
                                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_payouts` SET `status`='ACCEPTED' WHERE `id`=%s LIMIT 1",
-                                                       array(bigintval(getRequestElement('pid'))), __FILE__, __LINE__);
+                                                       array(bigintval(getRequestParameter('pid'))), __FILE__, __LINE__);
 
                                                // Send out mail
-                                               $message = loadEmailTemplate('member_payout_accepted', postRequestElement('text'), $userid);
+                                               $message = loadEmailTemplate('member_payout_accepted', postRequestParameter('text'), $userid);
 
                                                // Output message
                                                if ($allow == 'Y') {
@@ -161,14 +161,14 @@ LIMIT 1",
                                // Prepare content
                                $content = array(
                                        'task' => $task,
-                                       'pid'  => bigintval(getRequestElement('pid')),
+                                       'pid'  => bigintval(getRequestParameter('pid')),
                                        'user' => '<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">' . translateGender(getUserData('gender')) . ' ' . getUserData('surname') . ' ' . getUserData('family') . '</a>',
                                );
 
                                // Load template
                                loadTemplate('admin_payout_accept_form', false, $content);
                        }
-               } elseif ((getRequestElement('do') == 'reject') && (!empty(getUserData('email')))) {
+               } elseif ((getRequestParameter('do') == 'reject') && (!empty(getUserData('email')))) {
                        // Ok, now we can output the form or execute rejecting
                        if (isFormSent()) {
                                if ($task > 0) {
@@ -178,10 +178,10 @@ LIMIT 1",
 
                                // Clear payout request
                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_payouts` SET `status`='REJECTED' WHERE `id`=%s LIMIT 1",
-                                       array(bigintval(getRequestElement('pid'))), __FILE__, __LINE__);
+                                       array(bigintval(getRequestParameter('pid'))), __FILE__, __LINE__);
 
                                // Send out mail
-                               $message = loadEmailTemplate('member_payout_rejected', postRequestElement('text'), $userid);
+                               $message = loadEmailTemplate('member_payout_rejected', postRequestParameter('text'), $userid);
 
                                // Output message
                                loadTemplate('admin_settings_saved', false, getMessage('PAYOUT_REJECTED_NOTIFIED'));
@@ -192,7 +192,7 @@ LIMIT 1",
                                // Prepare content
                                $content = array(
                                        'task' => $task,
-                                       'pid'  => bigintval(getRequestElement('pid')),
+                                       'pid'  => bigintval(getRequestParameter('pid')),
                                        'user' => '<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">' . translateGender(getUserData('gender')) . ' ' . getUserData('surname') . ' ' . getUserData('family') . '</a>',
                                );
 
@@ -208,7 +208,7 @@ LIMIT 1",
                loadTemplate('admin_settings_saved', false, getMessage('PAYOUT_FAILED_OBTAIN_TASK_ID'));
        }
 } else {
-       if (getRequestElement('do') == 'delete') {
+       if (getRequestParameter('do') == 'delete') {
                // Delete all requests
                $result = SQL_QUERY("TRUNCATE `{?_MYSQL_PREFIX?}_user_payouts`", __FILE__, __LINE__);
        } // END - if