Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update Report_Sales.php
  • Loading branch information
jic13003 committed Dec 6, 2016
1 parent 38134d9 commit ba82e25
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions adminPages/Report_Sales.php
Expand Up @@ -16,10 +16,13 @@ require("../commonFunctions.php");
<?php
if (isset($_GET['Category'])){ //Check if category has already been set
$query = "SELECT * FROM `sales by category` WHERE CategoryID = ?
AND ProductName = ? "; //'?' in place of variable
AND ProductName LIKE ?
AND SupplierName LIKE ?
AND InStock = ?"; //'?' in place of variable
$ProductName = "%" . $_GET['ProductName'] . "%";
$SupplierName = "%" . $_GET['SupplierName'] . "%";
$stmt = $con->prepare($query);
$stmt ->bind_param("ds", $_GET['Category'], $ProductName); //Bind category to query, category is taken in as CategoryID, so it's a digit
$stmt ->bind_param("dssd", $_GET['Category'], $ProductName, $SupplierName, $_GET['InStock']); //Bind category to query, category is taken in as CategoryID, so it's a digit
$stmt ->execute();

$searchResult = $stmt->get_result(); //Get results
Expand Down Expand Up @@ -47,6 +50,10 @@ require("../commonFunctions.php");
</select>
<label>Product Name</label>
<input type="text" name="ProductName" id="ProductName">
<label>Supplier Name</label>
<input type="text" name="SupplierName" id="SupplierName">
<label>In Stock</label>
<input type="text" name="InStock" id="InStock">
<input type="submit" value="View Report">
</div>
</form>
Expand Down

0 comments on commit ba82e25

Please sign in to comment.