<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>resources/css/date-css.css" />
<div class="centering" style="width:400px;margin-top: 10%;">
	<div id='popup_cetak_register' style="border: 1px solid #ffffff;">
    		<div class="detil" style="padding: 2px;background-color: white;">
		<form id="frm_cetak_reg">
		<table id="tableDetilPerkara" style="background: #dedbdb;">
			<col width="97%">
			<tbody>
				<tr>
					<td style="font-size:15px;text-align:center;"><font color="#fff"><?php echo $judul; ?></font></td>
					<input type="hidden" id="idalurperkara" value="<?php echo $idalurperkara; ?>">
				</tr>
				<tr>
					<td style="background:white;color:#111;" align="center">Periode :
						<span class="custom-dropdown custom-dropdown--emerald" >
							<?php echo form_dropdown('bulan', $bulan, $bulan_sekarang, 'class="custom-dropdown__select custom-dropdown__select--white" id="bulan"'); ?>
						</span>	
						<span class="custom-dropdown custom-dropdown--emerald" style="width:80px;color:#111">
							<?php echo form_dropdown('tahun', $tahun, $tahun_sekarang, 'class="custom-dropdown__select custom-dropdown__select--white" id="tahun"'); ?>
						</span>	
					</td>
				</tr>
				<tr>
					<td style="background:white;" align="center">
					<input type="button" id='btn_close_form_register' value="Kembali" class="btn">
					<input type="button" onClick="btn_cetak_register()" value="Cetak" class="btn">						
					</td>
				</tr>
			</tbody>
		</table>
	</form>
	</div>
	</div>
</div>

<script type="text/javascript">
$('#btn_close_form_register').closingFormWin();

$(document).ready(function() {
	$(window).keydown(function(event){
	    	if(event.keyCode == 13) {
	      		event.preventDefault();
	      		return false;
	    	}
  	});
});
	
function btn_cetak_register(){
	var tahun = $("#tahun").val();
	var bulan = $("#bulan").val();
	var idalurperkara = $("#idalurperkara").val();
	var w = window.open('', 'view_laporan');
	var xls = 0;
	$.post('<?php echo base_url()?>cetak_register/cetak', {
		bulan:bulan,
		tahun:tahun,
		idalurperkara:idalurperkara,
		xls:xls
	}, function(response){
		var json = jQuery.parseJSON(response);
		events = '';
		if(json.st==1){
			message_show(json.msg);
			w.location.href ='<?php echo base_url()?>cetak_register/tampil';
		}else{
			message_show(json.msg);
		}
	});
};
</script>