diff --git a/commonFunctions.php b/commonFunctions.php index 17859d3..5fdeed7 100644 --- a/commonFunctions.php +++ b/commonFunctions.php @@ -1,4 +1,35 @@ array("Home",""), + "eOrdersToFill.php" => array("Active Orders",""), + "eEditProducts.php" => array("Search/Edit Products",""), + "eEditCategories.php" => array("Edit Categories",""), + "eReviewCustomerDemographics.php" => array("Review Customer Information",""), + "logout.php" => array("Log Out","class='fRight'") + ); + $menuItems[$curPage][1] = "class='active'"; + + echo ""; + + /* echo " + + "; + */ +} + function orderCustomer($orderID) { //Get the customerID of the whomever placed this order global $con; $sql = "SELECT CustomerID from orders WHERE OrderID=" . $orderID; @@ -164,11 +195,11 @@ function loadPicture($blob, $widthPercent=100){ echo ''; } -function makeTable($result, $trArgs="") { +function makeTable($result, $trArgs=array("",array("" => ""))) { $result->fetch_array( MYSQLI_ASSOC ); echo ""; tableHead( $result ); - tableBody( $result, $trArgs="" ); + tableBody( $result, $trArgs); echo '
'; } @@ -185,10 +216,20 @@ function tableHead($result) { echo ''; } -function tableBody($result, $trArgs="") { +function tableBody($result, $trArgs) { echo ''; + // onclick=\"window.document.location='cViewOrder.php?orderID=" . $row['orderID'] + // onclick=\"window.document.location='cViewOrder.php?orderID=%orderID% + foreach ($result as $x) { - echo ''; + $trArgsS = $trArgs[0]; + if ($trArgsS <> ""){ + foreach($trArgs[1] as $sString => $varID) { //Replace each search string given in $trArgs with actual value + $trArgsS = str_replace($sString, $x[$varID], $trArgsS); + } + } + echo $trArgsS . " "; + echo ''; foreach ($x as $y) { echo '' . $y . ''; } diff --git a/customerPages/cCart.php b/customerPages/cCart.php index 527bea7..5f51c58 100644 --- a/customerPages/cCart.php +++ b/customerPages/cCart.php @@ -97,7 +97,8 @@ if(!isset($_SESSION['RequiredBy']) || !isset($_SESSION['PaymentType'])){

diff --git a/employeePages/eOrdersToFill.php b/employeePages/eOrdersToFill.php index 26784c9..09913a0 100644 --- a/employeePages/eOrdersToFill.php +++ b/employeePages/eOrdersToFill.php @@ -21,27 +21,21 @@ if ($row) {

Active orders


query($sql)){} - makeTable($result); + $sql = "SELECT * FROM northwind.`orders qry` WHERE EmployeeID is null ORDER BY RequiredDate ASC;"; + if (!$result = $con->query($sql)){} + + + $trArgs = array("onclick=\"window.document.location='eViewOrder.php?orderID=%OrderID%'\"", + array('%OrderID%' => 'OrderID') + ); + makeTable($result, $trArgs); ?>
- - - diff --git a/employeePages/eViewOrder.php b/employeePages/eViewOrder.php new file mode 100644 index 0000000..7cfff88 --- /dev/null +++ b/employeePages/eViewOrder.php @@ -0,0 +1,28 @@ + + + + + + + + +
+ "; + displayOrderDetails($orderID); + ?> +
+ + + + + diff --git a/employeePages/eViewProduct.php b/employeePages/eViewProduct.php new file mode 100644 index 0000000..5614c43 --- /dev/null +++ b/employeePages/eViewProduct.php @@ -0,0 +1,29 @@ + + + + + + + + +
+ + +
+ +
+ + + + +