<?php 
                $opt_year=array(''=>'-Year-');
               for($a=2016;$a<=date('Y');$a++){
                   $opt_year[$a]=$a;
               }
		$opt_brand=GetOptAll('master_brand','-Semua Merk-',array('status'=>'Aktif'));
                $opt_jenis=GetOptAll('master_jenis_produk','-Semua Jenis Produk-',array('status'=>'where/abcdefghijkl'));
                $opt_gudang=GetOptAll('master_gudang','-Semua Gudang-');
                ?>
<script>
    $(document).ready(function(e){
        cari_exp_stok();
    });
    function cari_exp_stok(){
        
        var brand=$('#brand2').val();
        var jp=$('#jp2').val();
        var gudang=$('#gudang2').val();
        
        $('#data_exp').load('<?php echo base_url()?>dashboard/chart_exp_stok',{b:brand,j:jp,g:gudang});
    }
    function gantiproduk2(v){
        var bg=2;
        $('#jenis_produk_sp2').load('<?php echo base_url()?>dashboard/loadjenis',{v:v,bg:bg});
    }
    </script>
<style>
    .centerz{
        float:none!important;
        margin:0 auto;
    }
    input[type="text"]{
        padding:0!important;
    }
</style>
<div class="col-md-12">
    <div class="col-md-12 centerz"><center>
            <label></label>
            &nbsp;&nbsp;&nbsp;<?php echo form_dropdown('brand',$opt_brand,$_POST['brand'],'class="select2" id="brand2" OnChange="gantiproduk2(this.value)"')?>&nbsp;-&nbsp;
            <span id="jenis_produk_sp2"><?php echo form_dropdown('jenis_produk',$opt_jenis,$_POST['jenis_produk'],'class="select2" id="jp"')?>
            </span>    
                &nbsp;-&nbsp;
            <?php echo form_dropdown('gudang',$opt_gudang,$_POST['gudang'],'class="select2" id="gudang2"')?>&nbsp;-&nbsp;
        <button type="button" id="search" onclick="cari_exp_stok()">Search</button></center>
    </div>
</div>
<div id="data_exp"></div>