Codice PHP:
<?php
if (!defined('GEN2_PROCESS'))
{
exit();
}
if ($loggedin)
{
include_once ('menu.php');
$contents .= "$menu_text
";
$ref_title = "Cashout Funds";
if (isset($_GET['alertpay']) && $ir['balance'] >= $set['min_cashout'])
{
if ($set['ap_automated'] and $do->is_curl_installed() and (($set['upg_automated'] >
0 and $ir['upgraded'] > time()) or $set['upg_automated'] == 0))
{
include "modules/autopay/alertpay.php";
$alertpay_payment_details = array(
"USER" => $set['ap_username'],
"PASSWORD" => $set['ap_api_password'],
"AMOUNT" => round($ir['balance'], 2),
"CURRENCY" => "USD",
"RECEIVEREMAIL" => $ir['alertpay_email'],
"PURCHASETYPE" => "0",
"NOTE" => $set['ap_note']
);
//print_r($payment_details);
//die;
if (alertpay_make_payment($alertpay_payment_details))
{
$contents .= "<td width='80%' valign='top'>
<div id='box7'>
<div id='lb'>
<div id='rb'>
<div id='bb'>
<div id='blc'>
<div id='brc'>
<div id='tb'>
<div id='tlc'>
<div id='trc'>
<div id='content'><h3>Payment sent successfully.</h3>
Your payment was sent successfully. Please check your email to confirm.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>";
mysql_query("UPDATE users SET balance='0', withdrew=withdrew+'{$ir['balance']}', cashouts=cashouts+'1' WHERE username='{$ir['username']}' LIMIT 1;");
mysql_query("UPDATE settings SET set_value=set_value+'{$ir['balance']}' WHERE set_name='total_paid' LIMIT 1;");
mysql_query("INSERT INTO history (username, time, type, custom1) VALUES ('{$ir['username']}', unix_timestamp(), 'cashout', '{$ir['balance']}')");
mysql_query("UPDATE stats SET cashouts=cashouts+'{$ir['balance']}'");
}
else
{
$contents .= "<td width='80%' valign='top'>
<div id='box7'>
<div id='lb'>
<div id='rb'>
<div id='bb'>
<div id='blc'>
<div id='brc'>
<div id='tb'>
<div id='tlc'>
<div id='trc'>
<div id='content'><h3>Unable to send payment</h3>
Sorry, we couldn't send your payment - try again later.
[url='javascript:history.back()']Back[/url]
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>";
}
$do->refresh_sess(); //vital
}
else
{
if ($ir['pcashout'] > 0)
{
$contents .= "<td width='80%' valign='top'>
<div id='box7'>
<div id='lb'>
<div id='rb'>
<div id='bb'>
<div id='blc'>
<div id='brc'>
<div id='tb'>
<div id='tlc'>
<div id='trc'>
<div id='content'><h3>You have a payment pending.</h3>
You cannot cashout while you have a payment which needs to be sent - Please wait until you have been paid your previous requests first.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>";
}
else
{
mysql_query("UPDATE users SET balance='0', pcashout=pcashout+'{$ir['balance']}', pmethod='2' WHERE username='{$ir['username']}' LIMIT 1;");
$contents .= "<td width='80%' valign='top'>
<div id='box7'>
<div id='lb'>
<div id='rb'>
<div id='bb'>
<div id='blc'>
<div id='brc'>
<div id='tb'>
<div id='tlc'>
<div id='trc'>
<div id='content'><h3>Payment Requested</h3>
Your payment has been requested, We'll check the request and then send it via AlertPay - If you wish to change your payment email, simply check your account.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>";
$do->refresh_sess(); //vital
}
}
}
elseif (isset($_GET['paypal']) && $ir['balance'] >= $set['min_cashout'])
{
if ($set['pp_automated'] and $do->is_curl_installed() and (($set['upg_automated'] > 0 and $ir['upgraded'] > time()) or $set['upg_automated'] == 0))
{
include "modules/autopay/paypal.php";
$paypal_payment_details = array(
"USER" => $set['pp_api_username'],
"PWD" => $set['pp_api_password'],
"SIGNATURE" => $set['pp_api_signature'],
"EMAILSUBJECT" => $set['pp_subject'],
"CURRENCYCODE" => "USD",
"L_EMAIL0" => $ir['paypal_email'],
"L_AMT0" => round($ir['balance'], 2),
"L_NOTE0" => $set['pp_message']
);
if (paypal_make_payment($paypal_payment_details))
{
$contents .= "<td width='80%' valign='top'>
<div id='box7'>
<div id='lb'>
<div id='rb'>
<div id='bb'>
<div id='blc'>
<div id='brc'>
<div id='tb'>
<div id='tlc'>
<div id='trc'>
<div id='content'><h3>Payment sent successfully.</h3>
Your payment was sent successfully. Please check your email to confirm.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>";
mysql_query("UPDATE users SET balance='0', withdrew=withdrew+'{$ir['balance']}', cashouts=cashouts+'1' WHERE username='{$ir['username']}' LIMIT 1;");
mysql_query("UPDATE settings SET set_value=set_value+'{$ir['balance']}' WHERE set_name='total_paid' LIMIT 1;");
mysql_query("INSERT INTO history (username, time, type, custom1) VALUES ('{$ir['username']}', unix_timestamp(), 'cashout', '{$ir['balance']}')");
mysql_query("UPDATE stats SET cashouts=cashouts+'{$ir['balance']}'");
}
else
{
$contents .= "<td width='80%' valign='top'>
<div id='box7'>
<div id='lb'>
<div id='rb'>
<div id='bb'>
<div id='blc'>
<div id='brc'>
<div id='tb'>
<div id='tlc'>
<div id='trc'>
<div id='content'><h3>Unable to send payment</h3>
Sorry, we couldn't send your payment - try again later.
[url='javascript:history.back()']Back[/url]
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>";
}
$do->refresh_sess(); //vital
}
else
{
if ($ir['pcashout'] > 0)
{
$contents .= "<td width='80%' valign='top'>
<div id='box7'>
<div id='lb'>
<div id='rb'>
<div id='bb'>
<div id='blc'>
<div id='brc'>
<div id='tb'>
<div id='tlc'>
<div id='trc'>
<div id='content'><h3>You have a payment pending.</h3>
You cannot cashout while you have a payment which needs to be sent - Please wait until you have been paid your previous requests first.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>";
}
else
{
mysql_query("UPDATE users SET balance='0', pcashout=pcashout+'{$ir['balance']}', pmethod='1' WHERE username='{$ir['username']}' LIMIT 1;") or
die(mysql_error());
$contents .= "<td width='80%' valign='top'>
<div id='box7'>
<div id='lb'>
<div id='rb'>
<div id='bb'>
<div id='blc'>
<div id='brc'>
<div id='tb'>
<div id='tlc'>
<div id='trc'>
<div id='content'><h3>Payment Requested</h3>
Your payment has been requested, We'll check the request and then send it via PayPal - If you wish to change your payment email, simply check your account.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>";
$do->refresh_sess(); //vital
}
}
}
else
{
$tp .= "<td width='80%' valign='top'>
<div id='box7'>
<div id='lb'>
<div id='rb'>
<div id='bb'>
<div id='blc'>
<div id='brc'>
<div id='tb'>
<div id='tlc'>
<div id='trc'>
<div id='content'>
<table>
<tr>
<td>[img]themes/GeN3/images/cashout.png[/img]</td>
<td><h3><font color='black'><h3>Cashout</h3></font></h3></td>
</tr>
</table>";
if ($set['pp_enabled'])
{
$tp .= "<div style='overlay:auto;'>
[url='cashout.php?paypal'][b]Cashout \${$ir['balance']} via PayPal[/b][/url]</p>";
if ($set['pp_automated'] and (($set['upg_automated'] > 0 and $ir['upgraded'] >
time()) or $set['upg_automated'] == 0))
{
$tp .= "
Your funds will be sent [b]INSTANTLY[/b] via PayPal, So you should recieve your funds on average 30 seconds after you've requested it.</p></div>";
}
else
{
$tp .= "
Your funds will be audited and screened by our professional anti-fraud department - Your funds should be dispatched within 5-7 days.</p></div>";
}
}
$tp .= "
";
if ($set['ap_enabled'])
{
$tp .= "<div style='overlay:auto;'>
[url='cashout.php?alertpay'][b]Cashout \${$ir['balance']} via AlertPay[/b][/url]</p>";
if ($set['ap_automated'] and (($set['upg_automated'] > 0 and $ir['upgraded'] >
time()) or $set['upg_automated'] == 0))
{
...