Torna al Thread
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="generator" content="" />
<link href="stile.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="utility.js"><!--// ajax utility //--></script>
<script type="text/javascript" language="JavaScript">
<!--hide
var folder;
var file;
var renamed=true;
var ajax;
function prendiElementoDaId(id_elemento) {
var elemento;
if(document.getElementById)
elemento = document.getElementById(id_elemento);
else
elemento = document.all[id_elemento];
return elemento;
};
// funzione per assegnare un oggetto XMLHttpRequest
function assegnaXMLHttpRequest() {
var
XHR = null,
browserUtente = navigator.userAgent.toUpperCase();
if(typeof(XMLHttpRequest) === "function" || typeof(XMLHttpRequest) === "object")
XHR = new XMLHttpRequest();
else if(window.ActiveXObject && browserUtente.indexOf("MSIE 4") < 0) {
if(browserUtente.indexOf("MSIE 5") < 0)
XHR = new ActiveXObject("Msxml2.XMLHTTP");
else
XHR = new ActiveXObject("Microsoft.XMLHTTP");
}
return XHR;
};
// oggetto di verifica stato
var readyState = {
INATTIVO: 0,
INIZIALIZZATO: 1,
RICHIESTA: 2,
RISPOSTA: 3,
COMPLETATO: 4
};
// array descrittivo dei codici restituiti dal server
// [la scelta dell' array è per evitare problemi con vecchi browsers]
var statusText = new Array();
statusText[100] = "Continue";
statusText[101] = "Switching Protocols";
statusText[200] = "OK";
function cambia(num){
var namet='t'+num;
var namel='l'+num;
if (prendiElementoDaId(namet).style.display=="none") {
prendiElementoDaId('t'+num).value=prendiElementoDaId('c'+num).value;
prendiElementoDaId(namet).style.display = "";
prendiElementoDaId(namel).style.display = "none";
prendiElementoDaId('post'+num).style.display = "";
prendiElementoDaId('submit'+num).setAttribute("value","Annulla");
}
else {
prendiElementoDaId(namel).style.display = "";
prendiElementoDaId(namet).style.display = "none";
prendiElementoDaId('post'+num).style.display = "none";
prendiElementoDaId('t'+num).value=prendiElementoDaId('c'+num).value;
prendiElementoDaId('submit'+num).setAttribute("value","Rinomina");
}
}
function getFolder(){
var param = window.location.search.substr(1).split(/\&/);
for(var i=0; i<param.length; i++) {
var nom_val = param[i].split(/\=/);
if (nom_val[0]=='nome'){
folder=unescape(nom_val[1]);
}
else if (nom_val[0]=='file'){
file=unescape(nom_val[1]);
}
}
}
function caricatabella(){
ajax = assegnaXMLHttpRequest();
var elemento = prendiElementoDaId('erase');
var usaLink = true;
getFolder()
if (file!=undefined){
//elimina(file);
}
if(ajax) {
var link="tabella.php";
var nomeFile="";
if (folder!=undefined){
nomeFile += "?nome=" + escape(folder);
}
usaLink = false;
elemento.innerHTML="<p Style=\"text-align:center\">Attendere prego</p>";
ajax.open("GET", link+nomeFile, true);
ajax.setRequestHeader("connection", "close");
ajax.onreadystatechange = function() {
if(ajax.readyState === readyState.COMPLETATO) {
if(statusText[ajax.status] === "OK")
elemento.innerHTML = ajax.responseText;
else {
elemento.innerHTML = "Impossibile effettuare l'operazione richiesta.<br />";
elemento.innerHTML += "Errore riscontrato: " + statusText[ajax.status];
}
}
}
ajax.send(null);
}
return usaLink;
} //-->
</script>
</head>
<body onload="java-script:caricatabella()">
<div id="erase">
</div>
</body>
</html>