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

    <div class="row">
        <div class="col-12 box-margin">
            <div class="card">
                <div class="card-body">
                    <div class="d-flex justify-content-between align-items-center mb-20">
                        <h6 class="card-title mb-0"><?php echo e(__('content.pages')); ?></h6>
                        <div>
                           <button type="button" class="btn btn-primary float-right mb-3" data-toggle="modal" data-target="#pageBuilderModal">+ <?php echo e(__('content.add_page')); ?></button>
                        </div>
                        </div>
                    <?php if(count($page_builders) > 0): ?>
                        <div>
                            <input id="check_all" type="checkbox" onclick="showHideDeleteButton(this)">
                            <label for="check_all"><?php echo e(__('content.all')); ?></label>
                            <a id="deleteChecked" class="ml-2" href="#" data-toggle="modal" data-target="#deleteCheckedModal">
                                <i class="fa fa-trash text-danger font-18"></i>
                            </a>
                        </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 onsubmit="return btnCheckListGet()" action="<?php echo e(route('page-builder.destroy_checked')); ?>" method="POST">
                                <?php echo method_field('DELETE'); ?>
                                <?php echo csrf_field(); ?>
                                <?php endif; ?>

                            <input type="hidden" id="checked_lists" name="checked_lists" value="">

                            <!-- Modal -->
                            <div class="modal fade" id="deleteCheckedModal" tabindex="-1" role="dialog" aria-labelledby="deleteCheckedModalCenterTitle" 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="deleteCheckedModalCenterTitle"><?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.delete_selected')); ?>

                                        </div>
                                        <div class="modal-footer">
                                            <button type="button" class="btn btn-danger" data-dismiss="modal"><?php echo e(__('content.cancel')); ?></button>
                                            <button onclick="btnCheckListGet()" type="submit" class="btn btn-success"><?php echo e(__('content.yes_delete_it')); ?></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                        <table id="basic-datatable" class="table table-striped dt-responsive nowrap w-100">
                            <thead>
                            <tr>
                                <th scope="col">#</th>
                                <th><?php echo e(__('content.page_uri')); ?></th>
                                <th><?php echo e(__('content.page_name')); ?></th>
                                <th><?php echo e(__('content.is_default')); ?></th>
                                <th><?php echo e(__('content.order')); ?></th>
                                <th><?php echo e(__('content.status')); ?></th>
                                <th class="custom-width-action"><?php echo e(__('content.action')); ?></th>
                            </tr>
                            </thead>

                            <tbody>
                            <?php $__currentLoopData = $page_builders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page_name => $pagesWithSamePageName): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php $__currentLoopData = $pagesWithSamePageName; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php if($page->page_name != 'blog-search-index'): ?>
                                <tr>
                                    <td>
                                        <?php if($page->is_default != 'yes'): ?>
                                        <input name="check_list[]" type="checkbox" value="<?php echo e($page->id); ?>" onclick="showHideDeleteButton2(this)">
                                        <?php else: ?>
                                            <span class="d-none">.</span>
                                        <?php endif; ?>
                                    </td>
                                    <td><?php echo e($page->page_uri); ?></td>
                                    <td><?php echo e($page->page_name); ?></td>
                                    <td>
                                        <?php if($page->is_default == 'no'): ?>
                                            <span class="badge badge-danger"><?php echo e(__('content.custom_page')); ?></span>
                                        <?php else: ?>
                                            <span class="badge badge-success"><?php echo e(__('content.default_page')); ?></span>
                                        <?php endif; ?>
                                    </td>
                                    <td><?php echo e($page->order); ?></td>
                                    <td>
                                        <?php if($page->status == 0): ?>
                                            <span class="badge badge-danger"><?php echo e(__('content.disable')); ?></span>
                                        <?php else: ?>
                                            <span class="badge badge-success"><?php echo e(__('content.enable')); ?></span>
                                        <?php endif; ?>
                                    </td>
                                    <td>
                                        <div>
                                            <a href="<?php echo e(route('page-builder.edit', $page->id)); ?>" class="mr-2">
                                                <i class="fa fa-edit text-info font-18"></i>
                                            </a>
                                            <?php if($page->is_default != 'yes'): ?>
                                                <a href="#" data-toggle="modal" data-target="#deleteModel<?php echo e($page->id); ?>">
                                                    <i class="fa fa-trash text-danger font-18"></i>
                                                </a>
                                            <?php endif; ?>
                                        </div>
                                    </td>
                                </tr>

                                <?php if($page->is_default != 'yes'): ?>
                                    <!-- Modal -->
                                    <div class="modal fade" id="deleteModel<?php echo e($page->id); ?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" 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="exampleModalCenterTitle"><?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('page-builder.destroy', $page->id)); ?>" method="POST">
                                                            <?php echo method_field('DELETE'); ?>
                                                            <?php echo csrf_field(); ?>
                                                            <?php endif; ?>

                                                            <button type="button" class="btn btn-danger" 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>
                                <?php endif; ?>

                                <?php endif; ?>

                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    <?php else: ?>
                        <span><?php echo e(__('content.not_yet_created')); ?></span>
                    <?php endif; ?>

                </div> <!-- end card body-->
            </div> <!-- end card -->
        </div><!-- end col-->
    </div><!-- end row-->
    <div class="modal fade" id="pageBuilderModal" tabindex="-1" role="dialog" aria-labelledby="pageBuilderModalLabel" aria-modal="false">
        <div class="modal-dialog modal-md">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title mt-0 font-16" id="pageBuilderModalLabel"><?php echo e(__('content.add_new')); ?></h5>
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                </div>
                <div class="modal-body">
                <?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('page-builder.store')); ?>" method="POST">
                            <?php echo csrf_field(); ?>
                            <?php endif; ?>

                        <div class="row">
                            <div class="col-md-12">
                                <div class="form-group form-group-default">
                                    <label for="page_name"><?php echo e(__('content.page_names')); ?> <span class="text-red">*</span></label>
                                    <select class="form-control" name="page_name_id" id="page_name" required>
                                        <?php $__currentLoopData = $page_names; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page_name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php if($page_name->page_name != 'blog-search-index'): ?>
                                                <option value="<?php echo e($page_name->id); ?>" data-segment-count="<?php echo e($page_name->segment_count); ?>"><?php echo e($page_name->page_name); ?></option>
                                            <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                            </div>
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label for="page_uri"><?php echo e(__('content.page_uri')); ?> <span class="text-red">*</span></label>
                                    <input type="text" name="page_uri" class="form-control" id="page_uri" required>
                                    <div  class="form-text" id="selectedSegmentCountDiv"></div>
                                    <small class="form-text">example: 1 segment usage -> about</small>
                                    <small class="form-text">example: 2 segment usage -> service/detail</small>
                                    <small class="form-text"><?php echo e(__('content.please_base_on_the_count_of_segments')); ?></small>
                                </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="0">
                                </div>
                            </div>
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label for="status" class="col-form-label"><?php echo e(__('content.status')); ?></label>
                                    <select name="status" class="form-control" id="status">
                                        <option value="1" selected><?php echo e(__('content.select_your_option')); ?></option>
                                        <option value="1"><?php echo e(__('content.enable')); ?></option>
                                        <option value="0"><?php echo e(__('content.disable')); ?></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>
                        <button type="submit" class="btn btn-sm btn-primary"><?php echo e(__('content.submit')); ?></button>
                    </form>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
<?php $__env->stopSection(); ?>

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