@extends('admin.layouts.app')


@section('content')
<h2 class="mb-3">{{awtTrans('New Service')}}</h2>

{!! Form::open(['method' => 'POST', 'route' => 'admin.services.store', 'files' => true]) !!}
<div class="row">
    <div class="col-md-12">

        <div class="row">
            <div class="form-group col-lg-12">
                {!! Form::label('parent_id', awtTrans('Main Services')) !!}
                {!! Form::select('parent_id', [''=>awtTrans('Choose Main Service'),] + $services, null, ['class' => 'form-control']) !!}
                <small class="text-danger">{{ $errors->first('parent_id') }}</small>
            </div>
        </div>

        <div class="row">
            <div class="form-group col-md-6">
                {!! Form::label('name_ar', awtTrans('Name Arabic')) !!}
                {!! Form::text('name_ar', null, ['class' => $errors->has('name_ar') ? 'form-control is-invalid' : 'form-control']) !!}
                <small class="text-danger">{{ $errors->first('name_ar') }}</small>
            </div>

            <div class="form-group col-md-6">
                {!! Form::label('name_en', awtTrans('Name Arabic')) !!}
                {!! Form::text('name_en', null, ['class' => $errors->has('name_en') ? 'form-control is-invalid' : 'form-control']) !!}
                <small class="text-danger">{{ $errors->first('name_en') }}</small>
            </div>
        </div>


        <div class="row">

            <div class="form-group col-lg-6">
                {!! Form::label('desc_ar', awtTrans('Description Arabic')) !!}
                {!! Form::textarea('desc_ar', null, [ 'class' => 'form-control tinyEditor']) !!}
                <small class="text-danger">{{ $errors->first('desc_ar') }}</small>
            </div>

            <div class="form-group col-lg-6">
                {!! Form::label('desc_en', awtTrans('Description English')) !!}
                {!! Form::textarea('desc_en', null, [ 'class' => 'form-control tinyEditor']) !!}
                <small class="text-danger">{{ $errors->first('desc_en') }}</small>
            </div>

        </div>


        <div class="row">

            <div class="form-group col-lg-12">
                {!! Form::label('photo', awtTrans('الصورة')) !!}
                <div class="input-group">
                    <span class="input-group-btn">
                        <a id="lfm" data-input="photo" data-preview="photo" class="btn btn-secondary text-white px-4" style="border-top-right-radius: 0;border-bottom-right-radius: 0;border-top-left-radius: 0;border-bottom-left-radius: 0;">
                            <i class="fa fa-picture-o"></i> {{ awtTrans('اختر الصورة') }}
                        </a>
                    </span>
                    {!! Form::text('photo', null, ['class' => $errors->has('photo') ? 'form-control is-invalid photo' : 'form-control photo' , 'readonly' => 'readonly']) !!}
                </div>
                <div class="mb-3 mt-3 d-block slider-holder photo" id="photo">
                    <img width="100" src="http://127.0.0.1:8000/storage/1/th.jpeg" alt="">
                </div>
                <small class="text-danger">{{ $errors->first('photo') }}</small>
            </div>
        </div>



        <div class="row">

            <div class="form-group col-lg-12">
                <button type="button" class="btn btn-info btn-block" id="add-image-desc"><i class="fas fa-plus"></i> {{ awtTrans('Add Image With Description') }}</button>
            </div>
        </div>

        <div class="row" id="append-image-desc">

            <div class="row col-lg-12">


                <div class="form-group col-lg-2">
                    {!! Form::label('image', 'الصورة:') !!}
                    <div class="input-group">
                        <div class="custom-file">
                            <input type="file" name="image[]" data-id="image" class="from-control image">
                        </div>
                    </div>

                    <div class="">
                        @if ($errors->has('image'))
                        <span class="help-block">
                            <strong style="color: red;">{{ $errors->first('image') }}</strong>
                        </span>
                        @endif
                    </div>

                </div>

                <div class="form-group col-lg-5">
                    {!! Form::label('desc2_ar', awtTrans('Description Arabic')) !!}
                    {!! Form::textarea('desc2_ar[]', null, [ 'class' => 'form-control tinyEditor']) !!}
                    <small class="text-danger">{{ $errors->first('desc2_ar') }}</small>
                </div>
                <div class="form-group col-lg-5">
                    {!! Form::label('desc2_en', awtTrans('Description English')) !!}
                    {!! Form::textarea('desc2_en[]', null, [ 'class' => 'form-control tinyEditor']) !!}
                    <small class="text-danger">{{ $errors->first('desc2_en') }}</small>
                </div>

            </div>

        </div>


        <div class="row">

            <div class="form-group col-lg-12">
                <button type="button" class="btn btn-info btn-block" id="add-keyword"><i class="fas fa-plus"></i></button>
            </div>
        </div>

        <div class="row" id="append-keyword">

            <div class="row col-lg-12">


                <div class="form-group col-lg-6">
                    {!! Form::label('keyword_ar', awtTrans('الكلمات المفتاحية بالعربي')) !!}
                    {!! Form::text('keyword_ar[]', null, [ 'class' => 'form-control']) !!}
                    <small class="text-danger">{{ $errors->first('keyword_ar') }}</small>
                </div>

                <div class="form-group col-lg-6">
                    {!! Form::label('keyword_en', awtTrans('الكلمات المفتاحية بالانجليزي')) !!}
                    {!! Form::text('keyword_en[]', null, [ 'class' => 'form-control']) !!}
                    <small class="text-danger">{{ $errors->first('keyword_en') }}</small>
                </div>

            </div>

        </div>


    </div>
</div>


{!! Form::submit(awtTrans('Add Service'), ['class' => 'btn btn-success']) !!}
<a href="{{ route('admin.services.index') }}" class="btn btn-primary"><i class="fas fa-arrow-left  fa-sm  "></i> {{awtTrans('Back')}}</a>
{!! Form::close() !!}

@endsection

@section('scripts')
<script>
    $(document).ready(function() {

    });
</script>
@endsection