<?php $__env->startSection('content'); ?>
<div class="side-title">
    <h3><?php echo e($head); ?></h3>
</div>

<div class="border-item">
    <form class="form-row" method="post" action="<?php echo e($action); ?>" enctype="multipart/form-data">
        <?php if($page ?? ''  && $page->id): ?>
            <?php echo method_field('PUT'); ?>
        <?php endif; ?>
        <?php echo csrf_field(); ?>

        <?php $__currentLoopData = $languages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="form-group col-lg-6">
            <label><?php echo e(meta('title', $language->local) ?? __('pages.title')); ?> <?php echo e(count($languages) > 1 ? "({$language->name})" : ''); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('title_'.$language->local) ? 'is-invalid' : ''); ?>" name="title_<?php echo e($language->local); ?>" placeholder="<?php echo e(meta('title', $language->local) ?? __('pages.title')); ?>" value='<?php echo e(old("title_{$language->local}", $page[$language->local]->title ?? "")); ?>'/>
        </div>

        
       
        <div class="form-group col-lg-12" >
            <label><?php echo e(meta('description', $language->local) ?? __('pages.description')); ?> <?php echo e(count($languages) > 1 ? "({$language->name})" : ''); ?> </label>
            <textarea name="description_<?php echo e($language->local); ?>" class="form-control my-editor <?php echo e($errors->has('description_'.$language->local) ? 'is-invalid' : ''); ?>" placeholder="<?php echo e(meta('description', $language->local) ?? __('pages.description')); ?>"><?php echo e(old("description_{$language->local}", $page[$language->local]->description ?? "")); ?></textarea>
        </div>
       
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

<?php if(in_array($page->id,[1,2])): ?>
        
        <div class="form-group col-lg-12">
            <label><?php echo e(meta('image', getCurrentLocale()) ?? __('pages.image')); ?> </label>
            <input id="image_thumbnail" class="image_thumbnail" type="hidden" name="image" value="<?php echo e(old("image", $page->image ?? "")); ?>"/>

            <div class="photos main_photo <?php echo e(old('image', $page->image ?? '') ? ' wow fadeInUp' : 'hide'); ?>">
                <div class="col-lg-4">
                    <div class="items">
                        <div class="img">
                            <a href="#" id="lfm" data-input=".image_thumbnail" data-preview=".image_holder" class="lfm" data-hide=".pick_button">
                                <img src="<?php echo e(asset(old('image', $page->image ?? ''))); ?> "  id="image_holder" class="image_holder"/>
                            </a>
                        </div>
                        <a href="#" class="showHide resetImage close" data-empty=".image_thumbnail" data-hide=".main_photo" data-show=".pick_button"><i class="fas fa-times"></i></a>
                    </div>
                </div>
            </div>

            <div class="clearfix"></div>
            <span class="input-group-btn pick_button <?php echo e(old('image', $page->image ?? '') ? 'hide' : ''); ?> ">
                <a id="lfm" data-input=".image_thumbnail" data-preview=".image_holder" data-show=".main_photo" data-hide=".pick_button" class="lfm btn btn-primary text-light">
                    <i class="fas fa-camera-retro"></i> Choose
                </a>
            </span>
        </div>
        
        <?php endif; ?>
<?php if(in_array($page->id,[0])): ?>
 <div class="form-group col-lg-12 image_container">
            <label><?php echo e(meta('image_1', getCurrentLocale()) ?? __('pages.image_1')); ?> </label>
            <input id="image_1_thumbnail" class="image_1_thumbnail" type="hidden" name="image_1" value="<?php echo e(old("image_1", $page->image_1 ?? "")); ?>"/>

            <div class="photos main_1_photo <?php echo e(old('image_1', $page->image_1 ?? '') ? ' wow fadeInUp' : 'hide'); ?>">
                <div class="col-md-4">
                    <div class="items">
                        <div class="img">
                            <a href="#" id="lfm" data-input=".image_1_thumbnail" data-preview=".image_1_holder" class="lfm" data-hide=".pick_1_button">
                                <img src="<?php echo e(asset(old('image_1', $page->image_1 ?? ''))); ?> "  id="image_1_holder" class="image_1_holder"/>
                            </a>
                        </div>
                        <a href="#" class="showHide resetImage close" data-empty=".image_1_thumbnail" data-hide=".main_1_photo" data-show=".pick_1_button"><i class="fas fa-times"></i></a>
                    </div>
                </div>
            </div>

            <div class="clearfix"></div>
            <span class="input-group-btn pick_1_button <?php echo e(old('image_1', $page->image_1 ?? '') ? 'hide' : ''); ?> ">
                <a id="lfm"  data-input=".image_1_thumbnail" data-preview=".image_1_holder" data-show=".main_1_photo" data-hide=".pick_1_button" class="lfm btn btn-primary text-light">
                    <i class="fas fa-camera-retro"></i> Choose
                </a>
             </span>
        </div>
 <div class="form-group col-lg-12 image_container">
            <label><?php echo e(meta('image_2', getCurrentLocale()) ?? __('pages.image_2')); ?> </label>
            <input id="image_2_thumbnail" class="image_2_thumbnail" type="hidden" name="image_2" value="<?php echo e(old("image_2", $page->image_2 ?? "")); ?>"/>

            <div class="photos main_2_photo <?php echo e(old('image_2', $page->image_2 ?? '') ? ' wow fadeInUp' : 'hide'); ?>">
                <div class="col-md-4">
                    <div class="items">
                        <div class="img">
                            <a href="#" id="lfm" data-input=".image_2_thumbnail" data-preview=".image_2_holder" class="lfm" data-hide=".pick_2_button">
                                <img src="<?php echo e(asset(old('image_2', $page->image_2 ?? ''))); ?> "  id="image_2_holder" class="image_2_holder"/>
                            </a>
                        </div>
                        <a href="#" class="showHide resetImage close" data-empty=".image_2_thumbnail" data-hide=".main_2_photo" data-show=".pick_2_button"><i class="fas fa-times"></i></a>
                    </div>
                </div>
            </div>

            <div class="clearfix"></div>
            <span class="input-group-btn pick_2_button <?php echo e(old('image_2', $page->image_2 ?? '') ? 'hide' : ''); ?> ">
                <a id="lfm"  data-input=".image_2_thumbnail" data-preview=".image_2_holder" data-show=".main_2_photo" data-hide=".pick_2_button" class="lfm btn btn-primary text-light">
                    <i class="fas fa-camera-retro"></i> Choose
                </a>
             </span>
        </div>
        
        
        
 <div class="form-group col-lg-12 image_container">
            <label><?php echo e(meta('image_3', getCurrentLocale()) ?? __('pages.image_3')); ?> </label>
            <input id="image_3_thumbnail" class="image_3_thumbnail" type="hidden" name="image_3" value="<?php echo e(old("image_3", $page->image_3 ?? "")); ?>"/>

            <div class="photos main_2_photo <?php echo e(old('image_3', $page->image_3 ?? '') ? ' wow fadeInUp' : 'hide'); ?>">
                <div class="col-md-4">
                    <div class="items">
                        <div class="img">
                            <a href="#" id="lfm" data-input=".image_3_thumbnail" data-preview=".image_3_holder" class="lfm" data-hide=".pick_2_button">
                                <img src="<?php echo e(asset(old('image_3', $page->image_3 ?? ''))); ?> "  id="image_3_holder" class="image_3_holder"/>
                            </a>
                        </div>
                        <a href="#" class="showHide resetImage close" data-empty=".image_3_thumbnail" data-hide=".main_2_photo" data-show=".pick_2_button"><i class="fas fa-times"></i></a>
                    </div>
                </div>
            </div>

            <div class="clearfix"></div>
            <span class="input-group-btn pick_2_button <?php echo e(old('image_3', $page->image_3 ?? '') ? 'hide' : ''); ?> ">
                <a id="lfm"  data-input=".image_3_thumbnail" data-preview=".image_3_holder" data-show=".main_2_photo" data-hide=".pick_2_button" class="lfm btn btn-primary text-light">
                    <i class="fas fa-camera-retro"></i> Choose
                </a>
             </span>
        </div>
        
        
        
 <div class="form-group col-lg-12 image_container">
            <label><?php echo e(meta('image_4', getCurrentLocale()) ?? __('pages.image_4')); ?> </label>
            <input id="image_4_thumbnail" class="image_4_thumbnail" type="hidden" name="image_4" value="<?php echo e(old("image_4", $page->image_4 ?? "")); ?>"/>

            <div class="photos main_2_photo <?php echo e(old('image_4', $page->image_4 ?? '') ? ' wow fadeInUp' : 'hide'); ?>">
                <div class="col-md-4">
                    <div class="items">
                        <div class="img">
                            <a href="#" id="lfm" data-input=".image_4_thumbnail" data-preview=".image_4_holder" class="lfm" data-hide=".pick_2_button">
                                <img src="<?php echo e(asset(old('image_4', $page->image_4 ?? ''))); ?> "  id="image_4_holder" class="image_4_holder"/>
                            </a>
                        </div>
                        <a href="#" class="showHide resetImage close" data-empty=".image_4_thumbnail" data-hide=".main_2_photo" data-show=".pick_2_button"><i class="fas fa-times"></i></a>
                    </div>
                </div>
            </div>

            <div class="clearfix"></div>
            <span class="input-group-btn pick_2_button <?php echo e(old('image_4', $page->image_4 ?? '') ? 'hide' : ''); ?> ">
                <a id="lfm"  data-input=".image_4_thumbnail" data-preview=".image_4_holder" data-show=".main_2_photo" data-hide=".pick_2_button" class="lfm btn btn-primary text-light">
                    <i class="fas fa-camera-retro"></i> Choose
                </a>
             </span>
        </div>
<?php endif; ?>


<?php if(in_array($page->id,[0])): ?>

<div class="col-lg-12">
         <div class="row "  id="points">
                    <div class="col-lg-12"><h3><?php echo e(__('pages.points')); ?></h3></div>
                    
                    <?php $__currentLoopData = $points; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="row col-lg-12 pricing-list-item border-item mb-4">
        <?php $__currentLoopData = languages(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            
        
         <div class="form-group col-lg-6" >
            <label><?php echo e(__('pages.description')); ?> <?php echo e($lang->local); ?></label>
            <textarea name="points[<?php echo e($key); ?>][description_<?php echo e($lang->local); ?>]" class="form-control"  required  placeholder="<?php echo e(__('pages.description')); ?>"><?php echo e(pointdescription($row->id,'description')); ?></textarea>
        </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
       
        <div class="form-group col-lg-2" style="font-size: 30px;margin-top:35px;">
    	<i class="fas fa-times-circle" onclick="remove(this)"></i></div>
    	
    	 
    	</div>
    	<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    
                </div>
</div>
       <div class="col-lg-12">
       <a style="cursor: pointer;"  data-id="<?php echo e(count($points)); ?>" onclick="addpoint(this)"  class="btn_1 gray "><i class="fa fa-fw fa-plus-circle"></i><?php echo e(__("pages.add_point")); ?></a>
                   
</div>  
        <div class="border-item photos col-md-12 other_image_container">
            <div class="row">
                <?php if($page ?? false): ?>
                    <?php $__currentLoopData = $photos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $photo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="col-md-4">
                            <div class="items">
                                <div class="img">
                                    <a href="<?php echo e(asset($photo->image ?? '')); ?>" data-fancybox="gallery"><img src="<?php echo e(asset($photo->image ?? '')); ?>" alt=""></a>
                                </div>
                                <input type="hidden" name="images[]" value="<?php echo e($photo->image ?? ""); ?>">
                                <a href="#" class="close"><i class="fas fa-times"></i></a>
                            </div>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>
            </div>
            <div class="text-center">
                <input id="other_image_thumbnail" class="other_image_thumbnail" type="hidden"/>
                <div class="clearfix"></div>
                <span id="add">
                    <a id="lfm" data-width="" data-cache="article_gallery" data-input=".other_image_thumbnail" data-preview="" data-show="" data-hide="" class="lfm add">
                        Add New Item
                    </a>
                </span>
            </div>
        </div>
        
        <?php endif; ?>
        <div class="text-center mt-5 col-12">
            <button class="butn"><span><?php echo e(__('dashboard.save')); ?></span></button>
        </div>
    </form>
</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('inner_js'); ?>
<script>
    
    function remove(elem){
            $(elem).closest('.row').remove();
        }
        function addpoint(elem){
            
            var num = $(elem).attr('data-id');
        
        var newrow = parseInt(num)+1; 
        $(elem).attr('data-id', newrow);
         $.ajax({
          url : url_point+'/'+num,
          type : 'GET',
          data : 'nothing',
          success:function(data)
          {
            $('#points').append(data);
          }
        })
        }
</script>
    <!-- Editor JS files -->
        <script src="<?php echo e(asset('/assets/admin/js/lib/tinymce.min.js')); ?>"></script>

    <script>
        var route_prefix = "<?php echo e(url(config('lfm.prefix'))); ?>";
        var url = "<?php echo e(url('/')); ?>/";
        var url_point = <?php echo json_encode(url(getCurrentLocale().'/admin/addpoint/')); ?>;
    </script>
    <script src="<?php echo e(asset('assets/admin/js/editor.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/js/lfm.js')); ?>"></script>

<?php $__env->stopSection(); ?>




<?php echo $__env->make('admin.layouts.container', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/omaralyomhost/public_html/rest8/resources/views/admin/pages/form.blade.php ENDPATH**/ ?>