<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">
        <div class="container">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1 class="m-0"> Beranda</h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item active"><a href="<?php echo base_url('beranda') ?>">Beranda</a></li>
                    </ol>
                </div>
            </div>
        </div>
    </div>
    <!-- /.content-header -->

    <!-- Main content -->
    <div class="content">
        <div class="container">
            <div class="row">
                <div class="col-lg-6">
                    <div class="card card-success card-outline">
                        <div class="card-header">
                            <h5 class="card-title">Total Inventori | <?php echo @$tanggal ?></h5> 
                        </div>
                        <div class="card-body">
                            <h4>Perkiraan: Rp <?php echo number_format(@$totinv,0,',','.') ?></h4>
                        </div>
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="card card-success card-outline">
                        <div class="card-header">
                            <h5 class="card-title">Total Pendapatan | <?php echo @$tanggal ?></h5> 
                        </div>
                        <div class="card-body">
                            <h4>Penjualan: Rp <?php echo number_format(@$totpendapatan,0,',','.') ?></h4>
                            <h4>Keuntungan: Rp <?php echo number_format(@$untung,0,',','.') ?></h4>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
  <!-- End #main -->
<?php @$this->load->view($footer) ?>
<script src="<?php echo base_url('assets/vendor/chart.js/chart.min.js') ?>"></script>
<!-- Page specific script -->
<script type="text/javascript">
$(document).ready(function() {
    tampilkan();
});

function tampilkan() {
    var tahun=$("#tahun").val();
    $.ajax({
        url:"<?php echo base_url('beranda/ajax_grafikjual') ?>",
        cache:false,
        type:"POST",
        data:{tahun:tahun},
        beforeSend: function(){
            //$("#grafik").html('<center><img src="<?php echo base_url('assets/img/loading.gif') ?>"></center>');
        },
        success:function(result){
            //$("#grafik").html(result);
        }
    });
}
</script>
<?php @$this->load->view($footerend) ?>