@extends('layouts.contentLayoutMaster')

@section('title','Edit Password')

@section('vendor-styles')
<link rel="stylesheet" type="text/css" href="{{asset('css/plugins/forms/validation/form-validation.css')}}">
<link rel="stylesheet" type="text/css" href="{{asset('vendors/css/forms/select/select2.min.css')}}">
<link rel="stylesheet" type="text/css" href="{{asset('vendors/css/pickers/pickadate/pickadate.css')}}">
<link rel="stylesheet" type="text/css" href="{{asset('vendors/css/pickers/daterange/daterangepicker.css')}}">
@endsection

@section('page-styles')
<link rel="stylesheet" type="text/css" href="{{asset('css/pages/page-users.css')}}">
@endsection

@section('content')
<!-- users edit start -->
<section class="users-edit">
    <div class="card">
        <div class="card-content">
        <div class="card-body">
            <form method="post" action="{{ route('akun.update') }}" autocomplete="off" class="form" enctype="multipart/form-data">
                @csrf
                @method('put')
                <div class="row">
                    <div class="col-12">
                        <div class="form-group">
                            <div class="controls">
                                <label>Email</label>
                                <input type="text" name="email" id="email" class="form-control" placeholder="Email"
                                    value="{{ $user->email }}" readonly>
                                    <small class="text-warning">Hubungi admin untuk mengubah Email.</small>
                                    @if ($errors->has('email'))
                                    <div class="help-block text-danger">
                                        <ul role="alert">
                                            <li>{{ $errors->first('email') }}</li>
                                        </ul>
                                    </div>
                                    @endif
                            </div>
                        </div>
                        <div class="form-group">
                          <div class="controls">
                            <label for="old_password"><span class="text-danger">*</span> Password Lama</label>
                            <input type="password" class="form-control" id="old_password" name="old_password" required
                              placeholder="Password Lama"
                              data-validation-required-message="Password Lama Wajib diisi." minlength="8"
                              data-validation-minlength-message="Harus terdiri dari minimal 8 karakter.">
                              @if ($errors->has('old_password'))
                              <div class="help-block text-danger">
                                  <ul role="alert">
                                      <li>{{ $errors->first('old_password') }}</li>
                                  </ul>
                              </div>
                              @endif 
                          </div>
                        </div>
                        <div class="form-group">
                          <div class="controls">
                            <label for="password"><span class="text-danger">*</span> Password Baru</label>
                            <input type="password" name="password" id="password" class="form-control"
                              placeholder="Password Baru" required
                              data-validation-required-message="Password Lama Wajib diisi." minlength="8"
                              data-validation-minlength-message="Harus terdiri dari minimal 8 karakter.">
                              @if ($errors->has('password'))
                              <div class="help-block text-danger">
                                  <ul role="alert">
                                      <li>{{ $errors->first('password') }}</li>
                                  </ul>
                              </div>
                              @endif
                          </div>
                        </div>
                        <div class="form-group">
                          <div class="controls">
                            <label for="account-retype-new-password"><span class="text-danger">*</span> Konfirmasi Password Baru</label>
                            <input type="password" name="password_confirmation" class="form-control" required
                              id="password_confirmation" data-validation-match-match="password"
                              placeholder="Konfirmasi Password Baru"
                              data-validation-required-message="Konfirmasi Password Baru Wajib diisi." minlength="8"
                              data-validation-match-message="Password Harus Sama."
                              data-validation-minlength-message="Harus terdiri dari minimal 8 karakter.">
                              @if ($errors->has('password_confirmation'))
                              <div class="help-block text-danger">
                                  <ul role="alert">
                                      <li>{{ $errors->first('password_confirmation') }}</li>
                                  </ul>
                              </div>
                              @endif
                          </div>
                        </div>
                    </div>
                    <div class="col-12 d-flex flex-sm-row flex-column justify-content-start mt-1">
                        <button type="submit" class="btn btn-danger glow mb-1 mb-sm-0 mr-0 mr-sm-1">Simpan</button>
                        <button type="reset" class="btn btn-light">Cancel</button>
                    </div>
                </div>
            </form>
        </div>
        </div>
    </div>
</section>
<!-- users edit ends -->
@endsection

{{-- vendor scripts --}}
@section('vendor-scripts')
<script src="{{asset('vendors/js/forms/select/select2.full.min.js')}}"></script>
<script src="{{asset('vendors/js/forms/validation/jqBootstrapValidation.js')}}"></script>
<script src="{{asset('vendors/js/pickers/pickadate/picker.js')}}"></script>
<script src="{{asset('vendors/js/pickers/pickadate/picker.date.js')}}"></script>
<script src="{{asset('vendors/js/pickers/pickadate/picker.time.js')}}"></script>
<script src="{{asset('vendors/js/pickers/pickadate/legacy.js')}}"></script>
<script src="{{asset('vendors/js/pickers/daterange/moment.min.js')}}"></script>
<script src="{{asset('vendors/js/pickers/daterange/daterangepicker.js')}}"></script>
@endsection

{{-- page scripts --}}
@section('page-scripts')
<script src="{{asset('js/scripts/pages/page-users.js')}}"></script>
<script src="{{asset('js/scripts/navs/navs.js')}}"></script>
<script src="{{asset('js/scripts/forms/validation/form-validation.js')}}"></script>
<script src="{{asset('js/scripts/pickers/dateTime/pick-a-datetime.js')}}"></script>   
@endsection