<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>
                        <img src="<?= site_url() ?>images/shared/SaleculatorLogoWebinSmall.png" alt="posics">                        
                    </li></ul>
            </div>
            <ul class="accordion">               
                <?php
                foreach ($floors as $flr) {
                    echo "<li id=" . $flr['ID'] . ">";
                    echo "<a href=#one>" . $flr['NAME'] . "</a>";
                    echo "<ul class=sub-menu>";
                    $arraysts = array();                   
                    $i = 0;
                    foreach ($places as $plc) {
                        foreach ($status as $sts) {

                            if ($sts == $plc['ID']) {
                                array_push($arraysts, $sts);
                                
                            }
                        }
                        if ($flr['ID'] == $plc['FLOOR']) {
                            if ($plc['CONTENT'] == true) {
                                if ($arraysts[$i] == $plc['ID']) {
                                    $i++;
                                    echo '<li class=green><a href="' . site_url('pos/tables/select/' . $plc['ID']) . '">' . $plc['NAME'] . '</a></li>';
                                } else {
                                    echo '<li class=occupied><a href="' . site_url('pos/ticket/selectticket/' . $plc['ID']) . '">' . $plc['NAME'] . '</a></li>';
                                    
                                }
                            } if ($plc['CONTENT'] == false) {

                                echo '<li><a href="' . site_url('pos/tables/select/' . $plc['ID']) . '">' . $plc['NAME'] . '</a></li>';
                            }
                        }
                    }
                    echo "</ul></li>";
                }
                ?>

            </ul>
        </div>
    </body>
</html>