<?php $__env->startSection('small_title'); ?>
Menu
<?php $__env->stopSection(); ?>

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



                <div class="page-content">
                    <div class="container-fluid">

                        <!-- start page title -->
                        <div class="row">
                            <div class="col-12">
                                <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                                    <h4 class="mb-sm-0 font-size-18">Menu</h4>

                                    <div class="page-title-right">
                                        <ol class="breadcrumb m-0">
                                            <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard.index')); ?>">Dashboard</a></li>
                                            <li class="breadcrumb-item active">Menu</li>
                                        </ol>
                                    </div>

                                </div>
                            </div>
                            <?php if(Session::has('message')): ?>
                            <div class="alert alert-info"><?php echo e(Session::get('message')); ?></div>

                            <?php endif; ?>

                        </div>
                        <!-- end page title -->


                        <div class="row">
                            <div class="col-12">
                                <div class="card">
                                    <div class="card-header">
                                        <a type="button" href="<?php echo e(route('menus.create')); ?>" class="btn btn-primary ">  Add </a>
                                    </div>
                                    <div class="card-body">
                                        <div class="table-rep-plugin">
                                            <div class="table-responsive mb-0" data-pattern="priority-columns">
                                                <div class="table-responsive">
                                                    <form action="<?php echo e(route('menus.order')); ?>" method="post">
                                                        <?php echo csrf_field(); ?>

                                                    <table class="table table-striped ">
                                                    <tr>
                                                        <th> Name (English) </th>
                                                        <th> Name (Dari) </th>
                                                        <th> Name (Pashto) </th>
                                                        <th>Route </th>
                                                        <th>Order </th>
                                                        <th> Sub Menu</th>
                                                        <th>Action</th>
                                                    </tr>

                                                    <?php $__currentLoopData = $menus; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $menu): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                                    <tr>
                                                        <td>
                                                            <p><?php echo e($menu->menu_name); ?></p>
                                                        </td>
                                                          <td>
                                                            <p><?php echo e($menu->da_menu_name); ?></p>
                                                        </td>

                                                         <td>
                                                            <p><?php echo e($menu->pa_menu_name); ?></p>
                                                        </td>

                                                        <td>
                                                            <p><?php echo e($menu->route_name); ?></p>
                                                        </td>
                                                        <td>

                                                            <p>

                                                                <input type="number" min="1" onchange="ShowSubmit()" name="menu_orders[<?php echo e($menu->id); ?>]" class="text-center" style="border:1px solid rgb(211, 208, 208);width:50px" value="<?php echo e($menu->menu_order); ?>">
                                                            </p>
                                                        </td>
                                                        <td>
                                                           <?php if(!empty($menu->sub_menus->count())): ?>

                                                            <a href="<?php echo e(route('submenus.show' ,$menu->id)); ?>" >
                                                                <?php echo e(__("lable.view")); ?>

                                                            </a>

                                                            <?php else: ?>
                                                            <a href="<?php echo e(route('submenus.create',['menu'=>$menu->id])); ?>" >
                                                                Add
                                                            </a>

                                                            <?php endif; ?>

                                                        </td>

                                                            <td>
                                                                    <a href="<?php echo e(route('menus.edit' , $menu->id)); ?>" ><i class="fas fa-edit"></i></a>

                                                                    &nbsp;
                                                                                   <a href="<?php echo e(route('menus.delete',['menu'=>$menu->id])); ?>"
                                                                       onclick="if(!confirm('Are you sure to delete?')) {
                                                                               event.preventDefault();

                                                                               }"
                                                                       ><i class="fas fa-trash-alt"></i></a>
                                                                </td>
                                                    </tr>

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



                                                </table>
                                                <input type="submit" id="btnSubmit" value="Save Changes" class="btn btn-secondary" style="display:none">

                                                </form>
                                                <br>
                                                        <br>
                                                        <div class="container">

                                                            <div class="row justify-content-center ">
                                                            <?php echo e($menus->links()); ?>

                                                        </div>
                                                        </div>

                                                        <br>
                                                        <br>
                                                        <br>

                                                </div>


                                            </div>

                                        </div>

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



                    </div>
                    <!-- container-fluid -->
                </div>
                <!-- End Page-content -->



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

<?php $__env->startSection('script'); ?>
<script>
    function ShowSubmit(){

        let btnSubmit = document.getElementById('btnSubmit');
        btnSubmit.style.display = 'block'

    }

</script>

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

<?php echo $__env->make('Admin.master_page', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/wssupport/app.mami/resources/views/Admin/menu/index.blade.php ENDPATH**/ ?>