@extends('layouts.dashboard')

@section('content')
            <div class="card mb-3 margin-card">
                <div class="header-titulo">
                    Perfil
                </div>
                <div class="card-body">
                    <form action="updateCliente/{{Auth::user()->id}}" class="form-inline mt-2 form-datos" 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" class="card-img-top" src="{{Auth::user()->getPicture()}}" alt="Card image cap">
                                    <div class="card-body">
                                        <input id="img-file" class="image-profile-input" type="file" onchange="cargarIMG(this.files[0])" accept="image/jpeg">
                                    </div>
                                </div>
                            </div>
                            <div class="buttons-container mt-4">
                                <button type="submit"class="btn btn-primary btn-sm" id="button-guardar-cliente">Guardar</button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="card-footer small text-muted">Updated yesterday at 11:59 PM</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 id="button-editar-clave" class="editar-container" data-toggle="tooltip" data-placement="top" title="Editar clave" onclick="editarClave()">
                        <i class="fas fa-edit"></i>
                    </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('updateClientePassword',[Auth::user()->id]) }}" class="form-inline mt-2 form-datos" method="post" id="form-datos-clave">
                        {{ csrf_field() }}
                        <div class="form-group">
                            <label for="inputPassword6" class="form-label-title">New Password:</label>
                            <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>
  
    <div class="card mb-3">
        <div class="card-header">
            <i class="fas fa-ruler"></i> Aplicaciones del cliente
        </div>
        <div class="card-body">
            <div class="container">
                <div class="row">
                    @if ( $apps_cliente == '[]')
                        <small>Este cliente no tiene Aplicaciones</small>
                    @endif
                    @foreach($apps_cliente as $app)
                        <div class="col-md-4 list-group-item list-group-item-action flex-column align-items-start">
                            <div class="d-flex w-100 justify-content-between">
                            <h5 class="mb-1">{{$app->app_name}}</h5>
                            </div>
                        </div>
                    @endforeach
                </div>
            </div>
        </div>
    </div>
  <div class="card mb-3">
        <div class="card-header">
        <i class="fas fa-ruler"></i> Requerimientos del cliente
        </div>
        <div class="card-body">
            <div class="container">
                <div class="row">
                    @if ( $requerimientos_cliente == '[]')
                        <small>Este desarrollador no tiene requerimientos</small>
                    @endif
                    @foreach($requerimientos_cliente as $requerimiento)
                        <a href="../requerimiento/{{$requerimiento->id}}" class="col-md-4 list-group-item list-group-item-action flex-column align-items-start">
                            <div class="d-flex w-100 justify-content-between">
                            <h5 class="mb-1">{{$requerimiento->titulo}}</h5>
                            </div>
                            <p class="mb-1">{{$requerimiento->descripcion}}.</p>
                            <small class="text-muted">{{$requerimiento->updated_at}}</small>
                        </a>
                    @endforeach
                </div>
            </div>
        </div>
    </div>
    <style>        
        #mainNav.navbar-dark .navbar-collapse .navbar-sidenav>.nav-item>.profileLink {color:#1c8dff;}
    </style>
  <script  src="{{ asset('js/admin.js') }}"> </script>  
	<link  media="all" rel="stylesheet" type="text/css" href="{{ asset('css/cliente.css') }}">
	<link  media="all" rel="stylesheet" type="text/css" href="{{ asset('css/general.css') }}">
@endsection