@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 documentación</h6>
                <a href="{{route('documentoTipo.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">

<h3>Crear tipo de documento</h3>

    @if(session('success'))
        <div class="alert alert-success">
            {{ session('success') }}
        </div>
    @endif

    <form method="POST" action="{{ route('documentoTipo.store') }}">
        @csrf

        {{-- NOMBRE --}}
        <div class="mb-3">
            <label>Nombre</label>
            <input type="text" name="name" class="form-control" required>
        </div>

        {{-- SLUG --}}
        <div class="mb-3">
            <label>Slug</label>
            <input type="text" name="slug" class="form-control" required>
        </div>

        {{-- EXTENSIONES --}}
        <div class="mb-3">
            <label>Extensiones permitidas</label>

            <div class="form-check">
                <label>
                    <input type="checkbox" name="extensiones[]" value="pdf" class="form-check-input cb">
                    PDF
                </label>
            </div>

            <div class="form-check">
                <label>
                    <input type="checkbox" name="extensiones[]" value="jpg" class="form-check-input cb">
                    JPG
                </label>
            </div>

            <div class="form-check">
                <label>
                    <input type="checkbox" name="extensiones[]" value="png" class="form-check-input cb">
                    PNG
                </label>
            </div>

        </div>


        <div class="mb-3">
            <label>Niveles a impartir</label>

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

        <button class="btn btn-primary">Guardar</button>

    </form>

        </div>
    </div>
</div>

@endsection
