<div class="container-fluid body">
    <div class="row no-padding">
        <?php echo $template['partials']['left_sidebar'] ?>
        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-8  bodyitem">
            <div id="MiddleContent">
                <?php if ($this->config->item('gk_order_table') == 'yes'): ?>
                    <?php if (!empty($table_orders)): ?>
                        <div class="order-list col-sm-12 ">
                            <div class="orders ">
                                <?php foreach ($table_orders as $table) : ?>
                                    <?php $order_status_color = 'order-status-color-' . $table->status ?>
                                    <?php $order_table_bg_color = 'order-table-bg-color-' . $table->status ?>
                                    <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2" style="padding: 0px!important">
                                        <div onclick="isOccupied('<?php echo $table->id ?>')"  class="center-block text-center <?php echo $order_table_bg_color ?>"><div class="table-number"><?php echo $table->table_number ?></div></div>
                                        <div class="order-heading center-block text-center text-capitalize <?php echo $order_status_color; ?>"><?php echo $table->guest_quantity ?></div>
                                    </div>
                                <?php endforeach; ?>
                            </div>
                        </div>
                    <?php endif; ?>
                <?php endif; ?>

                <?php if ($this->config->item('gk_order_delivery') == 'yes' || $this->config->item('gk_order_collection') == 'yes' || $this->config->item('gk_order_waiting') == 'yes'): ?>
                    <?php if (!empty($takeaway_orders)): ?>
                        <div  class="order-list  col-sm-12 ">
                            <div class="orders ">
                                <?php foreach ($takeaway_orders as $takeaway_order) : ?>
                                    <?php $order_status_color = 'order-status-color-' . $takeaway_order->status ?>
                                    <?php $takeaway_bg_color = ' order-bg-color-' . $takeaway_order->order_type ?>
                                    <?php $takeaway_icon = $takeaway_order->order_type . 'icon' ?>
                                    <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 order-item " style="padding: 0px!important">
                                        <div onclick="isOccupied('<?php echo $takeaway_order->id ?>')" class="center-block table-icon <?php echo $takeaway_bg_color ?>"><img src="<?php echo ASSETS_GKPOS_PATH . 'images/' . $takeaway_icon . '.png' ?>" class="img-responsive center-block"></div> 
                                        <div class="order-heading center-block text-center text-capitalize <?php echo $order_status_color; ?>"><?php isset($takeaway_order->name) && $takeaway_order->name != null ? print substr($takeaway_order->name, 0, 8) : print $takeaway_order->phone ?></div>
                                    </div>
                                <?php endforeach; ?>
                            </div>
                        </div>
                    <?php endif; ?>
                <?php endif; ?>
                <?php if ($this->config->item('gk_order_bar') == 'yes'): ?>
                    <?php if (!empty($bar_orders)): ?>
                        <div id="tableOrders" class="order-list col-sm-12  ">
                            <div class="orders ">
                                <?php foreach ($bar_orders as $bar_order) : ?>
                                    <?php $order_status_color = 'order-status-color-' . $bar_order->status ?>
                                    <?php $takeaway_bg_color = ' order-bar-bg-color' ?>
                                    <?php $takeaway_icon = $bar_order->order_type . 'icon' ?>
                                    <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 order-item" style="padding: 0px!important">
                                        <div onclick="isOccupied('<?php echo $bar_order->id ?>')" class="center-block table-icon <?php echo $takeaway_bg_color ?>"><img src="<?php echo ASSETS_GKPOS_PATH . 'images/' . $takeaway_icon . '.png' ?>" class="img-responsive center-block"></div> 
                                        <div class="center-block order-heading text-center text-capitalize <?php echo $order_status_color; ?>"><?php isset($bar_order->name) && $bar_order->name != null ? print substr($bar_order->name, 0, 8) : print $bar_order->phone ?></div>
                                    </div>
                                <?php endforeach; ?>
                            </div>
                        </div>
                    <?php endif; ?>
                <?php endif; ?>
            </div>
            <div id="customerInformation"></div>
        </div>
        <?php echo $template['partials']['right_sidebar'] ?>
    </div>
</div>
<div id="MangerOrderPopoUp"></div>
<script>
    $(document).ready(function () {
        manageWindowHeight();
        $('#MangerOrderPopoUp').html('');
        $("#caller_order_type").autocomplete({
            delay: 0,
            source: ["delivery", "collection", "table", "waiting"],
            minLength: 0
        });
        $('.online-order-btn-visibility').show();
        var normalWindow = $(window).height();
        if (normalWindow <= 768) {
            $(window).bind('resize', function () {
                $('.userlogingbg h3 > a > img').css({
                    'max-width': '100%'
                });
                $('.center-div.extra-bg').css({
                    'margin-top': '37px'
                });
                var resizeWindow = $(window).height();
                if (resizeWindow > normalWindow) {
                    $('.customernambg').css({'padding': '10px 0px'})
                } else {
                    $('.customernambg').css({'padding': '4px 0px'})
                    $('.userlogingbg h3 > a > img').css({
                        'max-height': '70px',
                        'max-width': '165px'
                    });
                    $('.center-div.extra-bg').css({
                        'margin-top': '3px'
                    });
                }
            });
        }
    });

</script>
