First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
include "db.php";
|
||||
|
||||
$school_num = 240;
|
||||
$cutoff_date = '2026-09-01 00:00:00';
|
||||
|
||||
$query = "SELECT * FROM user_online_payments WHERE school_num = $school_num AND transaction_datetime >= '$cutoff_date' AND status = 'Pending'";
|
||||
echo("$query\n");
|
||||
$payments = db_query($query);
|
||||
$num = db_num_rows($payments);
|
||||
echo("Num Rows: $num\n");
|
||||
|
||||
$entered_time = time();
|
||||
|
||||
$usersMissing = 0;
|
||||
$trxNotFound = 0;
|
||||
$trxFound = 0;
|
||||
|
||||
while ($row = db_fetch_assoc($payments)) {
|
||||
extract($row, EXTR_PREFIX_ALL, 'p');
|
||||
echo("$p_balance_owing -> $p_transaction_fee :: ");
|
||||
if ($p_transaction_fee > 0) {
|
||||
|
||||
$r = db_query("SELECT * FROM users WHERE school_num = $school_num AND record_num = $p_user_num");
|
||||
if (db_num_rows($r) == 0) {
|
||||
// echo("$query\n");
|
||||
echo("User Account not found\n");
|
||||
$usersMissing++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$user = db_fetch_assoc($r);
|
||||
$name = $user['first_name'].' '.$user['last_name'];
|
||||
echo("$name - $p_user_num\n");
|
||||
$trx_amt = $p_balance_owing * -1;
|
||||
|
||||
$query = "SELECT * FROM user_account WHERE school_num = $school_num AND user_num = $p_user_num AND transaction_type = 'Payment' AND transaction_amount = $trx_amt";
|
||||
$r = db_query($query);
|
||||
if (db_num_rows($r) == 0) {
|
||||
// echo("$query\n");
|
||||
echo("User Account TRX not found\n");
|
||||
$trxNotFound++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$trxRecord = db_fetch_assoc($r);
|
||||
|
||||
$trx_time = date("Y-m-d H:i:s",$p_transaction_time);
|
||||
$P_txn_id = '';
|
||||
|
||||
$trxFound++;
|
||||
|
||||
if (is_array($user)) {
|
||||
$snum = 0;
|
||||
$query = "INSERT INTO user_account " .
|
||||
"(school_num,user_num,schedule_num,transaction_datetime,transaction_type,transaction_status,note,transaction_amount,amount_paid," .
|
||||
"transaction_fee,payment_method,payment_reference,order_payments,deleted,entered_time) " .
|
||||
"VALUES ($p_school_num,$p_user_num,$snum,'$trx_time','PayPal Transaction Fee','Closed','',$p_transaction_fee,$p_transaction_fee,0,'PayPal','$P_txn_id',NULL,'N',$entered_time)";
|
||||
// echo("$query\n");
|
||||
db_query($query);
|
||||
}
|
||||
}
|
||||
echo("\n");
|
||||
}
|
||||
|
||||
echo("\n");
|
||||
echo("Users Not Found: $usersMissing\n");
|
||||
echo("TRX Not Found: $trxNotFound\n");
|
||||
echo("TRX Found: $trxFound\n");
|
||||
echo("\n");
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user