
<?php $__env->startSection('title'); ?>
<title><?php echo e($websiteLang->where('lang_key','services')->first()->custom_text); ?></title>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('admin-content'); ?>


    <div class="card shadow mb-4">
        <div class="card-body">
            <form action="<?php echo e(route('admin.service-image')); ?>" enctype="multipart/form-data" method="POST">
                <?php echo csrf_field(); ?>
                <div class="row">
                    <div class="col-12">
                        <div class="form-group">
                            <label for=""><?php echo e($websiteLang->where('lang_key','bg_img')->first()->custom_text); ?></label>
                        <div>
                            <img src="<?php echo e(url($feature_image->image)); ?>" alt="" width="200px">
                        </div>
                        <label class="mt-2" for=""><?php echo e($websiteLang->where('lang_key','new_img')->first()->custom_text); ?></label>
                        <div>
                            <input type="file" name="image">
                        </div>
                        </div>
                    </div>

                    <div class="col-12">
                        <div class="form-group">
                            <label for=""><?php echo e($websiteLang->where('lang_key','title')->first()->custom_text); ?></label>
                            <input type="text" name="title" class="form-control" value="<?php echo e($feature_image->title); ?>">
                        </div>
                    </div>

                    <div class="col-12">
                        <div class="form-group">
                            <label for=""><?php echo e($websiteLang->where('lang_key','des')->first()->custom_text); ?></label>
                            <textarea name="description" id="" class="form-control" cols="30" rows="5"><?php echo e($feature_image->description); ?></textarea>
                        </div>
                    </div>

                </div>
                <button class="btn btn-success"><?php echo e($websiteLang->where('lang_key','update')->first()->custom_text); ?></button>
            </form>
        </div>
    </div>

    <!-- Page Heading -->
    <h1 class="h3 mb-2 text-gray-800"><a href="#" data-toggle="modal" data-target="#addTestimonial" class="btn btn-success"><i class="fas fa-plus" aria-hidden="true"></i> <?php echo e($websiteLang->where('lang_key','create')->first()->custom_text); ?> </a></h1>

    <!-- DataTales Example -->
    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <h6 class="m-0 font-weight-bold text-primary"><?php echo e($websiteLang->where('lang_key','service_table')->first()->custom_text); ?></h6>
        </div>
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                    <thead>
                        <tr>
                            <th width="5%" ><?php echo e($websiteLang->where('lang_key','serial')->first()->custom_text); ?></th>
                            <th width="20%" ><?php echo e($websiteLang->where('lang_key','title')->first()->custom_text); ?></th>
                            <th width="10%" ><?php echo e($websiteLang->where('lang_key','icon')->first()->custom_text); ?></th>
                            <th width="30%" ><?php echo e($websiteLang->where('lang_key','des')->first()->custom_text); ?></th>
                            <th width="10%" ><?php echo e($websiteLang->where('lang_key','status')->first()->custom_text); ?></th>
                            <th width="10%" ><?php echo e($websiteLang->where('lang_key','action')->first()->custom_text); ?></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td><?php echo e(++$index); ?></td>
                            <td><?php echo e($item->title); ?></td>
                            <td><i class="<?php echo e($item->icon); ?>"></i></td>
                            <td><?php echo e($item->description); ?></td>
                            <td>
                                <?php if($item->status==1): ?>
                                    <a href="" onclick="testimonialStatus(<?php echo e($item->id); ?>)"><input type="checkbox" checked data-toggle="toggle" data-on="<?php echo e($websiteLang->where('lang_key','active')->first()->custom_text); ?>" data-off="<?php echo e($websiteLang->where('lang_key','inactive')->first()->custom_text); ?>" data-onstyle="success" data-offstyle="danger"></a>
                                <?php else: ?>
                                    <a href="" onclick="testimonialStatus(<?php echo e($item->id); ?>)"><input type="checkbox" data-toggle="toggle" data-on="<?php echo e($websiteLang->where('lang_key','active')->first()->custom_text); ?>" data-off="<?php echo e($websiteLang->where('lang_key','inactive')->first()->custom_text); ?>" data-onstyle="success" data-offstyle="danger"></a>

                                <?php endif; ?>
                            </td>
                            <td>
                                <a href="#" data-toggle="modal" data-target="#updateFaq-<?php echo e($item->id); ?>" class="btn btn-primary btn-sm"><i class="fas fa-edit"></i></a>
                                <a data-toggle="modal" data-target="#deleteModal" href="javascript:;" onclick="deleteData(<?php echo e($item->id); ?>)" class="btn btn-danger btn-sm"><i class="fas fa-trash    "></i></a>


                            </td>
                        </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <!-- create new testimonial Modal -->
    <div class="modal fade" id="addTestimonial" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                    <div class="modal-header">
                            <h5 class="modal-title"><?php echo e($websiteLang->where('lang_key','service_form')->first()->custom_text); ?></h5>
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                        </div>
                <div class="modal-body">
                    <div class="container-fluid">

                    <form action="<?php echo e(route('admin.service.store')); ?>" method="POST" enctype="multipart/form-data">
                        <?php echo csrf_field(); ?>
                        <div class="row">
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label for="title"><?php echo e($websiteLang->where('lang_key','title')->first()->custom_text); ?></label>
                                    <input type="text" class="form-control" name="title" id="title" value="<?php echo e(old('title')); ?>">
                                </div>
                            </div>
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label for="icon"><?php echo e($websiteLang->where('lang_key','icon')->first()->custom_text); ?></label>
                                    <input type="text" class="form-control custom-icon-picker" name="icon" id="icon" value="<?php echo e(old('icon')); ?>">
                                </div>
                            </div>


                            <div class="col-md-12">
                                <div class="form-group">
                                    <label for="description"><?php echo e($websiteLang->where('lang_key','des')->first()->custom_text); ?></label>
                                    <textarea class="form-control" id="description" name="description" rows="5" cols="30"><?php echo e(old('description')); ?></textarea>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label for="status"><?php echo e($websiteLang->where('lang_key','status')->first()->custom_text); ?></label>
                                    <select name="status" id="status" class="form-control">
                                        <option value="1"><?php echo e($websiteLang->where('lang_key','active')->first()->custom_text); ?></option>
                                        <option value="0"><?php echo e($websiteLang->where('lang_key','inactive')->first()->custom_text); ?></option>
                                    </select>
                                </div>
                            </div>
                        </div>


                        <button type="button" class="btn btn-danger" data-dismiss="modal"><?php echo e($websiteLang->where('lang_key','close')->first()->custom_text); ?></button>
                        <button type="submit" class="btn btn-success"><?php echo e($websiteLang->where('lang_key','save')->first()->custom_text); ?></button>
                    </form>
                    </div>
                </div>

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

     <!-- update testimonial Modal -->
     <?php $__currentLoopData = $services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <div class="modal fade" id="updateFaq-<?php echo e($item->id); ?>" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true">
        <div class="modal-dialog " role="document">
            <div class="modal-content">
                    <div class="modal-header">
                            <h5 class="modal-title"><?php echo e($websiteLang->where('lang_key','service_form')->first()->custom_text); ?></h5>
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                        </div>
                <div class="modal-body">
                    <div class="container-fluid">

                        <form action="<?php echo e(route('admin.service.update',$item->id)); ?>" method="POST" enctype="multipart/form-data">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('patch'); ?>
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="title"><?php echo e($websiteLang->where('lang_key','title')->first()->custom_text); ?></label>
                                        <input type="text" class="form-control" name="title" id="title" value="<?php echo e($item->title); ?>">
                                    </div>
                                </div>

                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="icon"><?php echo e($websiteLang->where('lang_key','icon')->first()->custom_text); ?></label>
                                        <input type="text" class="form-control custom-icon-picker" id="icon" name="icon" value="<?php echo e($item->icon); ?>">
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="description"><?php echo e($websiteLang->where('lang_key','des')->first()->custom_text); ?></label>
                                        <textarea class="form-control" id="description" name="description" rows="5" cols="30"><?php echo e($item->description); ?></textarea>
                                    </div>
                                </div>

                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="status"><?php echo e($websiteLang->where('lang_key','status')->first()->custom_text); ?></label>
                                        <select name="status" id="status" class="form-control">
                                            <option <?php echo e($item->status==1 ? 'selected' : ''); ?> value="1"><?php echo e($websiteLang->where('lang_key','active')->first()->custom_text); ?></option>
                                            <option <?php echo e($item->status==0 ? 'selected' : ''); ?> value="0"><?php echo e($websiteLang->where('lang_key','inactive')->first()->custom_text); ?></option>
                                        </select>
                                    </div>
                                </div>
                            </div>


                            <button type="button" class="btn btn-danger" data-dismiss="modal"><?php echo e($websiteLang->where('lang_key','close')->first()->custom_text); ?></button>
                            <button type="submit" class="btn btn-success"><?php echo e($websiteLang->where('lang_key','update')->first()->custom_text); ?></button>
                        </form>
                    </div>
                </div>

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

    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>



    <script>
        function deleteData(id){
            $("#deleteForm").attr("action",'<?php echo e(url("/admin/service/")); ?>'+"/"+id)
        }

        function testimonialStatus(id){
            // project demo mode check
            var isDemo="<?php echo e(env('PROJECT_MODE')); ?>"
            var demoNotify="<?php echo e(env('NOTIFY_TEXT')); ?>"
            if(isDemo==0){
                toastr.error(demoNotify);
                return;
            }
            $.ajax({
                type:"get",
                url:"<?php echo e(url('/admin/service-status/')); ?>"+"/"+id,
                success:function(response){
                   toastr.success(response)
                },
                error:function(err){
                    console.log(err);

                }
            })
        }
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/cloudelite/imobi.eliteteclda.com/resources/views/admin/service/index.blade.php ENDPATH**/ ?>