<div class="container-fluid container-fixed-lg bg-white">
    <div class="panel panel-transparent">
        <div class="panel-heading">
            <div class="panel-title bold">
                <?php echo CommonLanguage::getMessage($title); ?>
            </div>
            <div class="row <?php echo $permissions->hasPermission('Branches') ? '':'hidden'; ?>">
                <div class="col-md-3 <?php echo $permissions->hasPermission('Branches') ? '' : 'hidden'; ?>">
                    <label><?php echo CommonLanguage::getMessage('choose_branch') ?></label>
                    <input id="search_branch_id" type="hidden" class="full-width" name="search_branch_id" >
                </div>

            </div>
            <div class="clearfix"></div>

        </div>
        <div class="panel-body">
            <div class="row ">
                <div class="col-md-12 table-responsive">
                    <table class="table table-bordered inventory" id="tableWithSearch">
                        <thead>
                            <tr>
                                <th class="text-center" style="width:10%"><?php print CommonLanguage::getMessage('company'); ?></th>
                                <th class="text-center" style="width:10%"><?php print CommonLanguage::getMessage('mobile_phone'); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function() {
        build_select2($("#search_branch_id"), "xhr/CommonSearch?col_name=branch_name&col_id=branch_id&table=tbl_organization_branches");
        RebuildDataTable($('.panel-title h4').html(), [0, 1, 2, 3], "InventoryAjax/CustomerSupplierContacts", { search_branch_id: $('#search_branch_id').val()}, '#tableWithSearch', [0, 1]);
        $('#search_branch_id').on('change', function() {
            RebuildDataTable($('.panel-title h4').html(), [0, 1, 2, 3], "InventoryAjax/CustomerSupplierContacts", { search_branch_id: $('#search_branch_id').val()}, '#tableWithSearch', [0, 1]);
        });

    });
</script>