PHP Classes

File: fwphp/glomodul/z_examples/book_video/auction_wrox24h_30/content/menus.php

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/glomodul/z_examples/book_video/auction_wrox24h_30/content/menus.php  >  Download  
File: fwphp/glomodul/z_examples/book_video/auction_wrox24h_30/content/menus.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:
Date: 3 months ago
Size: 868 bytes
 

Contents

Class file image Download
<?php
/**
 * menus.php
 */

$accessLevel = Contact::accessLevel();
if (
$accessLevel != 'Admin') :
  echo
'Sorry, no access allowed to this page';
else :
 
// Get the menu information
 
$items = Menu::getMenus();

 
?>
<h1>Menu List
      <a class="button" href="index.php?content=menumaint&id=0">Add</a>
  </h1>

  <ul class="ulfancy">
    <?php foreach ($items as $i=>$item) : ?>
<li class="row<?php echo $i % 2; ?>">
        <h2><?php echo htmlspecialchars($item->getTitle()); ?>
<a class="button"
            href="index.php?content=menudelete&id=<?php echo $item->getId(); ?>">Delete</a>
          <a class="button"
            href="index.php?content=menumaint&id=<?php echo $item->getId(); ?>">Edit</a>
        </h2>
        <p><?php echo htmlspecialchars($item->getLink()); ?></p>
      </li>
    <?php endforeach; ?>
</ul>
<?php endif; ?>

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