  <div class="breadcrumb-area mb-20">

        <div class="container">

            <div class="row">

                <div class="col">

                    <div class="breadcrumb-container">

                        <ul>

                            <li><a href="<?php echo base_url();?>"><i class="fa fa-home"></i> Home</a></li>

                            <li class="active">My Account</li>

                        </ul>

                    </div>

                </div>

            </div>

        </div>

    </div>

	<div class="faq-area page-content mb-20">

		<div class="container">

			<div class="row">

            	<div class="col-md-3">

                	<div class="list-group">

              <a href="<?php echo base_url();?>home/MyAccount" class="list-group-item active"><i class="fa fa-shopping-cart"></i> My Orders</a>

              <a href="#" class="list-group-item"><i class="fa fa-map-marker"></i> My Address</a>

              <a href="#" class="list-group-item"><i class="fa fa-lock"></i> Change Password</a>

              <a href="<?php echo base_url();?>home/logout" class="list-group-item"><i class="fa fa-sign-out"></i> Logout</a>

                    </div>

                </div>

				<div class="col-md-9"><?php if($this->session->flashdata('msg')){echo $this->session->flashdata('msg'); }?>

					<div class="faq-wrapper">



						<div id="accordion">

                        	<?php $i=1;foreach($orders as $order){?>

							<div class="card">

								<div class="card-header" id="heading<?php echo $i;?>">

									<h5 class="mb-0">

										<button class="btn btn-link" <?php if($order['pay_status']=='FAILURE'){echo 'style="background:#ff6262;"';}?> data-toggle="collapse" data-target="#collapse<?php echo $i;?>"

											aria-expanded="true" aria-controls="collapse<?php echo $i;?>">

											Order No #<?php echo $order['oid'];?><span> <i class="fa fa-chevron-down"></i>

												<i class="fa fa-chevron-up"></i> </span>

										</button>

									</h5>

								</div>



								<div id="collapse<?php echo $i;?>" class="collapse <?php if($i==1){echo "show";}?>" aria-labelledby="heading<?php echo $i;?>"

									data-parent="#accordion">

									<div class="card-body">

										<div class="row" style="padding:10px;">

                    <div class="col-md-6">



                        <table class="table table-condensed table-striped">



                      <tbody>



                        <tr>



                          <td><strong>Order Date </strong></td>



                          <td><span class="label label-primary"><?php echo date("d M Y",strtotime($order['odate']));?></span></td>



                        </tr>



                        <tr>



                          <td><strong>Order Total</strong></td>



                          <td> <i class="fa fa-inr"></i><?php echo $order['ototal']+$order['shiptot'];?>/- &nbsp;&nbsp;&nbsp;  <b> <?php echo $order['bitems'];?> Item(s)</b></td>



                        </tr>



                        <tr>



                          <td ><strong>Order Amount</strong></td>



                          <td><i class="fa fa-inr"></i><?php echo $this->session->userdata("symbol").$order['ototal'];?>/-</td>



                        </tr>



                        <tr>



                          <td ><strong>Shipping</strong></td>



                          <td><i class="fa fa-inr"></i><?php echo $this->session->userdata("symbol").$order['shiptot'];?>/-</td>



                        </tr>
                        <tr>



                          <td ><strong>Payment Mode</strong></td>



                          <td><?php echo $order['pay_method'];?></td>



                        </tr>



                       



                      </tbody>



                    </table>



                    </div>



                    <div class="col-md-6">



                    <label class="label label-success pull-right" style="border:2px solid #063; padding:2px;"><b>Payment Status</b> : <?php echo $order['pay_status'];?></label>



                    
                    <?php if($order['del_type']=="Delivery"){?>
				 
				<h4 class="text-warning">Shipping Details</h4>
				<h5>   <?php echo $order['bname'].' '.$order['bphone'];?></h5>

                <p>   <i class="fa fa-map-marker"></i> <?php echo $order['baddress'].' '.$order['blandmark'].' '.$order['bcity']." ".$order['bstate']." ".$order['bpin'];
				
					}else{
								$this->db->select("*");
								$this->db->from("city_stores");
								$this->db->join("cities","cities.city_id=city_stores.city_id");
								$this->db->where("city_stores.city_id",$order['pickup_city']);
								$store=$this->db->get()->row();?>
                    <h4 class="text-warning">Self Pickup</h4>
				<h4>   <?php echo $store->city_name;?></h4>

                <p>   <i class="fa fa-map-marker"></i> <?php echo $store->store_name.' '.$store->store_pincode;}?>
                <div style="padding:5px; background:#3C6;">
                <b style="color:#fff;">Delivery Slot <?php echo $order['dt_slot'];?></b>
                </div>
                    </div>

                   



                   <div class="col-md-12">



                   



                      <table class="table table-condensed table-bordered">



                      <!-- <thead><tr><th colspan="6">Order Includes</th></tr></thead>-->



                       <thead><td>Image</td><td>Product</td><td>Qty</td><td>Price</td><td>Subtotal</td></tr></thead>



                        <tbody>



                   		<?php $items=$this->db->get_where("order_items",array("oid"=>$order['oid']))->result();



							foreach($items as $item){?>



                       <tr>



                       	  <td width="100px">



                          <img class="img img-responsive pull-left" width="100px" src="<?php echo $item->pimg;?>" alt=""></td><td>



                          <?php echo $item->pname;?>

                          <b><?php echo $item->packs;?></b><br/><?php echo "SKU: <b class='text-success'>SBJ00".$item->pid.'</b>';?></td>



                           <td><?php echo $item->qty;?> <i class="fa fa-times"></i> <?php echo $item->subtotal/$item->qty;?></td>

							

                           <td><h5><i class="fa fa-inr"></i><?php echo $item->subtotal;?>/-</h5></td>

                           <td><h5><i class="fa fa-inr"></i><?php echo $item->subtotal+$item->s_pro_ship;?>/-</h5></td>

    </tr>     



                            <?php }



						?>       



                        </tbody>



                      </table>



                    </div> 



                   </div>

									</div>

								</div>

							</div>

                            <?php $i++;}?>

									

								</div>



					</div>

				</div>

			</div>

		</div>

	</div>