File: fwphp/01mater/shop/catalog/product_view.php

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/01mater/shop/catalog/product_view.php  >  Download  
File: fwphp/01mater/shop/catalog/product_view.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change: ver 7.0.1 mnu, msg, mkd FUNCTIONAL namespaces, CRUD PDO trait, pretty URL-s
Date: 2 months ago
Size: 1,360 bytes
 

Contents

Class file image Download
<?php

   
// Parse data
   
$category_id = $product['categoryID'];
   
$product_code = $product['productCode'];
   
$product_name = $product['productName'];
   
$description = $product['description'];
   
$list_price = $product['listPrice'];
   
$discount_percent = $product['discountPercent'];

   
// Add HMTL tags to the description
   
$description_with_tags = add_tags($description);

   
// Calculate discounts
   
$discount_amount = round($list_price * ($discount_percent / 100), 2);
   
$unit_price = $list_price - $discount_amount;

   
// Format discounts
   
$discount_percent_f = number_format($discount_percent, 0);
   
$discount_amount_f = number_format($discount_amount, 2);
   
$unit_price_f = number_format($unit_price, 2);

   
// Get image URL and alternate text
   
$image_filename = $product_code . '_m.png';
   
//$image_path = $module_relpath . 'images/' . $image_filename;
   
$image_path = $img_dirpath . $image_filename;
   
$image_alt = 'Image filename: ' . $image_filename;

$subtitle = htmlspecialchars($product_name);
include
'../view/header.php'; ?>
<main>
  <div class="main">
    <section class="chapter">

    <!-- display product -->
    <?php include './product_view_content.php'; ?>

    </section>
  </div>

  <?php include '../view/sidebar.php'; ?>
</main>
<?php include '../view/footer.php'; ?>

For more information send a message to info at phpclasses dot org.