<div class="container-fluid container-fixed-lg bg-white">
    <div class="panel panel-transparent">
        <div class="panel-heading">
            <div class="panel-title"><?php print $title; ?></div>
            <?php if ($permissions->hasPermission('add_commission_setting')) { ?>
            <div class="col-xs-12 p-0 m-b-10 ">  
                <div class="floatingContainer ">
                    <a href="" id="new_commission_setting" data-target="#commission_setting_modal" data-toggle="modal" >
                        <div class="actionButton btn-success" >
                            <p class="floatingText"><span class="floatingTextBG"><?php echo CommonLanguage::getMessage('add_commission_setting') ?></span></p>
                        </div>
                    </a>
                </div>
            </div>
            <?php } ?>
        </div>
        <div class="panel-body">
            <div class="row">
                <div class="col-md-12">
                    <div class="table-responsive">
                        <table class="table table-bordered hrm" id="tableWithSearch">
                            <thead>
                                <tr>
                                    <th><?php print CommonLanguage::getMessage('commission_name') ?></th>
                                    <th><?php print CommonLanguage::getMessage('Action') ?></th>
                                </tr>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function(){
        RebuildDataTable($('.panel-heading .panel-title').html(), [0,1], 'HRMAjax/commissionSettingAjax');
        $('#tableWithSearch').on('click', '.delete', function () {
            var entry_value = $(this).parents('div.Action').attr('data-id')
            IncludeDeleteModal(common_delete_modal, {commission_id: entry_value}, function () {
                RebuildDataTable($('.panel-heading .panel-title').html(), [0,1], 'HRMAjax/commissionSettingAjax');
            }, "HRMAjax/deleteCommissionSetting");
        });
    });
</script>
<?php
    include 'Views/HRM/commission_setting_modal.php';