<div class="container-fluid container-fixed-lg bg-white">
    <div class="panel panel-transparent">
        <div class="panel-heading">
            <div class="panel-title"><?php print CommonLanguage::getMessage('floor_setting') ?></div>
            <?php if ($permissions->hasPermission('add_floor')) {
    echo Forms::FloatingAddButton('4c0870', '#floor_modal', CommonLanguage::getMessage('Add'), 'new_floor_btn'); } ?>
            <div class="clearfix"></div>
        </div>
        <div class="panel-body">
            <div class="table-responsive">
                <table class="table table-bordered inventory demo-table-search" id="tableWithSearch">
                    <thead>
                        <tr>
                            <th><?php print CommonLanguage::getMessage('floor_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('floor_setting')); ?>,
        delete_modal = <?php
            echo json_encode([CommonLanguage::getMessage('Confirm_Delete'),
                              CommonLanguage::getMessage('About_To_Delete'),
                              CommonLanguage::getMessage('Proceed_Delete'),
                              CommonLanguage::getMessage('Close'),
                              CommonLanguage::getMessage('delete'),
                              CommonLanguage::getMessage('Deleted_Successfully')
                             ]);
            ?>;
        $(function () {
            RebuildDataTable(title, [0], 'RestaurantAjax/floors_list');
            $('#tableWithSearch').on('click', '.delete_floor', function () {
                var floor_id = $(this).parents('div.Action').attr('data-id')
                IncludeDeleteModal(delete_modal, {entry_value: floor_id}, function () {
                    RebuildDataTable(title, [0], 'RestaurantAjax/floors_list');
                }, "RestaurantAjax/UpdateFloorTableRecords");
            });
        });
</script>
<?php
if ($permissions->hasPermission('add_floor') || $permissions->hasPermission('edit_floor')) {
    include 'Views/Inventory/floor.php';
}
