Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
72 lines (62 sloc) 3.39 KB
$orderID = $_GET['orderID'];
<link rel="stylesheet" href="../style.css">
<div id="header">
<?php writeMenuAdm('AllOrders.php'); ?>
<div id='contentwrapper'>
$where = " WHERE o.OrderID=" . $orderID . " ";
$sql = "SELECT
o.OrderID as _OrderID,
CONCAT(e.FirstName, ' ', e.LastName) as Employee,
DATE_FORMAT(OrderDate, '%m-%d-%Y') as `Order Date`, DATE_FORMAT(s.RequiredDate, '%m-%d-%Y') as `Required Date`, DATE_FORMAT(ShippedDate, '%m-%d-%Y') as `Shipped Date`,
Freight, ShipName as `Ship To`,
CONCAT(ShipAddress, ', ', ShipCity, '<br>', ShipRegion, ' ', ShipPostalCode, ', ', ShipCountry) as `Ship Address`,
CONCAT('$', FORMAT(Total,2)) as Total, pt.Name as `Paid Via`
((((orders o LEFT JOIN employees e ON o.EmployeeID = e.EmployeeID)
LEFT JOIN shipments sh ON o.OrderID = sh.OrderID)
LEFT JOIN shipaddresses s ON sh.ShipmentsID = s.ShipAddrID)
LEFT JOIN payment p ON o.orderID = p.orderID)
LEFT JOIN paymenttype pt ON pt.paymenttypeid = p.paymenttypeid
" . $where . " ORDER BY OrderDate DESC";
$result = $con->query($sql);
$trArgs = array("onclick=\"window.document.location='ViewOrder.php?orderID=%OrderID%'\"",
array('%OrderID%' => '_OrderID')
makeTable($result, $trArgs);
echo "<hr>";
$sql = "SELECT
p.ProductID as _ProductID,
ProductName as Product,
CategoryName as Category,
CompanyName as Company,
QuantityPerUnit as Quantity,
CONCAT('$', FORMAT(p.UnitPrice,2)) as Price,
UnitsInStock as Stock,
Quantity as `Amount Ordered`,
CONCAT('$', FORMAT(Quantity*p.UnitPrice,2)) as `Sub-total`
(((`order details` od LEFT JOIN products p ON od.ProductID = p.ProductID)
LEFT JOIN suppliers as s ON p.SupplierID = s.SupplierID)
LEFT JOIN categories c ON p.CategoryID = c.CategoryID)
LEFT JOIN company co ON s.CompanyId = co.CompanyID
WHERE orderid = " . $orderID . "
order by od.ProductID ASC";
$result = $con->query($sql);
$trArgs = array("onclick=\"window.document.location='ViewProduct.php?productID=%ProductID%'\"",
array('%ProductID%' => '_ProductID')
makeTable($result, $trArgs);
You can’t perform that action at this time.