@extends('layouts.admin.main')

@section('content')
    <div class="row">
        <div class="card ">
            <div class="card-header card-header-primary">
                <h4 class="card-title">Ajouter un événement à l'horaire</h4>
            </div>
            <div class="card-body ">
                <form action="/admin/schedule/event/add" method="POST">
                    @csrf

                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                              <label for="type">Type d'événement</label>
                              <select class="form-control selectpicker" data-style="btn btn-link" name="type" id="type" onchange="switchType('{{$date}}')" required>
                                @foreach (\App\ComplementaryActivity::all() as $item)
                                    <option value="{{$item->id}}">{{$item->name}}</option>
                                @endforeach
                              </select>
                            </div>  
                        </div>
                    </div>
                    <div class="row" id="container">
                        
                    </div>
                    <button type="submit" class="btn btn-primary mt-5">Sauvegarder</button>
                </form>
            </div>
        </div>
    </div>
@endsection

@section('custom_scripts')
<script src="/js/calendar.js"></script>
<script>
switchType('{{$date}}')
$('.datetimepicker').datetimepicker({
    icons: {
        time: "fa fa-clock-o",
        date: "fa fa-calendar",
        up: "fa fa-chevron-up",
        down: "fa fa-chevron-down",
        previous: 'fa fa-chevron-left',
        next: 'fa fa-chevron-right',
        today: 'fa fa-screenshot',
        clear: 'fa fa-trash',
        close: 'fa fa-remove'
    }
});
</script>
    
@endsection