<?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); } } }
if ($reportType === "PickupAccount") { $xlsFileName = 'Pickup_Account_' . str_replace('/', '_', $deadline) . '.xlsx'; echo "<h2>Report for pickup with deadline " . $deadline . "</h2>"; echo "Please print this report out. "; echo 'Or download Report in Excel from <a href="' . $xlsFileName . '">Here</a><br><br>'; $orders = getOrderWithAccountAndDeadline("", $deadline); $data = reportByPickupOptionAndAccount($orders); /*turn off debug echo '<br>'; var_dump( $data ); echo '<br>'; */ exportExcelReportForPickup($data, $xlsFileName); echo displayReportForPickup($data); } else { if ($reportType === "VenderPrice") { $xlsFileName = 'Vendor_Price_' . str_replace('/', '_', $deadline) . '.xlsx'; echo "<h2>Report for Vendor and Price with deadline " . $deadline . "</h2>"; echo "Please print this report out. "; echo 'Or download Report in Excel from <a href="' . $xlsFileName . '">Here</a><br><br>'; $orders = getOrderWithAccountAndDeadline("", $deadline); $data = reportByVendorAndPrice($orders); exportExcelReportForPurchase($data, $xlsFileName); echo displayReportForPurchase($data); } } /* code to report single user order $orders = getOrderWithAccountAndDeadline($accountEmail, $date); echo displayReportForAccount($orders); */