<script type="text/javascript" src="<?php echo base_url();?>resources/js/jquery-1.7.1.min.js"></script>
<style type="text/css">
.reg_mediasi{
  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 
    switch ($bulan) {
      case '01':
        $bulan_name = 'Januari';
        break;
      case '02':
        $bulan_name = 'Februari';
        break;
      case '03':
        $bulan_name = 'Maret';
        break;
      case '04':
        $bulan_name = 'April';
        break;
      case '05':
        $bulan_name = 'Mei';
        break;
      case '06':
        $bulan_name = 'Juni';
        break;
      case '07':
        $bulan_name = 'Juli';
        break;
      case '08':
        $bulan_name = 'Agustus';
        break;
      case '09':
        $bulan_name = 'September';
        break;
      case '10':
        $bulan_name = 'Oktober';
        break;
      case '11':
        $bulan_name = 'Nopember';
        break;
      case '12':
        $bulan_name = 'Januari';
        break;
      
      default:
        $bulan_name = 'Wrong parameter';
        break;
    }
    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 jenis_register = '<?php echo $register;?>'
    var xls = 1;
    var w = window.open('', 'view_laporan');
    $.post('<?php echo base_url()?>cetak_register_mediasi/cetak_register', {
      bulan:bulan,
      tahun:tahun,
      jenis_register:jenis_register,
      xls:xls
    }, function(response){
      var json = jQuery.parseJSON(response);
      events = '';
      if(json.st==1){
        w.location.href ='<?php echo base_url()?>register_mediasi';
      }else{
        message_show(json.msg)
      }
    });
  });

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

</script>