<div class="container-fluid container-fixed-lg bg-white">
    <div class="panel panel-transparent">
        <div class="panel-heading">
            <div class="panel-title"><?php echo $floor_name; ?></div>
            <?php if ($permissions->hasPermission('add_table')) {
    echo Forms::FloatingAddButton('4c0870', '#table_modal', CommonLanguage::getMessage('Add'), 'new_table_btn');} ?>
            <div class="clearfix"></div>
        </div>
        <div class="panel-body">
            <div class="table-responsive">
                <table class="table table-bordered inventory" id="tableWithSearch">
                    <thead>
                        <tr>
                            <th><?php print CommonLanguage::getMessage('table_name') ?></th>
                            <th><?php print CommonLanguage::getMessage('table_alias_name') ?></th>
                            <th><?php print CommonLanguage::getMessage('Action') ?></th>
                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<script>
    var title = <?php echo json_encode(CommonLanguage::getMessage('table_setting')); ?>,
        floor_id = <?php echo $floor_id; ?>;
        $(function () {
            RebuildDataTable(title, [0], 'RestaurantAjax/tables_list',{floor_id:floor_id});
            $('#tableWithSearch').on('click', '.delete_table', function () {
                var table_id = $(this).parents('div.Action').attr('data-id')
                IncludeDeleteModal(common_delete_modal, {table: 'tbl_table', entry_id: 'table_id', entry_value: table_id, attr_id: 'status_id', attr_value: 0}, function () {
                    RebuildDataTable(title, [0], 'RestaurantAjax/tables_list',{floor_id:floor_id});
                }, "common_ajax/CommonUpdateRecord");
            });
        });
</script>
<?php if ($permissions->hasPermission('add_table') || $permissions->hasPermission('edit_table')) {
    include 'Views/Inventory/table.php';
}
