<?php
session_start();

defined('PUBLIC_ACCESS') or die('Restricted Access');

require_once($_SERVER['DOCUMENT_ROOT'] . '/sys/db.php');

class MainMenu {

private $path;
  
  public function __construct($path, $lo_id) {

    $this->path = (isset($path)) ? $path : '';
    $this->lo_id = (isset($lo_id)) ? $lo_id : 0;

  }

  public function genDemo() {

    $dal = new DAL();

    $sql = "SELECT MM.path, MM.name " . 
           "FROM demomenu DM " ;
    $demos = $dal->query($sql);
  
    $layout = "";
    foreach ($items as $item) {
      $layout .= "
<a name='tag$item->path'></a>
<a id='tag$item->path' href=\"#tag$item->path\"></a>
<div id='hdr$item->path' onclick='location.href=\"/$item->path\";' 
  style='width:50%;height:65px;background-color:#f1f1f1;cursor:pointer;border: 1px solid black;
         border-radius:5px 5px 0px 0px;border-bottom:none;'>
  <h4>Left Side</h4>

  <table class='table table-condensed'>
    <tr>
      <td style='width:30%;'><div id='hdrmsg$item->path' style='color:red;'></div></td>
      <td style='width:30%;'></div></td>
      <td style='width:20%;'><div id='login$item->path'></div></td>
      <td style='width:20%;'><div id='event$item->path'></div></td>
    </tr>
  </table>
</div>
<div id='hdr$item->path' onclick='location.href=\"/$item->path\";' 
  style='width:50%;height:65px;background-color:#f1f1f1;cursor:pointer;border: 1px solid black;
         border-radius:5px 5px 0px 0px;border-bottom:none;'>
  <h4>Right Side$item->name</h4>

  <table class='table table-condensed'>
    <tr>
      <td style='width:30%;'><div id='hdrmsg$item->path' style='color:red;'></div></td>
      <td style='width:30%;'></div></td>
      <td style='width:20%;'><div id='login$item->path'></div></td>
      <td style='width:20%;'><div id='event$item->path'></div></td>
    </tr>
  </table>
</div>

      ";
    }
    return $menuBefore;
  }
  
}
?>  
  
  
