<style>

.order_table .table th, .table td{padding:5px;}

</style>

<div class="breadcrumb section pt-60 pb-60">

      <div class="container">

        <h1 class="uppercase">My Addresses</h1>

        <ul>

          <li><a href="<?php echo base_url();?>" style="color:#fff;"><i class="fa fa-home"></i></a></li>

          <li class="active" style="color:#fff;">My Addresses</li>

        </ul>

      </div>

    </div>

    <!-- =====  BREADCRUMB END===== -->

    <div class="page-checkout section">

      <!-- =====  CONTAINER START  ===== -->

      <div class="container">

<div class="row">

	  <aside id="column-right" class="col-sm-3 hidden-xs">

      <div class="section sidebar">

          <div class="heading-part">

            <h3 class="section_title">Addresses</h3>

          </div>   

          <div class="list-group">

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



              <a href="<?php echo base_url();?>home/my_address" class="list-group-item active"><i class="fa fa-map-marker"></i> My Address</a>



              <a href="<?php echo base_url();?>home/account" 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>



    </aside>

      	<div  id="content" class="col-lg-9">

        		<h3 class="text-success">My Saved Addresses</h3>

                <div class="box-account box-info">

                            <?php if(empty($address)){?>

                            <h3 class="text-center text-danger">No Address Found </h3>

                            <?php }else{foreach($address as $add){?>

								<div class="well" id="address<?php echo $add->user_add_id;?>" style="background:#489147; padding:10px; border-radius:10; margin-bottom:10px;">

				  <button type="button" id="<?php echo $add->user_add_id;?>" class="delete_address btn-sm btn btn-danger pull-right">Delete</button>

			<h4 style="color:#fff;"><?php echo $add->add_name.' '.$add->add_phone;?></h4>

			<p style="color:#fff;"><?php echo $add->add_address.'<br/>'.$add->add_landmark.' '.$add->add_city.' '.$add->add_state.' '.$add->add_pin;?></p>

								</div>

								<?php }}?>

                            

                        </div>

            </div>

</div>

      <!-- =====  Brand start ===== -->

      

      <!-- =====  Brand end ===== -->

      </div>

      <!-- =====  CONTAINER END  ===== -->

    </div>

    <script>

	$(document).ready(function(){ //$("#change_myModal").modal();

	  	 $(".delete_address").click(function(e){e.preventDefault();

			 

			 if (!confirm("Sure you want to delete?")){

				  return false;

				}

				var id=$(this).attr('id');

				$("#address"+id).remove();

			 $.ajax({

				 type: "POST",

				 url: '<?php echo base_url();?>home/delete_address',

				 data: {id:id},

				 success: function(res){

					// alert(res);

				 }

			 });

		 });

	});

	</script>