X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_payouts.php;h=289dd508ed21434102a41d411f20a049560107e3;hb=2142149f3f72f1a2476f95a87937c044d63bbaf2;hp=3a646ac64d213b06ee3d500a99eae2664337a1e0;hpb=d0ab0382dd73638f0bc13a1a3d6f117ec11a203e;p=mailer.git
diff --git a/inc/modules/admin/what-list_payouts.php b/inc/modules/admin/what-list_payouts.php
index 3a646ac64d..289dd508ed 100644
--- a/inc/modules/admin/what-list_payouts.php
+++ b/inc/modules/admin/what-list_payouts.php
@@ -32,53 +32,47 @@
************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
-{
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
}
+
// Add description as navigation point
-ADD_DESCR("admin", basename(__FILE__));
+ADD_DESCR("admin", __FILE__);
if (!empty($_GET['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=%d LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT userid, target_account, payout_total, payout_timestamp, password FROM "._MYSQL_PREFIX."_user_payouts WHERE id=%s LIMIT 1",
array($_GET['pid']), __FILE__, __LINE__);
list($uid, $tuid, $points, $tstamp, $tpass) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
// Obtain some data
- if (empty($_GET['task']) && (!empty($uid)) && ($uid > 0))
- {
+ if (empty($_GET['task']) && (!empty($uid)) && ($uid > 0)) {
// Get task ID from database
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE userid=%d AND task_type='PAYOUT_REQUEST' AND task_created='".$tstamp."' LIMIT 1",
+ $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($uid)), __FILE__, __LINE__);
list($task) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- if (empty($task)) $task = "0";
-
- }
- elseif ((empty($uid)) || ($uid == "0"))
- {
+ if (empty($task)) $task = 0;
+ } elseif ((empty($uid)) || ($uid == "0")) {
// Cannot obtain member ID!
LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_FAILED_OBTAIN_USERID);
- }
- else
- {
+ } else {
// Get task ID from URL
$task = $_GET['task'];
}
- if ((!empty($task)) && (!empty($uid)) && ($uid > 0))
- {
+
+ if ((!empty($task)) && (!empty($uid)) && ($uid > 0)) {
// Load user's data
- $result = SQL_QUERY_ESC("SELECT email, sex, surname, family FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT email, gender, surname, family FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
array(bigintval($uid)), __FILE__, __LINE__);
- list($email, $sex, $surname, $family) = SQL_FETCHROW($result);
+ list($email, $gender, $surname, $family) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
// Konstante bauen
- define('PAYOUT_USERDATA_VALUE', "".TRANSLATE_SEX($sex)." ".$surname." ".$family."");
+ define('PAYOUT_USERDATA_VALUE', "".TRANSLATE_GENDER($gender)." ".$surname." ".$family."");
if (($_GET['do'] == "accept") && (!empty($email)))
{
@@ -86,7 +80,7 @@ if (!empty($_GET['pid']))
if (isset($_POST['ok']))
{
// Obtain payout type and other data
- $result = SQL_QUERY_ESC("SELECT payout_id FROM "._MYSQL_PREFIX."_user_payouts WHERE id=%d LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT payout_id FROM "._MYSQL_PREFIX."_user_payouts WHERE id=%s LIMIT 1",
array(bigintval($_GET['pid'])), __FILE__, __LINE__);
list($ptype) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
@@ -94,7 +88,7 @@ if (!empty($_GET['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 "._MYSQL_PREFIX."_payout_types WHERE id=%d LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT from_account, from_pass, engine_url, engine_ret_ok, engine_ret_failed, pass_enc, allow_url FROM "._MYSQL_PREFIX."_payout_types WHERE id=%s LIMIT 1",
array(bigintval($ptype)), __FILE__, __LINE__);
list($fuid, $fpass, $eurl, $eok, $failed, $eenc, $allow) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
@@ -134,14 +128,12 @@ if (!empty($_GET['pid']))
if ($ret[0] == $eok)
{
// Clear task
- if ($task > 0)
- {
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_task_system SET status='SOLVED' WHERE id=%d LIMIT 1",
- array(bigintval($task)),__FILE__, __LINE__);
+ if ($task > 0) {
+ ADMIN_SOLVE_TASK($task);
}
// Clear payout request
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_payouts SET status='ACCEPTED' WHERE id=%d LIMIT 1",
+ $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_payouts SET status='ACCEPTED' WHERE id=%s LIMIT 1",
array(bigintval($_GET['pid'])), __FILE__, __LINE__);
// Send out mail
@@ -165,14 +157,14 @@ if (!empty($_GET['pid']))
else
{
// Something goes wrong... :-(
- $content = implode("
", $ret);
+ $content = implode("
", $ret);
LOAD_TEMPLATE("admin_payout_failed_transfer", false, $content);
}
}
else
{
// Cannot load payout id
- OUTPUT_HTML ("".PAYOUT_FAILED_OBTAIN_PAYOUT_ID."");
+ OUTPUT_HTML("".PAYOUT_FAILED_OBTAIN_PAYOUT_ID."");
}
}
else
@@ -186,15 +178,13 @@ if (!empty($_GET['pid']))
// Ok, now we can output the form or execute rejecting
if (isset($_POST['ok']))
{
- if ($task > 0)
- {
+ if ($task > 0) {
// Clear task
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_task_system SET status='SOLVED' WHERE id=%d LIMIT 1",
- array(bigintval($task)), __FILE__, __LINE__);
+ ADMIN_SOLVE_TASK($task);
}
// Clear payout request
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_payouts SET status='REJECTED' WHERE id=%d LIMIT 1",
+ $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_payouts SET status='REJECTED' WHERE id=%s LIMIT 1",
array(bigintval($_GET['pid'])), __FILE__, __LINE__);
// Send out mail
@@ -253,17 +243,14 @@ ORDER BY p.payout_timestamp DESC", __FILE__, __LINE__);
else
{
// Translate status
- $evl = "\$status = PAYOUT_STATUS_".strtoupper($status).";";
- eval($evl);
+ $status = constant('PAYOUT_STATUS_'.strtoupper($status).'');
$status = "".$status."";
}
// Nothing entered must be secured in member/what-payputs.php !
- if ($allow == "Y")
- {
+ if ($allow == "Y") {
// Banner/Textlink views/clicks request
- if (!empty($banner))
- {
+ if (!empty($banner)) {
// Prepare array for the banner
$content = array(
'banner' => $banner,
@@ -273,9 +260,7 @@ ORDER BY p.payout_timestamp DESC", __FILE__, __LINE__);
// Load template for the banner
$account = LOAD_TEMPLATE("admin_list_payouts_banner", true, $content);
- }
- else
- {
+ } else {
// Textlink
$content = array(
'txt_link' => $alt,
@@ -286,9 +271,7 @@ ORDER BY p.payout_timestamp DESC", __FILE__, __LINE__);
// Admins can addionally test the URL for framekillers
$bank = "".CLICK_HERE."";
- }
- else
- {
+ } else {
// e-currency payout request
if (empty($account)) $account = "---";
if (empty($bank)) $bank = "---";