<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>Web Pos</title>
        <link rel="stylesheet" type="text/css" href="<?= site_url() ?>css/style.css" media="screen">
        <link rel="stylesheet" type="text/css" href="<?= site_url() ?>css/navi.css" media="screen">
        <link rel="stylesheet" href="<?= site_url() ?>css/accordionmenu.css" type="text/css" media="screen" />
        <style type="text/css">#wrapper-250{width:98%;margin:0 auto;}</style>
        <meta name="robots" content="noindex,follow" />
        <script type="text/javascript" src="<?= site_url() ?>js/jquery-1.8.3.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                // Store variables
                var accordion_head = $('.accordion > li > a'),
                        accordion_body = $('.accordion li > .sub-menu');
                // Open the first tab on load
                accordion_head.first().addClass('active').next().slideDown('normal');
                // Click function
                accordion_head.on('click', function(event) {
                    // Disable header links
                    event.preventDefault();
                    // Show and hide the tabs on click
                    if ($(this).attr('class') != 'active') {
                        accordion_body.slideUp('normal');
                        $(this).next().stop(true, true).slideToggle('normal');
                        accordion_head.removeClass('active');
                        $(this).addClass('active');
                    }
                });
            });
        </script>
    </head>
    <body><br>       
        <div id="wrapper-250">
            <div class="cssmenu">
                <ul><li><a href="<?= site_url() ?>pos/tables">
                            <img src="<?= site_url() ?>images/table.png" alt="posics">
                            <br>
                            <b>Table</b></a> </li><li>
                        <a href="<?= site_url() ?>pos/ticket/selectticket/<?php echo $tableID ?>">
                            <img src="<?= site_url() ?>images/ticket.png" alt="posics">
                            <br>
                            <b>Ticket</b></a></li>
                    <li>
                        <br>
                        <?php echo '<a href="">' . $tableName[0]['NAME'] . '  ' . $tableToken[0]['NAME'] . '</a>'; ?>
                    </li>
                    <li>
                        <a href="<?= site_url() ?>pos/tables/logout/">
                            <img src="<?= site_url() ?>images/logout.png" alt="posics">
                            <br>
                            <b>Logout</b></a></li>
                </ul>
            </div>
            <ul class="accordion">
                <?php
                
                foreach ($categories as $cat) {
                    echo "<li  id=" . $cat['ID'] . ">";
                    echo "<a href=#one>" . $cat['NAME'] . "</a>";
                    echo "<ul class=sub-menu id=sub-menu>";
                    $arrayitems = array();
                    $i = 0;
                    foreach ($products as $prod) {
                        foreach ($items as $its) {

                            if ($its == $prod['ID']) {
                                array_push($arrayitems, $its);                                
                            }
                        }

                        if ($cat['ID'] == $prod['CATEGORY']) {
                            if ($arrayitems[$i] == $prod['ID']) {
                                $i++;
                                echo "<li class=green id=" . $prod['ID'] . "><a href=" . site_url('pos/menu/additem/' . $tableID . '/' . $prod['ID']) . "><em><button id=add class=ad name=" . $prod['ID'] . "><img src=" . site_url() . "images/add4.png alt=add  style=margin:-12px></button></em>&nbsp;" . $prod['NAME'] . "<span>" . $this->formatslist->formatCurrencywithHash($prod['PRICESELL']) . "</span></a></li>";
                            } else {
                                echo "<li  id=" . $prod['ID'] . "><a href=" . site_url('pos/menu/additem/' . $tableID . '/' . $prod['ID']) . "><em><button id=add class=ad name=" . $prod['ID'] . "><img src=" . site_url() . "images/add4.png alt=add  style=margin:-12px></button></em>&nbsp;" . $prod['NAME'] . "<span>" . $this->formatslist->formatCurrencywithHash($prod['PRICESELL']) . "</span></a></li>";
                            }
                        }
                    }
                    echo "</ul></li>";
                }
                ?>
            </ul>
        </div>
    </body>
</html>