@extends('layouts.base-project')

@section('under-header')

<div style="margin-bottom:0;" class="page-wrapper">
    <!-- ============================================================== -->
    <!-- Bread crumb and right sidebar toggle -->
    <!-- ============================================================== -->
    <div class="page-breadcrumb border-bottom">
        <div class="row">
            <div class="col-lg-3 col-md-4 col-xs-12 align-self-center">
                <h5 class="font-medium text-uppercase mb-0">Profile</h5>
            </div>
            <div class="col-lg-9 col-md-8 col-xs-12 align-self-center">
                <!--button class="btn btn-danger text-white float-right ml-3 d-none d-md-block">Buy Ample Admin</button-->
                <nav aria-label="breadcrumb" class="mt-2 float-md-right float-left">
                    <ol class="breadcrumb mb-0 justify-content-end p-0">
                        <li class="breadcrumb-item"><a href="#">Profile</a></li>
                        <li class="breadcrumb-item active" aria-current="page">{{ $user_connected ->username }}</li>
                    </ol>
                </nav>
            </div>
        </div>
    </div>
    <!-- ============================================================== -->
    <!-- End Container fluid  -->
    <!-- ============================================================== -->
    <!-- ============================================================== -->
    <!-- footer -->
    <!-- ============================================================== -->
</div>

@endsection

@section('content')
{{-- Le contenu de la page --}}

<div class="row">
    <div class="col-lg-8 offset-2">

        <div class="card ">

            <div class="form-body">
                <div class="card-body">
                    <div class="d-flex justify-content-between">
                        <h4 class="card-title">PROFILE</h4>
                        <!-- <div class="d-flex">
                            <button type="button" class="btn waves-effect waves-light btn-outline-primary" id="edit">
                                Modifier
                            </button>
                        </div> -->
                    </div>
                </div>
                <hr class="mt-0 mb-5">
                <form action="{{ route('profile-update') }}" class="form-horizontal" method="POST">
                    @csrf
                    @method('PATCH')
                    <div class="card-body">
                        <div class="row">
                            <img class="ml-auto mr-auto mb-5" style="border-radius: 25px;width: 10%;height: auto "
                                src="@if($photo)  {{config('app.aws_url').$photo}} @else {{asset('assets/avatars/user.jpg')}} @endif" alt="image de profil">
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <div class="row ">
                                    <div class="col-md-6 ">
                                        <div class="form-group row">
                                            <label class="control-label text-right col-md-3">Prénoms</label>
                                            <div class="col-md-9">
                                                <input type="text"
                                                    class="form-control @error('first_name') is-invalid @enderror is-editable"
                                                    value="{{$user_etudiant->prenom}}" name="first_name" disabled>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group row">
                                            <label class="control-label text-right col-md-3">Nom</label>
                                            <div class="col-md-9">
                                                <input type="text"
                                                value="{{$user_etudiant->nom}}"
                                                    class="form-control is-editable  @error('last_name') is-invalid @enderror"
                                                    placeholder="" name="last_name" disabled>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group row">
                                            <label class="control-label text-right col-md-3">Email</label>
                                            <div class="col-md-9">
                                                <input  value="{{$user_connected->email}}" name="email"
                                                    class="form-control is-editable @error('email') is-invalid @enderror"
                                                    placeholder="" name="email" required disabled>
                                                @error('email')
                                                <span class="invalid-feedback" role="alert">
                                                    <strong>{{ $message }}</strong>
                                                </span>
                                                @enderror
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group row">
                                            <label class="control-label text-right col-md-3">Filière</label>
                                            <div class="col-md-9">
                                                <input type="text"
                                                value="{{$filiere->intituleFilieres}}"
                                                    class="form-control is-editable  @error('last_name') is-invalid @enderror"
                                                    placeholder="Doe" name="filière" disabled>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group row">
                                            <label class="control-label text-right col-md-3">Sigle Filière</label>
                                            <div class="col-md-9">
                                                <input type="text"
                                                value="{{$filiere->sigleFilieres}}"
                                                    class="form-control is-editable  @error('last_name') is-invalid @enderror"
                                                    placeholder="Doe" name="filière" disabled>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group row">
                                            <label class="control-label text-right col-md-3">Téléphone</label>
                                            <div class="col-md-9">
                                                <input name="phone"  type="tel"
                                                    value="{{$user_etudiant->adresse}}"
                                                    class="form-control is-editable @error('phone') is-invalid @enderror"
                                                    placeholder="22961000000" required disabled>
                                                @error('phone')
                                                <span class="invalid-feedback" role="alert">
                                                    <strong>{{ $message }}</strong>
                                                </span>
                                                @enderror
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <!-- <div class="col-md-6">
                                <div class="row">

                                </div>
                            </div> -->

                            <!-- <div class="col-md-6">
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="form-group row">
                                            <label class="control-label text-right col-md-3">Mot de passe</label>
                                            <div class="col-md-9">
                                                <input name="password" disabled type="password"
                                                    minlength="8" maxlength="13"
                                                    class="form-control is-editable @error('password') is-invalid @enderror"
                                                    placeholder="Mot de passe">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div> -->
                            <!-- <div class="col-md-6">
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="form-group row">
                                            <label class="control-label text-right col-md-3">Confirmation du Mot de passe</label>
                                            <div class="col-md-9">
                                                <input name="password_confirmation" disabled type="password"
                                                    minlength="8" maxlength="13"
                                                    class="form-control is-editable"
                                                    placeholder="Confirmation Mot de passe">
                                                @error('password')
                                                <span class="invalid-feedback" role="alert">
                                                    <strong>{{ $message }}</strong>
                                                </span>
                                                @enderror
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div> -->

                        </div>
                    </div>
                    <hr>
                    <!-- <div class="form-actions">
                        <div class="card-body">
                            <div class="text-right" id="edit-block">
                                <button type="button" class="btn waves-effect waves-light btn-outline-secondary"
                                    id="abort">
                                    Abandonner
                                </button>
                                <button type="submit" class="btn waves-effect waves-light btn-outline-success"
                                    id="validate">
                                    Valider
                                </button>
                            </div>
                        </div>
                    </div> -->
            </div>
            </form>
        </div>
    </div>
</div>
@endsection
