Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function exportExcel()
- {
- var mulai = $('#mulai').val();
- var sampai = $('#sampai').val();
- var pelanggan = $('#pelanggan').val();
- var lokasi = $('#lokasi').val();
- var barang = $('#barang').val();
- var target = $('#export-excel');
- if(mulai!='' && sampai !='' && pelanggan=='' && lokasi=='' && barang=='')//just tgl
- {
- target.attr('src','<?php echo site_url('form_laporan_penjualan/cetak_all/'); ?>'+mulai+'/'+sampai);
- }
- else if(pelanggan!='' && lokasi!='' && barang!='')//all
- {
- target.attr('src','<?php echo site_url('form_laporan_penjualan/cetak_all/'); ?>'+mulai+'/'+sampai+'/'+pelanggan+'/'+lokasi+'/'+barang);
- }
- else if(pelanggan!='' && lokasi=='' && barang=='') //just pelanggan
- {
- target.attr('src','<?php echo site_url('form_laporan_penjualan/cetak_plg/'); ?>'+mulai+'/'+sampai+'/'+pelanggan);
- }
- else if(lokasi!='' && pelanggan=='' && barang=='')//just lokasi
- {
- target.attr('src','<?php echo site_url('form_laporan_penjualan/cetak_loc/'); ?>'+mulai+'/'+sampai+'/'+lokasi);
- }
- else if(barang!='' && pelanggan=='' && lokasi=='')//just barang
- {
- target.attr('src','<?php echo site_url('form_laporan_penjualan/cetak_thing/'); ?>'+mulai+'/'+sampai+'/'+barang);
- }
- else if(pelanggan!='' && lokasi!='')//pelanggan & lokasi
- {
- target.attr('src','<?php echo site_url('form_laporan_penjualan/cetak_plgloc/'); ?>'+mulai+'/'+sampai+'/'+pelanggan+'/'+lokasi);
- }
- else if(pelanggan!='' && barang!='')//pelanggan & barang
- {
- target.attr('src','<?php echo site_url('form_laporan_penjualan/cetak_plgthing/'); ?>'+mulai+'/'+sampai+'/'+pelanggan+'/'+barang);
- }
- else if(lokasi!='' && barang!='')//lokasi & barang
- {
- target.attr('src','<?php echo site_url('form_laporan_penjualan/cetak_locthing/'); ?>'+mulai+'/'+sampai+'/'+lokasi+'/'+barang);
- }
- else //disni yang terakhir
- {
- target.attr('src','<?php echo site_url('form_laporan_penjualan/cetak_tanpa_filter/'); ?>'');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement