<style>
.multiselect .caret {
    position: absolute;
    top: 50%;
    right: 12px;
    margin-top: -3px;
    width: unset !important;
    text-align: center;
}
</style>
<span class="multiselect-native-select <?php echo $unique_class; ?>">
    <div class="btn-group" style="width: 100%;">
        <button type="button" class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown"
            title="Assign To" style="width: 100%; overflow: hidden; text-overflow: ellipsis;" aria-expanded="false">
            <span class="multiselect-selected-text">No selected</span>
            <b class="caret"></b>
        </button>
        <ul class="multiselect-container dropdown-menu" style="width:100%;">
            <?php foreach($data_list as $current_id => $text){ ?>
            <li>
                <a tabindex="0">
                    <label class="checkbox" style="font-weight:400;">
                        <input name="<?php echo $name ?>[]" class="<?php echo $class_name; ?>" type="checkbox"
                            value="<?php echo $current_id; ?>"
                            onclick="$(`.<?php echo $class_name; ?>:checked`).length > 0 ? $(`.<?php echo $unique_class; ?> .multiselect-selected-text`).html($(`.<?php echo $unique_class; ?> .<?php echo $class_name; ?>:checked`).length + ` selected`) : $(`.<?php echo $unique_class; ?> .multiselect-selected-text`).html(`No selected`)">
                        <?php echo $text; ?>
                    </label>
                </a>
            </li>
            <?php } ?>
        </ul>
    </div>
</span>
<span class="pull-right" style="position: absolute;top: 32px;right: 70px;">
    <a href="#"
        onclick="event.preventDefault();$(`.<?php echo $unique_class; ?> .<?php echo $class_name; ?>`).prop(`checked`, true);$(`.<?php echo $unique_class; ?> .multiselect-selected-text`).html($(`.<?php echo $unique_class; ?> .<?php echo $class_name; ?>:checked`).length + ` selected`);">
        <i class="fa fa-check" aria-hidden="true"></i>
        Select all
    </a>
</span>
<span class="pull-right" style="position: absolute;top: 32px;right: 14px;">
    <a href="#"
        onclick="event.preventDefault();$(`.<?php echo $unique_class; ?> .<?php echo $class_name; ?>`).prop(`checked`, false);$(`.<?php echo $unique_class; ?> .multiselect-selected-text`).html(`No selected`);">
        <i class="fa fa-eraser" aria-hidden="true"></i>
        Clear
    </a>
</span>