0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.139.239.25


Current Path : /var/www/html/mum/src/
Upload File :
Current File : /var/www/html/mum/src/backup.js

function viewAll()
{
	$("#page_main_div").load('html_modules/krvw.html',function()
	{
		document.getElementById('display_module_name').innerHTML = ' Database Backup ';
	document.getElementById('module_name_for_save').value = 'Database Backup';	
		getDefaultHeadFooterLinks("Database Backup");
		
		 var $host_url="http://"+window.location.host+"/"+window.location.pathname.split('/')[1]+"/app.php?a=";
		//var $host_url="http://"+window.location.host+"/"+window.location.pathname.split('/')[1]+"/"+window.location.pathname.split('/')[2]+"/"+window.location.pathname.split('/')[3]+"/app.php?a=";
		$.ajax({
		type:'post',
		url:$host_url+"connect.demo",
		success: function($responce)
		{
			$responce= JSON.parse($responce);
			$data = $responce;
			var count=$data.length;
			var new_row ='';
			var arrIndex = 0;
			
			for(var countRows=1;countRows<= count;countRows++)  
			{
				var Databasename = $responce[arrIndex];
				new_row +="<tr><td style='width:250px; margin-left:250px; border:1px solid #C5DBEC;padding:5px; font-size:15px; ' type='text' >"+Databasename+"</td>";
				new_row +="<td style='width:30px;border:1px solid #C5DBEC;padding:5px;' type='text' ><input name='recstore' type='checkbox' value='"+Databasename+"' onclick = 'checkdb(this.id)' id='recstore"+countRows+"'/></td></tr>";
				++arrIndex;
				
			}
			$("#table").append(new_row);
		}});
	});
}

function checkdb(id)
{
	
	var checkboxes = document.getElementsByTagName('input');

	for (var i = 0; i < checkboxes.length; i++) {
		if (checkboxes[i].type == 'checkbox' && id != checkboxes[i].id) {
			 checkboxes[i].checked = false;
		}
	}

}

function backupdb()
{ 
	
	var inputFileds = document.getElementsByTagName('input');
	
		var sendarr = new Array();
		var chkCnt = 0;
		var k=0
		for (var counter=0; counter < inputFileds.length; counter++) 
		{   
			if ( inputFileds[counter].type.toUpperCase()=='CHECKBOX'  && inputFileds[counter].name == "recstore"  )
			{   
				++chkCnt;
				if(document.getElementById("recstore"+chkCnt).checked == true )
				{
					sendarr[k]= document.getElementById("recstore"+chkCnt).value;
					++k;
				}
			}
		}	
		 var $host_url="http://"+window.location.host+"/"+window.location.pathname.split('/')[1]+"/app.php?a=";
 		//var $host_url="http://"+window.location.host+"/"+window.location.pathname.split('/')[1]+"/"+window.location.pathname.split('/')[2]+"/"+window.location.pathname.split('/')[3]+"/app.php?a=";
		var myJSONText = sendarr;
		$.blockUI({ message: "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>" });
		$.ajax({
		type: 'POST',
		url: $host_url+"backupdb.demo", 
		data:"&sendarr="+myJSONText,
		success: function($responce)
		{
			$.unblockUI();
			
			document.getElementById('dlink').innerHTML =$responce; 
		}
		}); 
}