<style>
    .pagination a {
        padding: 10px;
    }
</style>
<?php $status = array('Pending', 'Confirmed', 'Canceled', 'Wating For Online Payment') ?>
<?php $status_color = array('color:#FF9900;', 'color:#219921;', 'color:#D52229;', 'color:#FF9900;') ?>
<div id="story" class="light-wrapper customer-wrapper">
    <div class="container-fluid inner-customer-dashboard ">
        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
            <?php echo $this->load->view('customer/site_nav') ?>
        </div>
        <div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
            <h3 class="text-center">Order list</h3>
            <div class="innercommon-right-content">
                <table class="payment-table table table-responsive">
                    <tbody>
                        <tr class="even">
                            <th class="bdr-bottom bdr-right">Ref.#</th>
                            <th class="bdr-bottom bdr-right">Restaurant</th>
                            <th class="bdr-bottom bdr-right">Order Placed on</th>
                            <th class="bdr-bottom bdr-right">Total</th>
                            <th class="bdr-bottom bdr-right">Status</th>
                            <th class="bdr-bottom bdr-right">Type</th>
                            <th class="bdr-bottom bdr-right">Action</th>
                        </tr>
                        <?php if (!empty($orders)): ?>
                            <?php foreach ($orders as $order): ?>
                                <tr class="even">
                                    <td class="bdr-bottom bdr-right"><a href="<?php echo site_url('customer/order_detail/' . $order->id) ?>"><?php echo strtoupper($order->id) ?></a></td>
                                    <td class="bdr-bottom bdr-right"><?php echo $this->config->item('gk_name') ?></td>
                                    <td class="bdr-bottom bdr-right"><?php isset($order->created) && $order->created !== '0000-00-00 00:00:00' ? print date('F j, Y H:i:A', strtotime($order->created)) : print'' ?></td>
                                    <td class="bdr-bottom bdr-right"><?php echo to_currency($order->grand_total) ?></td>
                                    <td class="bdr-bottom bdr-right"><span style="<?php echo $status_color[$order->online_status] ?>" class="blink"><?php echo $status[$order->online_status] ?></span></td>
                                    <td class="bdr-bottom bdr-right"><?php $order->online_type == 'collection' ? print 'Pick Up' : print'Delivery' ?></td>
                                    <td class="bdr-bottom bdr-right">
                                        <a href="<?php echo site_url('customer/order_detail/' . $order->id) ?>" class="icon icon-edit">View</a>
                                    </td>
                                </tr>
                            <?php endforeach; ?>
                        <?php else: ?>
                            <tr>
                                <td colspan="7">No yet placed...</td>
                            </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
                <ul class="pagination pagination-sm">
                    <?php echo $pagination; ?>
                </ul>
            </div>
        </div>
    </div>
</div>
