Example #1
0
<?php

error_reporting(-1);
include 'config/config.php';
include MODEL_PATH . 'model.php';
include HEADER;
$model = new Model();
$product_array = $model->show_all();
?>


<?php 
if (isset($_GET['product_id'])) {
    //TODO sanitize this $_GET
    $product_id = htmlspecialchars($_GET['product_id']);
    $row = $model->show($product_id);
    if (!empty($row)) {
        ?>

  <div class="content">
    <h3><?php 
        echo $row['product_name'];
        ?>
</h3>
    <div class="product_view_image_parent">
    <img class="product_view_image" src=uploads/<?php 
        echo $row['product_image'];
        ?>
>
  </div>
  </div>