@extends('layouts.app')

@section('title')
    {{ config('app.name') }} | Perfil
@endsection

@section('header')
    <a href="{{ route('home') }}" class="w3-bar-item w3-button"><span class="fa fa-home fa-fw"></span> Home</a>
@endsection

@section('content')
<div class="w3-content">
    <h2 class="w3-center"><span class="fa fa-user-circle fa-4x"></span></h2>
    <span class="help-block"><b>Nota:</b> La información aquí presente, corresponde a la información almacenada en el sistema de Correos Institucioanales; para acutalizar sus datos debe ingresar a este sistema, o contactar al Área TIC para el respectivo soporte.</span>
</div>

<div class="w3-content">
	<p>
		{{ Form::label('nombres', 'Nombres*') }}
		{{ Form::text('nombres', $usuario->cuenta->cuenta_primer_nombre.' '.$usuario->cuenta->cuenta_segundo_nombre, ['class' => 'w3-input w3-border w3-border-theme w3-round', 'placeholder' => 'Nombres', 'disabled']) }}
	</p>

	<p>
		{{ Form::label('apellidos', 'Apellidos*') }}
		{{ Form::text('apellidos', $usuario->cuenta->cuenta_primer_apellido.' '.$usuario->cuenta->cuenta_segundo_apellido, ['class' => 'w3-input w3-border w3-border-theme w3-round', 'placeholder' => 'Apellidos', 'disabled']) }}
	</p>

	<p>
		{{ Form::label('email', 'E-mail Institucional*') }}
		{{ Form::email('email', $usuario->email, ['class' => 'w3-input w3-border w3-border-theme w3-round', 'placeholder' => 'E-mail Institucional', 'disabled']) }}
	</p>

	<p>
		{{ Form::label('rol_id', 'Rol*') }}
		{{ Form::select('rol_id', $roles->pluck('rol_nombre', 'rol_id'), $usuario->rol_id, ['class' => 'w3-input w3-border w3-border-theme w3-round w3-disabled', 'placeholder' => 'Seleccionar', 'disabled']) }}
	</p>

	<p>
		<button type="button" class="w3-btn w3-theme w3-round" onclick="document.getElementById('reset_ps_modal').style.display='block'"><span class="fa fa-key fa-fw"></span> Cambiar Contraseña</button>
	</p>
</div>

<div class="w3-container">
    <div id="reset_ps_modal" class="w3-modal">
    <div class="w3-modal-content">
      <header class="w3-container w3-center w3-theme w3-padding"> 
        <span onclick="document.getElementById('reset_ps_modal').style.display='none'" class="w3-button w3-display-topright">&times;</span>
        <h3><span class="fa fa-user fa-fw"></span> Cambiar contraseña</h3>
      </header>
      <div class="w3-container w3-padding">
        {!! Form::open(['route' => ['erc.usuarios.reset', $usuario], 'method' => 'post']) !!} 
            <p>
                {{ Form::label('lastpassword', 'Contraseña Actual*') }}
                {{ Form::password('lastpassword', ['class' => 'w3-input w3-border w3-border-theme w3-round', 'placeholder' => 'Contraseña actual', 'required', 'pattern' => '.{5,15}']) }}
            </p>

            <p>
                {{ Form::label('newpassword', 'Nueva contraseña*') }}
                {{ Form::password('newpassword', ['class' => 'w3-input w3-border w3-border-theme w3-round', 'placeholder' => 'Nueva contraseña (Min. 8. Max. 15 caracteres)', 'required', 'pattern' => '.{8,15}']) }}
            </p>

            <p>
                {{ Form::label('confirmpassword', 'Confirmar contraseña*') }}
                {{ Form::password('confirmpassword', ['class' => 'w3-input w3-border w3-border-theme w3-round', 'placeholder' => 'Confirmar contraseña (Min. 8. Max. 15 caracteres)', 'required', 'pattern' => '.{8,15}']) }}
            </p>

            <p>
                <button type="submit" class="w3-btn w3-theme w3-round"><span class="fa fa-save fa-fw"></span> Guardar</button>
                <button type="button" class="w3-btn w3-red w3-round" onclick="document.getElementById('reset_ps_modal').style.display='none'"><span class="fa fa-times fa-fw"></span> Cancelar</button>
            </p>
        {!! Form::close() !!}
      </div>
      <footer class="w3-container w3-center w3-light-grey w3-padding">
        <p>{{ config('app.name') }} | 2018 - {{ date('Y') }}</p>
      </footer>
    </div>
    </div>
</div>
@endsection
