{{-- Extends layout --}}
@extends('layout.default')

{{-- Content --}}
@section('content')

<div class="card card-custom example example-compact">
    <div class="card-header">
        <h3 class="card-title">
            Bulk Email
        </h3>
    </div>
    <!--begin::Form-->
    <form class="form" action="{{$action}}" method="POST">
        @csrf
        @isset($batch->id)
        {{ method_field('PATCH')}}
        @endisset
        <div class="card-body">

            @if ($errors->any())
            <div class="alert alert-danger">
                <strong>Error!</strong>
                <ul>
                    @foreach ($errors->all() as $error)
                    <li>{{ $error }}</li>
                    @endforeach
                </ul>
            </div>
            @endif

            <div class="form-group row">
                <div class="col-lg-4">
                    <select class="form-control" id="instructor" name="instructor" required>
                        <option value="" selected="">Instructor</option>
                        <?php
                        foreach ($instructor as $row) {
                            echo "<option value='" . $row['EmployeeID'] . "'";
                            echo ">" . $row['FirstName'] . "</option>";
                        }
                        ?>
                    </select>
                </div>
                <div class="col-lg-4">
                    <select class="form-control" id="course_id" name="course_id">
                        <option value="">Select Course</option>
                        @foreach ($courses as $row)
                        <option value="{{ $row ->id }}">{{ $row ->name }}</option>
                        @endforeach
                    </select>
                </div>
                <div class="col-lg-4">
                    <select class="form-control" id="timing" name="timing">
                        <option value="">Select Timing</option>
                        @foreach ($timings as $row)
                        <option value="{{ $row ->timename }}">{{ $row ->timename }}</option>
                        @endforeach
                    </select>
                </div>
            </div>
            <div class="form-group row">

                <div class="col-lg-9">
                    <textarea name="kt-ckeditor-1" id="kt-ckeditor-1">

        </textarea>
                </div>
            </div>
        </div>
        <div class="card-footer">
            <div class="row">
                <div class="col-lg-9 ml-lg-auto">
                    <button type="submit" class="btn btn-success mr-2">Submit</button>
                  
                </div>
            </div>
        </div>
    </form>
    <!--end::Form-->
</div>
@endsection
@section('scripts')
<script>
    $(document).ready(function() {
        $('.select2').select2();
    });
</script>
<script>
    var KTCkeditor = function() {
        // Private functions
        var demos = function() {
            ClassicEditor
                .create(document.querySelector('#kt-ckeditor-1'))
                .then(editor => {
                    console.log(editor);
                })
                .catch(error => {
                    console.error(error);
                });
        }

        return {
            // public functions
            init: function() {
                demos();
            }
        };
    }();
    jQuery(document).ready(function() {
        KTCkeditor.init();
    });
</script>
<script src="{{ asset('plugins/custom/ckeditor/ckeditor-classic.bundle.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/app.js') }}" type="text/javascript"></script>
@endsection