<?php echo $__env->make("messages", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php
$size = Config::get('params.best_post_image_size');
$hotelTypes = Config::get('params.hotel_types');
$countries = array();
$required = "";

$collection = collect(Config::get('countries'));

foreach ($collection as $key => $item) {
    $countries[$key] = $item["name"];
}

if (!empty(old("facilities"))) {
    $selectedFacilities = old("facilities");
}
$action = "posts";
?>

<div class="row">
    <ul id="tabsJustified" class="nav nav-tabs">
        <li class="nav-item"><a href="#_" data-target="#about" data-toggle="tab" class="nav-link small text-uppercase active">About</a></li>
 
    </ul>
</div>

<div id="tabsJustifiedContent" class="tab-content">

    <div id="about" class="tab-pane fade active show">
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <?php echo Form::label('title'); ?>

                    <?php echo Form::text('title', null , array('class' => 'form-control',$required) ); ?>

                </div>
            </div>
            
            <div class="col-sm-6">
                <div class="form-group">
                    <?php echo Form::label('Categories'); ?>

                    <?php echo Form::select('category_id', $categories,null,['class' => 'form-control','name'=>'category_id',$required]); ?>

                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <?php echo Form::label('key'); ?>

                    <?php echo Form::text('key', null , array('class' => 'form-control',$required) ); ?>

                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <?php echo Form::label('tagline'); ?>

                    <?php echo Form::text('tagline', null , array('class' => 'form-control',$required) ); ?>

                </div>
            </div>
        </div>
        
         <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <?php echo Form::label('Meta keyword'); ?>

                    <?php echo Form::text('meta_keyword', null , array('class' => 'form-control',$required) ); ?>

                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <?php echo Form::label('Meta Title'); ?>

                    <?php echo Form::text('meta_title', null , array('class' => 'form-control',$required) ); ?>

                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <?php echo Form::label('short description'); ?>

                    <?php echo Form::textarea('short_description', null, ['class'=>'form-control', 'rows' => 3, 'cols' => 3, 'style' => '']); ?>

                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <?php echo Form::label('meta description'); ?>

                    <?php echo Form::textarea('meta_description', null, ['class'=>'form-control', 'rows' => 3, 'cols' => 3, 'style' => '']); ?>

                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <?php echo Form::label('description'); ?>

                    <?php echo Form::textarea('description', null, ['class'=>'form-control mb-20 editor','id'=>'ckview', 'rows' => 3, 'cols' => 3, 'style' => '']); ?>


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

        <div class="row">
            <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 if(isset($model->status) && $model->status==1): ?>
                               checked 
                               <?php 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 class="row">
            <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>
    </div>
    <div class="row">
        <div class="col-sm-6">
           <div class="form-group">
                <?php echo Form::label('Publish Date'); ?>

                <?php echo Form::text('publish_date', $date , array('class' => 'form-control pickadate2',$required) ); ?>


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

    <br clear="all" />
    <div class="row">
        <div class="col-md-8">
            <button type="submit" class="btn btn-primary mr-1 mb-1 waves-effect waves-light">Save</button>
            <a href="<?php echo e(url('admin/posts')); ?>" class="btn btn-outline-warning mr-1 mb-1 waves-effect waves-light">Cancel</a>
        </div>
    </div>
</div>

</div>

<?php echo $__env->make('vendor_script', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->startSection('myscript'); ?>

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

<script>
    var ckview = document.getElementById("ckview");
    //CKEDITOR.replace(ckview, options);
    CKEDITOR.config.allowedContent = true;
    CKEDITOR.replace(ckview, {filebrowserImageBrowseUrl: '/file-manager/ckeditor',
    });
     $( "#removeImage" ).click(function() {
            $("#image").val(" ");
            
          });

</script>
<script>
    $('.pickadate2').pickadate({
            labelMonthNext: 'Go to the next month',
            labelMonthPrev: 'Go to the previous month',
            labelMonthSelect: 'Pick a month from the dropdown',
            labelYearSelect: 'Pick a year from the dropdown',
            selectMonths: true,
            selectYears: true,
            editable: true
        });
</script>

<?php $__env->stopSection(); ?><?php /**PATH /home/seolocaj/public_html/homefloltd/resources/views/admin/posts/form.blade.php ENDPATH**/ ?>