<script type="text/javascript">
$(document).ready(function(){
	console.log('tab third party payment loaded');
});

function btnEditThirdParty(elem) {
	var b64 = $(elem).data('content');
	var json = JSON.parse(atob(b64));

	console.log(json);
	$('#mdl-thirdparty-id').val(json.id);
	$('#mdl-thirdparty-date_start').val(json.date_start);
	$('#mdl-thirdparty-date_end').val(json.date_end);
	$('#mdl-thirdparty-type').val(json.type);
	$('#mdl-thirdparty-amount').val(json.amount);
	$('#mdl-thirdparty-status').val(json.status);
}

function btnRemoveThirdParty(id) {
	toastConfirm('Are you sure you want to remove third party payment?',function(){
		_removeThirdParty(id);
	});
}

function _removeThirdParty(id) {
	ajxRequest('<?php echo base_url('/hr/staffProfile/removeThirdParty/'); ?>','POST',{id:id},'<?php echo base_url('/hr/staffProfile/staffDetail/'.$staff_id)?>');
}
</script>