@extends('Templates/templateAdmin')

@section('Main-content')
    <br><br>
    @if (session('status'))
        <div class="alert alert-success" role="alert">
            {{ session('status') }}
        </div>
    @endif
    <div class="content">
        <div class="card">
            <div class="card-header bg-primary text-white">
                <h3 class="card-title mb-0">Enviar Formulário:</h3>
            </div>

            <div class="card-body">
                <form action="{{ route('enviar.formulario') }}" method="post">
                    @csrf
                    <div class="row">
                        <div class="col-sm-8">
                            <div class="form-group">
                                <p for='email'>Email
                                    <input type="email" class="form-control" name="email" required>
                                </p>
                            </div>
                        </div>
                        <div class="col-sm-4 text-center">
                            <button style="width:30%;height:90%;" type="submit" class="btn btn-primary">Enviar</button>
                        </div>
                    </div>
                </form>
            </div>
            {{-- /.card-body --}}
        </div>
        {{-- ./card --}}

        <div class="card card-primary">
            <div class="card-header">
                <h2 class="card-title">Utilizadores Pendentes :</h2>
            </div>
            <div class="card-body p-0">

                <div class="table-responsive">
                    <table class="table table-bordered table-striped justify-content-center">
                        <thead class="text-center">
                            <tr>
                                <th>Id</th>
                                <th>Nome</th>
                                <th>Email</th>
                                <th>Verificar</th>
                            </tr>
                        </thead>
                        <tbody class="text-center">
                            @foreach ($pend_users as $pend_user)
                                <tr>
                                    <td>{{ $pend_user->pending_user_id }}</td>
                                    <td>{{ $pend_user->pending_user_name }}</td>
                                    <td>{{ $pend_user->pending_user_email }}</td>
                                    <td><a href="{{ route('ShowPendingUser', ['id' => $pend_user->pending_user_id]) }}"><i
                                                class="fa-solid fa-eye text-primary"></i></a></td>
                                </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>

                {{-- ./container --}}
            </div>
            {{-- ./Card-body --}}
        </div>
        {{-- ./card --}}
    </div>
@endsection
