HEX
Server: Apache
System: Linux digivps 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC 2025 x86_64
User: www (1000)
PHP: 8.3.15
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/healthyton.com/wp-content/plugins/astro-accounting/admin/js/astro-accounting-admin.js
let $ = jQuery;
$(function(){
	var ajaxurl = astro_object.ajaxurl;
	
	$('.data-table').DataTable();


	/* Rates */

	$('body').on('click','.btn-delete-rate',function () {
		var id = $(this).data('id');
		var postdata = "action=admin_ajax_request&param=delete_rate&id="+id;
		var conf = confirm("Do you want to delete?");
		if(conf){
			$.post(ajaxurl,postdata,function(response){
				data = $.parseJSON(response);
				if(data.status == 1){
					Swal.fire({
						icon: 'info',
						title: 'Success',
						text: response.message
					  });
					setTimeout(function(){
						location.reload();
					},1000);
				}else{
					alert(data.message);
				}
			});
		}
		return false;
	});
	$('#frm-create-rate').validate({
		submitHandler:function(){
			var postdata = "action=admin_ajax_request&param=create_rate&";
			postdata = postdata + $('#frm-create-rate').serialize();
			$('.submit-btn').attr('disabled',true).html('Submitting ...');
			$.post(ajaxurl,postdata,function(response){
				response = $.parseJSON(response);
				if(response.status == 1){

					Swal.fire({
						title: 'Success',
						icon: 'info',
						text: response.message
					});
					
					setTimeout(function(){
						location.href = '/wp-admin/admin.php?page=astro-accounting-rates' ;
					},1000);
				}else{
					Swal.fire({
						icon: 'error',
						title: 'Oops...',
						text: response.message
					  })
					$('.submit-btn').attr('disabled',false).html('Submit');
				}

			});
		}
	});

	$('body').on('click','.btn-add-rate', function(){
		newTr = 
		"<tr>"+
			"<td><input type='number' name='words[]'></td>"+
			"<td><input type='number' name='amount[]'></td>"+
			"<td><a href='#' class='btn btn-danger btn-sm btn-remove-rate'>Remove</<a></td>"+
		"</tr>";
		$('table#tbl-rates tbody').append(newTr);
		return false;
	});

	$('body').on('click','.btn-remove-rate', function(){
		$(this).closest('tr').remove();
		return false;
	});
	/* Rates */

	/* Payments */
	$('body').on('click','.btn-delete-payment',function () {
		var id = $(this).data('id');
		var postdata = "action=admin_ajax_request&param=delete_payment&id="+id;
		var conf = confirm("Do you want to delete?");
		if(conf){
			$.post(ajaxurl,postdata,function(response){
				data = $.parseJSON(response);
				if(data.status == 1){
					Swal.fire({
						icon: 'info',
						title: 'Success',
						text: response.message
					  });
					setTimeout(function(){
						location.reload();
					},1000);
				}else{
					alert(data.message);
				}
			});
		}
		return false;
	});

	$('#frm-create-payment').validate({
		submitHandler:function(){
			var postdata = "action=admin_ajax_request&param=create_payment&";
			postdata = postdata + $('#frm-create-payment').serialize();
			$('.submit-btn').attr('disabled',true).html('Submitting ...');
			$.post(ajaxurl,postdata,function(response){
				response = $.parseJSON(response);
				if(response.status == 1){

					Swal.fire({
						title: 'Success',
						icon: 'info',
						html: response.message +
							"<br>" +
							'<button type="button" role="button" tabindex="0" class="swalPaymentLists customSwalBtn">' + 'Go to Payments' + '</button>' +
							'<button type="button" role="button" tabindex="0" class="swalAddNew customSwalBtn">' + 'Add New' + '</button>',
						showCancelButton: false,
						showConfirmButton: false
					});
					
					// setTimeout(function(){
					// 	location.reload();
					// },1000);
				}else{
					Swal.fire({
						icon: 'error',
						title: 'Oops...',
						text: response.message
					  })
					$('.submit-btn').attr('disabled',false).html('Submit');
				}

			});
		}
	});

	$('body').on('click', '.swalAddNew', function(){
		location.reload();
	});

	$('body').on('click', '.swalPaymentLists', function(){
		location.href = '/wp-admin/admin.php?page=astro-accounting-list-payments' ;
	});


	/* Payments */
});