<?php echo $__env->make("messages", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php
$yes_no = Config::get('params.yes_no');
$template = Config::get('params.template');
$size = Config::get('params.best_boiler_image_size');

$required = "";
$action = "pages";
?>

<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="#faqs" data-toggle="tab" class="nav-link small text-uppercase ">Faqs</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-md-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-md-6">
                <div class="form-group">
                    <?php echo Form::label('Template'); ?>

                    <?php echo Form::select('Template', $template,null,['class' => 'form-control','name'=>'Template','id'=>'template'] ); ?>

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

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

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

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

                </div>
            </div>


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

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

                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <?php echo Form::label('No Index Follow Tag'); ?>

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

                </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 if(isset($model->Status) && $model->Status=="Enabled"): ?>
                                checked 
                                <?php endif; ?>
                                class="custom-control-input" name="Status" id="Status" value="Enabled">
                                <label class="custom-control-label" for="Status">Status</label>
                     </div>
                 </div>
             </div>
        </div>
        <div class="row">
            <div class="col-md-12 col-xs-12 col-lg-12">
                <div class="form-group">
                    <?php echo Form::label('URL'); ?>

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

                </div>
            </div>    
        </div>
         <div id="bannerimage">
            <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->bannerImage) ? $model->bannerImage : ""; ?>"  placeholder="Upload Image" id="bannerImage" name="bannerImage" 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="bannerImage">Browse</button>
                    </div>
                    <div class="col-lg-1 col-xl-1 ">

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

                    </div>
                </div>
            </div>   
            </div>
            
        </div>
        <div id="noneTemplate">
            <div class="row">

                <div class="col-md-12 col-xs-12 col-lg-12">
                    <div class="form-group">
                        <?php echo Form::label('Header Title'); ?>

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


                    </div>
                </div>  
            </div>
            <div class="row">
                <div class="col-md-12 col-xs-12 col-lg-12">
                    <div class="form-group">
                        <?php echo Form::label('Content'); ?>

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

                    </div>
                </div>    
            </div>
        <div id="img">
            <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->HeaderImageName) ? $model->HeaderImageName : ""; ?>"  placeholder="Upload Image" id="HeaderImageName" name="HeaderImageName" 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="HeaderImageName">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>
        
        <div class="row" id="boilerTemplate">
            <div class="col-sm-12">
                <div class="form-group">
                    <?php echo Form::label('Content 2'); ?>

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

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

       
        
        
    </div>
    
    <div id="meta" class="tab-pane fade">
        <div class="row">
            <div class="col-md-6 ">
                <div class="form-group">
                    <?php echo Form::label('Meta Title'); ?>

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

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

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

                </div>
            </div>
            
        </div>
        
        <div class="row">
            
            <div class="col-md-12 col-xs-12 col-lg-12">
                <div class="form-group">
                    <?php echo Form::label('Meta Description'); ?>

                    <?php echo Form::textarea('MetaDescription', null, ['class'=>'form-control','id' => 'MetaDescription', 'rows' => 5, 'cols' => 100]); ?>

                </div>
            </div>
        </div>
        
    </div>
    
    <div id="faqs" class="tab-pane fade">
        <?php echo $__env->make("admin.common.faqs_form", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    </div>
    
    
    
</div>

<br clear="all"/>
<div class="row">
    <div class="col-md-8">
                <?php echo 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="<?php echo e(url('admin/pages')); ?>" class="btn btn-outline-warning mr-1 mb-1 waves-effect waves-light">Cancel</a>
    </div>
</div>
<?php echo $__env->make('vendor_script', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->startSection('myscript'); ?>

<script>
  var options = {
    filebrowserImageBrowseUrl: '/laravel-filemanager?type=Images',
    filebrowserImageUploadUrl: '/laravel-filemanager/upload?type=Images&_token=<?php echo e(csrf_token()); ?>',
    filebrowserBrowseUrl: '/laravel-filemanager?type=Files',
    filebrowserUploadUrl: '/laravel-filemanager/upload?type=Files&_token=<?php echo e(csrf_token()); ?>'
  };
</script>
<script>
    $(document).ready(function () {

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

    });

</script>

<script>
    $( document ).ready(function() {
        $('#media_action').val("<?php echo $action; ?>");
        if($( "#template" ).val()=="None"){
            
            $("#noneTemplate").show();
             $("#boilerTemplate").hide();
              $("#bannerimage").hide();
             
        }else  if($( "#template" ).val()=="Boiler"){
            $("#boilerTemplate").show();
            $("#bannerimage").hide();
        }else  if($( "#template" ).val()=="About"){
            $("#boilerTemplate").hide();
            $("#bannerimage").show();
        }else  if($( "#template" ).val()=="WhatsCovered"){
            $("#boilerTemplate").hide();
            $("#img").hide();
            $("#bannerimage").hide();
        }

    $('#template').on('change', function() {
        var value = $(this).val();
        if(value== "None"){
            
            $("#noneTemplate").show();
             $("#boilerTemplate").hide(); 
             $("#bannerimage").hide();

        }else if(value == "Boiler"){
            $("#boilerTemplate").show();
            $("#bannerimage").hide();
           
        }else  if($( "#template" ).val()=="About"){
            $("#boilerTemplate").hide();
            $("#bannerimage").show();
        }else  if($( "#template" ).val()=="WhatsCovered"){
            $("#boilerTemplate").hide();
              $("#img").hide();
              $("#bannerimage").hide();
        }
    });
    $( "#removeImage" ).click(function() {
            $("#HeaderImageName").val(" ");
            
          });
           $( "#removeImage2" ).click(function() {
            $("#bannerImage").val(" ");
            
          });
    
    
    });
</script>

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