<?php require "giftcards_common.php"; $type = $_REQUEST["Type"]; $accountEmail = $_REQUEST["Account"]; $date = $_REQUEST["Date"]; if ($type === '1') { //per user $orders = getOrderWithAccountAndDeadline($accountEmail, $date); echo displayReportForAccount($orders); } else { if ($type === '2') { // pickup and deadline echo "<h2>Report for pickup with deadline " . $date . "</h2>"; echo "Please print this report out <br><br>"; $orders = getOrderWithAccountAndDeadline_old("", $date); $data = reportByPickupOptionAndAccount($orders); echo displayReportForPickup($data); } else { if ($type === '3') { //purchase echo "<h2>Report for Vendor and Price with deadline " . $date . "</h2>"; echo "Please print this report out <br><br>"; $orders = getOrderWithAccountAndDeadline_old("", $date); $data = reportByVendorAndPrice($orders); echo displayReportForPurchase($data); } } }
</body> </html> '; } if (!empty($_POST)) { displayPageHead(); $order_Deadline = $_POST['Order_Deadline']; $accountEmail = $_POST['AccountEmail']; $pickupOption = $_POST['pickupOption']; $orderRemitTotal = $_POST['OrderRemitTotal']; $orderTotal = $_POST['OrderTotal']; $Order_Deadline = $order_Deadline; $AccountEmail = $accountEmail; $PickupOption = $pickupOption; echo "<h2>Order_Deadline:" . $order_Deadline . '</h2>'; echo "<h2>AccountEmail:" . $accountEmail . '</h2>'; echo "<h2>PickupOptions:" . $pickupOption . '</h2>'; $order_details = json_decode($_POST["order_details"], true); if (!is_null($order_details)) { if (validateOrderDetails($order_details)) { $orders_to_post = array('Order_Deadline' => $order_Deadline, 'Account' => $accountEmail, 'Pickup' => $pickupOption, 'Order' => json_encode($order_entries)); if (postOrderWithCurl($orders_to_post)) { $orders = getOrderWithAccountAndDeadline($accountEmail, $order_Deadline); $displayStr = displayReportForAccount($orders); sendEmailNotification($accountEmail, $order_Deadline, $pickupOption, $displayStr); echo $displayStr; } } } displayPageEnd(); }