
<div class="wrap w3eden" style="margin-top: 45px">

    <div class="panel panel-default" id="wpdm-wrapper-panel">
        <div class="panel-heading">
            <button type="button" id="cdh" class="btn btn-default pull-right" style="font-weight: 600"><i class="sinc fa fa-refresh color-green"></i> &nbsp; <?php _e("Clear Download History","wpdmpro"); ?></button>
            <b><i class="fa fa-bar-chart-o color-purple"></i> &nbsp; <?php echo __('Download History','wpdmpro'); ?></b>

        </div>

        <div class="tab-content" style="padding: 15px;">
<?php 

$type = WPDM_BASE_DIR."admin/tpls/stats/history.php";

include($type);

?>
</div>
</div>

    <style>
        .notice, .updated{
            display: none !important;
        }
    </style>
    <script>
        jQuery(function ($) {
            $('#cdh').on('click', function () {
                var olabel = $(this).html();
                var ow = $(this).width();
                $(this).css('width', (ow+30)+"px");
                $(this).html('<i class="sinc fa fa-refresh fa-spin color-green"></i> &nbsp; <?php _e("Clearing...","wpdmpro"); ?>');
                $.post(ajaxurl, {action:'wpdm_clear_stats'}, function (res) {
                    $('#cdh').html(olabel);
                });

            });
        });
    </script>