Codice dei programmi nella directory:
///File: estrai.html
<html>
<form action=_check.php method=post>
<input name=password type=password>Immetti Password
<input type=submit value="Invio">
</form>
</html>
///(Fine file: estrai.html)
///File: index.html
<html>
<title>
Redirect
</title>
<head>
<! La linea qui sotto redirige in 1 secondo... (metti 3 al posto di 1 se vuoi 3 secondi) >
<meta http-equiv=refresh content="1; url=http://www.itis.pr.it/~dsacco">
</head>
<body>
<h2>Pagina NON disponibile...
</body>
</html>
///(Fine file: index.html)
///File: _estrai-5b - Copia.html
<html>
<head>
<title>Estrai alunni</title>
<script language="javascript">
function classe() // 2013 --> genera ELENCO COMPLETO ALFABETICO/FOTO di classe (5 X riga)
{
var nominativi = new Array();
nominativi = frm.elenco.value.split("\n"); // wow split di textarea al carattere <invio>
str = "<table border=1>"
str += "<tr><TH> Alunni nella classe " + frm.nalunni.value + "</TH><tr>\n";
//finestra = window.open('', 'nuovafin', 'toolbar=no, status=no, width=300, height=400');
for (i=1; i <= frm.nalunni.value; i++)
{
str += "<td>" /*+ alunno*/ + " " + nominativi[i-1] +"</td>\n";
if (frm.passwd.value == "5binf") // CONTROLLO
str+="<td><IMG width=100 height=100 src=./_foto/"+i+".jpg </a></td>";
if (i % 5 == 0) str+="<tr>\n"; // 5 per riga
}
str += "</TABLE>";
//finestra.document.write(str);
document.write(str);
//alert("Premi per chiudere...");
//finestra.close();
document.close();
}
function apri()
// Genera una nuova finestra e visualizza i dati
{
var str;
var alunno, estratto,i; // numero di alunni
var estratti = new Array();
var nominativi = new Array();
if (frm.estrazione.value == 3) // foto classe
{
classe();
return;
}
for(i=1; i <= frm.nalunni.value; i++)
{
estratti[i] = 0; // azzero estratti
}
// Apre la nuova finestra
/* controllo input **/
if (parseInt(frm.genero.value) > parseInt(frm.nalunni.value))
{
str="ERRORE: Posso estrarre al massimo "+frm.nalunni.value+ " alunni, non "+frm.genero.value;
alert(str);
return;
}
nominativi = frm.elenco.value.split("\n"); // wow split di textarea al carattere <invio>
str = "<table border=1>"
str += "<tr><TH> Alunni nella classe " + frm.nalunni.value + ", ne estraggo " + frm.genero.value +"</TH><tr>\n";
//finestra = window.open('', 'nuovafin', 'toolbar=no, status=no, width=300, height=400');
for (i=1; i <= frm.genero.value; i++)
{
do { alunno = Math.random()*frm.nalunni.value;
alunno = Math.round(alunno); } while (alunno == 0 || estratti[alunno] == 1);
// non estraggo lo zero e non ripeto
estratti[alunno]=1; // booleano --> e' stato estratto
// Crea l'elenco puntato per la nuova finestra
str += "<td>" /*+ alunno*/ + " " + nominativi[alunno-1] +"</td>\n";
if (frm.passwd.value == "5binf") // CON FOTO
str+="<td><IMG width=100 height=100 src=./_foto/"+alunno+".jpg </a></td>";
if (frm.estrazione.value == 1) str+="<tr>\n"; // singoli
if (frm.estrazione.value == 2 && i % 2 == 0) str+="<tr>\n"; // coppie
if (frm.estrazione.value == 4 && i % 4 == 0) str+="<tr>\n"; // Laboratorio Vbtest
}
str += "</TABLE>";
//finestra.document.write(str);
document.write(str);
//alert("Premi per chiudere...");
//finestra.close();
document.close();
}
</script>
</head>
<body bgcolor="#000000" text="#ffffff" link="#ccffcc" vlink="#ffd4ff" alink="#ffaaaa">
<FONT FACE="Arial">
<h3><i> Estrazione nominativi (verifiche/interrogazioni/elenco classe/Test Laboratorio)</i> </h3>
<table border=0><tr><td colspan=2>
<img src=_foto/tramonto2.jpg>
</td><tr>
<td>
<form name="frm">
<input type="text" name="nalunni" value=14 size=2>Numero alunni nella classe?<br>
<input type="text" name="genero" size=2 value=1>Quanti alunni estraggo? <br>
<SELECT NAME="estrazione">
<OPTION VALUE=1 SELECTED>Sing
<OPTION VALUE=2>Copp
<OPTION VALUE=3>Elen
<OPTION VALUE=4>Test
</SELECT>Estrazione Singola/Coppie/Elenco classe?/Test. Lab. (vbtest) <br>
<input name = passwd type=password size=8> Vuoi la foto? Digita password!
</td>
<td>
Copia/Incolla qui i cognomi/nomi <br> degli alunni (uno per riga) <br>se hai un'altra classe... <br>
<TEXTAREA NAME="elenco" ROWS=10 COLS=30>ABATI EMANUELE
ABOU EL FARAH HAMZA
BARATTINI GIACOMO GIOELE
BIBA MARSELA
CASSANO GINEVRA
D'IGNOTI PARENTI FEDERICO
GODEA LUCA
LAGHI FRANCESCO
LOTTICI GABRIELE
MARTEMUCCI FRANCESCO
MERCURIO SARA
PIAZZA LUCA
TROFIMOV DANIL
ZIVERI TOMMASO
</TEXTAREA>
</td>
<tr><td colspan=2>
<p>
<input type="button" value="ESTRAI" onClick="apri();">
<input type="reset" value="PULISCI">
</p>
</td>
</table>
<p>
</form>
<h5><i>(Vers. 28 Feb. 2014)</i></h5>
</body>
</html>
///(Fine file: _estrai-5b - Copia.html)
///File: _estrai-5b.html
<html>
<head>
<title>Estrai alunni</title>
<script language="javascript">
function classe() // 2013 --> genera ELENCO COMPLETO ALFABETICO/FOTO di classe (5 X riga)
{
var nominativi = new Array();
nominativi = frm.elenco.value.split("\n"); // wow split di textarea al carattere <invio>
str = "<table border=1>"
str += "<tr><TH> Alunni nella classe " + frm.nalunni.value + "</TH><tr>\n";
//finestra = window.open('', 'nuovafin', 'toolbar=no, status=no, width=300, height=400');
for (i=1; i <= frm.nalunni.value; i++)
{
str += "<td>" /*+ alunno*/ + " " + nominativi[i-1] +"</td>\n";
if (frm.passwd.value == "5binf") // CONTROLLO
str+="<td><IMG width=100 height=100 src=./_foto/"+i+".jpg </a></td>";
if (i % 5 == 0) str+="<tr>\n"; // 5 per riga
}
str += "</TABLE>";
//finestra.document.write(str);
document.write(str);
//alert("Premi per chiudere...");
//finestra.close();
document.close();
}
function apri()
// Genera una nuova finestra e visualizza i dati
{
var str;
var alunno, estratto,i; // numero di alunni
var estratti = new Array();
var nominativi = new Array();
if (frm.estrazione.value == 3) // foto classe
{
classe();
return;
}
for(i=1; i <= frm.nalunni.value; i++)
{
estratti[i] = 0; // azzero estratti
}
// Apre la nuova finestra
/* controllo input **/
if (parseInt(frm.genero.value) > parseInt(frm.nalunni.value))
{
str="ERRORE: Posso estrarre al massimo "+frm.nalunni.value+ " alunni, non "+frm.genero.value;
alert(str);
return;
}
nominativi = frm.elenco.value.split("\n"); // wow split di textarea al carattere <invio>
str = "<table border=1>"
str += "<tr><TH> Alunni nella classe " + frm.nalunni.value + ", ne estraggo " + frm.genero.value +"</TH><tr>\n";
//finestra = window.open('', 'nuovafin', 'toolbar=no, status=no, width=300, height=400');
for (i=1; i <= frm.genero.value; i++)
{
do { alunno = Math.random()*frm.nalunni.value;
alunno = Math.round(alunno); } while (alunno == 0 || estratti[alunno] == 1);
// non estraggo lo zero e non ripeto
estratti[alunno]=1; // booleano --> e' stato estratto
// Crea l'elenco puntato per la nuova finestra
str += "<td>" /*+ alunno*/ + " " + nominativi[alunno-1] +"</td>\n";
if (frm.passwd.value == "5binf") // CON FOTO
str+="<td><IMG width=100 height=100 src=./_foto/"+alunno+".jpg </a></td>";
if (frm.estrazione.value == 1) str+="<tr>\n"; // singoli
if (frm.estrazione.value == 2 && i % 2 == 0) str+="<tr>\n"; // coppie
if (frm.estrazione.value == 4 && i % 4 == 0) str+="<tr>\n"; // Laboratorio Vbtest
}
str += "</TABLE>";
//finestra.document.write(str);
document.write(str);
//alert("Premi per chiudere...");
//finestra.close();
document.close();
}
</script>
</head>
<body bgcolor="#000000" text="#ffffff" link="#ccffcc" vlink="#ffd4ff" alink="#ffaaaa">
<FONT FACE="Arial">
<h3><i> Estrazione nominativi (verifiche/interrogazioni/elenco classe/Test Laboratorio)</i> </h3>
<table border=0><tr><td colspan=2>
<img src=_foto/tramonto2.jpg>
</td><tr>
<td>
<form name="frm">
<input type="text" name="nalunni" value=14 size=2>Numero alunni nella classe?<br>
<input type="text" name="genero" size=2 value=1>Quanti alunni estraggo? <br>
<SELECT NAME="estrazione">
<OPTION VALUE=1 SELECTED>Sing
<OPTION VALUE=2>Copp
<OPTION VALUE=3>Elen
<OPTION VALUE=4>Test
</SELECT>Estrazione Singola/Coppie/Elenco classe?/Test. Lab. (vbtest) <br>
<input name = passwd type=password size=8> Vuoi la foto? Digita password!
</td>
<td>
Copia/Incolla qui i cognomi/nomi <br> degli alunni (uno per riga) <br>se hai un'altra classe... <br>
<TEXTAREA NAME="elenco" ROWS=10 COLS=30>ABATI EMANUELE
ABOU EL FARAH HAMZA
BARATTINI GIACOMO GIOELE
BIBA MARSELA
CASSANO GINEVRA
D'IGNOTI PARENTI FEDERICO
GODEA LUCA
LAGHI FRANCESCO
LOTTICI GABRIELE
MARTEMUCCI FRANCESCO
MERCURIO SARA
PIAZZA LUCA
TROFIMOV DANIL
ZIVERI TOMMASO
</TEXTAREA>
</td>
<tr><td colspan=2>
<p>
<input type="button" value="ESTRAI" onClick="apri();">
<input type="reset" value="PULISCI">
</p>
</td>
</table>
<p>
</form>
<h5><i>(Vers. 28 Feb. 2014)</i></h5>
</body>
<br><br><br><br><br><br><br><br><img src=_foto/tramonto.jpg>
</html>
///(Fine file: _estrai-5b.html)