@extends('admin.layouts.app')

@push('styles_top')

@endpush

@section('content')
    <section class="section">
        <div class="section-header">
            <h1>إنشاء شهادة منتسورى جديدة</h1>
            <div class="section-header-breadcrumb">
                <div class="breadcrumb-item active"><a href="/admin/">{{trans('admin/main.dashboard')}}</a>
                </div>
                <div class="breadcrumb-item">
                    إنشاء  شهادة منتسورى جديدة
                </div>
            </div>
        </div>

        <div class="section-body">
            <div class="card">
                <div class="card-body">
                    {{--<div class="form-group row">
                        <p class="col-6 col-lg-3">{{ trans('quiz.student') }} : [student] </p>

                        <p class="col-6 col-lg-3">{{ trans('admin/main.course') }} : [course] </p>

                        <p class="col-6 col-lg-3">{{ trans('quiz.grade') }} : [grade] </p>

                        <p class="col-6 col-lg-3">{{ trans('admin/main.certificate_id') }} : [certificate_id] </p>

                        <p class="col-6 col-lg-3">{{ trans('admin/main.date') }} : [date] </p>

                        <p class="col-6 col-lg-3">{{ trans('admin/main.instructor') }} : [instructor_name] </p>

                        <p class="col-6 col-lg-3">{{ trans('public.duration') }} : [duration] </p>

                        <p class="col-6 col-lg-6">{{ trans('update.user_certificate_additional') }} : [user_certificate_additional] </p>
                    </div>--}}

                    <hr class="my-4">

                    <form method="post" {{--action="/admin/certificates/store-imtmontessori"--}} action="" id="templateForm" class="form-horizontal form-bordered">
                        {{ csrf_field() }}

                        <div class="row">
                            <div class="col-lg-6">
                                {{--@if(!empty(getGeneralSettings('content_translate')))
                                    <div class="form-group">
                                        <label class="input-label">{{ trans('auth.language') }}</label>
                                        <select name="locale" class="form-control {{ !empty($template) ? 'js-edit-content-locale' : '' }}">
                                            @foreach($userLanguages as $lang => $language)
                                                <option value="{{ $lang }}" @if(mb_strtolower(request()->get('locale', app()->getLocale())) == mb_strtolower($lang)) selected @endif>{{ $language }}</option>
                                            @endforeach
                                        </select>
                                        @error('locale')
                                        <div class="invalid-feedback">
                                            {{ $message }}
                                        </div>
                                        @enderror
                                    </div>
                                @else
                                    <input type="hidden" name="locale" value="{{ getDefaultLocale() }}">
                                @endif--}}

                                {{--<div class="form-group">
                                    <label class="control-label" for="inputDefault">{!! trans('public.type') !!}</label>
                                    <select name="type" class="form-control @error('type') is-invalid @enderror">
                                        <option value="">{{ trans('admin/main.select_type') }}</option>
                                        <option value="quiz" {{ (!empty($template) and $template->type == 'quiz') ? 'selected' : '' }}>{{ trans('update.quiz_related') }}</option>
                                        <option value="course" {{ (!empty($template) and $template->type == 'course') ? 'selected' : '' }}>{{ trans('update.course_completion') }}</option>
                                    </select>
                                    <div class="invalid-feedback">@error('type') {{ $message }} @enderror</div>
                                </div>--}}

                                <div class="form-group">
                                            <label class="input-label d-block">{{ trans('admin/main.user') }}</label>
                                            <select name="student_id" class="form-control search-user-select2" data-placeholder="{{ trans('public.search_user') }}">

                                            </select>
                                            @error('user_id')
                                            <div class="invalid-feedback d-block">{{ $message }}</div>
                                            @enderror
                                        </div>

                                <div class="form-group">
                                    <label class="control-label" for="inputDefault">القوالب</label>
                                    <select name="template" class="form-control @error('template') is-invalid @enderror">
                                        <option value="">قالب الشهادة</option>
                                        @foreach($templates as $template)
                                            <option value="{{$template->image}}" @if(old('template') == $template->image) selected @endif >{{$template->name}}</option>
                                        @endforeach
                                    </select>
                                    <div class="invalid-feedback">@error('template') {{ $message }} @enderror</div>
                                </div>

                                <div class="form-group">
                                    <label class="control-label" for="inputDefault">أبعاد الشهادة</label>
                                    <select name="dimensions_type" class="form-control @error('dimensions_type') is-invalid @enderror">
                                        <option value="height" @if(old('dimensions_type') == 'height') selected @endif>شهادة بالطول</option>
                                        <option value="width1" @if(old('dimensions_type') == 'width1') selected @endif >شهادة بالعرض 1</option>
                                        <option value="width2" @if(old('dimensions_type') == 'width2') selected @endif >شهادة بالعرض 2</option>
                                    </select>
                                    <div class="invalid-feedback">@error('dimensions_type') {{ $message }} @enderror</div>
                                </div>

                                <div class="form-group">
                                    <label class="control-label" for="inputDefault">نوع الشهادة</label>
                                    <select name="age" class="form-control @error('age') is-invalid @enderror">
                                        <option value="">ذوي الهمم</option>
                                        <option value="0-3" @if(old('age') == '0-3') selected @endif >0-3</option>
                                        <option value="3-6" @if(old('age') == '3-6') selected @endif >3-6</option>
                                        <option value="6-9" @if(old('age') == '6-9') selected @endif >6-9</option>
                                    </select>
                                    <div class="invalid-feedback">@error('age') {{ $message }} @enderror</div>
                                </div>

                                <div class="form-group">
                                    <label class="control-label" for="inputDefault">التاريخ</label>
                                    <input type="text" name="date" class="form-control @error('date') is-invalid @enderror" value="{{  old('date') }}">
                                    <div class="invalid-feedback">@error('date') {{ $message }} @enderror</div>
                                </div>



{{--                                <div class="form-group">--}}
{{--                                    <label class="control-label" for="inputDefault">نوع الشهادة</label>--}}
{{--                                    <select name="type" class="form-control @error('type') is-invalid @enderror">--}}
{{--                                        <option value="">{{ trans('admin/main.select_type') }}</option>--}}
{{--                                        <option value="normal">للطلبة غير ذوى الاحتياجات الخاصة</option>--}}
{{--                                        <option value="special">للطلبة ذوى الاحتياجات الخاصة</option>--}}
{{--                                    </select>--}}
{{--                                    <div class="invalid-feedback">@error('type') {{ $message }} @enderror</div>--}}
{{--                                </div>--}}


                            </div>
                        </div>







                        <div class="form-group">
                            <div class="col-md-12">
                                <button class="btn btn-success pull-left" id="submiter" type="button" {{--data-action="{{ !empty($template) ? '/admin/certificates/templates/'. $template->id .'/update' : '/admin/certificates/templates/store' }}" --}} data-action="{{'/admin/certificates/store-imtmontessori'}}">{{ trans('public.save') }}</button>
                                <button class="btn btn-info pull-left" id="preview" type="button" data-action="/admin/certificates/imtmontessori-preview">{{ trans('admin/main.preview_certificate') }}</button>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </section>
@endsection

@push('scripts_bottom')


    <script src="/assets/default/js/admin/certificates.min.js"></script>
@endpush
