<?php $__env->startSection('table'); ?>
    <?php echo e(__('testimonials')); ?>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('mainContent'); ?>
    <?php echo generateBreadcrumb(); ?>


    <section class="admin-visitor-area up_st_admin_visitor">
        <div class="container-fluid p-0">
            <div class="row justify-content-center">
                <div class="col-xxl-3">
                    <div class="white-box mb_30  student-details header-menu">
                        <div class="row justify-content-center">
                            <div class="col-12">
                                <div class="box_header common_table_header">
                                    <div class="main-title d-md-flex w-100">
                                        <h3 class="mb-0 mr-30 mb_xs_15px mb_sm_20px">
                                            <?php if(!isset($edit)): ?>
                                                <?php echo e(__('frontendmanage.Add New Testimonial')); ?>

                                            <?php else: ?>
                                                <?php echo e(__('common.Update')); ?>

                                            <?php endif; ?></h3>

                                        <?php if(isset($edit)): ?>
                                            <div class="float-end text-end">
                                                <a href="<?php echo e(route('frontend.testimonials')); ?>"
                                                   class="primary-btn small fix-gr-bg updatebtn float-end"
                                                   title="<?php echo e(__('frontendmanage.Add New Testimonial')); ?>">+ </a>
                                            </div>

                                        <?php endif; ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <?php if(!isset($edit) && permissionCheck('frontend.testimonials_store')): ?>
                            <form
                                action="<?php echo e(route('frontend.testimonials_store')); ?>"
                                method="POST" id="coupon-form" name="coupon-form" enctype="multipart/form-data">
                                <?php echo csrf_field(); ?>
                                <?php elseif(permissionCheck('frontend.testimonials_edit') && isset($edit)): ?>
                                    <form
                                        action="<?php echo e(isset($edit)?route('frontend.testimonials_update'): ''); ?>"
                                        method="POST" id="coupon-form" name="coupon-form" enctype="multipart/form-data">
                                        <?php echo csrf_field(); ?>
                                        <?php if(isset($edit)): ?>
                                            <input type="hidden" name="id" value="<?php echo e($edit->id); ?>">
                                        <?php endif; ?>
                                        <?php endif; ?>


                                        <input type="hidden" name="category" value="1">

                                        <?php
                                            $LanguageList = getLanguageList();
                                        ?>
                                        <div class="row pt-0">
                                            <?php if(isModuleActive('FrontendMultiLang')): ?>
                                                <ul class="nav nav-tabs no-bottom-border  mt-sm-md-20 mb-10 ms-3"
                                                    role="tablist">
                                                    <?php $__currentLoopData = $LanguageList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <li class="nav-item">
                                                            <a class="nav-link  <?php if(auth()->user()->language_code == $language->code): ?> active <?php endif; ?>"
                                                               href="#element<?php echo e($language->code); ?>"
                                                               role="tab"
                                                               data-bs-toggle="tab"><?php echo e($language->native); ?>  </a>
                                                        </li>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </ul>
                                            <?php endif; ?>
                                        </div>
                                        <div class="tab-content">
                                            <?php $__currentLoopData = $LanguageList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <div role="tabpanel"
                                                     class="tab-pane fade <?php if(auth()->user()->language_code == $language->code): ?> show active <?php endif; ?>  "
                                                     id="element<?php echo e($language->code); ?>">
                                                    <div class="row">
                                                        <div class="col-xl-12">
                                                            <div class="primary_input mb-25">
                                                                <label class="primary_input_label"
                                                                       for=""><?php echo e(__('frontendmanage.Body Text')); ?>

                                                                    <span class="required_mark">*</span> </label>
                                                                <textarea name="body[<?php echo e($language->code); ?>]" id=""
                                                                          cols="30" rows="10"
                                                                          <?php echo e($errors->has('body') ? ' autofocus' : ''); ?>

                                                                          placeholder="<?php echo e(__('frontendmanage.Body Text')); ?>"
                                                                          class="primary_textarea <?php echo e(@$errors->has('body') ? ' is-invalid' : ''); ?>"><?php echo e(isset($edit)?$edit->getTranslation('body',$language->code):''); ?></textarea>
                                                                <?php if($errors->has('body')): ?>
                                                                    <span class="invalid-feedback d-block mb-10"
                                                                          role="alert">
                                                <strong><?php echo e(@$errors->first('body')); ?></strong>
                                            </span>
                                                                <?php endif; ?>
                                                            </div>
                                                        </div>
                                                        <div class="col-xl-12">
                                                            <div class="primary_input mb-25">
                                                                <label class="primary_input_label"
                                                                       for=""><?php echo e(__('frontendmanage.Author')); ?>

                                                                    <span class="required_mark">*</span> </label>
                                                                <input name="author[<?php echo e($language->code); ?>]" id="author"
                                                                       <?php echo e($errors->has('author') ? ' autofocus' : ''); ?>

                                                                       class="primary_input_field name <?php echo e(@$errors->has('author') ? ' is-invalid' : ''); ?>"
                                                                       placeholder="<?php echo e(__('frontendmanage.Enter Author Name')); ?>"
                                                                       type="text"
                                                                       value="<?php echo e(isset($edit)?$edit->getTranslation('author',$language->code):''); ?>">
                                                                <?php if($errors->has('author')): ?>
                                                                    <span class="invalid-feedback d-block mb-10"
                                                                          role="alert">
                                                <strong><?php echo e(@$errors->first('author')); ?></strong>
                                            </span>
                                                                <?php endif; ?>
                                                            </div>
                                                        </div>
                                                        <div class="col-xl-12">
                                                            <div class="primary_input mb-25">
                                                                <label class="primary_input_label"
                                                                       for=""><?php echo e(__('frontendmanage.Profession')); ?>

                                                                    <span class="required_mark">*</span> </label>
                                                                <input name="profession[<?php echo e($language->code); ?>]"
                                                                       id="profession"
                                                                       <?php echo e($errors->has('profession') ? ' autofocus' : ''); ?>

                                                                       class="primary_input_field name <?php echo e(@$errors->has('profession') ? ' is-invalid' : ''); ?>"
                                                                       placeholder="<?php echo e(__('frontendmanage.Enter Profession')); ?>"
                                                                       type="text"
                                                                       value="<?php echo e(isset($edit)?$edit->getTranslation('profession',$language->code):''); ?>">
                                                                <?php if($errors->has('profession')): ?>
                                                                    <span class="invalid-feedback d-block mb-10"
                                                                          role="alert">
                                                <strong><?php echo e(@$errors->first('profession')); ?></strong>
                                            </span>
                                                                <?php endif; ?>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </div>
                                        <div class="row">

                                            <div class="col-xl-12">
                                                <div class="primary_input mb-25">
                                                    <label class="primary_input_label" for=""><?php echo e(__('common.Star')); ?>

                                                        <span class="required_mark">*</span> </label>
                                                    <select class="primary_select mb-25" name="star" id="star">
                                                        <option value="1" <?php if(isset($edit)): ?>
                                                            <?php echo e($edit->star==1?'selected':''); ?>

                                                            <?php endif; ?>>
                                                            <?php echo e(translatedNumber(1)); ?>

                                                        </option>
                                                        <option value="2" <?php if(isset($edit)): ?>
                                                            <?php echo e($edit->star==2?'selected':''); ?>

                                                            <?php endif; ?>>
                                                            <?php echo e(translatedNumber(2)); ?>

                                                        </option>
                                                        <option value="3" <?php if(isset($edit)): ?>
                                                            <?php echo e($edit->star==3?'selected':''); ?>

                                                            <?php endif; ?>>
                                                            <?php echo e(translatedNumber(3)); ?>

                                                        </option>
                                                        <option value="4" <?php if(isset($edit)): ?>
                                                            <?php echo e($edit->star==4?'selected':''); ?>

                                                            <?php endif; ?>>
                                                            <?php echo e(translatedNumber(4)); ?>

                                                        </option>
                                                        <option value="5"
                                                                <?php if(isset($edit)): ?><?php echo e($edit->star==5?'selected':''); ?> <?php else: ?> selected <?php endif; ?> >
                                                            <?php echo e(translatedNumber(5)); ?>


                                                        </option>
                                                    </select>

                                                </div>
                                            </div>

                                            <div class="col-lg-12">
                                                <div class="  mb-15">
                                                    <?php if (isset($component)) { $__componentOriginal3c189c37dfafa3e6853f94906c245d36 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal3c189c37dfafa3e6853f94906c245d36 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.upload-file','data' => ['type' => 'image','name' => 'image','required' => 'true','mediaId' => ''.e(isset($edit)?$edit->image_media?->media_id:'').'','label' => ''.e(__('common.Image')).'']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('upload-file'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['type' => 'image','name' => 'image','required' => 'true','media_id' => ''.e(isset($edit)?$edit->image_media?->media_id:'').'','label' => ''.e(__('common.Image')).'']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal3c189c37dfafa3e6853f94906c245d36)): ?>
<?php $attributes = $__attributesOriginal3c189c37dfafa3e6853f94906c245d36; ?>
<?php unset($__attributesOriginal3c189c37dfafa3e6853f94906c245d36); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal3c189c37dfafa3e6853f94906c245d36)): ?>
<?php $component = $__componentOriginal3c189c37dfafa3e6853f94906c245d36; ?>
<?php unset($__componentOriginal3c189c37dfafa3e6853f94906c245d36); ?>
<?php endif; ?>

                                                </div>
                                            </div>


                                            <div class="col-xl-12">
                                                <div class="primary_input mb-25">
                                                    <label class="primary_input_label" for=""><?php echo e(__('common.Status')); ?>

                                                        <span class="required_mark">*</span> </label>
                                                    <select
                                                        class="primary_select mb-25  <?php echo e(@$errors->has('status') ? ' is-invalid' : ''); ?>"
                                                        name="status" id="status" required>
                                                        <option
                                                            value="1" <?php echo e(isset($edit)?($edit->status==1?'selected':''):''); ?>><?php echo e(__('common.Active')); ?></option>
                                                        <option
                                                            value="0" <?php echo e(isset($edit)?($edit->status==0?'selected':''):''); ?>><?php echo e(__('common.Inactive')); ?></option>
                                                    </select>
                                                </div>
                                            </div>

                                            <?php
                                                $disable =false;
                                                    if(!isset($edit)){
                                                        if (!permissionCheck('frontend.testimonials_store')){
                                                            $disable=true;
                                                        }
                                                        $text= __('common.Save');

                                                    }else{
                                                           if(!permissionCheck('frontend.testimonials_edit')){
                                                            $disable=true;
                                                        }
                                                           $text= __('common.Update');
                                                    }
                                            ?>
                                            <?php if(!$disable): ?>
                                                <div class="col-lg-12 text-center">
                                                    <div class="d-flex justify-content-center pt_20">
                                                        <button type="submit" class="primary-btn semi_large fix-gr-bg"
                                                                <?php echo e($disable?'disable':''); ?>

                                                                id="save_button_parent">
                                                            <i class="ti-check"></i>
                                                            <?php echo e($text); ?>

                                                        </button>
                                                    </div>
                                                </div>
                                            <?php endif; ?>
                                        </div>
                                    </form>
                    </div>
                </div>
                <div class="col-xxl-9">
                    <div class="white-box">
                        <div class="box_header common_table_header">
                            <div class="main-title d-flex flex-wrap mb-0">
                                <h3 class="mb-0" id="page_title"><?php echo e(__('frontendmanage.Testimonial')); ?> </h3>
                            </div>
                        </div>
                        <div class="QA_section QA_section_heading_custom check_box_table">
                            <div class="QA_table">
                                <!-- table-responsive -->
                                <div class="">
                                    <table id="lms_table" class="table Crm_table_active3">
                                        <thead>
                                        <tr>
                                            <th scope="col"><?php echo e(__('common.SL')); ?></th>
                                            <th scope="col"><?php echo e(__('frontendmanage.Body')); ?></th>
                                            <th scope="col"><?php echo e(__('frontendmanage.Author')); ?></th>
                                            <th scope="col"><?php echo e(__('frontendmanage.Profession')); ?></th>
                                            <th scope="col"><?php echo e(__('common.Image')); ?></th>
                                            <th scope="col"><?php echo e(__('frontendmanage.Date')); ?></th>

                                            <th scope="col"><?php echo e(__('common.Star')); ?></th>
                                            <th scope="col"><?php echo e(__('common.Status')); ?></th>
                                            <th scope="col"><?php echo e(__('common.Action')); ?></th>
                                        </tr>
                                        </thead>
                                        <tbody>


                                        <?php $__currentLoopData = $testimonials; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                                <th><?php echo e(translatedNumber($key+1)); ?></th>
                                                <td><?php echo e(@$item->body); ?></td>
                                                <td><?php echo e(@$item->author); ?></td>
                                                <td><?php echo e(@$item->profession); ?></td>
                                                <td>
                                                    <img src="<?php echo e(asset($item->image)); ?>" alt=""
                                                         class="img img-responsive"
                                                         style="width: auto; height:100px !important">
                                                </td>
                                                <td><?php echo e(showDate(@$item->created_at)); ?></td>

                                                <td>
                                                    <?php for($i=1;$i<=$item->star;$i++): ?>
                                                        <i class="fas fa-star"></i>
                                                    <?php endfor; ?>
                                                </td>
                                                <td>
                                                    <label class="switch_toggle"
                                                     >
                                                        <input type="checkbox"
                                                                class="status_enable_disable"
                                                               <?php if(@$item->status == 1): ?> checked
                                                               <?php endif; ?> value="<?php echo e(@$item->id); ?>">
                                                        <i class="slider round"></i>
                                                    </label>
                                                </td>
                                                <td>
                                                    <!-- shortby  -->
                                                    <div class="dropdown CRM_dropdown">
                                                        <button class="btn btn-secondary dropdown-toggle" type="button"
                                                                id="dropdownMenu2" data-bs-toggle="dropdown"
                                                                aria-haspopup="true" aria-expanded="false">
                                                            <?php echo e(__('common.Select')); ?>

                                                        </button>
                                                        <div class="dropdown-menu dropdown-menu-right"
                                                             aria-labelledby="dropdownMenu2">
                                                            <?php if(permissionCheck('frontend.testimonials_edit')): ?>
                                                                <a href="<?php echo e(route('frontend.testimonials_edit',@$item->id)); ?>"
                                                                   class="dropdown-item edit_brand"><?php echo e(__('common.Edit')); ?></a>
                                                            <?php endif; ?>
                                                            <?php if(permissionCheck('frontend.testimonials_delete')): ?>
                                                                <a onclick="confirm_modal('<?php echo e(route('frontend.testimonials_delete', @$item->id)); ?>');"
                                                                   class="dropdown-item edit_brand"><?php echo e(__('common.Delete')); ?></a>
                                                            <?php endif; ?>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <?php echo $__env->make('backend.partials.delete_modal', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('scripts'); ?>
    <script type="application/javascript">


        dataTableOptions = updateColumnExportOption(dataTableOptions, [0, 1, 2, 3, 5,]);

        let table = $('#lms_table').DataTable(dataTableOptions);


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

<?php echo $__env->make('backend.master', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/minialms/card.minialms.com/Modules/FrontendManage/Resources/views/testimonials.blade.php ENDPATH**/ ?>