function suppression(){	
	$("input[@name^=file_]:checked").each(function(){
		var file = $(this).val();
		var donnees = "ids="+file+"";
		$.ajax({
			url: "fichier_helper.php",
			type: "POST",
			dataType: "HTML",
			data: donnees,
			error: function(){
				alert("Notre serveur rencontre un souci. Si cela devait se reproduire, contactez votre administrateur.");
			},
			success: function(data){
				// resolution;
				if(data == "del"){
					document.location="index.php?mode=apps&option=fichier&view=default&msg=del";
				}
				else{
					document.location="index.php?mode=apps&option=fichier&view=default&msg="+data+"";
				}
			}
		});
	});
}

function upload(){
	$.ajax({
		url: "fichier_helper.php",
		type: "POST",
		dataType: "HTML",
		data: "info=is5",
		error: function(){
			alert("Notre serveur rencontre un souci. Si cela devait se reproduire, contactez votre administrateur.");
		},
		success: function(data){
			// resolution;
			if(data == "ok"){
				document.location="index.php?mode=apps&option=fichier&view=default&msg=is5";
			}
			else {
				document.location="index.php?mode=apps&option=fichier&view=upload";
			}
		}
	});
}

function ordre(){
	$("input[@id^=ordre_]").each(function(){
		var ordre = $(this).val();
		var file = $(this).attr("name");
		var donnees = "id_ordre="+file+"&ordre="+ordre+"";
		$.ajax({
			url: "fichier_helper.php",
			type: "POST",
			dataType: "HTML",
			data: donnees,
			error: function(){
				alert("Votre ordre est modifié");
			},
			success: function(data){
				// resolution;
				if(data == "tri"){
					document.location="index.php?mode=apps&option=fichier&view=default&msg=tri";
				}
				else{
					document.location="index.php?mode=apps&option=fichier&view=default&msg="+data+"";
				}
			}
		});
	});
}

function generer(){
	$.ajax({
		url: "xml_helper.php",
		type: "POST",
		dataType: "HTML",
		data: "gen=ok",
		error: function(){
			alert("Notre serveur rencontre un souci. Si cela devait se reproduire, contactez votre administrateur.");
		},
		success: function(data){
			// resolution;
			if(data == "ok"){
				document.location="index.php?mode=apps&option=xml&msg=gen";
			}
		}
	});
}