Okay. I installed this and noticed a bug. I made it work (Should be anyway) I did test it and it looked fine however I could have missed a spot.
<?php
/*
MCCode V2 - Send.php
Coded by Immortal;
-- FREE TO ALL MEMBERS OF THE FORUM --
*/
require_once("globals.php");
$_GET['ID'] = isset($_GET['ID']) && is_numeric($_GET['ID']) ? abs(@intval($_GET['ID'])) : false;
$_GET['action'] = isset($_GET['action']) && is_string($_GET['action']) ? strtolower(trim($_GET['action'])) : false;
$_POST['points'] = abs(@intval($_POST['points']));
switch($_GET['action'])
{
case 'sendbank':
sendbank();
break;
case 'sendoff';
sendoff();
break;
case 'sendcash';
sendcash();
break;
case 'sendpoints';
sendpoints();
break;
}
if (!in_array($_GET['action'], array('sendbank', 'sendoff', 'sendcash', 'sendpoints')))
{
echo "Operation not understood!";
exit;
}
function sendbank()
{
global $db,$h,$ir,$userid;
if(!$_GET['ID'])
{
echo "Invalid ID.<br /><a href='index.php'>Back</a>";
$h->endpage();
exit;
}
else if($_GET['ID'] == $userid)
{
echo "Is there a particular reason you are sending money to yourself?<br /><a href='index.php'>Back</a>";
$h->endpage();
exit;
}
else
{
$it=$db->query("SELECT `userid`, `bankmoney`, `lastip` FROM users WHERE userid={$_GET['ID']}");
$er=$db->fetch_row($it);
if($er['bankmoney']==-1 || $ir['bankmoney']==-1)
{
echo "Sorry,you or the person you are sending cash to does not have a bank account.<br /><a href='index.php'>Back</a>";
$h->endpage();
exit;
}
if($_POST['points'])
{
if($_POST['points'] > $ir['bankmoney'])
{
echo "You are trying to send more than you have.<br /><a href='index.php'>Back</a>";
$h->endpage();
exit;
}
else
{
$db->query(sprintf("UPDATE `users` SET `bankmoney`=`bankmoney`-%u WHERE `userid`=%d", $_POST['points'], $userid));
$db->query(sprintf("UPDATE `users` SET `bankmoney`=`bankmoney`+%u WHERE `userid`=%d", $_POST['points'], $_GET['ID']));
echo "Your Bank Transferred \$".number_format($_POST['points'])." to ID ".number_format($_GET['ID']).".";
event_add($_GET['ID'],"You received \$".number_format($_POST['points'])." into your bank account from ".stripslashes($ir['username']).".");
$db->query("INSERT INTO bankxferlogs VALUES ('', $userid, {$_GET['ID']}, {$_POST['points']}, unix_timestamp(), '{$ir['lastip']}', '{$er['lastip']}', 'bank')");
}
}
else
{
print "<h3>Bank Xfer</h3>
You are sending bank money to ID: <b>{$_GET['ID']}</b>.
<br>You have <b>\$".number_format($ir['bankmoney'])."</b> you can send.
<form action='sendbank.php?action=sendbank&ID={$_GET['ID']}' method='post'>
Money: <input type='text' name='points' /><br />
<input type='submit' value='Send' /></form>";
}
}
}
$h->endpage();
function sendoff()
{
global $db,$ir,$h,$userid;
if(!$_GET['ID'])
{
echo "Invalid ID.<br /><a href='index.php'>Back</a>";
$h->endpage();
exit;
}
else if($_GET['ID'] == $userid)
{
echo "Is there a particular reason you are sending money to yourself?<br /><a href='index.php'>Back</a>";
$h->endpage();
exit;
}
else
{
$it=$db->query("SELECT `userid`, `cybermoney`, `lastip` FROM users WHERE userid={$_GET['ID']}");
$er=$db->fetch_row($it);
if($er['cybermoney']==-1 || $ir['cybermoney']==-1)
{
echo "Sorry,you or the person you are sending cash to does not have an off-shore account.<br /><a href='index.php'>Back</a>";
$h->endpage();
exit;
}
if($_POST['points'])
{
if($_POST['points'] > $ir['cybermoney'])
{
echo "You are trying to send more than you have.<br /><a href='index.php'>Back</a>";
$h->endpage();
exit;
}
else
{
$db->query(sprintf("UPDATE `users` SET `cybermoney`=`cybermoney`-%u WHERE `userid`=%d", $_POST['points'], $userid));
$db->query(sprintf("UPDATE `users` SET `cybermoney`=`cybermoney`+%u WHERE `userid`=%d", $_POST['points'], $_GET['ID']));
echo "You CyberBank Transferred \$".number_format($_POST['points'])." to ID ".number_format($_GET['ID']).".";
event_add($_GET['ID'],"You received \${$_POST['points']} into your cyber bank account from ".stripslashes($ir['username']).".");
$db->query("INSERT INTO bankxferlogs VALUES ('', $userid, {$_GET['ID']}, {$_POST['points']}, unix_timestamp(), '{$ir['lastip']}', '{$er['lastip']}', 'cyber')");
}
}
else
{
echo "<h3>Off-Shore Xfer</h3>
You are sending off-shore bank money to ID: <b>{$_GET['ID']}</b>.
<br>You have <b>\$".number_format($ir['cybermoney'])."</b> you can send.
<form action='sendcyber.php?action=sendoff&ID={$_GET['ID']}' method='post'>
Money: <input type='text' name='points' /><br />
<input type='submit' value='Send' /></form>";
}
}
}
$h->endpage();
function sendpoints()
{
global $db, $userid, $ir;
if(!$_GET['ID'])
{
echo "Invalid ID.<br /><a href='index.php'>Back</a>";
$h->endpage();
exit;
}
else if($_GET['ID'] == $userid)
{
echo "Is there a particular reason you are sending points to yourself?<br /><a href='index.php'>Back</a>";
$h->endpage();
exit;
}
else
{
if($_POST['points'])
{
if($_POST['points'] > $ir['crystals'])
{
echo "You are trying to send more than you have.<br /><a href='index.php'>Back</a>";
$h->endpage();
exit;
}
else
{
$db->query(sprintf("UPDATE `users` SET `crystals`=`crystals`-%u WHERE `userid`=%d", $_POST['points'], $userid));
$db->query(sprintf("UPDATE `users` SET `crystals`=`crystals`+%u WHERE `userid`=%d", $_POST['points'], $_GET['ID']));
echo "You sent ".number_format($_POST['points'])." points to ID ".number_format($_GET['ID']).".";
event_add($_GET['ID'],"You received {$_POST['points']} points from ".stripslashes($ir['username']).".");
$it=$db->query("SELECT `lastip` FROM `users` WHERE `userid`={$_GET['ID']}");
$er=$db->fetch_row($it);
$db->query("INSERT INTO crystalxferlogs VALUES ('', $userid, {$_GET['ID']}, {$_POST['points']}, unix_timestamp(), '{$ir['lastip']}', '{$er['lastip']}')");
}
}
else
{
echo "<h3> Sending Points</h3>
You are sending points to ID: <b>{$_GET['ID']}</b>.
<br>You have <b>".number_format($ir['points'])."</b> points you can send.
<form action='send.php?action=sendpoints&ID={$_GET['ID']}' method='post'>
Points: <input type='text' name='points' /><br />
<input type='submit' value='Send' /></form>";
print "<h3>Latest 5 Transfers</h3>
<table width=75% border=2> <tr style='background:gray'> <th>Time</th> <th>User From</th> <th>User To</th> <th>Amount</th> </tr>";
$q=$db->query("SELECT cx.*,u1.username as sender, u2.username as sent FROM crystalxferlogs cx LEFT JOIN users u1 ON cx.cxFROM=u1.userid LEFT JOIN users u2 ON cx.cxTO=u2.userid WHERE cx.cxFROM=$userid ORDER BY cx.cxTIME DESC LIMIT 5");
while($r=$db->fetch_row($q)){
if($r['cxFROMIP'] == $r['cxTOIP']) { $m="<span style='color:red;font-weight:800'>MULTI</span>"; } else { $m=""; }
print "<tr> <td>" . date("F j, Y, g:i:s a",$r['cxTIME']) . "</td><td>{$r['sender']} [{$r['cxFROM']}] </td><td>{$r['sent']} [{$r['cxTO']}] </td> <td> {$r['cxAMOUNT']} points</td> </tr>";
}
print "</table>";
}
}
}
$h->endpage();
function sendcash()
{
global $db, $ir, $userid, $h;
$_POST['cash'] = abs(@intval($_POST['cash']));
if(!$_GET['ID'])
{
echo "Invalid ID.<br /><a href='index.php'>Back</a>";
$h->endpage();
exit;
}
else if($_GET['ID'] == $userid)
{
echo "Is there a particular reason you are sending cash to yourself?<br /><a href='index.php'>Back</a>";
$h->endpage();
exit;
}
else
{
if($_POST['cash'])
{
if($_POST['cash'] > $ir['cash'])
{
echo "You are trying to send more than you have.<br /><a href='index.php'>Back</a>";
$h->endpage();
exit;
}
else
{
$db->query(sprintf("UPDATE `users` SET `money`=`money`-%u WHERE `userid`=%d", $_POST['cash'], $userid));
$db->query(sprintf("UPDATE `users` SET `money`=`money`+%u WHERE `userid`=%d", $_POST['cash'], $_GET['ID']));
echo "You sent \$".number_format($_POST['cash'])." to ID ".number_format($_GET['ID']).".";
event_add($_GET['ID'],"You received \${$_POST['cash']} from {$ir['username']}.",$c);
$it=$db->query("SELECT `lastip` FROM `users` WHERE `userid`={$_GET['ID']}");
$er=$db->fetch_row($it);
$db->query("INSERT INTO cashxferlogs VALUES ('', $userid, {$_GET['ID']}, {$_POST['cash']}, unix_timestamp(), '{$ir['lastip']}', '{$er['lastip']}')");
}
}
else
{
print "<h3> Sending Money</h3>
You are sending money to ID: <b>{$_GET['ID']}</b>.
<br>You have <b>\$".number_format($ir['money'])."</b> you can send.
<form action='send.php?action=sendcash&ID={$_GET['ID']}' method='post'>
Amnt: <input type='text' name='cash' /><br />
<input type='submit' value='Send' /></form>";
print "<h3>Latest 5 Transfers</h3>
<table width=75% border=2> <tr style='background:gray'> <th>Time</th> <th>User From</th> <th>User To</th> <th>Amount</th> </tr>";
$q=$db->query("SELECT cx.*,u1.username as sender, u2.username as sent FROM cashxferlogs cx LEFT JOIN users u1 ON cx.cxFROM=u1.userid LEFT JOIN users u2 ON cx.cxTO=u2.userid WHERE cx.cxFROM=$userid ORDER BY cx.cxTIME DESC LIMIT 5");
while($r=$db->fetch_row($q))
{
if($r['cxFROMIP'] == $r['cxTOIP']) { $m="<span style='color:red;font-weight:800'>MULTI</span>"; } else { $m=""; }
print "<tr> <td>" . date("F j, Y, g:i:s a",$r['cxTIME']) . "</td><td>{$r['sender']} [{$r['cxFROM']}] </td><td>{$r['sent']} [{$r['cxTO']}] </td> <td> \${$r['cxAMOUNT']}</td> </tr>";
}
print "</table>";
}
}
}
$h->endpage();
?>
Should work. If not comment here and I'll re-try