


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

<?php if(session('service_update_msg')): ?>
<div class="alert alert-success">
    <?php echo e(session('service_update_msg')); ?>

</div>
<?php endif; ?>

<h2 class="mb-3"><?php echo e(awtTrans('Edit Service')); ?></h2>

<?php echo Form::model($service, ['method' => 'PATCH', 'route' => ['admin.services.update', $service->id], 'files' => true]); ?>

<div class="row">
    <div class="col-md-12">

        <div class="row">
            <div class="form-group col-md-6">
                <?php echo Form::label('name_ar', awtTrans('Name Arabic')); ?>

                <?php echo Form::text('name_ar', null, ['class' => $errors->has('name_ar') ? 'form-control is-invalid' : 'form-control']); ?>

                <small class="text-danger"><?php echo e($errors->first('name_ar')); ?></small>
            </div>

            <div class="form-group col-md-6">
                <?php echo Form::label('name_en', awtTrans('Name Arabic')); ?>

                <?php echo Form::text('name_en', null, ['class' => $errors->has('name_en') ? 'form-control is-invalid' : 'form-control']); ?>

                <small class="text-danger"><?php echo e($errors->first('name_en')); ?></small>
            </div>
        </div>


        <div class="row">

            <div class="form-group col-lg-6">
                <?php echo Form::label('desc_ar', awtTrans('Description Arabic')); ?>

                <?php echo Form::textarea('desc_ar', null, [ 'class' => 'form-control tinyEditor']); ?>

                <small class="text-danger"><?php echo e($errors->first('desc_ar')); ?></small>
            </div>

            <div class="form-group col-lg-6">
                <?php echo Form::label('desc_en', awtTrans('Description English')); ?>

                <?php echo Form::textarea('desc_en', null, [ 'class' => 'form-control tinyEditor']); ?>

                <small class="text-danger"><?php echo e($errors->first('desc_en')); ?></small>
            </div>

        </div>


        <div class="row">

            <div class="form-group col-lg-12">
                <?php echo Form::label('photo', awtTrans('الصورة')); ?>

                <div class="input-group">
                    <span class="input-group-btn">
                        <a id="lfm" data-input="photo" data-preview="holder" class="btn btn-secondary text-white px-4" style="border-top-right-radius: 0;border-bottom-right-radius: 0;border-top-left-radius: 0;border-bottom-left-radius: 0;">
                            <i class="fa fa-picture-o"></i> <?php echo e(awtTrans('اختر الصورة')); ?>

                        </a>
                    </span>
                    <?php echo Form::text('photo', null, ['class' => $errors->has('photo') ? 'form-control is-invalid' : 'form-control' , 'readonly' => 'readonly']); ?>

                </div>
                <div class="mb-3 mt-3 d-block slider-holder" id="holder">
                    <img width="100" src="<?php echo e($service->photo); ?>" alt="">
                </div>
                <small class="text-danger"><?php echo e($errors->first('photo')); ?></small>
            </div>
        </div>



        <div class="row">

            <div class="form-group col-lg-12">
                <button type="button" class="btn btn-info btn-block" id="add-image-desc"><i class="fas fa-plus"></i> <?php echo e(awtTrans('Add Image With Description')); ?></button>
            </div>
        </div>

        <div class="row" id="append-image-desc">

            <?php if($service->imagewithdesc->isNotEmpty()): ?>
            <?php $__currentLoopData = $service->imagewithdesc; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key2 => $imagewithdesc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php if($key2 == 0): ?>
            <div class="row col-lg-12">


                <div class="form-group col-lg-2">
                    <?php echo Form::label('image', 'الصورة:'); ?>

                    <div class="input-group">
                        <div class="custom-file">
                            <input type="file" name="imagee[]" data-id="image" multiple class="from-control image">
                        </div>
                    </div>
                    <img src="<?php echo e(url($imagewithdesc->image)); ?>" width="150px" alt="">
                    <div class="">
                        <?php if($errors->has('image')): ?>
                        <span class="help-block">
                            <strong style="color: red;"><?php echo e($errors->first('image')); ?></strong>
                        </span>
                        <?php endif; ?>
                    </div>

                </div>

                <div class="form-group col-lg-5">
                    <lable for="desc2_ar">الوصف بالعربي</lable>
                    <textarea type="text" name="desc2_arr[]" class="form-control"><?php echo e($imagewithdesc->desc_ar); ?></textarea>
                </div>

                <div class="form-group col-lg-5">
                    <lable for="desc2_en">الوصف بالانجليزي</lable>
                    <textarea type="text" name="desc2_enn[]" class="form-control"><?php echo e($imagewithdesc->desc_en); ?></textarea>
                </div>

            </div>
            <?php else: ?>

            <div class="row col-lg-12">


                <div class="form-group col-lg-2">
                    <?php echo Form::label('image', 'الصورة:'); ?>

                    <div class="input-group">
                        <div class="custom-file">
                            <input type="file" name="imagee[]" data-id="image" multiple class="from-control image">
                        </div>
                    </div>
                    <img src="<?php echo e(url($imagewithdesc->image)); ?>" width="150px" alt="">

                    <div class="">
                        <?php if($errors->has('image')): ?>
                        <span class="help-block">
                            <strong style="color: red;"><?php echo e($errors->first('image')); ?></strong>
                        </span>
                        <?php endif; ?>
                    </div>

                </div>

                <div class="form-group col-lg-4">
                    <lable for="desc2_ar">الوصف بالعربي</lable>
                    <textarea type="text" name="desc2_arr[]" class="form-control"><?php echo e($imagewithdesc->desc_ar); ?></textarea>
                </div>

                <div class="form-group col-lg-4">
                    <lable for="desc2_en">الوصف بالانجليزي</lable>
                    <textarea type="text" name="desc2_enn[]" class="form-control"><?php echo e($imagewithdesc->desc_en); ?></textarea>
                </div>

                <div class="form-group col-lg-2">
                    <lable for="desc2_en">حذف</lable>
                    <button type="button" class="btn btn-danger btn-block delete-image-desc-ajax" data-url="<?php echo e(route('admin.remove.imagewithdesc')); ?>" data-id="<?php echo e($imagewithdesc->id); ?>"><i class="fas fa-trash"></i></button>
                </div>

            </div>

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



        <div class="row">

            <div class="form-group col-lg-12">
                <button type="button" class="btn btn-info btn-block" id="add-keyword"><i class="fas fa-plus"></i></button>
            </div>
        </div>

        <div class="row" id="append-keyword">

            <?php if($service->keywords->isNotEmpty()): ?>
            <?php $__currentLoopData = $service->keywords; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $keyword): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php if($key == 0): ?>

            <div class="row col-lg-12">


                <div class="form-group col-lg-5">
                    <lable for="keyword_ar">الكلمات المفتاحية بالعربي</lable>
                    <input type="text" name="keyword_ar[]" value="<?php echo e($keyword->body_ar); ?>" class="form-control" />
                </div>

                <div class="form-group col-lg-5">
                    <lable for="keyword_en">الكلمات المفتاحية بالانجليزي</lable>
                    <input type="text" name="keyword_en[]" value="<?php echo e($keyword->body_en); ?>" class="form-control" />
                </div>


            </div>

            <?php else: ?>

            <div class="row col-lg-12">


                <div class="form-group col-lg-5">
                    <lable for="keyword_ar">الكلمات المفتاحية بالعربي</lable>
                    <input type="text" name="keyword_ar[]" value="<?php echo e($keyword->body_ar); ?>" class="form-control" />
                </div>

                <div class="form-group col-lg-5">
                    <lable for="keyword_en">الكلمات المفتاحية بالانجليزي</lable>
                    <input type="text" name="keyword_en[]" value="<?php echo e($keyword->body_en); ?>" class="form-control" />
                </div>

                <div class="form-group col-lg-2">
                    <lable for="keyword_en">حذف</lable>
                    <button type="button" class="btn btn-danger btn-block" id="delete-keyword"><i class="fas fa-trash"></i></button>
                </div>

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


    </div>
</div>


<?php echo Form::submit(awtTrans('Update Service'), ['class' => 'btn btn-success']); ?>

<a href="<?php echo e(route('admin.services.index')); ?>" class="btn btn-primary "><i class="fas fa-arrow-left  fa-sm  "></i> <?php echo e(awtTrans('Back')); ?></a>

<?php echo Form::close(); ?>


<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\jaadara\Projects-from-10-2022\ics-back\resources\views/admin/services/edit.blade.php ENDPATH**/ ?>