PHP Classes

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

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/01mater/shop/view/sidebar_admin.php  >  Download  
File: fwphp/01mater/shop/view/sidebar_admin.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: 3 months ago
Size: 1,227 bytes
 

Contents

Class file image Download
<aside>
    <h2>Links</h2>
    <ul>
        <li>
        <?php
       
// Check if user is logged in and
        // display appropriate account links
       
$account_url = $module_relpath . 'admin/account';
       
$logout_url = $account_url . '?action=logout';
        if (isset(
$_SESSION['admin'])) :
       
?>
<a href="<?php echo $logout_url; ?>">Logout</a>
        <?php else: ?>
<a href="<?php echo $account_url; ?>">Login</a>
        <?php endif; ?>
</li>
        <li>
            <a href="<?php echo $module_relpath; ?>">Home</a>
        </li>
        <li>
            <a href="<?php echo $module_relpath; ?>admin">Admin</a>
        </li>
    </ul>
   
    <?php if (isset($categories)) : ?>
<!-- display links for all categories -->
    <h2>Categories</h2>
    <ul>
        <?php foreach ($categories as $category) : ?>
<li>
            <a href="<?php echo $module_relpath .
               
'admin/product?action=list_products' .
               
'&amp;category_id=' . $category['categoryID']; ?>">
                <?php echo htmlspecialchars($category['categoryName']); ?>
</a>
        </li>
        <?php endforeach; ?>
</ul>
    <?php endif; ?>
</aside>

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