<script type="text/javascript" src="<?php echo base_url();?>resources/js/jquery-1.7.1.min.js"></script>
<style type="text/css">
  .register{
      font-size: 12px;
     padding-left: 4px;
      border-collapse: collapse;
  }

  .title{
      font-size: 20px;
  }
  .subtitle{
      font-size: 16px;
  }  
  #head_reg{
      width: 100%;  height: 30px; background-color: #eee;left: 
      border-bottom: 1px; border-color: #000;z-index: 999;position: fixed;top: 0px;
  }
</style>


<input id="btnExcel" type="button" value="Export to Excel">
<input id="docExcel" type="button" value="Export to Doc">
<?php 
  include $fileview;
  function is_empty($isi){
    if(!empty($isi)){
      if($isi=='00-00-0000'){
        $data='-';
      }else{
      $data = $isi; 
   }     
  }else{
     $data = '-';
  }
  return $data;
}
?>

<script type="text/javascript">
$('#btnExcel').click(function(event){
    var tahun = '<?php echo $tahun;?>'
    var bulan = '<?php echo $bulan;?>'
    var idalurperkara = '<?php echo $idalurperkara; ?>'
    var xls = 1;
    var w = window.open('', 'view_laporan');
    $.post('<?php echo base_url()?>cetak_register/cetak', {
      tahun:tahun,
      bulan:bulan,
      idalurperkara:idalurperkara,
      xls:xls
    }, function(response){
      var json = jQuery.parseJSON(response);
      events = '';
      if(json.st==1){
        w.location.href ='<?php echo base_url()?>cetak_register/tampil_diversi';
      }else{
        message_show(json.msg)
      }
    });
  });

$('#docExcel').click(function(event){
    var tahun = '<?php echo $tahun;?>'
    var bulan = '<?php echo $bulan;?>'
    var idalurperkara = '<?php echo $idalurperkara; ?>'
    var xls = 2;
    var w = window.open('', 'view_laporan');
    $.post('<?php echo base_url()?>cetak_register/cetak', {
      tahun:tahun,
      bulan:bulan,
      idalurperkara:idalurperkara,
      xls:xls
    }, function(response){
      var json = jQuery.parseJSON(response);
      events = '';
      if(json.st==1){
        w.location.href ='<?php echo base_url()?>cetak_register/tampil_diversi';
      }else{
        message_show(json.msg)
      }
    });
  });
  

</script>