Viewing file: c0145d38e39928ef0ba49762e384401af6bbe19a.php (15.76 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php $__env->startSection('title',trans('layout.table')); ?>
<?php $__env->startSection('css'); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('main-content'); ?> <div class="row page-titles mx-0"> <div class="col-sm-6 p-md-0"> <div class="welcome-text"> <h4><?php echo e(trans('layout.table')); ?></h4> <p class="mb-0"></p> </div> </div> <div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex"> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="#"><?php echo e(trans('layout.home')); ?></a></li> <li class="breadcrumb-item active"><a href="javascript:void(0)"><?php echo e(trans('layout.table')); ?></a></li> </ol> </div> </div> <!-- row -->
<div class="row"> <div class="col-lg-12"> <div class="card"> <div class="card-header"> <h4 class="card-title"><?php echo e(trans('layout.list')); ?></h4> <div class="pull-right"> <button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#tableCreateModal"> <?php echo e(trans('layout.create')); ?>
</button> </div> </div> <div class="card-body"> <div class="table-responsive"> <table class="table table-responsive-md"> <thead class="text-center"> <tr> <th><strong><?php echo e(trans('layout.restaurant')); ?></strong></th> <th><strong><?php echo e(trans('layout.name')); ?></strong></th> <th><strong><?php echo e(trans('layout.no_of_capacity')); ?></strong></th> <th><strong><?php echo e(trans('layout.status')); ?></strong></th> <th><strong><?php echo e(trans('layout.action')); ?></strong></th> </tr> </thead> <tbody class="text-center"> <?php if($tables): ?> <?php $__currentLoopData = $tables; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $table): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr> <td><?php echo e($table->restaurant->name); ?></td> <td><?php echo e($table->name); ?> ( <?php echo e($table->table_position->name); ?> )</td> <td><?php echo e($table->no_of_capacity); ?></td> <td> <?php if($table->status=='active'): ?> <span class="badge light badge-success"><?php echo e(trans('layout.active')); ?></span> <?php elseif($table->status=='inactive'): ?> <span class="badge light badge-warning"><?php echo e(trans('layout.inactive')); ?></span> <?php endif; ?> </td> <td> <div class="dropdown"> <button type="button" class="btn btn-success light sharp" data-toggle="dropdown"> <svg width="20px" height="20px" viewBox="0 0 24 24" version="1.1"> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <rect x="0" y="0" width="24" height="24"/> <circle fill="#000000" cx="5" cy="12" r="2"/> <circle fill="#000000" cx="12" cy="12" r="2"/> <circle fill="#000000" cx="19" cy="12" r="2"/> </g> </svg> </button> <div class="dropdown-menu"> <button class="dropdown-item edit_table" type="button" data-id="<?php echo e($table->id); ?>" data-name="<?php echo e($table->name); ?>" data-restaurant_id="<?php echo e($table->restaurant_id); ?>" data-no_of_capacity="<?php echo e($table->no_of_capacity); ?>" data-status="<?php echo e($table->status); ?>" data-action="<?php echo e(route('table.update', $table->id)); ?>" data-toggle="modal" data-target="#tableEditModal"> <?php echo e(trans('layout.edit')); ?>
</button>
<button class="dropdown-item" type="button" data-message="<?php echo e(trans('layout.message.table_delete_warning')); ?>" data-action='<?php echo e(route('table.destroy',[$table])); ?>' data-input={"_method":"delete"} data-toggle="modal" data-target="#modal-confirm"><?php echo e(trans('layout.delete')); ?></button> </div> </div> </td> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php endif; ?> </tbody> </table> </div> </div> </div> </div> </div> <!-- Modal Create --> <?php $__env->startSection('create-modal-id', 'tableCreateModal'); ?> <?php $__env->startSection('create-modal-title', 'Table Create'); ?> <?php $__env->startSection('create-modal-content-wapper'); ?> <form method="POST" action="<?php echo e(route('table.store')); ?>"> <?php echo csrf_field(); ?> <div class="modal-body"> <div> <section> <div class="row"> <div class="col-lg-12 mb-2"> <div class="form-group"> <label class="text-label"><?php echo e(trans('layout.restaurant')); ?>*</label> <select name="restaurant_id" class="form-control"> <?php $__currentLoopData = $restaurants; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $restaurant): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($restaurant->id); ?>"><?php echo e($restaurant->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div>
<div class="col-lg-12 mb-2"> <div class="form-group"> <label class="text-label"><?php echo e(trans('layout.select_position')); ?>*</label> <select name="table_position_id" class="form-control"> <?php $__currentLoopData = $table_positions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $table_position): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($table_position->id); ?>"><?php echo e($table_position->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div>
<div class="col-lg-6 mb-2"> <div class="form-group"> <label class="text-label"><?php echo e(trans('layout.name')); ?>*</label> <input value="<?php echo e(old('name')); ?>" type="text" name="name" class="form-control" placeholder="Ex: Table-1" required> </div> </div> <div class="col-lg-6 mb-2"> <div class="form-group"> <label class="text-label"><?php echo e(trans('layout.no_of_capacity')); ?>*</label> <input value="<?php echo e(old('no_of_capacity')); ?>" type="number" name="no_of_capacity" class="form-control" placeholder="Ex: 6" required> </div> </div>
<div class="col-lg-12 mb-2"> <div class="form-group"> <label class="text-label"><?php echo e(trans('layout.status')); ?>*</label> <select name="status" class="form-control"> <option value="active"><?php echo e(trans('layout.active')); ?></option> <option value="inactive"><?php echo e(trans('layout.inactive')); ?></option> </select> </div> </div> </div> </section>
</div>
</div> <div class="modal-footer"> <button type="button" aria-label="Close" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary">Submit</button> </div> </form> <?php $__env->stopSection(); ?>
<!-- Modal Edit --> <?php $__env->startSection('edit-modal-id', 'tableEditModal'); ?> <?php $__env->startSection('edit-modal-title', 'Table Edit'); ?> <?php $__env->startSection('edit-modal-content-wapper'); ?> <form method="POST" id="tableFormUpdate"> <?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?> <input type="hidden" name="id" id="edit-table-id">
<div class="modal-body"> <section> <div class="row"> <div class="col-lg-12 mb-2"> <div class="form-group"> <label class="text-label"><?php echo e(trans('layout.restaurant')); ?>*</label> <select name="restaurant_id" id="edit-table-restaurant" class="form-control"> <?php $__currentLoopData = $restaurants; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $restaurant): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($restaurant->id); ?>"><?php echo e($restaurant->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> <div class="col-lg-12 mb-2"> <div class="form-group"> <label class="text-label"><?php echo e(trans('layout.select_position')); ?>*</label> <select name="table_position_id" id="edit-table-position" class="form-control"> <?php $__currentLoopData = $table_positions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $table_position): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($table_position->id); ?>"><?php echo e($table_position->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> <div class="col-lg-6 mb-2"> <div class="form-group"> <label class="text-label"><?php echo e(trans('layout.name')); ?>*</label> <input type="text" name="name" id="edit-table-name" class="form-control" placeholder="Ex: Table-1" required> </div> </div> <div class="col-lg-6 mb-2"> <div class="form-group"> <label class="text-label"><?php echo e(trans('layout.no_of_capacity')); ?>*</label> <input type="number" name="no_of_capacity" id="edit-table-capacity" class="form-control" placeholder="Ex: 6" required> </div> </div>
<div class="col-lg-12 mb-2"> <div class="form-group"> <label class="text-label"><?php echo e(trans('layout.status')); ?>*</label> <select name="status" id="edit-table-status" class="form-control"> <option value="active"><?php echo e(trans('layout.active')); ?></option> <option value="inactive"><?php echo e(trans('layout.inactive')); ?></option> </select> </div> </div> </div> </section> </div>
<div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary">Submit</button> </div> </form> <?php $__env->stopSection(); ?>
<?php $__env->stopSection(); ?> <?php $__env->startSection('js'); ?> <script> $(document).on('click', '.edit_table', function () { const id = $(this).data('id'); const name = $(this).data('name'); const restaurant_id = $(this).data('restaurant_id'); const capacity = $(this).data('no_of_capacity'); const status = $(this).data('status'); const action = $(this).data('action');
$('#edit-table-id').val(id); $('#edit-table-name').val(name); $('#edit-table-capacity').val(capacity); $('#edit-table-status').val(status).trigger('change'); $('#edit-table-restaurant').val(restaurant_id).trigger('change'); $('#tableFormUpdate').attr('action', action);
$('#tableEditModal').modal('show'); }); </script> <?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/picotech/domains/test.qr.picotech.app/public_html/resources/views/table/index.blade.php ENDPATH**/ ?>
|