<div class="clearfix"></div>
  <div class="content-wrapper">
    <div class="container-fluid">
      <!-- Breadcrumb-->
     <div class="row pt-2 pb-2">
        <div class="col-sm-9">
		    <h4 class="page-title">Manage Profile</h4>
	   </div>
     </div>
    <!-- End Breadcrumb-->
      <div class="row">
			<div class="col-lg-4">
			   <?php if($this->session->flashdata("msg")){echo $this->session->flashdata("msg"); }?>
               <div class="card">
                    	  <div class="card-header">Update Profile Details</div>
                    <div class="card-body">
                          <?php 
						  $city=$this->db->get_where("cities",array("city_id"=>$this->session->userdata("city_id")))->row();
						  $admin=$this->db->get_where("agents",array("ag_id"=>$this->session->userdata("userid")))->row();?>
                          <form action="<?php echo base_url();?>store/update_profile" method="post" enctype="multipart/form-data">
                          <input type="hidden" name="city_id" value="<?php echo $city->city_id;?>" />
                          <div class="row">
                          <div class="form-group col-md-6">
                          <img class="img img-responsive center-block" width="100px" src="<?php echo base_url().'assets/images/'.$city->city_img;?>" />
                          <input type="hidden" name="oldcity_img" value="<?php echo $city->city_img;?>" />
                          <label for="new">Change City Image</label>
                          <input type="file" class="form-control" name="city_img" />
                          </div>
                          <div class="form-group col-md-6">
                          <img class="img img-responsive center-block" width="100px" src="<?php echo base_url().'assets/images/'.$admin->ag_img;?>" />
                          <input type="hidden" name="oldag_img" value="<?php echo $admin->ag_img;?>" />
                          <label for="new">Profile Image</label>
                          <input type="file" class="form-control" name="ag_img" />
                          </div>
                          </div>
                          <div class="form-group">
                            <label for="new">Email</label>
                            <input type="email" class="form-control" name="ag_email" value="<?php echo $admin->ag_email;?>" />
                          </div>
                          <div class="form-group">
                            <label for="new">Mobile</label>
                            <input type="text" class="form-control" name="ag_mobile" value="<?php echo $admin->ag_mobile;?>" />
                          </div> 
                          <div class="form-group">
                          	<div class="icheck-material-primary">
                               <input type="checkbox" id="free_shipping" name="free_shipping" <?php if($admin->free_shipping!=''){echo 'checked';}?> value="yes"/>
                               <label for="free_shipping">Enable Free Shipping</label>
                            </div>
                          	
                          </div>
                          <div class="row">
                          	<div class="form-group col-md-6">
                            	<label for="new">Free Shipping Above</label>
                            	<input type="text" class="form-control" name="free_shipping_amt" value="<?php echo $admin->free_shipping_amt;?>" />
                            </div>
                            <div class="form-group col-md-6">
                            	<label for="new">Regular Shipping</label>
                            	<input type="text" class="form-control" name="shipping" value="<?php echo $admin->shipping;?>" />
                            </div>
                          </div>
                          <button type="submit" name="submit" class="btn btn-primary">Update Profile</button>
                          </form>
                    </div>
                    
               </div>                  
            </div>
            <div class="col-lg-4">
			   <?php if($this->session->flashdata("msg2")){echo $this->session->flashdata("msg2"); }?>
               <div class="card">
                    	  <div class="card-header">Change Password</div>
                    <div class="card-body">
                          <form class="form-horizontal" action="" method="post" id="changepass">
                              
                        <div class="form-group">
                                <input type="password"  name="npass" required class="form-control" id="inputPassword3" placeholder="New Password">
                            
                        </div>
                        <div class="form-group">
                                <input type="password"  name="cpass" required class="form-control" id="inputPassword3" placeholder="Confirm Password">
                                 <b class="text-warning" id="passch"></b>
                            
                            
                        </div>
                        <button type="submit" class="btn btn-primary">Change Password</button>
                    </form>
                    </div>
                    
               </div>                  
            </div>
            <div class="col-lg-4">
			   <?php if($this->session->flashdata("msg2")){echo $this->session->flashdata("msg2"); }?>
               <div class="card">
                    	  <div class="card-header">Update Bank Details</div>
                    <div class="card-body">
                          <?php //$admin=$this->db->get_where("agents",array("ag_id"=>$this->session->userdata("userid")))->row();?>
                          <form action="<?php echo base_url();?>store/update_bank_details" method="post" enctype="multipart/form-data">
                          <!--<img class="img img-responsive center-block" width="100px" src="<?php echo base_url().'adminassets/'.$admin->photo;?>" />
                          <input type="hidden" name="oldphoto" value="<?php //echo $admin->photo;?>" />-->
                          <!--<div class="form-group">
                            <label for="new">Change Photo</label>
                            <input type="file" class="form-control" name="photo" />
                          </div>-->
                          <div class="form-group">
                            <label for="new">Bank Name</label>
                            <input type="text" class="form-control" name="bank_name" value="<?php echo $admin->bank_name;?>" />
                          </div>
                          <div class="form-group">
                            <label for="new">Bank Account Number</label>
                            <input type="text" class="form-control" name="acc_no" value="<?php echo $admin->acc_no;?>" />
                          </div>
                          <div class="form-group">
                            <label for="new">Account Holder</label>
                            <input type="text" class="form-control" name="acc_name" value="<?php echo $admin->acc_name;?>" />
                          </div>
                          <div class="form-group">
                            <label for="new">IFSC Code</label>
                            <input type="text" class="form-control" name="ifsc_code" value="<?php echo $admin->ifsc_code;?>" />
                          </div> 
                          <div class="form-group">
                            <label for="new">Bank Branch</label>
                            <input type="text" class="form-control" name="bank_branch" value="<?php echo $admin->bank_branch;?>" />
                          </div> 
                          <button type="submit" class="btn btn-primary">Update Profile</button>
                          </form>
                    </div>
                    
               </div>                  
            </div>
        </div><!--End Row-->
	  
	  <!--End Row-->

    </div>
    <!-- End container-fluid-->
    
    </div><!--End content-wrapper-->
   <!--Start Back To Top Button-->
    <a href="javaScript:void();" class="back-to-top"><i class="fa fa-angle-double-up"></i> </a>
    <!--End Back To Top Button-->
	
	<!--Start footer-->
	<footer class="footer">
      <div class="container">
        <div class="text-center">
          Copyright © 2020 Grocery Store
        </div>
      </div>
    </footer>
	<!--End footer-->
   
  </div><!--End wrapper-->


  <!-- Bootstrap core JavaScript-->
	<script>
	$(document).ready(function(){
		$("#changepass").submit(function(e){e.preventDefault();//alert("Asdf"); 
								var formdata=$(this).serialize();
								$.ajax({
								 type: "POST",
								 url: '<?php echo base_url();?>store/change_pass',
								 data: {formdata:formdata},
								 success: function(res){
								//alert(res);
								$("#passch").html(res);
								}
								 }); 
										});
		});
</script>
	<!-- simplebar js -->
  <script src="<?php echo base_url();?>adminassets/js/sidebar-menu.js"></script>
  <!-- Custom scripts -->
  <script src="<?php echo base_url();?>adminassets/js/app-script.js"></script>
  
  <!-- Vector map JavaScript -->
  <!-- Index js -->
  <script src="<?php echo base_url();?>adminassets/js/index.js"></script>

    
	
</body>
</html>
