AnonSec Shell
Server IP : 162.214.74.102  /  Your IP : 216.73.217.103
Web Server : Apache
System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64
User : lrsys ( 1015)
PHP Version : 5.6.40
Disable Function : exec,passthru,shell_exec,system
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/lrsys/www/lrsys_apps/team/assets/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/lrsys/www/lrsys_apps/team/assets/js/ajax-form-submission.js
// ajax form plugin calls at each modal loading,
$(document).ready(function() { 
	
	// configuration for ajax form submission
	var options = { 
		beforeSubmit		:	validate,  
		success				:	showResponse,  
		resetForm			:	true 
	}; 
	
	// binding the form for ajax submission
	$('.ajax-submit').submit(function() { 
		$(this).ajaxSubmit(options); 
		
		// prevents normal form submission
		return false; 
	}); 
}); 

// form validation
function validate(formData, jqForm, options) { 
	
	if (!jqForm[0].name.value)
	{
			return false;
	}
	// sends ajax request after passing validation, showing a user-friendly preloader
	$('#preloader-form').html('<img src="assets/images/preloader.gif" style="height:15px;margin-left:20px;" />');
	
	// disables intermediatory form submission
	document.getElementById("submit-button").disabled=true;
}

// ajax success response after form submission, post_refresh_url is sent from modal body
function showResponse(responseText, statusText, xhr, $form)  { 
	
	// hides the preloader
	//$('#preloader-form').html('');
	
	// showing success message 
	toastr.success(post_message, "Success");
	
	// hides modal that holds the form
	$('#modal_ajax').modal('hide');
	
	// reload table data after data update
	reload_data(post_refresh_url);
}



/*-----------------custom functions for ajax post data handling--------------------*/



// custom function for reloading table data
function reload_data(url)
{
	$('div.main_data').block({ message: '<img src="assets/images/preloader.gif" style="height:25px;" />' }); 
	$.ajax({
		url: url,
		success: function(response)
		{
			jQuery('.main_data').html(response);
			$('div.main_data').unblock(); 
		}
	});
}



// custom function for data deletion by ajax and post refreshing call
function delete_data(delete_url , post_refresh_url)
{
	// showing user-friendly pre-loader image
	$('#preloader-delete').html('<img src="assets/images/preloader.gif" style="height:15px;margin-top:-10px;" />');
	
	// disables the delete and cancel button during deletion ajax request
	document.getElementById("delete_link").disabled=true;
	document.getElementById("delete_cancel_link").disabled=true;
	
	$.ajax({
		url: delete_url,
		success: function(response)
		{
			// remove the preloader 
			$('#preloader-delete').html('');
			
			// show deletion success msg.
			toastr.info("Data deleted successfully.", "Success");
			
			// hide the delete dialog box
			$('#modal_delete').modal('hide');
			
			// enables the delete and cancel button after deletion ajax request success
			document.getElementById("delete_link").disabled=false;
			document.getElementById("delete_cancel_link").disabled=false;
	
			// reload the table
			reload_data(post_refresh_url);
		}
	});
}

Anon7 - 2022
AnonSec Team