<script type="text/javascript">
	function populateModalStatutory(elem)
	{
		var json = JSON.parse(atob($(elem).data('content')));
		console.log(json);
		
		resetForm('#updateStatutoryForm');
		$('#idUpdateStatutory').val(json.id);
		$('#epfUpdateStatutory').val(json.ee_epf_no);
		$('input:radio[name=er_rate][value="'+json.er_rate+'"]').attr('checked','checked');
		$('#erPercentUpdateStatutory').val(json.er_percent);
		$('input:radio[name=ee_rate][value="'+json.ee_rate+'"]').attr('checked','checked');
		$('#eePercentUpdateStatutory').val(json.ee_percent);
		$('#socsoUpdateStatutory').val(json.ee_socso);
		$('#incomeTaxUpadateStatutory').val(json.ee_income_tax);
		$('#pcbUpdateStatutory').val(json.ee_pcb_deduction);
		$('#zakatUpdateStatutory').val(json.ee_zakat_deduction);
		$('#idUpdateStatus').val(json.status);
		$('#idUpdateYear').val(json.year);
	}

	function removeStatutoryDetails(id)
	{
		console.log('remove statutory details : '+id);

		toastConfirm('Are you sure you want to remove record ?',function(){
			_removeStatutory(id);
		});
	}

	function _removeStatutory(id) 
	{
		console.log(id);
		url = '<?php echo base_url('/hr/StaffProfile/removeStatutoryDetails/'); ?>';
		data = {id:id};
		redirect = '<?php echo current_url(); ?>';
		ajxRequest(url, 'post', data, redirect);
	}

</script>