<main>
        <!-- BREADCRUMB SECTION START -->
        <div class="ul-container">
            <div class="ul-breadcrumb">
                <h2 class="ul-breadcrumb-title">My Account</h2>
                <div class="ul-breadcrumb-nav">
                    <a href="<?php echo base_url();?>"><i class="flaticon-home"></i> Home</a>
                    <i class="flaticon-arrow-point-to-right"></i>
                    <span class="current-page">My Account</span>
                </div>
            </div>
        </div>
        <div class="ul-inner-page-container">


        <div class="row">
      <!-- Side Tabs -->
      <div class="col-md-3">
        <div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
          <button class="nav-link active text-start" id="v-pills-home-tab" data-bs-toggle="pill" data-bs-target="#v-pills-home" type="button" role="tab" aria-controls="v-pills-home" aria-selected="true">
          My Orders
          </button>
          <button class="nav-link text-start" id="v-pills-profile-tab" data-bs-toggle="pill" data-bs-target="#v-pills-profile" type="button" role="tab" aria-controls="v-pills-profile" aria-selected="false">
          Wishlist
          </button>
          <button class="nav-link text-start" id="v-pills-messages-tab" data-bs-toggle="pill" data-bs-target="#v-pills-messages" type="button" role="tab" aria-controls="v-pills-messages" aria-selected="false">
            Change Password
          </button>
          <button class="nav-link text-start" id="v-pills-settings-tab" data-bs-toggle="pill" data-bs-target="#v-pills-settings" type="button" role="tab" aria-controls="v-pills-settings" aria-selected="false">
            My Address
          </button>
          <a class="nav-link text-start" href="<?php echo base_url().'home/logout';?>">
            My Address
</a>
        </div>
      </div>

      <!-- Tab Content -->
      <div class="col-md-9">
        <div class="tab-content" id="v-pills-tabContent">
          <div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">
          <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-success" <?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['order_uid'];?><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 show" aria-labelledby="heading<?php echo $i;?>"



data-parent="#accordion">



<div class="card-body">



<div class="row">



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







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







<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']-$order['odis'];?>/- &nbsp;&nbsp;&nbsp;  <b> <?php echo $order['bitems'];?> Item(s)</b></td>







</tr>


<tr>







<td ><strong>Grand Total</strong></td>







<td><i class="fa fa-inr"></i><?php echo $order['grand_total'];?>/-</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; color:grey;"><b >Order Status</b> : <?php echo $order['ostatus'];?></label>





<hr/>





</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>';?>
MSO - <b class='text-warning'><?php echo $item->item_wid;?></b>
<?php if($item->prating=='fafsf'){?>
<button type="button" class="btn btn-warning btn-sm review_show pull-right" style="height: 30px;
padding: 5px; line-height:5px;" id="<?php echo $item->id;?>" data-toggle="modal" data-target="#myModalr">☆ Rating</button>
<?php }?>
</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 class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab">
            <h3>Profile</h3>
            <p>This is the Profile tab content.</p>
          </div>
          <div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab">
            <h3>Messages</h3>
            <p>You can check your messages here.</p>
          </div>
          <div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab">
            <h3>Settings</h3>
            <p>Update your settings in this tab.</p>
          </div>
        </div>
      </div>
    </div>








           



</div>



</div>



  <?php $i++;}?>







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

                <!-- sidebar -->
                
            </div>
        </div>
        <!-- BLOG SECTION END -->
    </main>













           
        <!-- Breadcrumb area End -->
		
        <div id="myModalr" class="modal fade" role="dialog">
          <div class="modal-dialog">
        
            <!-- Modal content-->
            <div class="modal-content">
              <div class="modal-header">
                <h4 class="modal-title">Rating & Review</h4>
                <button type="button" class="close" id="closemodal" data-dismiss="modal">&times;</button>
              </div>
              <div class="modal-body row">
              	<div class="col-md-4">
                <h3>What makes a good review</h3>
                <hr/>
                <h4 class="text-danger">Have you used this product?</h4>
                <p>Your review should be about your experience with the product.</p>
                <h4 class="text-danger">Why review a product?</h4>
                <p>Your valuable feedback will help fellow shoppers decide!</p>
                <h4 class="text-danger">How to review a product?</h4>
                <p>Your review should include facts. An honest opinion is always appreciated. If you have an issue with the product or service</p>
                </div>
                <div class="col-md-8">
                <form action="" method="post" class="revform">
                	<input type="hidden" name="itemid" value="" id="itemid" />
                	<div class="form-group">
                    	<label>Select Rating</label>
                        <select class="form-control" required name="rating">
                        	<option value="5-Excellent">🌟🌟🌟🌟🌟 Excellent</option>
                        	<option value="4-Very Good">🌟🌟🌟🌟 Very Good</option>
                        	<option value="3-Good">🌟🌟🌟 Good</option>
                        	<option value="2-Bad">🌟🌟 Bad</option>
                        	<option value="1-Very Bad">🌟 Very Bad</option>
                        </select>
                    </div>
                    <div class="form-group">
                    	<label>Write Review</label>
                        <textarea class="form-control" name="review" rows="4"></textarea>
                    </div>
                    <button type="submit"  class="btn btn-primary">Submit</button>
                </form>
                </div>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal" id="closemodal2">Close</button>
              </div>
            </div>
        
          </div>
        </div>

        <!-- Main Content Wrapper Start -->
        
        <script>
		$(document).ready(function(){
			$("#closemodal").click(function(){
				$('#myModalr').modal('toggle');
			});
			$("#closemodal2").click(function(){
				$('#myModalr').modal('toggle');
			});
			$(".review_show").click(function(){
				var id=$(this).attr("id");
				$("#itemid").val(id);
				$('#myModalr').modal('toggle');
			});
			$(".revform").submit(function(e){e.preventDefault();
				var formdata=$(this).serialize();
				$.ajax({
				 type: "POST",
				 url: '<?php echo base_url();?>home/review_submit',
				 data: {formdata:formdata},
				 success: function(res){
					 //alert(res);return false;
					 if(res==1){
						$('#myModalr').modal('toggle');
						alert("Thanks for your review. Happy to shop you more.");
					 }else{
						alert("Sorry we are unable to take your review now. Please try later.");
					 }
					 //alert(res);
					 //	console.log(res);
					}
				 });
			});
		});
		</script>