Files
HotLunches/adjustUserAccounts.php
T
2026-10-19 15:22:52 -07:00

29 lines
929 B
PHP

<?php
chdir("/m/data1/app.hotlunches.net/");
include "/m/data1/app.hotlunches.net/db.php";
include "/m/data1/app.hotlunches.net/include/logging-functions.php";
include "/m/data1/app.hotlunches.net/include/school-functions.php";
$query = "SELECT * FROM schools WHERE payment_detail = 'Y' AND status = 'Active' ORDER BY school_name";
$results = db_query($query);
echo(date("Y-m-d H:i:s",time())."\n");
while ($row = db_fetch_assoc($results)) {
$school_record = $row;
$school_num = $row['record_num'];
echo($school_record['school_name']."\n");
adjustUserAccountDetails(0,$school_num);
echo(date("Y-m-d H:i:s",time())."\n\n");
}
$query = "UPDATE hotlunch_order_header " .
"SET amount_paid = order_total " .
"WHERE amount_paid > order_total " .
"AND ordered_by_type != 'Concession' " .
"AND status = 'Paid' " .
"AND order_total * 2 < amount_paid";
db_query($query);
?>