<div class="container-fluid container-fixed-lg bg-white">
    <div class="panel panel-transparent">
        <div class="panel-heading">
            <?php if ($permissions->hasPermission('add_void_reason')) {
    echo Forms::FloatingAddButton('4c0870', '#add_edit_void_reason_modal', CommonLanguage::getMessage('Add'), 'add_void_reason');} ?>
            <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('reason_title') ?></th>
                            <th><?php print CommonLanguage::getMessage('reason_type') ?></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('void_reason_list')); ?>,
        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/void_reason_list',1);
            $('#tableWithSearch').on('click', '.delete', function () {
                var reason_id = $(this).parents('div.Action').attr('data-id')
                IncludeDeleteModal(delete_modal, {entry_value: reason_id}, function () {
                    RebuildDataTable(title, [0], 'RestaurantAjax/void_reason_list',1);
                }, "RestaurantAjax/deleteVoidReason");
            });
        });
</script>
<?php if ($permissions->hasPermission('add_void_reason') || $permissions->hasPermission('edit_void_reason')) {
    include 'Views/Inventory/add-edit-void-reason-modal.php';
}
