<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
    <div class="databox bg-white radius-bordered databox-shadowed">
        <div class="databox-left bg-success">
            <div class="databox-text white">
                <i id="salestotal_spinner" style="display: none;" class="fa fa-spinner fa-spin"></i>
                <?php echo $this->lang->line("SALESTOTAL"); ?></div>
        </div>
        <div class="databox-right">
            <span class="databox-number success" id="salestotal">0.00</span>
            <div class="databox-text darkgray" id="salescount"><?php echo $this->lang->line("SALESCOUNT"); ?> 0</div>
            <div class="databox-stat themesecondary radius-bordered">
            </div>
        </div>
    </div>
</div>

<script>
$(document).ready(function() {
    $("#salestotal_spinner").show();
        $.ajax({ url: "<?= base_url() ?>dashboard/databoxes/salestotal",
                    data: { count: 5},
                    dataType: "json",
                    type: "POST",
                    success: function(data){
                        $( '#salestotal').text(data[0].salestotal);
                        $( '#salescount').text(data[0].salescount+" RECEIPTS");
                        $("#salestotal_spinner").hide();
                    }
                });
    
});
</script>