 <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1 class="m-0 text-dark"><?php echo $title ?></h1>
          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="<?php echo base_url() ?>admin/admin/dashboard">Dashboard</a></li>
              <li class="breadcrumb-item"><a href="#"><?php echo ucwords(str_replace("_", " ", $this->uri->segment(2))); ?></a></li>
              <li class="breadcrumb-item active"><?php echo ucwords(str_replace("_", " ", $title)); ?></li>

            </ol>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    <!-- /.content-header -->
  <?php
    $errors = $this->session->userdata('errors');
    if (isset($errors)) {
        ?>
        <script>
            swal ( "Oops" ,  "<?php echo $errors ?>" ,  "error" )
        </script>
        <?php echo $errors ?>
        <?php
        $this->session->unset_userdata('errors');
    }
    $error = $this->session->userdata('error');
    if (isset($error)) {
        ?>
         <script>
            swal ( "Oops" ,  "<?php echo $error ?>" ,  "error" )
        </script>
        <?php
        $this->session->unset_userdata('error');
    }
    $success = $this->session->userdata('success');
    if (isset($success)) {
        ?>
         <script>
            swal({
          title: "Done!",
          text: "<?php echo $success ?>",
          icon: "success",
        });
        </script>
        <?php
        $this->session->unset_userdata('success');
    }
    ?>
    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <!-- Info boxes -->
        <div class="card card-default">
          <div class="card-header">
            <h3 class="card-title">Update <?php echo $title ?></h3>

            <div class="card-tools">
              <button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fas fa-minus"></i></button>
            </div>
          </div>
          <!-- /.card-header -->
          <?php echo form_open_multipart('admin/update_profile/update_profile_details_information'); ?>
          <div class="card-body">
            <div class="row">
              <div class="col-md-12">
                <div class="form-group">
                   <label for="inputEmail" class="col-sm-12 col-form-label">Name</label>
                   <div class="col-sm-12">
                      <input type="text" class="form-control"  name="name"  required="required" placeholder="Enter User Name" value="<?php echo $user->name ?>">
                   </div>
                </div>
              </div>

              <div class="col-md-12">
                <div class="form-group">
                   <label for="inputEmail" class="col-sm-12 col-form-label">Mobile No</label>
                   <div class="col-sm-12">
                      <input type="number" class="form-control"  name="mobile"  required="required" placeholder="Enter Mobile No" value="<?php echo $user->mobile ?>">
                   </div>
                </div>
              </div>

              <div class="col-md-12">
                <div class="form-group">
                   <label for="inputEmail" class="col-sm-12 col-form-label">Email ID</label>
                   <div class="col-sm-12">
                      <input type="email" class="form-control"  name="email"  required="required" placeholder="Enter Email ID" value="<?php echo $user->email ?>">
                   </div>
                </div>
              </div>
             
              <div class="col-md-12">
                <div class="form-group">
                   <label for="inputEmail" class="col-sm-12 col-form-label">Upload Profile Photo (Image size 512 X 512 px)</label>
                   <div class="col-sm-12">
                      <input type="file" class="form-control"  name="image"   id="logo_header">
                   </div>
                </div>
                <div class="form-group">
                   <label for="inputEmail" class="col-sm-12 col-form-label">Preview Profile Photo</label>
                   <div class="col-sm-12">
                      <img id="header_logo" src="<?php echo base_url() ?><?php echo $user->image ?>" width="100px" style="border:1px solid #333" >
                   </div>
                </div>
              </div>
              

              
              <div class="col-md-12">
                <div class="form-group">
                   <button name="submit" style="float: right" type="submit" class="btn btn-success">Update</button>
                </div>
              </div>

               <?php echo form_close() ?>
               

              <!-- /.col -->
            </div>
            <!-- /.row -->
          </div>
          <!-- /.card-body -->
        </div>
            <!-- /.row -->
      </div><!--/. container-fluid -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
<script>
  function logo_header(input) {
    if (input.files && input.files[0]) {
      var reader = new FileReader();
      reader.onload = function(e) {
        $('#header_logo').attr('src', e.target.result);
      }
      reader.readAsDataURL(input.files[0]);
    }
  }
  $("#logo_header").change(function() {
    logo_header(this);
  });

  function store_banner(input) {
    if (input.files && input.files[0]) {
      var reader = new FileReader();
      reader.onload = function(e) {
        $('#banner').attr('src', e.target.result);
      }
      reader.readAsDataURL(input.files[0]);
    }
  }
  $("#store_banner").change(function() {
    store_banner(this);
  });
</script>