First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
$ValidAccess = 2010;
|
||||
require_once("include/globals.php");
|
||||
|
||||
|
||||
if (SessionActive() != 1 || ! UserLoggedIn()) {
|
||||
header("Location: /");
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
if (!in_array($_SESSION['UserInfo']['type'],array('Parent','Staff','Administration Team','Guest'))) {
|
||||
header("Location: /");
|
||||
exit();
|
||||
}
|
||||
|
||||
$unum = intval($_SESSION['UserInfo']['record_num']);
|
||||
$user_balance = db_getVal("select sum(transaction_amount) as balance from user_account where school_num = $school_num and user_num = $unum AND (deleted != 'Y' OR deleted IS NULL)");
|
||||
|
||||
if ($user_balance >= 0) {
|
||||
header("Location: /");
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
// Post to user account
|
||||
$entered_time = time();
|
||||
$trx_time = date("Y-m-d H:i:s",time());
|
||||
$charity = getLanguageText('TEXT-DONATION').": ".$school_record['donation_charity'];
|
||||
$amt = $user_balance * -1;
|
||||
|
||||
$query = "INSERT INTO user_account " .
|
||||
"(school_num,user_num,schedule_num,transaction_datetime,transaction_type,note,transaction_amount,transaction_fee,payment_method,payment_reference,order_payments,deleted,entered_time,transaction_status) " .
|
||||
"VALUES ($school_num,$unum,0,'$trx_time','Donation','$charity',$amt,0,'','','','N',$entered_time,'Closed')";
|
||||
db_query($query);
|
||||
|
||||
$msg = getLanguageText('TEXT-TRANSACTION-POSTED')."<br>".getLanguageText('TEXT-THANK-YOU');
|
||||
header("Location: /?form_message=".urlencode($msg));
|
||||
exit();
|
||||
?>
|
||||
Reference in new issue
Block a user