]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_payouts.php
Added listing of sub id enhanced referral links in member area + used sub id in refer...
[mailer.git] / inc / modules / admin / what-list_payouts.php
index 00d5a450aaa4812f091ae4f6db164e48957c88ea..c52066f03f1029092a67dba65a01cfd7d738d4e3 100644 (file)
@@ -16,8 +16,8 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -43,15 +43,15 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 // Add description as navigation point
 addYouAreHereLink('admin', __FILE__);
 
-if (isGetRequestParameterSet('pid')) {
+if (isGetRequestElementSet('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(getRequestParameter('pid')), __FILE__, __LINE__);
+       $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__);
        list($userid, $tuserid, $points, $tstamp, $tpass) = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
 
        // Obtain some data
-       if (!isGetRequestParameterSet('task') && (!empty($userid)) && (isValidUserId($userid))) {
+       if (!isGetRequestElementSet('task') && (!empty($userid)) && (isValidUserId($userid))) {
                // 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`=%s LIMIT 1",
                        array(bigintval($userid), bigintval($tstamp)), __FILE__, __LINE__);
@@ -63,22 +63,22 @@ if (isGetRequestParameterSet('pid')) {
                displayMessage('{--ADMIN_PAYOUT_FAILED_OBTAIN_USERID--}');
        } else {
                // Get task id from URL
-               $taskId = getRequestParameter('task');
+               $taskId = getRequestElement('task');
        }
 
        if ((!empty($taskId)) && (!empty($userid)) && (isValidUserId($userid))) {
                // Load user's data
                if (!fetchUserData($userid)) {
                        // Abort here because it is not valid!
-                       debug_report_bug(__FILE__, __LINE__, 'No user account ' . $userid . ' found.');
+                       reportBug(__FILE__, __LINE__, 'No user account ' . $userid . ' found.');
                } // END - if
 
-               if ((getRequestParameter('do') == 'accept') && (getUserData('email') != '')) {
+               if ((getRequestElement('do') == 'accept') && (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(getRequestParameter('pid'))), __FILE__, __LINE__);
+                                       array(bigintval(getRequestElement('pid'))), __FILE__, __LINE__);
 
                                // Load ptype (id)
                                list($ptype) = SQL_FETCHROW($result);
@@ -89,7 +89,13 @@ if (isGetRequestParameterSet('pid')) {
                                if (!empty($ptype)) {
                                        // Obtain data from payout type
                                        $result = SQL_QUERY_ESC("SELECT
-       `from_account`,`from_pass`,`engine_url`,`engine_ret_ok`,`engine_ret_failed`,`pass_enc`,`allow_url`
+       `from_account`,
+       `from_pass`,
+       `engine_url`,
+       `engine_ret_ok`,
+       `engine_ret_failed`,
+       `pass_enc`,
+       `allow_url`
 FROM
        `{?_MYSQL_PREFIX?}_payout_types`
 WHERE
@@ -131,14 +137,14 @@ LIMIT 1",
                                                // Clear task
                                                if ($taskId > 0) {
                                                        runFilterChain('solve_task', $taskId);
-                                               }
+                                               } // END - if
 
                                                // Clear payout request
                                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_payouts` SET `status`='ACCEPTED' WHERE `id`=%s LIMIT 1",
-                                                       array(bigintval(getRequestParameter('pid'))), __FILE__, __LINE__);
+                                                       array(bigintval(getRequestElement('pid'))), __FILE__, __LINE__);
 
                                                // Send out mail
-                                               $message = loadEmailTemplate('member_payout_accepted', postRequestParameter('text'), $userid);
+                                               $message = loadEmailTemplate('member_payout_accepted', postRequestElement('text'), $userid);
 
                                                // Output message
                                                if ($data['allow_url'] == 'Y') {
@@ -164,14 +170,14 @@ LIMIT 1",
                                // Prepare content
                                $content = array(
                                        'task' => $taskId,
-                                       'pid'  => bigintval(getRequestParameter('pid')),
+                                       'pid'  => bigintval(getRequestElement('pid')),
                                        'user' => '<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">{%pipe,translateGender=' . getUserData('gender') . '%} ' . getUserData('surname') . ' ' . getUserData('family') . '</a>',
                                );
 
                                // Load template
                                loadTemplate('admin_payout_accept_form', false, $content);
                        }
-               } elseif ((getRequestParameter('do') == 'reject') && (getUserData('email') != '')) {
+               } elseif ((getRequestElement('do') == 'reject') && (getUserData('email') != '')) {
                        // Ok, now we can output the form or execute rejecting
                        if (isFormSent()) {
                                if ($taskId > 0) {
@@ -181,10 +187,10 @@ LIMIT 1",
 
                                // Clear payout request
                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_payouts` SET `status`='REJECTED' WHERE `id`=%s LIMIT 1",
-                                       array(bigintval(getRequestParameter('pid'))), __FILE__, __LINE__);
+                                       array(bigintval(getRequestElement('pid'))), __FILE__, __LINE__);
 
                                // Send out mail
-                               $message = loadEmailTemplate('member_payout_rejected', postRequestParameter('text'), $userid);
+                               $message = loadEmailTemplate('member_payout_rejected', postRequestElement('text'), $userid);
 
                                // Output message
                                displayMessage('{--ADMIN_PAYOUT_REJECTED_NOTIFIED--}');
@@ -195,7 +201,7 @@ LIMIT 1",
                                // Prepare content
                                $content = array(
                                        'task' => $taskId,
-                                       'pid'  => bigintval(getRequestParameter('pid')),
+                                       'pid'  => bigintval(getRequestElement('pid')),
                                        'user' => '<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">{%pipe,translateGender=' . getUserData('gender') . '%} ' . getUserData('surname') . ' ' . getUserData('family') . '</a>',
                                );
 
@@ -211,7 +217,7 @@ LIMIT 1",
                displayMessage('{--ADMIN_PAYOUT_FAILED_OBTAIN_TASK_ID--}');
        }
 } else {
-       if (getRequestParameter('do') == 'delete') {
+       if (getRequestElement('do') == 'delete') {
                // Delete all requests
                $result = SQL_QUERY("TRUNCATE `{?_MYSQL_PREFIX?}_user_payouts`", __FILE__, __LINE__);
        } // END - if