<?php $__env->startSection('content'); ?>

    <!-- Form row -->
    <div class="row">
        <div class="col-xl-12 box-margin height-card">
            <div class="card card-body">
                <div class="d-md-flex justify-content-between align-items-center mb-20">
                    <h4 class="card-title"><?php echo e(__('content.edit_service')); ?>

                        <div class="btn-group">
                            <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <?php echo e(__('content.select')); ?>

                            </button>
                            <div class="dropdown-menu">
                                <a class="dropdown-item" href="<?php echo e(route('service-content.create', $service->id)); ?>"><?php echo e(__('content.service_content')); ?></a>
                                <a class="dropdown-item" href="<?php echo e(route('service-process.create', $service->id)); ?>"><?php echo e(__('content.service_processes')); ?></a>
                                <a class="dropdown-item" href="<?php echo e(route('service-item.create', $service->id)); ?>"><?php echo e(__('content.service_items')); ?></a>
                            </div>
                        </div>
                        <!-- Button -->
                        <a id="hoverButton" class="iyzi-btn"><i class="fas fa-camera"></i> <?php echo e(__('content.view_draft')); ?></a>
                        <!-- Modal -->
                        <div id="imageModal" class="border border-success iyzi-modal">
                            <img class="img-fluid " src="<?php echo e(asset('uploads/img/dummy/style/service-'.$service->style.'.jpg')); ?>" alt="draft image">
                        </div>
                    </h4>
                    <div>
                        <a href="<?php echo e(url()->previous()); ?>" class="btn btn-primary"><i class="fas fa-angle-left"></i> <?php echo e(__('content.back')); ?></a>
                    </div>
                </div>
                <?php if($demo_mode == "on"): ?>
                    <!-- Include Alert Blade -->
                    <?php echo $__env->make('admin.demo_mode.demo-mode', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                <?php else: ?>
                    <form action="<?php echo e(route('service.update', $service->id)); ?>" method="POST" enctype="multipart/form-data">
                        <?php echo method_field('PUT'); ?>
                        <?php echo csrf_field(); ?>
                        <?php endif; ?>

                        <input name="style" type="hidden" value="<?php echo e($service->style); ?>">

                        <div class="row">
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label for="title"><?php echo e(__('content.title')); ?> <span class="text-red">*</span></label>
                                    <input type="text" name="title" class="form-control" id="title" value="<?php echo e($service->title); ?>" required>
                                </div>
                            </div>
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label for="category"><?php echo e(__('content.categories')); ?> <span class="text-red">*</span></label>
                                    <select class="form-control" name="category_id" id="category" required>
                                        <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($category->id); ?>" <?php echo e($category->id == $service->category_id ? 'selected' : ''); ?>><?php echo e($category->category_name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                            </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="short_description"><?php echo e(__('content.short_description')); ?></label>
                                        <textarea type="text" name="short_description" class="form-control" id="short_description" rows="3"><?php echo e($service->short_description); ?></textarea>
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <fieldset class="form-group">
                                        <legend class="font-14"><?php echo e(__('content.type')); ?></legend>
                                        <div class="form-check pl-0 mb-2">
                                            <label class="form-check-label">
                                                <input type="radio" class="form-check-input mr-2" name="type" id="optionsRadios1" onclick="showHideTypeDiv()" value="icon" <?php echo e($service->type == 'icon' ? 'checked' : ''); ?>><span class="ml-3"><?php echo e(__('content.icon')); ?></span>
                                                <i class="input-helper"></i>
                                            </label>
                                        </div>
                                        <div class="form-check pl-0">
                                            <label class="form-check-label">
                                                <input type="radio" class="form-check-input mr-1" name="type" id="optionsRadios2" onclick="showHideTypeDiv()" value="image" <?php echo e($service->type == 'image' ? 'checked' : ''); ?>><span class="ml-3"><?php echo e(__('content.image')); ?></span>
                                                <i class="input-helper"></i>
                                            </label>
                                        </div>
                                    </fieldset>
                                    <div class="form-group" id="icon-type" style="<?php echo e($service->type == 'icon' ? 'display:block' : 'display:none'); ?>">
                                        <label for="icon" class="d-block"><?php echo e(__('content.icon')); ?></label>
                                        <div class="btn-group">
                                            <input type="hidden" name="icon" class="form-control" id="icon" value="<?php echo e($service->icon); ?>">
                                            <button type="button" class="btn btn-primary  iconpicker-component"><i id="icon-value" class="<?php echo e($service->icon); ?> iconpicker-component"></i></button>
                                            <button type="button" id="iconPickerBtn" class="icp icp-dd btn btn-primary dropdown-toggle iconpicker-component" data-selected="fa-car" data-toggle="dropdown">
                                                <span class="caret"></span>
                                            </button>
                                            <div class="dropdown-menu"></div>
                                        </div>
                                    </div>
                                    <div id="image-type" style="<?php echo e($service->type == 'image' ? 'display:block' : 'display:none'); ?>">
                                        <div class="form-group">
                                            <label for="section_image"><?php echo e(__('content.image')); ?> (<?php echo e(__('content.size')); ?> 64 x 64) (.svg, .jpg, .jpeg, .png, .webp, .gif)</label>
                                            <input type="file" name="section_image" class="form-control-file" id="section_image">
                                            <small class="form-text text-muted"><?php echo e(__('content.please_use_recommended_sizes')); ?></small>
                                        </div>
                                        <div class="height-card box-margin">
                                            <div class="card">
                                                <div class="card-body">
                                                    <div class="avatar-area text-center">
                                                        <div class="media">
                                                            <?php if(!empty($service->section_image)): ?>
                                                                <a  class="d-block mx-auto" href="#" data-toggle="tooltip" data-placement="top" data-original-title="<?php echo e(__('content.current_image')); ?>">
                                                                    <img src="<?php echo e(asset('uploads/img/service/'.$service->section_image)); ?>" alt="image" class="rounded">
                                                                </a>
                                                            <?php else: ?>
                                                                <a class="d-block mx-auto" href="#" data-toggle="tooltip" data-placement="top" data-original-title="<?php echo e(__('content.not_yet_created')); ?>">
                                                                    <img src="<?php echo e(asset('uploads/img/dummy/no-image.jpg')); ?>" alt="no image" class="rounded w-25">
                                                                </a>
                                                            <?php endif; ?>
                                                        </div>
                                                        <?php if(!empty($service->section_image)): ?>
                                                            <a class="mt-3 d-block" href="#" data-toggle="modal" data-target="#deleteImageModal<?php echo e($service->id); ?>">
                                                                <i class="fa fa-trash text-danger font-18"></i>
                                                            </a>
                                                        <?php endif; ?>
                                                    </div>
                                                    <!--end card-body-->
                                                </div>
                                            </div>
                                            <!--end card-->
                                        </div>
                                        <!--end col-->
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="button_name"><?php echo e(__('content.button_name')); ?> </label>
                                        <input id="button_name" name="button_name" type="text" class="form-control" value="<?php echo e($service->button_name); ?>">
                                        <small class="form-text text-muted"><?php echo e(__('content.when_you_leave_this_section_blank_it_will_go_to_its_own_detail_page')); ?></small>
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="button_url"><?php echo e(__('content.button_url')); ?> </label>
                                        <input id="button_url" name="button_url" type="text" class="form-control" value="<?php echo e($service->button_url); ?>">
                                    </div>
                                </div>
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label for="order"><?php echo e(__('content.order')); ?></label>
                                    <input type="number" name="order" class="form-control" id="order" value="<?php echo e($service->order); ?>">
                                </div>
                            </div>
                            <div class="col-xl-12">
                                <div class="form-group">
                                    <label for="status" class="col-form-label"><?php echo e(__('content.status')); ?> </label>
                                    <select class="form-control" name="status" id="status">
                                        <option value="published" selected><?php echo e(__('content.select_your_option')); ?></option>
                                        <option value="published" <?php echo e($service->status == 'published' ? 'selected' : ''); ?>><?php echo e(__('content.published')); ?></option>
                                        <option value="draft" <?php echo e($service->status == 'draft' ? 'selected' : ''); ?>><?php echo e(__('content.draft')); ?></option>
                                    </select>
                                </div>
                            </div>
                            <div class="col-md-12">
                                <div class="form-group">
                                    <small class="form-text text-muted"><?php echo e(__('content.required_fields')); ?></small>
                                </div>
                            </div>
                            <div class="col-md-12">
                                <div class="form-group">
                                    <button type="submit" class="btn btn-primary"><?php echo e(__('content.submit')); ?></button>
                                </div>
                            </div>
                        </div>

                    </form>

                    <!-- Modal -->
                    <div class="modal fade" id="deleteImageModal<?php echo e($service->id); ?>" tabindex="-1" role="dialog" aria-labelledby="deleteImageModalCenterTitle" aria-hidden="true">
                        <div class="modal-dialog modal-dialog-centered modal-sm" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h5 class="modal-title" id="deleteImageModalCenterTitle"><?php echo e(__('content.delete')); ?></h5>
                                    <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo e(__('content.close')); ?>">
                                        <span aria-hidden="true">&times;</span>
                                    </button>
                                </div>
                                <div class="modal-body text-center">
                                    <?php echo e(__('content.you_wont_be_able_to_revert_this')); ?>

                                </div>
                                <div class="modal-footer">
                                    <?php if($demo_mode == "on"): ?>
                                        <!-- Include Alert Blade -->
                                        <?php echo $__env->make('admin.demo_mode.demo-mode', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                    <?php else: ?>
                                        <form class="d-inline-block" action="<?php echo e(route('service.destroy_image', $service->id)); ?>" method="POST">
                                            <?php echo method_field('DELETE'); ?>
                                            <?php echo csrf_field(); ?>
                                            <?php endif; ?>

                                        <button type="button" class="btn btn-danger mr-1" data-dismiss="modal"><?php echo e(__('content.cancel')); ?></button>
                                        <button type="submit" class="btn btn-success"><?php echo e(__('content.yes_delete_it')); ?></button>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>

            </div>
        </div>
    </div>
    <!-- end row -->

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

<?php echo $__env->make('layouts.admin.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/lltrusti/ajayfiresafety/ajay/resources/views/admin/service/edit.blade.php ENDPATH**/ ?>