@extends('layouts.dashboard')

@section('content')
    <div class="container-fluid" style="padding-right:unset;padding-left:unset;margin-top:40px;">
      <div class="card mb-3">
        <div class="card-header titulo-eliminar">
            <div class="title" style="font-size: 25px;font-weight: 700;">
                Perfil
            </div>
            <div class="eliminar-container">
                <div class="btn-group mr-2">
                    <button class="btn btn-sm btn-outline-secondary" onclick="editar()"><i class="fas fa-edit"></i></button>
                </div>
            </div>
        </div>
        <div class="card-body">
          <form class="form-inline mt-2" action="{{ route('updateAdmin',[Auth::user()->id]) }}" method="post"  id="form-datos">
            {{ csrf_field() }}
            <div class="container">
                <div class="image-profile-container">
                    <div class="card col-md-4" style="">
                        <img id="image-profile-img" name="img"class="card-img-top" src="{{Auth::user()->getPicture()}}" alt="Card image cap">
                        <div class="card-body">
                            <input id="img-file" name="img" class="image-profile-input" value="{{Auth::user()->img}}" type="file" onchange="cargarIMG(this.files[0])" accept="image/jpeg">
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group">
              <label for="name" class="form-label-title">Nombre:</label>
              <input type="text" id="name" name="name" value="{{Auth::user()->name}}" class="form-control mx-sm-3"disabled>
            </div>
            <div class="form-group">
              <label for="email" class="form-label-title">Correo:</label>
              <input type="email" id="email" name="email" value="{{Auth::user()->email}}" placeholder="ejemplo@ejemplo.com" class="form-control mx-sm-3" disabled>
            </div>
            <div class="form-group">
                <label for="inputPassword6" class="form-label-title">Apellido:</label>
                <input  id="surname" name="surname" value="{{Auth::user()->surname}}" class="form-control mx-sm-3" disabled>
            </div>
            <div class="form-group">
                <label for="inputPassword6" class="form-label-title">Cedula:</label>
                <input  id="idCard" name="idCard" value="{{Auth::user()->idCard}}" class="form-control mx-sm-3" disabled>
            </div>
            <div class="form-group">
                <label for="inputPassword6" class="form-label-title">Direccion:</label>
                <input id="address" name="address" value="{{Auth::user()->address}}" placeholder="ciudad/calle/# casa" class="form-control mx-sm-3" disabled>
            </div>
            <div class="form-group">
                <label for="telefono" class="form-label-title">Telefono:</label>
                <input type="number" id="tel" name="tel" value="{{Auth::user()->tel}}" class="form-control mx-sm-3" disabled>
            </div>
            <div class="buttons-container" id="button-editar-container">
                <button type="button" onclick="editar()" class="btn btn-dark btn-sm">Cancelar</button>
                <button type="submit" class="btn btn-light light2 btn-sm">Guardar</button>
            </div>
          </form>
        </div>
        <div class="card-footer small text-muted">Ultima actualizacion: {{Auth::user()->updated_at}}</div>
      </div>
        <div class="card mb-3">
            <div class="card-header titulo-eliminar">
                <div class="title">
                    <i class="fas fa-users-cog"></i> <strong>Editar contraseña</strong>
                </div>
                <div class="btn-group mr-2">
                    <button class="btn btn-sm btn-outline-secondary" onclick="editarClave()"><i class="fas fa-edit"></i></button>
                </div>
            </div>
            <div class="card-body">
                @if ($errors->any())
                    <div class="alert alert-danger text-center">
                        Error!.<br> Asegurese de llenar los datos correctamente
                    </div>
                @endif
                <form action="{{ route('updateAdminPassword',[Auth::user()->id]) }}" class="form-inline mt-2 form-datos" method="post" id="form-datos-clave">
                    {{ csrf_field() }}
                    <div class="form-group">
                        <input type="Password" id="newPassword" name="newPassword" class="form-control mx-sm-3" placeholder="7-20 caracters" minlength="7" maxlength="20" disabled>
                    </div>
                    <div class="buttons-container buttons-container-clave">
                        <button type="button" id="button-editar-clave" onclick="editarClave()" class="btn btn-danger">Cancelar</button>
                        <button type="submit"class="btn btn-primary" id="button-guardar-clave">Guardar</button>
                    </div>
                </form>
            </div>
            <div class="card-footer small text-muted">
                
            </div>
        </div>
    </div>
    <style>        
        #mainNav.navbar-dark .navbar-collapse .navbar-sidenav>.nav-item>.profileLink {color:#b34e10;}
    </style>
  <script  src="{{ asset('js/admin.js') }}"> </script>  
	<link  media="all" rel="stylesheet" type="text/css" href="{{ asset('css/admin.css') }}">
	<link  media="all" rel="stylesheet" type="text/css" href="{{ asset('css/general.css') }}">

@endsection