@include("messages")
<?php
$required = "";
$size = Config::get('params.best_image_size');

$statusChecked = "";
if (!isset($model->id)) {
    $statusChecked = "checked";
}
$action = "categories";
$media = Config::get('params.media_path.large');

?>

<div class="row">
    <ul id="tabsJustified" class="nav nav-tabs">
        <li class="nav-item"><a href="#_" data-target="#information" data-toggle="tab" class="nav-link small text-uppercase active">Information</a></li>
        <li class="nav-item"><a href="#_" data-target="#meta" data-toggle="tab" class="nav-link small text-uppercase ">Meta</a></li>
        <li class="nav-item"><a href="#_" data-target="#covered" data-toggle="tab" class="nav-link small text-uppercase ">Covered Text</a></li>
        <li class="nav-item"><a href="#_" data-target="#faqs" data-toggle="tab" class="nav-link small text-uppercase ">Faqs</a></li>
        <li class="nav-item"><a href="#_" data-target="#extra" data-toggle="tab" class="nav-link small text-uppercase ">Extra</a></li>

    </ul>
</div>
<div id="tabsJustifiedContent" class="tab-content">
    <div id="information" class="tab-pane fade active show">
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    {!! Form::label('Title') !!}
                    {!! Form::text('title', null , array('class' => 'form-control',$required) ) !!}
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    {!! Form::label('Code/Url') !!}
                    {!! Form::text('code', null , array('class' => 'form-control',$required) ) !!}
                </div>
            </div>
            <div class="col-sm-12">
                <div class="form-group">
                    {!! Form::label('Tagline 1') !!}
                    {!! Form::text('tagline', null , array('class' => 'form-control',$required) ) !!}
                </div>
            </div>
            <div class="col-sm-12">
                <div class="form-group">
                    {!! Form::label('Tagline 2') !!}
                    {!! Form::text('tagline2', null , array('class' => 'form-control',$required) ) !!}
                </div>
            </div>
            <div class="col-sm-12">
                <div class="form-group">
                    {!! Form::label('Button Title') !!}
                    {!! Form::text('buttonTitle', null , array('class' => 'form-control',$required) ) !!}
                </div>
            </div>
            <div class="col-sm-12">
                <div class="form-group">
                    {!! Form::label('Package Above Title') !!}
                    {!! Form::text('packages_title', null , array('class' => 'form-control',$required) ) !!}
                </div>
            </div>
            <div class="col-sm-12">
                <div class="form-group">
                    {!! Form::label('description') !!}
                    {!! Form::textarea('description', null, ['class'=>'form-control ckeditor', 'rows' => 3, 'cols' => 3, 'style' => '']) !!}
                </div>
            </div>
             <div class="col-sm-12">
                <div class="form-group">
                    {!! Form::label('Excluded What covered Option') !!}
                    {!! Form::select('facility_id', $facilities,null,['class' => 'form-control select2','id'=>'hotels',$required]) !!}
                </div>
            </div>
            <div class="col-sm-6">
                @if(isset($model->file))

                <a class="btn btn-success mr-1 mb-1 waves-effect waves-light" href="{{url("/")}}/<?php echo Config("params.dir_categories_image"); ?>/<?php echo $model->file; ?>" target="_blank">Download</a>
                @endif
            </div>

            <div class="col-sm-12">
                <div class="row form-group">
                    <label class="col-xl-2 col-lg-2 col-form-label"> Image</label>
                    <div class="col-lg-6 col-xl-6">
                        <input   value="<?php echo isset($model->image) ? $model->image : ""; ?>"  placeholder="Upload Image" id="image" name="image" type="text" class="form-control "  readonly="">
                        <br clear="all"/>
                        Best Image Size(<?php echo $size; ?>)
                    </div>
                    <div class="col-lg-2 col-xl-2">
                        <button type="button" class="btn btn-warning btn-label-brand btn-md mediaModel" data-toggle="modal" data-target="#media-model" data-control="image">Browse</button>
                    </div>
                    <div class="col-lg-1 col-xl-1 ">

                        <p id="removeImage" class="btn btn-outline-warning mr-1 mb-1 waves-effect waves-light float-right">Remove</p>

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

            



            <div class="col-sm-6">
                <div class="form-group">
                    {!! Form::label('position') !!}
                    {!! Form::text('position', null , array('class' => 'form-control',$required) ) !!}
                </div>
            </div>
            <div class="col-sm-6">
                <div class="d-flex justify-content-start flex-wrap">
                    <div class="custom-control custom-switch custom-switch-success mr-2 mb-1">
                        <p class="mb-0">Status</p>
                        <input type="checkbox"  <?php echo $statusChecked; ?>
                               @if(isset($model->status) && $model->status==1)
                               checked 
                               @endif
                               class="custom-control-input" name="status" id="status" value="1">
                               <label class="custom-control-label" for="status">Status</label>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="meta" class="tab-pane fade">

        <div class="col-sm-12">
            <div class="form-group">
                {!! Form::label('metaTitle') !!}
                {!! Form::text('metaTitle', null , array('class' => 'form-control',$required) ) !!}
            </div>
        </div>
        <div class="col-sm-12">
            <div class="form-group">
                {!! Form::label('metaDescription') !!}
                {!! Form::textarea('metaDescription', null , array('class' => 'form-control','rows' => 3, 'cols' => 3, 'style' => '',$required) ) !!}
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                {!! Form::label('keywords') !!}
                {!! Form::text('keywords', null , array('class' => 'form-control',$required) ) !!}
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                {!! Form::label('tags') !!}
                {!! Form::text('tags', null , array('class' => 'form-control',$required) ) !!}
            </div>
        </div>



    </div>


    <div id="covered" class="tab-pane fade">

        <div class="col-sm-12">
            <div class="form-group">
                {!! Form::label('not Covered Title') !!}
                {!! Form::text('coveredTitle', null , array('class' => 'form-control',$required) ) !!}
            </div>
        </div>
        <div class="col-sm-12">
            <div class="form-group">
                {!! Form::label('not Covered Text') !!}
                {!! Form::textarea('coveredText', null , array('id' => 'coveredText','class' => 'form-control ckeditor','rows' => 3, 'cols' => 3, 'style' => '',$required) ) !!}
            </div>
        </div>


    </div>
    
 


    <div id="faqs" class="tab-pane fade">
        @include("admin.common.faqs_form")
    </div>

    <br clear="all" />
</div>
<br clear="all" />
<div class="row">
    <div class="col-md-6">
        {!! Form::hidden('_token', csrf_token(),array("id"=>"_token")) !!}
        <button type="submit" class="btn btn-primary mr-1 mb-1 waves-effect waves-light">Save</button>
        <a href="{{url('admin/')}}/{{$action}}" class="btn btn-outline-warning mr-1 mb-1 waves-effect waves-light">Cancel</a>
    </div>
</div>

@include('vendor_script')
@section('myscript')
{{-- Page js files --}}
<script>
    $(document).ready(function () {

        CKEDITOR.config.allowedContent = true;
        CKEDITOR.replace("ckeditor", {filebrowserImageBrowseUrl: '/file-manager/ckeditor',
        });
        

    });

</script>

<script>
 
    var planCount = <?php echo!empty($plans) ? count($plans) : 0 ?>;

    $(document).ready(function () {
        
        $('#media_action').val("<?php echo $action; ?>");
 
      
     

    });
</script>
<script>
      $( "#removeImage" ).click(function() {
            $("#image").val(" ");
            
          });
</script>

@endsection