<script type="text/javascript">

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

		$('#modal_basic_pay_id').val(json.id);
		$('#modal_basic_pay_scale').val(json.scale_group);
		$('#modal_basic_pay_amount').val(json.amount);
		$('#modal_basic_pay_start_date').val(json.start_date);
		$('#modal_basic_pay_end_date').val(json.end_date);
		$('#modal_basic_pay_reason').val(json.reason);
		$('#mdl_basic_pay_status').val(json.status);
	}

	function btnDeleteBasicPay(elem) {
		toastConfirm('Are you sure you want remove this record',function(){
			var b64 = $(elem).data('content');
			var json = JSON.parse(atob(b64));
			var data = {
				'id' : json.id
			};
			ajxRequest('<?php echo base_url('hr/StaffProfile/removeBasicPay/'); ?>', 'POST', data, '<?php echo current_url(); ?>');
		});
	}

	function EditBasicPay() {
		var data = {
			id:$('#modal_basic_pay_id').val(),
			scale:$('#modal_basic_pay_scale').val(),
			amount:$('#modal_basic_pay_amount').val(),
			start_date:$('#modal_basic_pay_start_date').val(),
			end_date:$('#modal_basic_pay_end_date').val(),
			reason:$('#modal_basic_pay_reason').val(),
			status:$('#mdl_basic_pay_status').val()
		};
		ajxRequest('<?php echo base_url('hr/StaffProfile/updateBasicPay/'); ?>','POST',data,'<?php echo current_url(); ?>');
	}
</script>