<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-info">
            <div class="databox-text white"><i id="stockvalue_spinner" style="display: none;" class="fa fa-spinner fa-spin"></i>
                <?php echo $this->lang->line("STOCKVALUE"); ?></div>
        </div>
        <div class="databox-right">
            <span class="databox-number info" id="stockvalue">0.00</span>
            <div class="databox-text darkgray" id="locations"></div>
            <div class="databox-stat themesecondary radius-bordered">
            </div>
        </div>
    </div>
</div>

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