X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_payouts.php;h=b846eb8b56352f3925ca4d6267d15375ff2ecb67;hb=98b92ea5ba992a63304091fa1b57f477befffc22;hp=4f4d42c43dcd57fbcceeccaca77b2133fbedfb88;hpb=04b69ac9f33369cbf654396c4a42cb1fff710ff4;p=mailer.git
diff --git a/inc/modules/admin/what-list_payouts.php b/inc/modules/admin/what-list_payouts.php
index 4f4d42c43d..b846eb8b56 100644
--- a/inc/modules/admin/what-list_payouts.php
+++ b/inc/modules/admin/what-list_payouts.php
@@ -45,7 +45,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-if (isGetRequestParameterSet(('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(getRequestParameter('pid')), __FILE__, __LINE__);
@@ -53,29 +53,29 @@ if (isGetRequestParameterSet(('pid'))) {
SQL_FREERESULT($result);
// Obtain some data
- if (!isGetRequestParameterSet(('task')) && (!empty($userid)) && ($userid > 0)) {
+ if (!isGetRequestParameterSet('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__);
- list($task) = SQL_FETCHROW($result);
+ list($taskId) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- if (empty($task)) $task = '0';
+ if (empty($taskId)) $taskId = '0';
} elseif ((empty($userid)) || ($userid == '0')) {
// Cannot obtain member id!
loadTemplate('admin_settings_saved', false, '{--ADMIN_PAYOUT_FAILED_OBTAIN_USERID--}');
} else {
// Get task id from URL
- $task = getRequestParameter('task');
+ $taskId = getRequestParameter('task');
}
- if ((!empty($task)) && (!empty($userid)) && ($userid > 0)) {
+ 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.');
} // END - if
- if ((getRequestParameter('do') == 'accept') && (!empty(getUserData('email')))) {
+ if ((getRequestParameter('do') == 'accept') && (getUserData('email') != '')) {
// Ok, now we can output the form or execute accepting
if (isFormSent()) {
// Obtain payout type and other data
@@ -117,7 +117,7 @@ LIMIT 1",
$data['from_pass'] = base64_encode($data['from_pass']);
$tpass = base64_encode($tpass);
break;
- }
+ } // END - switch
// Transfer variables...
$reason = encodeString(getMessage('ADMIN_PAYOUT_REASON'), false);
@@ -131,8 +131,8 @@ LIMIT 1",
if ($ret[0] == $data['engine_ret_ok']) {
// Clear task
- if ($task > 0) {
- runFilterChain('solve_task', $task);
+ if ($taskId > 0) {
+ runFilterChain('solve_task', $taskId);
}
// Clear payout request
@@ -152,7 +152,7 @@ LIMIT 1",
}
// Finally send mail
- sendEmail(getUserData('email'), getMessage('MEMBER_PAYOUT_ACCEPTED_SUBJECT'), $message);
+ sendEmail(getUserData('email'), '{--MEMBER_PAYOUT_ACCEPTED_SUBJECT--}', $message);
} else {
// Something goes wrong... :-(
$content = implode('
', $ret);
@@ -165,7 +165,7 @@ LIMIT 1",
} else {
// Prepare content
$content = array(
- 'task' => $task,
+ 'task' => $taskId,
'pid' => bigintval(getRequestParameter('pid')),
'user' => '' . translateGender(getUserData('gender')) . ' ' . getUserData('surname') . ' ' . getUserData('family') . '',
);
@@ -173,12 +173,12 @@ LIMIT 1",
// Load template
loadTemplate('admin_payout_accept_form', false, $content);
}
- } elseif ((getRequestParameter('do') == 'reject') && (!empty(getUserData('email')))) {
+ } elseif ((getRequestParameter('do') == 'reject') && (getUserData('email') != '')) {
// Ok, now we can output the form or execute rejecting
if (isFormSent()) {
- if ($task > 0) {
+ if ($taskId > 0) {
// Clear task
- runFilterChain('solve_task', $task);
+ runFilterChain('solve_task', $taskId);
} // END - if
// Clear payout request
@@ -192,11 +192,11 @@ LIMIT 1",
loadTemplate('admin_settings_saved', false, '{--ADMIN_PAYOUT_REJECTED_NOTIFIED--}');
// Finally send mail
- sendEmail(getUserData('email'), getMessage('MEMBER_PAYOUT_REJECTED_SUBJECT'), $message);
+ sendEmail(getUserData('email'), '{--MEMBER_PAYOUT_REJECTED_SUBJECT--}', $message);
} else {
// Prepare content
$content = array(
- 'task' => $task,
+ 'task' => $taskId,
'pid' => bigintval(getRequestParameter('pid')),
'user' => '' . translateGender(getUserData('gender')) . ' ' . getUserData('surname') . ' ' . getUserData('family') . '',
);
@@ -208,7 +208,7 @@ LIMIT 1",
// Cannot load user data
loadTemplate('admin_settings_saved', false, '{--ADMIN_PAYOUT_FAILED_OBTAIN_USERDATA--}');
}
- } elseif ((empty($task)) || ($task == '0')) {
+ } elseif ((empty($taskId)) || ($taskId == '0')) {
// Failed loading task id
loadTemplate('admin_settings_saved', false, '{--ADMIN_PAYOUT_FAILED_OBTAIN_TASK_ID--}');
}
@@ -233,9 +233,9 @@ ON
ORDER BY
p.payout_timestamp DESC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List found payouts
- $OUT = ''; $SW = 2;
+ $OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
if ($content['status'] == 'NEW') {
// Generate links for direct accepting and rejecting
@@ -243,7 +243,6 @@ ORDER BY
} else {
// Translate status
$content['status'] = translatePayoutStatus($content['status']);
- $content['status'] = '