
<?= $this->extend('Page_layout') ?>
<?= $this->section('content') ?>
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1>Profile</h1>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
            
              <li class="breadcrumb-item active">Profile</li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>

    <!-- Main content -->
    <section class="content">

      <!-- Default box -->
      <div class=" card card-primary ">
        <div class="bg-olive card-header">
          <h3 class="card-title">Profile</h3>

          <div class="card-tools">
            <button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse">
              <i class="fas fa-minus"></i>
            </button>
            <button type="button" class="btn btn-tool" data-card-widget="remove" title="Remove">
              <i class="fas fa-times"></i>
            </button>
          </div>
        </div>
        <div class="card-body">
          <p>User Profile</p>
           <?php if(isset($validation)):?>
                    <div class="alert alert-danger"><?= $validation->listErrors() ?></div>
                <?php endif;?>
         <?php if(session()->getFlashdata('msg')):?>
                    <div class="alert alert-danger"><?= session()->getFlashdata('msg') ?></div>
                <?php endif;?>
        <?= form_open_multipart('user/update-profile') ?> 
                <div class="card-body">
                  <div class="form-group row">
                    <label for="names" class="col-sm-2 col-form-label">Username</label>
                    <div class="col-sm-4">
                      <input type="text" class="form-control" name="username" id="username" disabled value="<?=$USER_NAME?>">
                    </div>
                  </div>
                   <div class="form-group row">
                <label for="names" class="col-sm-2 col-form-label">Photo</label>
                <div class="col-sm-4">
                <input type="file" class="form-control" id="x_photo" name="x_photo" placeholder="">
                </div>
                </div>
                   <div class="form-group row">
                <label for="names" class="col-sm-2 col-form-label">Reset Password ?</label>
               <div class="form-check">
                   <input type="checkbox" class="form-check-input form-control" name="e_resetpass" id="e_resetpass">
                    <label class="form-check-label" for="exampleCheck1"></label>
                  </div>
               
            </div>
                  <div class="form-group row">
                    <label for="names" class="col-sm-2 col-form-label">Old Password</label>
                    <div class="col-sm-4">
                      <input type="password" class="form-control" name="oldpass" id="oldpass" disabled >
                    </div>
                  </div>
                  <div class="form-group row">
                    <label for="names" class="col-sm-2 col-form-label">New Password</label>
                    <div class="col-sm-4">
                      <input type="password" class="form-control" name="newpass" id="newpass" disabled >
                    </div>
                  </div>
                  <div class="form-group row">
                    <label for="names" class="col-sm-2 col-form-label">Retype Password</label>
                    <div class="col-sm-4">
                      <input type="password" class="form-control" name="repass" id="repass" disabled >
                    </div>
                  </div>
                   <button type="submit" class="btn btn-info btn-save">Save</button>
            
                </div>
 </form>
             
        </div>
        <!-- /.card-body -->
        <div class="card-footer">
            </div>
        <!-- /.card-footer-->
      </div>
      <!-- /.card -->

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  </div>



   <?= $this->endSection() ?> 

  <?=$this->section("scripts")?>
<script src="<?=base_url('public/plugins/jquery-ui/jquery-ui.js')?>"></script>  
<script src="<?=base_url('public/plugins/datatables/jquery.dataTables.min.js')?>"></script>
<script src="<?=base_url('public/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js')?>"></script>
<script src="<?=base_url('public/plugins/datatables-responsive/js/dataTables.responsive.min.js')?>"></script>
<script src="<?=base_url('public/plugins/datatables-responsive/js/responsive.bootstrap4.min.js')?>"></script>
<script src="<?=base_url('public/plugins/datatables-buttons/js/dataTables.buttons.min.js')?>"></script>
<script src="<?=base_url('public/plugins/datatables-buttons/js/buttons.bootstrap4.min.js')?>"></script>
<script src="<?=base_url('public/plugins/jszip/jszip.min.js')?>"></script>
<script src="<?=base_url('public/plugins/pdfmake/pdfmake.min.js')?>"></script>
<script src="<?=base_url('public/plugins/pdfmake/vfs_fonts.js')?>"></script>
<script src="<?=base_url('public/plugins/datatables-buttons/js/buttons.html5.min.js')?>"></script>
<script src="<?=base_url('public/plugins/datatables-buttons/js/buttons.print.min.js')?>"></script>
<script src="<?=base_url('public/plugins/datatables-buttons/js/buttons.colVis.min.js')?>"></script>

<script>
 $("#e_resetpass").change( function () {
    if($('#e_resetpass').is(':checked'))
    { 
      $( "#oldpass" ).prop( "disabled", false );
      $( "#newpass" ).prop( "disabled", false );
      $( "#repass" ).prop( "disabled", false );
    }
    else
    {
       $( "#oldpass" ).prop( "disabled", true );
      $( "#newpass" ).prop( "disabled", true );
      $( "#repass" ).prop( "disabled", true );
    }
    
  });

</script>

<?=$this->endSection()?>
