
Code: Select all
$deposit = round($deposit);
if ((!is_numeric($deposit)) || ($deposit < 1)) { message_die(GENERAL_MESSAGE, 'Invalid Deposit Amount!'); }
if ($deposit > $urow[user_points]) { message_die(GENERAL_MESSAGE, 'You don\'t have that many '.$bankinfo[7].' to deposit!'); }
$newbalance = $row[holding] + $deposit;
$newpoints = $urow[user_points] - $deposit;
$sql = "update " . USERS_TABLE . " set user_points='$newpoints' where user_id='$userdata[user_id]'";
if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Updating User Points!'); }
Code: Select all
if( $deposit != 0 )
{
$sql = "INSERT INTO " . TRANSACTION_TABLE . " (trans_date, trans_from, trans_to, trans_amount)
VALUES ( " . time() . ", '" . $userdata['username'] . "', 'Deposit in Bank', '$deposit')";
}
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Could not insert data into transaction table", '', __LINE__, __FILE__, $sql);
}
Code: Select all
$withdrawtotal = round($withdraw / 100 * $bankinfo[1]);
$withdrawtotal = $withdrawtotal + $withdraw;
if ($row[holding] < $withdrawtotal) { message_die(GENERAL_MESSAGE, 'You don\'t have enough '.$bankinfo[7].' deposited to make that withdrawal!'); }
$newbalance = $row[holding] - $withdrawtotal;
$newpoints = $urow[user_points] + $withdraw;
$sql = "update " . USERS_TABLE . " set user_points='$newpoints' where user_id='$userdata[user_id]'";
if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Updating User Points!'); }
Code: Select all
if( $withdrawtotal != 0 )
{
$sql = "INSERT INTO " . TRANSACTION_TABLE . " (trans_date, trans_from, trans_to, trans_amount)
VALUES ( " . time() . ", '" . $userdata['username'] . "', 'Bank Withdrawal', '$withdraw')";
}
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Could not insert data into transaction table", '', __LINE__, __FILE__, $sql);
}
thewizard wrote: what is it exactly that this does??
thewizard wrote: yeah something that shows that users purchases and such.
LaZeR wrote:Zarath wrote:Nice work LaZeR![]()
Thanks, feel free to incorporate it if you wish within the bank, thats why I added it to this thread rather than putting in a mod template, ect... But I understand if you don't wish to work further on this mod, we'll just keep adding our tweaks here 8)
Zarath wrote: Can't, that would cause it to require the transaction mod and then it wouldn't be standalone minus the requirement of the points mod
I don't have the transaction mod installed on my boards either.