@extends('layouts.landing')

@section('title',"Crear")

@section('content')

<div class="container-fluid">
    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <div class="d-sm-flex align-items-center justify-content-between">
                        <h6 class="m-0 font-weight-bold text-primary">Crear Usuario</h6>
                        <a href="{{route('user.index')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Regresar</a>
            </div>
        </div>

        <div class="card-body">
            <form action="{{route('user.store')}}" method="POST">
                @csrf
                <div class="mb-3">
                    <label class="small mb-1">Nombre</label>
                    <input class="form-control" name="name">
                </div>

                <div class="mb-3">
                    <label class="small mb-1">Apellido Paterno</label>
                    <input class="form-control" name="apellidoPaterno">
                </div>

                <div class="mb-3">
                    <label class="small mb-1">Apellido Materno</label>
                    <input class="form-control" name="apellidoMaterno">
                </div>

                <div class="mb-3">
                    <label class="small mb-1">Correo</label>
                    <input class="form-control" name="email">
                </div>

                <div class="mb-3">
                    <label class="small mb-1">Telefono</label>
                    <input class="form-control" name="telefono" type="number">
                </div>

                <div class="mb-3">
                    <label class="small mb-1">Dirección</label>
                    <input class="form-control" name="direccion">
                </div>
{{--
                <div class="mb-3">
                    <label class="small mb-1">Contraseña</label>
                    <input class="form-control" name="password">
                </div> --}}

                <div class="mb-3">
                    <label class="small mb-1">Planteles</label>
                     @foreach ($plantels as $plantel)
                    <div class="form-check">
                        <input type="checkbox" class="form-check-input cb"
                            id="p-{{ $plantel->id }}"
                            name="plantels[]" value="{{ $plantel->id }}"
                        >
                        <label class="form-check-label" for="p-{{ $plantel->id }}">
                            {{ $plantel->name }}
                        </label>
                    </div>
                @endforeach
                </div>


                 <div class="mb-3">
                    <label class="small mb-1">Roles</label>

                     @foreach ($roles as $role)
                    <div class="form-check">
                        <input type="checkbox" class="form-check-input cb"
                            id="r-{{ $role->id }}"
                            name="roles[]" value="{{ $role->id }}">
                        <label class="form-check-label" for="r-{{ $role->id }}">
                            {{ $role->name }}
                        </label>
                    </div>
                @endforeach

                </div>

                <div class="mb-3">
                    <label for="status">Seleccionar código</label>
                    <select class="form-control" name="code" id="code">
                        <option value="0">Selecciona un código....</option>
                        @foreach ($codigos as $codigo)
                        <option value="{{ $codigo->id }}">{{ $codigo->name}}</option>
                        @endforeach
                    </select>
                    </div>

                <div class="mb-3">
                    <label for="status">Seleccionar status</label>
                    <select class="form-control" name="status" id="status">
                        <option value="1">Activo</option>
                        <option value="0">Inactivo</option>
                    </select>
                </div>

            <input class="btn btn-primary" type="submit" value="Crear">
            </form>
        </div>
    </div>
</div>

@endsection
