First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
include "db.php";
|
||||
|
||||
$query = "SELECT * FROM hotlunch_order_header WHERE price_category != 'Regular' AND added_date > '2013-08-01'";
|
||||
$orders = db_query($query);
|
||||
|
||||
while ($row = db_fetch_assoc($orders)) {
|
||||
extract($row);
|
||||
$order_num = $record_num;
|
||||
|
||||
$category_savings = 0.00;
|
||||
|
||||
db_query("use hotlunch_prev2");
|
||||
$price_category = db_getVal("SELECT price_category FROM hotlunch_order_header WHERE school_num = $school_num AND record_num = $order_num");
|
||||
db_query("use hotlunch");
|
||||
$mcategory = db_getVal("SELECT menu_price_category FROM people WHERE school_num = $base_school_num AND record_num = $ordered_by_num");
|
||||
// if ($price_category != $mcategory) echo("$school_num - $ordered_by_num - $order_num - $schedule_num - $price_category - $mcategory\n");
|
||||
echo("$school_num - $order_num - $price_category\n");
|
||||
|
||||
$query = "SELECT * FROM hotlunch_order_items WHERE school_num = $school_num AND order_num = $order_num ORDER BY menu_num";
|
||||
$items = db_query($query);
|
||||
while ($row = db_fetch_assoc($items)) {
|
||||
extract($row);
|
||||
|
||||
$online_price = db_getVal("SELECT online_price FROM hotlunch_menu_items WHERE school_num = $school_num AND menu_num = $menu_num AND record_num = $menu_item_num");
|
||||
$full_price = $qty * $online_price;
|
||||
$category_savings += $full_price - $extended_price;
|
||||
}
|
||||
|
||||
db_query("UPDATE hotlunch_order_header SET price_category = '$price_category', category_savings = $category_savings WHERE record_num = $order_num");
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user