<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 Orders</h1>
        <ul>
          <li><a href="<?php echo base_url();?>"><i class="fa fa-home"></i></a></li>
          <li class="active">My Orders</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">Account</h3>
          </div>   
          <div class="list-group">
              <a href="<?php echo base_url();?>home/MyAccount" 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"><i class="fa fa-map-marker"></i> My Address</a>

              <a href="<?php echo base_url();?>home/account" class="list-group-item active"><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">
                <div class="dashboard-right" style="background:#fff; padding:30px;">
                    <div class="dashboard">
                        <div class="page-title">
                            <h2>Hi, <?php echo $user->first_name.' '.$user->last_name;?></h2></div>
                        
                        <div class="box-account box-info">
                            <div class="row">
                                <div class="col-sm-4">
                                    <div class="box">
                                        <div class="box-title">
                                            <h3>Change Password</h3></div>
                                        <div class="box-content">
                                            <form id="changepass" method="post">
                                                <input type="hidden" name="uid" value="<?php echo $this->session->userdata("user");?>" />
                        
                                                <div class="form-group">
                        
                                                    <label>New Password</label>
                        
                                                    <input type="password" required name="npass" class="form-control"  />
                        
                                                </div>
                        
                                                <div class="form-group">
                        
                                                    <label>Confirm Password</label>
                        
                                                    <input type="password" required name="cpass" class="form-control" />
                        
                                                </div>
                        
                                                <button class="btn btn-success btn-block" type="submit">Change Password</button>
                        
                                            </form>
                                            </div>
                                    </div>
                                </div>
                                <div class="col-sm-4">
                                    <div class="box">
                                        <div class="box-title">
                                            <h3>Update Profile</h3></div>
                                        <div class="box-content">
                                            <form id="update_profile" method="post">
                    	<input type="hidden" name="uid" value="<?php echo $this->session->userdata("user");?>" />

                        <!--<div class="form-group">

                            <label>Old Password</label>

                            <input type="password" required name="opass" class="form-control"  />

                        </div>-->
						<?php //$user=$this->db->get_where("users",array("id"=>$this->session->userdata("user")))->row();?>
                        <div class="form-group">

                            <label>Name</label>

                            <input type="text" required name="name" class="form-control"  value="<?php echo $user->first_name;?>" />

                        </div>

                        <div class="form-group">

                            <label>Mobile Number</label>

                            <input type="text" required name="mobile" class="form-control" value="<?php echo $user->mobile;?>" />
                            <input type="hidden" required name="oldmobile" class="form-control" value="<?php echo $user->mobile;?>" />

                        </div>

                        <button class="btn btn-success btn-block" type="submit">Update Profile</button>

                    </form>
                    <div id="change_myModal" class="modal fade" role="dialog">
                      <div class="modal-dialog modal-sm">
                        <!-- Modal content-->
                        <div class="modal-content">
                          <div class="modal-header">
                            <h4 class="modal-title">Verify OTP</h4>
                            <button type="button" class="close" data-dismiss="modal">&times;</button>
                          </div>
                          <div class="modal-body">
                            <form action="#" method="post" id="change_verify_otp">
                                <div class="form-group text-center">
            
                                    <p class="text-success text-center">We have sent an OTP to Your Mobile Number Please confirm the OTP.</p>
            
                                        <i class="fa fa-mobile fa-5x text-success "></i><br/>
            
            <input type="text" class="form-control" required name="otp" placeholder="6 Digit Code" style="margin-bottom:0px;font-size:20px;text-align:center;" />
            
            <a href="#" id="change_resend_otp">Resend OTP</a>
            </div>
                                        <b class="text-danger  text-center change_otp_error"></b>
            
                                        <button type="submit"  class="btn btn-warning">Verify OTP</button> 
                            <button type="button" class="btn btn-default pull-right" data-dismiss="modal">Close</button>
            
                                    
                           </form>
                          </div>
                        </div>
                    
                      </div>
                    </div>
      <script>
	  $(document).ready(function(){ //$("#change_myModal").modal();
	  	 $("#change_verify_otp").submit(function(e){e.preventDefault();
			 var formdata=$(this).serialize();
			 $.ajax({
				 type: "POST",
				 url: '<?php echo base_url();?>home/change_verify_otp',
				 data: {formdata:formdata},
				 success: function(res){
					 alert(res);
				 }
			 });
		 });
		 $("#changepass").submit(function(e){e.preventDefault();
			 var formdata=$(this).serialize();
			 $.ajax({
				 type: "POST",
				 url: '<?php echo base_url();?>home/change_password',
				 data: {formdata:formdata},
				 success: function(res){
					 alert(res);
				 }
			 });
		 });
		 $("#update_profile").submit(function(e){e.preventDefault();
			 var formdata=$(this).serialize();
			 $.ajax({
				 type: "POST",
				 url: '<?php echo base_url();?>home/update_profile',
				 data: {formdata:formdata},
				 success: function(res){
					 if(res==1){
						 $("#change_myModal").modal();
					 }else{
					 alert(res);
					 }
				 }
			 });
		 });
	  });
	  </script>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                        </div>
                    </div>
                </div>
            </div>
</div>
      <!-- =====  Brand start ===== -->
      
      <!-- =====  Brand end ===== -->
      </div>
      <!-- =====  CONTAINER END  ===== -->
    </div>