<link rel="stylesheet" href="<?php echo base_url(); ?>assets/ecommerce/scss/style.css" />
<div class="user-profile mt-5 mb-5">
    <div class="container">
        <div class="row justify-content-between">
            <div class="col-lg-12">
                <div class="alert alert-success alert-dismissible" role="alert" <?php if($this->session->flashdata('message')==''){ ?> style="display:none" <?php } ?> >
                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                    <?php echo $this->session->flashdata('message'); ?>
                </div>
                <div class="alert alert-danger alert-dismissible" role="alert" <?php if($this->session->flashdata('emessage')==''){ ?> style="display:none" <?php } ?> >
                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                    <?php echo $this->session->flashdata('emessage'); ?>
                </div>
            </div>
        </div>
        <div class="row justify-content-between ">
            <div class="col-lg-5 col-md-5 col-12 px-lg-5 account-sidebar">
                <?php $ad['active']=2; $this->load->view('user-sidebar',$ad); ?>
            </div>
            <div class="col-lg-7 col-md-7 col-12 px-md-5">
              <div class="order-history">
                <div class="row align-items-center">
                  <div class="col-12">
                    <?php 
                        $order_status = $this->config->item("order_status");
                        if($order){ foreach ($order as $key => $value) :
                    ?>
                      <div class="all-orders d-flex align-items-center justify-content-between mb-3">
                          <?php if($value['order_status']==4){ ?>
                              <img src="<?php echo base_url(); ?>assets/ecommerce/img/icon-feather-check-circle.svg" width="36">
                          <?php }else{ ?>
                              <img src="<?php echo base_url(); ?>assets/ecommerce/img/car.png" width="55">
                          <?php } ?>
                          <div class="shipping">
                              <p class="mb-2"><?php echo (array_key_exists($value['order_status'], $order_status)?$order_status[$value['order_status']]:""); ?></p>
                              <h6 class="mb-0">On <?php echo date("F, d M",strtotime($value['order_time'])); ?></h6>
                          </div>
                          <div class="product-img">
                              <!-- <img src="assets/img/reviews/sheet.webp">
                              <span class="count">1</span> -->
                              <a href="<?php echo base_url("user-order-detail/".$value['orderid']); ?>">#<?php echo $value['orderid']; ?></a>
                          </div>
                          <div class="product-name">
                              <h5 class="mb-2">Order Amount</h5>
                              <p class="price mb-0">$<?php echo $value['grandtotal']; ?></p>
                          </div>
                      </div>
                    <?php endforeach; }else{ ?>
                      <p>There’s nothing here. Browse our <a style="color:#b9955c;" href="<?php echo base_url('products'); ?>">Products?</a></p>
                    <?php } ?>
                  </div>
                </div>
              </div>
            </div>
        </div>
    </div>
</div>
<!-- orders1 end -->