<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
    <!--<![endif]-->
    <!-- BEGIN HEAD -->
    <head>
        <link rel="stylesheet" type="text/css" id="theme" href="<?= $this->config->item('adminassets'); ?>css/theme-default.css"/>
        <script type="text/javascript" src="<?= $this->config->item('adminassets'); ?>js/plugins/jquery/jquery.min.js"></script>
        <script type="text/javascript" src="<?= $this->config->item('adminassets'); ?>js/plugins/jquery/jquery-ui.min.js"></script>
        <script type="text/javascript" src="<?= $this->config->item('adminassets'); ?>js/plugins/bootstrap/bootstrap.min.js"></script>    
    </head>
    <body>
        <div class="page-content-wrap">
            <div class="row">
                <div class="col-md-6">
                    <form action="" class="form-horizontal" method="post" enctype="multipart/form-data">
                        <div class="panel panel-default">
                            <div class="panel-heading">                       
                                <h3 class="panel-title">Order View</h3>                       
                            </div>
                            <center>Order Detail</center>
                            <div class="panel-body form-group-separated">                      
                                <div class="form-group">
                                    <label class="col-md-1 col-xs-3">Name</label>
                                    <div class="col-md-1 col-xs-9">                                                
                                        <div class="input-group">
                                            <?= $view_data['name'] ?>
                                        </div>
                                    </div>
                                </div>                     
                                <div class="form-group">
                                    <label class="col-md-1 col-xs-3">Phone</label>
                                    <div class="col-md-1 col-xs-9">                                                
                                        <div class="input-group">
                                            <?= $view_data['phone'] ?>
                                        </div>
                                    </div>
                                </div>                     
                                <div class="form-group">
                                    <label class="col-md-1 col-xs-3">Email</label>
                                    <div class="col-md-1 col-xs-9">                                                
                                        <div class="input-group">
                                            <?= $view_data['email'] ?>
                                        </div>
                                    </div>
                                </div>                     
                                <div class="form-group">
                                    <label class="col-md-1 col-xs-3">Address</label>
                                    <div class="col-md-1 col-xs-9">                                                
                                        <div class="input-group">
                                            <?= $view_data['address'] ?>
                                        </div>
                                    </div>
                                </div>                     
                                <div class="form-group">
                                    <label class="col-md-1 col-xs-3">Comments</label>
                                    <div class="col-md-1 col-xs-9">                                                
                                        <div class="input-group">
                                            <?= $view_data['comments'] ?>
                                        </div>
                                    </div>
                                </div>      
                                  <div class="form-group">
                                    <label class="col-md-1 col-xs-3">Order Location Name</label>
                                    <div class="col-md-1 col-xs-9">                                                
                                        <div class="input-group">
                                            <?= $view_data['location_name'] ?>
                                        </div>
                                    </div>
                                </div> 
                                  <div class="form-group">
                                    <label class="col-md-1 col-xs-3">Delivery Location Name</label>
                                    <div class="col-md-1 col-xs-9">                                                
                                        <div class="input-group">
                                            <?= $view_data['delivery_location_name'] ?>
                                        </div>
                                    </div>
                                </div> 
                                <div class="form-group">
                                    <label class="col-md-1 col-xs-3">City</label>
                                    <div class="col-md-1 col-xs-9">                                                
                                        <div class="input-group">
                                            <?= $view_data['city'] ?>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-1 col-xs-3">Area Name</label>
                                    <div class="col-md-1 col-xs-9">                                                
                                        <div class="input-group">
                                            <?= $view_data['area_name'] ?>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-1 col-xs-3">Sub Total</label>
                                    <div class="col-md-1 col-xs-9">                                                
                                        <div class="input-group">
                                            <?php echo number_format($view_data['sub_total'], 2, '.', '') ?>
                                        </div>
                                    </div>
                                </div>        
                                <?php if ($view_data['gst'] && $view_data['gst'] != '0') { ?>
                                    <div class="form-group">
                                        <label class="col-md-1 col-xs-3">GST</label>
                                        <div class="col-md-1 col-xs-9">                                                
                                            <div class="input-group">
                                                <?php echo number_format($view_data['gst'], 2, '.', '') ?>
                                            </div>
                                        </div>
                                    </div>     
                                <?php } ?>
                                <?php if ($view_data['pst'] && $view_data['pst'] != '0') { ?>
                                    <div class="form-group">
                                        <label class="col-md-1 col-xs-3">PST</label>
                                        <div class="col-md-1 col-xs-9">                                                
                                            <div class="input-group">
    <?php echo number_format($view_data['pst'], 2, '.', '') ?>
                                            </div>
                                        </div>
                                    </div>     
<?php } ?>
                                <?php if ($view_data['hst'] && $view_data['hst'] != '0') { ?>
                                    <div class="form-group">
                                        <label class="col-md-1 col-xs-3">HST</label>
                                        <div class="col-md-1 col-xs-9">                                                
                                            <div class="input-group">
    <?php echo number_format($view_data['hst'], 2, '.', '') ?>
                                            </div>
                                        </div>
                                    </div>     
<?php } ?>
 <?php if ($view_data['delivery_charges'] && $view_data['delivery_charges'] != '0') { ?>
                                    <div class="form-group">
                                        <label class="col-md-1 col-xs-3">PST</label>
                                        <div class="col-md-1 col-xs-9">                                                
                                            <div class="input-group">
    <?php echo number_format($view_data['delivery_charges'], 2, '.', '') ?>
                                            </div>
                                        </div>
                                    </div>     
<?php } ?>
                                <div class="form-group">
                                    <label class="col-md-1 col-xs-3">Total</label>
                                    <div class="col-md-1 col-xs-9">                                                
                                        <div class="input-group">
<?php echo number_format($view_data['total_amount'], 2, '.', '') ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <center>Order Item Detail</center>
                            <div class="panel-body panel-body-table">
                                <div class="table-responsive">
                                    <table class="table table-bordered table-striped table-actions">
                                        <thead>
                                            <tr>
                                                <th>Item Title</th>                                                                      
                                                <th>Item Type</th>                                                                      
                                                <th>category</th>                                                                      
                                                <th>Unit</th>                                                                      
                                                <th>Quantity</th>                                                                      
                                                <th>Item Price</th>    
                                                <th>Total Price</th>    
                                            </tr>
                                        </thead>
                                        <tbody>   
<?php foreach ($order_item as $order) { ?>                                                            
                                                <tr>         
                                                    <td><?php echo (isset($order['item_name'])) ? $order['item_name'] : '-'; ?></td>
                                                    <td><?php echo (isset($order['item_type'])) ? $order['item_type'] : '-'; ?></td>
                                                    <td><?php echo (isset($order['category_name'])) ? $order['category_name'] : '-'; ?></td>
                                                    <td><?php echo (isset($order['unit_name'])) ? $order['unit_name'] : '-'; ?></td>
                                                    <td><?php echo (isset($order['item_quantity'])) ? $order['item_quantity'] : '-'; ?></td>
                                                    <td><?php echo (isset($order['unit_price'])) ? number_format($order['unit_price'], 2, '.', '') : '-'; ?></td>
                                                    <td><?php echo (isset($order['total_item_price'])) ? number_format($order['total_item_price'], 2, '.', '') : '-'; ?></td>
                                                </tr>
<?php } ?>
                                        </tbody>
                                    </table>
                                </div>                                

                            </div>   



                        </div>
                    </form>

                </div>
            </div> 
        </div>
    </body>
