<section role="main" class="content-body">
					<header class="page-header">
						<h2>Orders Details</h2>
					
						<div class="right-wrapper pull-right">
							<ol class="breadcrumbs">
								<li>
									<a href="<?php echo base_url();?>admin">
										<i class="fa fa-home"></i>
									</a>
								</li>
								<li><span>Orders Details</span></li>
							</ol>
					
						</div>
					</header>

					<div class="row">
              <div class="col-sm-9">
                <div class="panel widget light-widget">
                  <div class="panel-body" style="padding:40px;" id="printsec">
                    <div class="pull-right text-right">
                      <h3 class="font-semibold mgbt-xs-20">INVOICE</h3>
                      <table class="table table-bordered">
                        <tr>
                          <th>Invoice No.</th>
                          <th>Date</th>
                        </tr>
                        <tr>
                          <td>#<?php echo $order->oid;?></td>
                          <td><?php echo date("d M Y h:i a",strtotime($order->odate));?></td>
                        </tr>
                      </table>
                    </div>
                    <div class="mgbt-xs-20"><img style="height:60px;" alt="logo" src="<?php echo base_url();?>assets/images/logo.png" /></div>
                    <address>
                    Espedia International Limited, <br>
                    123, ABC Test Store, ABC City State 123456<br/>shop no.1, ABC Country 123456<br>
                    <abbr title="Phone">Ph :</abbr> 1234567890, +91 1231231230<br />
                    <br />
                    info@bid9ja.com
                    </address>
                    <hr/>
                    <br/>
                    <div class="pd-25">
                      <div class="row">
                        <div class="col-xs-8">
                          <address>
                          <strong>Bill To:</strong><br>
                          <?php echo $order->bname;?><br>
                          <?php echo $order->baddress;?><br>
                          <?php echo $order->blandmark.' '.$order->bcity.' '.$order->bstate.' '.$order->bpin;?><br>
                          <i class="fa fa-phone"></i> <?php echo $order->bphone;?>
                          </address>
                        </div>
                       <!-- <div class="col-xs-4">
                          <address>
                          <strong>Ship To:</strong><br>
                          John Doe<br>
                          795 Folsom Ave, Suite 600<br/>
                          San Francisco, CA 94107<br>
                          </address>
                        </div>-->
                       <!-- <div class="col-xs-2">
                          <address>
                          <strong>Due Date:</strong><br>
                          24 July 2013
                          </address>
                        </div>-->
                        <div class="col-xs-4">
                          <div class="text-right">
                          <strong>Total Amount:</strong><br>
                          <span class="mgtp-5 vd_green font-md"><?php echo $order->curr.' '.$order->ototal;?>/-</span>
                          <br/>Pay Method - <strong> <?php echo $order->pay_method;?></strong>
                           <br/>Transaction ID- <strong> <?php echo $order->trans_id;?></strong>
                           <br/>Transaction Ref- <strong> <?php echo $order->txn_ref;?></strong>
                          </div>
                        </div>
                      </div>
                    </div>
                    <table class="table table-condensed table-striped">
                      <thead>
                        <tr>
                          <th>SKU</th>
                          <th>DESCRIPTION</th>
                          <th class="text-center" style="width:20px;">QTY</th>
                          <th class="text-right" style="width:120px;">UNIT PRICE</th>
                          <th class="text-right" style="width:120px;">Shipping</th>
                          <th class="text-right" style="width:120px;">TOTAL</th>
                        </tr>
                      </thead>
                      <tbody>
                      <?php foreach($items as $item){?>
                        <tr>
                          <td class="text-center"><?php echo $item->pid;?></td>
                          <td class="text-center">
                          <img  width="100px" class="img img-responsive pull-left" src="<?php echo base_url();?>assets/images/products/<?php echo $item->pimg;?>"> <?php echo $item->pname;if($item->claim_pro=="yes"){?><br/><label class="label label-warning">Claimed</label><?php }?></td>
                          <td><?php echo $item->qty?></td>
                          <td class="text-right"> <?php echo $item->price.'/- ';?></td>
                          <td class="text-right"> <?php echo $item->s_pro_ship.'/- ';?></td>
                          <td class="text-right"> <?php echo $item->s_pro_ship+$item->subtotal;?>/-</td>
                          
                        </tr>
                        <?php }?>
                      </tbody>
                      <tfoot>
                        <tr>
                          <th colspan="4" rowspan="3" class="bdr">
                            <!--<h4>Offer Code Used - 
                            <b class="text-danger"><?php if($order->offer!=""){
							  $of=$this->db->get_where("promos",array("promo_id"=>$order->offer))->row();
							  echo $of->promo_code;}?></b></h4>--></th>
                          <th class="text-right pd-10">Sub Total</th>
                          <th class="text-right pd-10"><?php echo $order->otot;?>/-</th>
                        </tr>
                        <tr>
                          <th class="text-right  pd-10 no-bd">Shipping Cost</th>
                          <th class="text-right  pd-10 no-bd"><?php echo $order->shiptot;?>/-</th>
                        </tr>
                        
                        <tr>
                          <th class="text-right  pd-10 no-bd">Discount</th>
                          <th class="text-right  pd-10 vd_red no-bd"><?php echo $order->odis;?>/-</th>
                        </tr>
                        <tr>
                          <th colspan="4">Thank you for your order. Please remit the total amount due within 30 days.</th>
                          <th class="text-right  pd-10">Order Total</th>
                          <th class="text-right  pd-10"><span class="vd_green font-sm font-normal"><?php echo $order->ototal-$order->odis;//-$order->odis;?>/-</span></th>
                        </tr>
                      </tfoot>
                    </table>
                  </div>
                  <!-- panel-body --> 
                  
                </div>
                <!-- Panel Widget --> 
              </div>
              <!-- col-sm-9-->
              <div class="col-sm-3">
                <div class="mgbt-xs-5">
                  <a href="<?php echo base_url();?>admin/orders" class="btn btn-warning" type="button">
                  <i class="fa fa-arrow-left"></i> Back To All Orders</a>
                </div>
                <div class="mgbt-xs-5">
                  <button class="btn vd_btn vd_bg-grey" onclick="printPage('printsec');" type="button"><i class="fa fa-print append-icon"></i>Print Invoice</button>
                </div>
                <div class="mgbt-xs-5">
                  <a class="btn vd_btn vd_bg-green" href="<?php echo base_url();?>admin/invoice_pdf/<?php echo $this->uri->segment(3);?>"><i class="fa fa-download append-icon"></i>Get PDF</a>
                </div>
                 <div class="mgbt-xs-5">
                  <a class="btn vd_btn vd_bg-red" href="<?php echo base_url();?>admin/delete_order/<?php echo $order->oid;?>"><i class="fa fa-trash-o append-icon"></i>Delete Order</a>
                </div>
                <div class="mgbt-xs-5">
                <hr/>
                <h5>Update Order Status</h5>
                <p id="ostresponse" class="text-danger"></p>
                  <select id="changestatus" class="form-control">
                  		<option value="In Process" <?php if($order->ostatus=="In Process"){echo "selected";}?>>Pending</option>
                        <option value="Delivered" <?php if($order->ostatus=="Delivered"){echo "selected";}?>>Delivered</option>
                        <option value="Cancel" <?php if($order->ostatus=="Cancel"){echo "selected";}?>>Cancel</option>
                        <option value="Completed" <?php if($order->ostatus=="Completed"){echo "selected";}?>>Completed</option>
                  </select>
                </div>
              </div>
            </div>
						
                    </div>
				</section>
			</div>

			
		</section>

		<!-- Vendor -->
        <script>
function printPage(id) {
    var html="<html>";
    html+= document.getElementById(id).innerHTML;
    html+="</html>";
    var printWin = window.open('','','left=100,top=100,width=1200,height=600,toolbar=0,scrollbars=0,status =0');
    printWin.document.write(html);
    printWin.document.close();
    printWin.focus();
    printWin.print();
    printWin.close();
}
	$(document).ready(function(){
		$("#changestatus").change(function(){
			//alert("AFsd");
			var st=$(this).val();
			$.ajax({
					type:'POST',
					data:{oid:'<?php echo $this->uri->segment(3);?>',st:st},
					url:'<?php echo base_url();?>admin/ostatus_change',
					success:function(data){
					  // alert(data);
						$("#ostresponse").html(data); 
						//$('#sectionn').material_select();  
					}
			});
		});
	});
</script>

		<script src="<?php echo base_url();?>admin_assets/vendor/jquery-browser-mobile/jquery.browser.mobile.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/bootstrap/js/bootstrap.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/nanoscroller/nanoscroller.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/jquery-placeholder/jquery.placeholder.js"></script>
		
		<!-- Theme Base, Components and Settings -->
		<script src="<?php echo base_url();?>admin_assets/javascripts/theme.js"></script>
		
		<!-- Theme Custom -->
		<script src="<?php echo base_url();?>admin_assets/javascripts/theme.custom.js"></script>
		
		<!-- Theme Initialization Files -->
		<script src="<?php echo base_url();?>admin_assets/javascripts/theme.init.js"></script>

	</body>
</html>