<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('add_ons_list') ?></div>
            <?php if ($permissions->hasPermission('new_add_ons')) {
    echo Forms::FloatingAddButton('4c0870', '#add_ons_modal', CommonLanguage::getMessage('Add'), 'add_ons_btn'); 
} ?>
        </div>
        <div class="panel-body">
            <table class="table table-bordered inventory" id="tableWithSearch">
                <thead>
                    <tr>
                        <th><?php print CommonLanguage::getMessage('add_ons_title') ?></th>
                        <th><?php print CommonLanguage::getMessage('Action') ?></th>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>
    </div>
</div>
<script>
    var  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($('.panel-heading .panel-title').html(), [0,1], 'RestaurantAjax/addOnsList');
        $('#tableWithSearch').on('click', '.delete_add_ons', function () {
            var add_ons_id = $(this).parents('div.Action').attr('data-id')
            IncludeDeleteModal(delete_modal, {entry_value: add_ons_id}, function () {
                RebuildDataTable($('.panel-heading .panel-title').html(), [0,1], 'RestaurantAjax/addOnsList');
            }, "RestaurantAjax/deleteAddOns");
        });
    });
</script>
<?php   if ($permissions->hasPermission('new_add_ons') || $permissions->hasPermission('edit_add_ons')) {
    include 'Views/Inventory/add-edit-add-ons-modal.php';
}