<div style="display:none">
    <div id="onlineOrderContent" class="popupouter">
        <div class="popup-header row">
            <div id="warningPopupHeader" class="warningPopupHeader col-lg-10 col-md-10 col-sm-10 col-xs-10 text-left ">Order Detail</div>
            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 closeWarningPopup text-right times" onclick="closecolorbox()"><i class="fa fa-close"></i></div>
        </div>
        <div class="popup-body row" style="padding: 30px; margin-top: 30px;">
            <div id="warningPopupContent" class="warningPopupContent col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="popup-content">
                    <?php $status = array('Pending', 'Confirmed', 'Canceled', 'Wating For Online Payment') ?>
                    <?php $status_color = array('color:#FF9900;', 'color:#219921;', 'color:#D52229;', 'color:#FF9900;') ?>
                    <?php if (isset($order) && !empty($order[0])): ?>

                        <table class="table table-bg-color-white table-content" style='margin-top: -30px;margin-bottom:-5px;'  width="100%" cellspacing="0" cellpadding="0" border="0">
                            <tbody>
                                <?php if ($order[0]->online_type == 'collection'): ?>
                                    <tr class="odd">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'> Order ID</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'><?php echo strtoupper($order[0]->id) ?></td>
                                    </tr>
                                    <tr class="even">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Order Type</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'>Collection</td>
                                    </tr>
                                    <tr class="even">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Customer Name</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'><?php echo $order[0]->namealt ? $order[0]->namealt : $order[0]->name ?></td>
                                    </tr>

                                    <tr class="even">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Customer Phone</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'><?php echo $order[0]->phonealt ? $order[0]->phonealt : $order[0]->phone ?></td>
                                    </tr>
                                    <tr class="even">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;' >Restaurant Name</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'><?php echo ucwords($this->config->item('gk_name')) ?></td>
                                    </tr>
                                    <tr class="even">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Restaurant Phone</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'><?php echo $this->config->item('gk_phone') ?></td>
                                    </tr>
                                    <tr class="odd">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Collection Address:</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'><?php echo ucwords($this->config->item('gk_address')) ?></td>
                                    </tr>
                                    <tr class="odd">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Order Status</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'>
                                            <span style="<?php echo $status_color[$order[0]->online_status] ?>"><?php echo $status[$order[0]->online_status] ?></span>
                                        </td>
                                    </tr>

                                    <tr class="odd">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Order Date</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'><?php isset($order[0]->created) && $order[0]->created !== '0000-00-00 00:00:00' ? print date('F j, Y H:i:A', strtotime($order[0]->created)) : print'' ?></td>
                                    </tr>
                                    <tr class="odd">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Collection Time</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'><?php isset($order[0]->delivery_time) ? print $order[0]->delivery_time : '' ?></td>
                                    </tr>
                                    <tr class="even">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Payment Method</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'><?php echo strtoupper($order[0]->online_method) ?></td>
                                    </tr>
                                <?php else: ?>
                                    <tr class="odd">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Order ID</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'><?php echo strtoupper($order[0]->id) ?></td>
                                    </tr>
                                    <tr class="even">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Order Type</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'>Delivery</td>
                                    </tr>
                                    <tr class="even">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Customer Name</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'><?php echo $order[0]->namealt ? $order[0]->namealt : $order[0]->name ?></td>
                                    </tr>

                                    <tr class="even">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Customer Phone</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'><?php echo $order[0]->phonealt ? $order[0]->phonealt : $order[0]->phone ?></td>
                                    </tr>

                                    <?php
                                    $billAddressString = '';
                                    $billAddressString .= trim($order[0]->floor_or_apt) ? $this->lang->line('gkpos_floor_or_apt_no') . '&nbsp;:&nbsp;' . ucwords($order[0]->floor_or_apt) . ', ' : '';
                                    $billAddressString .= trim($order[0]->building) ? $this->lang->line('gkpos_building') . '&nbsp;:&nbsp;' . ucwords($order[0]->building) . ', ' : '';
                                    $billAddressString .= trim($order[0]->house) ? ucwords($order[0]->house) . '&nbsp;' : '';
                                    $billAddressString .= trim($order[0]->street) ? ucwords($order[0]->street) . ', ' : '';
                                    $billAddressString .= trim($order[0]->city) ? ucwords($order[0]->city) . ', ' : '';
                                    $billAddressString .= trim($order[0]->postcode) ? ucwords($order[0]->postcode) : '';
                                    ?>
                                    <tr class="even">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Customer Delivery Address</td>
                                        <td class="bdr-bottom" width="60%"><?php echo $billAddressString ?></td>
                                    </tr>
                                    <tr class="odd">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Order Status</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'>
                                            <span style="<?php echo $status_color[$order[0]->online_status] ?>"><?php echo $status[$order[0]->online_status] ?></span>
                                        </td>
                                    </tr>

                                    <tr class="odd">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Order Date</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'><?php isset($order[0]->created) && $order[0]->created !== '0000-00-00 00:00:00' ? print date('F j, Y H:i:A', strtotime($order[0]->created)) : print'' ?></td>
                                    </tr>
                                    <tr class="odd">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Delivery Time</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'><?php isset($order[0]->delivery_time) ? print $order[0]->delivery_time : '' ?></td>
                                    </tr>
                                    <tr class="even">
                                        <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>Payment Method</td>
                                        <td class="bdr-bottom" width="60%" style='padding: 2px 4px;'><?php echo strtoupper($order[0]->online_method) ?></td>
                                    </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                        <table class="table table-bg-color-white table-content" cellspacing="0" cellpadding="0" border="0"style='margin-top: -5px'>
                            <tbody>
                                <tr class="even">
                                    <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'><strong>Name</strong></td>
                                    <td class="bdr-bottom bdr-right" width="20%" style='padding: 2px 4px;'><strong>U.P</strong></td>
                                    <td class="bdr-bottom bdr-right" width="20%" style='padding: 2px 4px;'><strong>Qty</strong></td>
                                    <td class="bdr-bottom bdr-right" width="20%" style='padding: 2px 4px;'>Price</td>
                                </tr>

                                <?php if (!empty($items)): ?>
                                    <?php foreach ($items as $item): ?>
                                        <tr class="odd">
                                            <td class="bdr-bottom bdr-right" width="40%" style='padding: 2px 4px;'>
                                                <?php
                                                $itemString = isset($item->selection_title) && $item->selection_title != null ? $item->selection_title . '-' . $item->menu_title : $item->menu_title;
                                                $itemString .= $item->set_items != null ? '<br/><i><strong style="font-size:11px;">Items: </strong>' . $item->set_items . '</i>' : '';
                                                $itemString .= $item->toppings != null ? '<br/><i><strong style="font-size:10px; text-transform: uppercase;">T/S:</strong>' . $item->toppings . '</i>' : '';
                                                echo $itemString;
                                                ?>
                                            </td>
                                            <td class="bdr-bottom bdr-right" width="20%" style='padding: 2px 4px;'><?php echo to_currency($item->price) ?></td>
                                            <td class="bdr-bottom bdr-right" width="20%" style='padding: 2px 4px;'><?php echo $item->quantity ?></td>
                                            <td class="bdr-bottom bdr-right" width="20%" style='padding: 2px 4px;'><?php echo to_currency($item->price * $item->quantity) ?></td>
                                        </tr>
                                    <?php endforeach; ?>
                                <?php endif; ?>
                                <tr class="even">
                                    <td colspan="3" class="bdr-bottom bdr-right" width="80%" style="text-align: right; padding: 2px 4px;"><strong>Subtotal:</strong></td>
                                    <td class="bdr-bottom bdr-right" width="20%" style="text-align: left; padding: 2px 4px;"><strong><?php echo to_currency($order[0]->order_total) ?></strong></td>
                                </tr>

                                <?php if (isset($vat) && $vat > 0): ?>
                                    <tr class="even">
                                        <td colspan="3" class="bdr-bottom bdr-right" width="80%" style="text-align: right;padding: 2px 4px;">VAT(+):</td>
                                        <td class="bdr-bottom bdr-right" width="20%" style="text-align: left; padding: 2px 4px;"><?php echo to_currency($vat) ?></td>
                                    </tr>
                                <?php endif; ?>
                                <?php if ($order[0]->cc_fee != null && $order[0]->cc_fee > 0) : ?>    
                                    <tr class="odd">
                                        <td colspan="3" class="bdr-bottom bdr-right" width="80%" style="text-align: right; padding: 2px 4px;">ccFee(+):</td>
                                        <td class="bdr-bottom bdr-right" width="20%" style="text-align: left; padding: 2px 4px;"><?php echo to_currency($order[0]->cc_fee) ?></td>
                                    </tr>
                                <?php endif; ?>
                                <?php if ($order[0]->delivery_charge > 0): ?>
                                    <tr class="odd">
                                        <td colspan="3" class="bdr-bottom bdr-right" width="80%" style="text-align: right; padding: 2px 4px;">DeliveryFee(+):</td>
                                        <td class="bdr-bottom bdr-right" width="20%" style="text-align: left; padding: 2px 4px;"><?php echo to_currency($order[0]->delivery_charge) ?></td>
                                    </tr>
                                <?php endif; ?>
                                <?php if ($order[0]->bogo_discount > 0): ?>
                                    <tr class="odd">
                                        <td colspan="3" class="bdr-bottom bdr-right" width="80%" style="text-align: right; padding: 2px 4px;">Multi Discount(-):</td>
                                        <td class="bdr-bottom bdr-right" width="20%" style="text-align: left; padding: 2px 4px;"><?php echo to_currency($order[0]->bogo_discount) ?></td>
                                    </tr>
                                <?php endif; ?>  
                                <?php if (isset($discount) && $discount > 0): ?>
                                    <tr class="odd">
                                        <td colspan="3" class="bdr-bottom bdr-right" width="80%" style="text-align: right;padding: 2px 4px;">Discount(-):</td>
                                        <td class="bdr-bottom bdr-right" width="20%" style="text-align: left; padding: 2px 4px;"><?php echo to_currency($discount) ?></td>
                                    </tr>
                                <?php endif; ?>  

                                <tr class="odd">
                                    <td colspan="3" class="bdr-bottom bdr-right" width="80%" style="text-align: right; padding: 2px 4px;"><strong>Grand Total:</strong></td>
                                    <td class="bdr-bottom bdr-right" width="20%" style="text-align: left; padding: 2px 4px;"><strong><?php echo to_currency($order[0]->grand_total) ?></strong></td>
                                </tr>
                            </tbody>
                        </table>
                    <?php endif; ?>
                </div>
            </div>
        </div>
        <div class="popup-footer row">
            <a href="javascript:void(0)" class="closeWarningPopup text-center btn btn-default col-md-offset-5 col-md-2 col-md-offset-5" onclick="closeColorbox()"><?php echo $this->lang->line('gkpos_close') ?></a>
        </div>
    </div>
</div>














