PHP Classes

File: fwphp/01mater/shop/view/sidebar.php

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


Class file image Download
= $pp1->module_relpath ;
$module_path = $pp1->module_path ;
<div class="sidebar">

  <!-- ************************ J:\awww\www\fwphp\01mater\shop\view\sidebar.php -->
    <li><a href="<?php echo $module_relpath . 'cart'; ?>">View Cart</a>
    </li><?php // Check if user is logged in and display appropriate account links
$account_url = $module_relpath . 'account';
$logout_url = $account_url . '?action=logout';
      if (isset(
$_SESSION['user'])) : ?>
<li><a href="<?php echo $account_url; ?>">My Account</a></li>
        <li><a href="<?php echo $logout_url; ?>">Logout</a>
      <?php else: ?>
<li><a href="<?php echo $account_url; ?>">Login/Register</a></li>
      <?php endif; ?>
<li><a href="<?=$pp1->home?>">Home</a></li>

  <!-- ************************ -->
  <ol><!-- display links for all categories -->
require_once($module_path .'model/database.php');
$module_path .'model/category_db.php');

$categories = get_categories($pp1);
$categories as $category) :
$name = $category['categoryName'];
$id = $category['categoryID'];
$url = $module_relpath . 'catalog?category_id=' . $id; ?>
<li><a href="<?php echo $url; ?>"><?php echo htmlspecialchars($name); ?></a></li>
    <?php endforeach; ?>

  <h2>Temp Link</h2>
  <!-- ************************ -->
    <li><!-- This link is for testing only. Remove it from a production app. -->
        <a href="<?php echo $module_relpath; ?>admin">Admin</a>


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