-
Notifications
You must be signed in to change notification settings - Fork 1
/
product.php
55 lines (47 loc) · 1.72 KB
/
product.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
require_once "include.php";
$q = "";
if (isset($_GET["id"]) && !empty($_GET["id"])) {
$id = $_GET["id"];
} else {
$id = 0;
}
$product = getVisibleProductById($id);
?>
<?php require_once $rootPath . "/header.php"; ?>
<?php if ($product != null) { ?>
<h3 class="text-center">Product</h3>
<div class="row">
<div class="text-center">
<div class="panel panel-default">
<div class="panel-heading"><a class="link" href="product.php?id=<?php echo $product["id"]; ?>"><h3><?php echo $product["productName"]; ?></h3></a></div>
<div class="panel-body"><img src="<?php echo $product["imageURL"]; ?>" heght="300" width="300"></div>
<ul class="list-group">
<li class="list-group-item"><b>Price: </b>$<?php echo $product["price"]; ?></li>
<li class="list-group-item"><b>Description: </b><?php echo $product["description"]; ?></li>
<li class="list-group-item">
<b>Category: </b>
<?php
$category = getCategoryById($product["categoryId"]);
echo $category["category_name"];
?>
</li>
<?php $manufacturer = getManufactuerById($product["manufacturerId"]); ?>
<li class="list-group-item">
<b>Manufacturer: </b>
<?php
echo $manufacturer["business_name"];
?>
</li>
<li class="list-group-item"><b>Email: </b><?php echo $manufacturer["email"]; ?></li>
</ul>
<div class="panel-footer">
<a class="btn btn-primary" href="login.php">Buy</a>
</div>
</div>
</div>
</div>
<?php } else { ?>
<h3 class="text-center">No Product Found.</h3>
<?php } ?>
<?php require_once $rootPath . "/footer.php"; ?>