@extends('layouts')

@section('content')
{{-- <div class="login-box"> --}}
    <!-- /.login-logo -->
    <br>
    <div class="col-md-6">
    <div class="login-box-body">
        <h3 class="login-box-msg">Change password</h3>
        <br>
        @if ($message = Session::get('error'))
            <p class="text-danger">
                <strong>{{ $message }}</strong>
            </p>
        @endif
        
            <form method="POST" action="{{ route('upt_pass') }}">
                @csrf

                {{-- <input type="hidden" name="token" value="{{ $token }}"> --}}

                <div class="form-group has-feedback">
                    <input id="current_password" type="password" name="current_password" class="form-control{{ $errors->has('current_password') ? ' is-invalid' : '' }}" placeholder="Current password" value="{{ old('current_password') }}" required>
                    <span class="fa fa-lock form-control-feedback"></span>

                    @if ($errors->has('current_password'))
                        <span class="text-danger">
                                        <strong>{{ $errors->first('current_password') }}</strong>
                                    </span>
                    @endif
                    
                </div>

                <div class="form-group has-feedback">
                    <input id="password" type="password" name="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" placeholder="Password" value="{{ old('password') }}" required>
                    <span class="fa fa-key form-control-feedback"></span>

                    @if ($errors->has('password'))
                        <span class="text-danger">
                                        <strong>{{ $errors->first('password') }}</strong>
                                    </span>
                    @endif
                </div>

                <div class="form-group has-feedback">
                    <input id="password_confirmation" type="password" name="password_confirmation" class="form-control{{ $errors->has('password_confirmation') ? ' is-invalid' : '' }}" placeholder="Confirm Password" required>
                    <span class="fa fa-key form-control-feedback"></span>
                </div>


                <div class="form-group row mb-0">
                    <div class="col-md-6 offset-md-4">
                        <button type="submit" class="btn btn-primary">
                            {{ __('Change Password') }}
                        </button>
                        <a href="{{ url()->previous() }}" class="btn btn-danger"><span class="fa fa-times"></span> Cancel </a>
                    </div>
                </div>
                
            </form>
    </div>
{{-- </div> --}}
</div>

@endsection
