Example #1
0
<?php

# The view of showing a product. The product name, price, image, description and stock is displayed. Furthermore, a button ("buy")
# that adds the product to the cart is displayed, assuming the product's stock is not 0.
include 'model/product_model.php';
$p = new Product();
$data = $p->build();
?>

<html>
<head>
	<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
	<div class="container_brown">
		<a class="product_back" href="products.php?category=<?php 
echo $data['category'];
?>
"> << Back to <?php 
echo $data['category'];
?>
</a>
		<br>
		<img class="product_img" src="<?php 
echo $data['image_path'];
?>
" alt="Product Image">
		<div class="product_details">
			<h1><?php 
echo $data['name'];
?>