<?php $status = array('Pending', 'Confirmed', 'Cancelled', 'Wating For Online Payment') ?>
<?php $status_color = array('color:#FF9900;', 'color:#219921;', 'color:#D52229;', 'color:#FF9900;') ?>

<div class="buttons">
    <div onclick="getPage('<?php echo site_url('gkpos/online_order') ?>', 'online order')" class="col-lg-2 col-md-2 col-sm-2 col-xs-2 btn btn-primary gradient text-center" style="font-size:90%">All</div>
    <div onclick="getPage('<?php echo site_url('gkpos/online_order/pending/0') ?>', 'online order')" class="col-lg-2 col-md-2 col-sm-2 col-xs-2 btn btn-warning gradient text-center" style="font-size: 90%">Pending</div>
    <div onclick="getPage('<?php echo site_url('gkpos/online_order/confirmed/1') ?>', 'online order')" class="col-lg-2 col-md-2 col-sm-2 col-xs-2 btn btn-success gradient text-center" style="font-size: 90%">Confirmed</div>
    <div onclick="getPage('<?php echo site_url('gkpos/online_order/canceled/2') ?>', 'online order')" class="col-lg-2 col-md-2 col-sm-2 col-xs-2 btn btn-danger gradient text-center" style="font-size: 90%">Cancelled</div>
    <div onclick="getPage('<?php echo site_url('gkpos/online_order/paid/1') ?>', 'online order')" class="col-lg-2 col-md-2 col-sm-2 col-xs-2 btn btn-info gradient text-center" style="font-size: 90%">Paid</div>
    <div onclick="getPage('<?php echo site_url('gkpos/online_order/unpaid/2') ?>', 'online order')" class="col-lg-2 col-md-2 col-sm-2 col-xs-2 btn btn-danger gradient text-center" style="font-size: 90%" >Unpaid</div>
</div>
<input type="hidden" id="currentPage" value="<?php (isset($current_page) && ($current_page != '' || $current_page != null )) ? print $current_page : print'false' ?>">
<?php if (!empty($takeaway_orders)): ?>
    <div id="tableOrders" class="order-list row no-padding">
        <div class="orders">
            <?php foreach ($takeaway_orders as $takeaway_order) : ?>
                <?php $order_status_color = $status_color[$takeaway_order->online_status] ?>
                <?php $takeaway_bg_color = ' order-bg-color-' . $takeaway_order->online_type ?>
                <?php $takeaway_icon = $takeaway_order->online_type . 'icon' ?>
                <div style="padding: 0px!important" class="col-lg-2 col-md-2 col-sm-2 col-xs-2 order-item" onclick="getPage('<?php echo site_url('gkpos/online_solo_order/' . $takeaway_order->id) ?>', 'online order')">
                    <div class="order-heading text-center text-uppercase" style="color: #ffffff;"><strong><?php $takeaway_order->paid_status == 1 ? print 'Paid' : print'Unpaid' ?></strong></div>
                    <div class="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 text-center text-uppercase" style="<?php echo $order_status_color ?>"><?php echo $takeaway_order->phonealt?$takeaway_order->phonealt:$takeaway_order->phone ?></div>
                    <div class="order-heading text-center text-uppercase" style="<?php echo $order_status_color ?>"><?php echo $takeaway_order->namealt?$takeaway_order->namealt:$takeaway_order->name ?></div>
                </div>
            <?php endforeach; ?>
        </div>
    </div>
<?php else: ?>
    <div class="pages-height"></div>
    <div class="alert alert-dismissable alert-warning"><?php $action != null ? print'No ' . $action . ' orders found' : print'No Online Orders yet placed today!' ?></div>
<?php endif; ?>
<script>
  $(document).ready(function(){
      manageWindowHeight();
  });
</script>