Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : Prime modifiche git-svn-id: svn://10.65.10.50/trunk@9788 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7eb69fc6e9
commit
f7af9ddfa9
@ -1,20 +1,20 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Admin</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<table width="100%" height="100%" border="0"><tr>
|
||||
<td valign="middle" align="center" class="grande">Gestione corsi</font></td></tr></table>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
<html>
|
||||
<head>
|
||||
<title>Admin</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<table width="100%" height="100%" border="0"><tr>
|
||||
<td valign="middle" align="center" class="grande">Gestione corsi</font></td></tr></table>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,93 +1,93 @@
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (isset ($aggiorna))
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl_utenti WHERE id = $utente";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow[idcorso] == 0)
|
||||
{
|
||||
$sql = "UPDATE $tbl_utenti SET idcorso = $corso WHERE id = $utente";
|
||||
//echo $sql;
|
||||
$ins = mysql_query($sql,$db);
|
||||
if ($ins)
|
||||
echo "<br><br><p class=success>Aggiornamento effettutato con successo!</p><br><br>";
|
||||
else
|
||||
echo "<br><br><p class=error>Aggiornamento non effettutato!</p><br><br>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>L'utente é giá assegnato ad un corso!</p><br><br>";
|
||||
}
|
||||
|
||||
echo "<form name=assegna action=assegna.php method=get>";
|
||||
echo "<table border=0 align=center>";
|
||||
echo "<tr><th>Utente</td></tr>";
|
||||
|
||||
// SELECT UTENTI
|
||||
$criteri = "SELECT * FROM $tbl_utenti ORDER BY cognome, nome";
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<tr><td align=center><select name=utente>";
|
||||
//echo "<option></option>";
|
||||
do
|
||||
{
|
||||
$font = "";
|
||||
if ($myrow[idcorso] != 0) $font = "class=rosso";
|
||||
|
||||
$nominativo = $myrow["cognome"]." ".$myrow["nome"];
|
||||
if (isset ($utente) && $myrow[id] == $utente)
|
||||
echo "<option value=$myrow[id] selected $font>$nominativo</option>";
|
||||
else
|
||||
echo "<option value=$myrow[id] $font>$nominativo</option>";
|
||||
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</select></td></tr>";
|
||||
}
|
||||
else
|
||||
echo "<tr><td><p class=error>Nessun Utente trovato!</p></td></tr>";
|
||||
|
||||
|
||||
echo "<tr><td><br></td></tr><tr><th>Corso</td></tr>";
|
||||
// SELECT CORSI
|
||||
$criteri = "SELECT * FROM $tbl_corsi ORDER BY nome";
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<tr><td align=center><select name=corso>";
|
||||
//echo "<option></option>";
|
||||
do
|
||||
{
|
||||
if (isset ($corso) && $myrow[id] == $corso)
|
||||
echo "<option value=$myrow[id] selected>$myrow[nome]</option>";
|
||||
else
|
||||
echo "<option value=$myrow[id]>$myrow[nome]</option>";
|
||||
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</select></td></tr>";
|
||||
}
|
||||
else
|
||||
echo "<tr><td><p class=error>Nessun Corso trovato!</p></td></tr>";
|
||||
|
||||
echo "<tr><td><br></td></tr><tr><td align=center><input type=submit name=aggiorna value=Assegna class=bottoni></td></tr>";
|
||||
|
||||
echo "</table></form>";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (isset ($aggiorna))
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl_utenti WHERE id = $utente";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow[idcorso] == 0)
|
||||
{
|
||||
$sql = "UPDATE $tbl_utenti SET idcorso = $corso WHERE id = $utente";
|
||||
//echo $sql;
|
||||
$ins = mysql_query($sql,$db);
|
||||
if ($ins)
|
||||
echo "<br><br><p class=success>Aggiornamento effettutato con successo!</p><br><br>";
|
||||
else
|
||||
echo "<br><br><p class=error>Aggiornamento non effettutato!</p><br><br>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>L'utente é giá assegnato ad un corso!</p><br><br>";
|
||||
}
|
||||
|
||||
echo "<form name=assegna action=assegna.php method=get>";
|
||||
echo "<table border=0 align=center>";
|
||||
echo "<tr><th>Utente</td></tr>";
|
||||
|
||||
// SELECT UTENTI
|
||||
$criteri = "SELECT * FROM $tbl_utenti ORDER BY cognome, nome";
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<tr><td align=center><select name=utente>";
|
||||
//echo "<option></option>";
|
||||
do
|
||||
{
|
||||
$font = "";
|
||||
if ($myrow[idcorso] != 0) $font = "class=rosso";
|
||||
|
||||
$nominativo = $myrow["cognome"]." ".$myrow["nome"];
|
||||
if (isset ($utente) && $myrow[id] == $utente)
|
||||
echo "<option value=$myrow[id] selected $font>$nominativo</option>";
|
||||
else
|
||||
echo "<option value=$myrow[id] $font>$nominativo</option>";
|
||||
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</select></td></tr>";
|
||||
}
|
||||
else
|
||||
echo "<tr><td><p class=error>Nessun Utente trovato!</p></td></tr>";
|
||||
|
||||
|
||||
echo "<tr><td><br></td></tr><tr><th>Corso</td></tr>";
|
||||
// SELECT CORSI
|
||||
$criteri = "SELECT * FROM $tbl_corsi ORDER BY nome";
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<tr><td align=center><select name=corso>";
|
||||
//echo "<option></option>";
|
||||
do
|
||||
{
|
||||
if (isset ($corso) && $myrow[id] == $corso)
|
||||
echo "<option value=$myrow[id] selected>$myrow[nome]</option>";
|
||||
else
|
||||
echo "<option value=$myrow[id]>$myrow[nome]</option>";
|
||||
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</select></td></tr>";
|
||||
}
|
||||
else
|
||||
echo "<tr><td><p class=error>Nessun Corso trovato!</p></td></tr>";
|
||||
|
||||
echo "<tr><td><br></td></tr><tr><td align=center><input type=submit name=aggiorna value=Assegna class=bottoni></td></tr>";
|
||||
|
||||
echo "</table></form>";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,95 +1,95 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
echo "<table border=0 align=center>";
|
||||
|
||||
$criteri = "SELECT prove.risultato, utenti.nome as utente, corsi.nome as corso, prove.data ";
|
||||
|
||||
//$criteri .= "FROM (corsi INNER JOIN utenti ON corsi.id = utenti.idcorso) INNER JOIN prove ON utenti.id = prove.idutente ";
|
||||
$criteri .= "FROM (corsi LEFT JOIN utenti ON corsi.id = utenti.idcorso) LEFT JOIN prove ON utenti.id = prove.idutente ";
|
||||
//$criteri .= "FROM (corsi STRAIGHT JOIN utenti ON corsi.id = utenti.idcorso) STRAIGHT JOIN prove ON utenti.id = prove.idutente ";
|
||||
//$criteri .= "FROM corsi RIGHT JOIN (utenti RIGHT JOIN prove ON utenti.id = prove.idutente) ON corsi.id = utenti.idcorso ";
|
||||
|
||||
// Selezione dei criteri di ricerca
|
||||
|
||||
// CORSO
|
||||
if ($corso != 9000) $s_corso = "(corsi.id = $corso)";
|
||||
|
||||
// UTENTE
|
||||
if ($utente != 9000) $s_utente = "(utenti.id = $utente)";
|
||||
|
||||
// DATA
|
||||
if ($data != 9000)
|
||||
{
|
||||
switch ($data)
|
||||
{
|
||||
case "prima": $s_data = "(prove.data < $v_data)";
|
||||
break;
|
||||
case "dopo": $s_data = "(prove.data > $v_data)";
|
||||
break;
|
||||
case "giorno": $s_data = "(prove.data = $v_data)";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// RISULTATO
|
||||
if ($ris != 9000)
|
||||
{
|
||||
switch ($ris)
|
||||
{
|
||||
case "minore": $s_ris = "(prove.risultato < $v_ris)";
|
||||
break;
|
||||
case "maggiore": $s_ris = "(prove.risultato > $v_ris)";
|
||||
break;
|
||||
case "uguale": $s_ris = "(prove.risultato = $v_ris)";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//if ($ris == 9000) $criteri .= "Where ".$s_corso." AND ".$s_utente." AND ".$s_data." AND ".$s_ris;
|
||||
|
||||
echo $criteri;
|
||||
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#CCCCCC><td>".$myrow["data"]."</td><td>".$myrow["risultato"]."</td><td>".$myrow["utente"]."</td><td>".$myrow["corso"]."</td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td>".$myrow["data"]."</td><td>".$myrow["risultato"]."</td><td>".$myrow["utente"]."</td><td>".$myrow["corso"]."</td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
|
||||
echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
echo "<table border=0 align=center>";
|
||||
|
||||
$criteri = "SELECT prove.risultato, utenti.nome as utente, corsi.nome as corso, prove.data ";
|
||||
|
||||
//$criteri .= "FROM (corsi INNER JOIN utenti ON corsi.id = utenti.idcorso) INNER JOIN prove ON utenti.id = prove.idutente ";
|
||||
$criteri .= "FROM (corsi LEFT JOIN utenti ON corsi.id = utenti.idcorso) LEFT JOIN prove ON utenti.id = prove.idutente ";
|
||||
//$criteri .= "FROM (corsi STRAIGHT JOIN utenti ON corsi.id = utenti.idcorso) STRAIGHT JOIN prove ON utenti.id = prove.idutente ";
|
||||
//$criteri .= "FROM corsi RIGHT JOIN (utenti RIGHT JOIN prove ON utenti.id = prove.idutente) ON corsi.id = utenti.idcorso ";
|
||||
|
||||
// Selezione dei criteri di ricerca
|
||||
|
||||
// CORSO
|
||||
if ($corso != 9000) $s_corso = "(corsi.id = $corso)";
|
||||
|
||||
// UTENTE
|
||||
if ($utente != 9000) $s_utente = "(utenti.id = $utente)";
|
||||
|
||||
// DATA
|
||||
if ($data != 9000)
|
||||
{
|
||||
switch ($data)
|
||||
{
|
||||
case "prima": $s_data = "(prove.data < $v_data)";
|
||||
break;
|
||||
case "dopo": $s_data = "(prove.data > $v_data)";
|
||||
break;
|
||||
case "giorno": $s_data = "(prove.data = $v_data)";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// RISULTATO
|
||||
if ($ris != 9000)
|
||||
{
|
||||
switch ($ris)
|
||||
{
|
||||
case "minore": $s_ris = "(prove.risultato < $v_ris)";
|
||||
break;
|
||||
case "maggiore": $s_ris = "(prove.risultato > $v_ris)";
|
||||
break;
|
||||
case "uguale": $s_ris = "(prove.risultato = $v_ris)";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//if ($ris == 9000) $criteri .= "Where ".$s_corso." AND ".$s_utente." AND ".$s_data." AND ".$s_ris;
|
||||
|
||||
echo $criteri;
|
||||
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#CCCCCC><td>".$myrow["data"]."</td><td>".$myrow["risultato"]."</td><td>".$myrow["utente"]."</td><td>".$myrow["corso"]."</td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td>".$myrow["data"]."</td><td>".$myrow["risultato"]."</td><td>".$myrow["utente"]."</td><td>".$myrow["corso"]."</td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
|
||||
echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,30 +1,30 @@
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
|
||||
if (isset($tbl) && isset($id))
|
||||
{
|
||||
$query = "DROP ".$tbl." WHERE id = ".$id;
|
||||
echo $query;
|
||||
//$canc = mysql_query($query,$db);
|
||||
if (!$canc)
|
||||
echo "<br><br><p class=error>Cancellazione non effettuata!</p><br><br>";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
|
||||
if (isset($tbl) && isset($id))
|
||||
{
|
||||
$query = "DROP ".$tbl." WHERE id = ".$id;
|
||||
echo $query;
|
||||
//$canc = mysql_query($query,$db);
|
||||
if (!$canc)
|
||||
echo "<br><br><p class=error>Cancellazione non effettuata!</p><br><br>";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,55 +1,55 @@
|
||||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
class Table
|
||||
{
|
||||
var $table_array = array();
|
||||
var $headers = array();
|
||||
var $cols;
|
||||
|
||||
function table($headers)
|
||||
{
|
||||
$this->headers = $headers;
|
||||
$this->cols = count($headers);
|
||||
}
|
||||
|
||||
function addrow($row)
|
||||
{
|
||||
if (count($row) != $this->cols)
|
||||
return false;
|
||||
array_push($this->table_array, $row);
|
||||
return true;
|
||||
}
|
||||
|
||||
function output()
|
||||
{
|
||||
print "<pre>";
|
||||
foreach($this->headers as $headers)
|
||||
print "<b>$headers</b>";
|
||||
print "\n";
|
||||
foreach($this->table_array as $y)
|
||||
{
|
||||
foreach($y as $xcell)
|
||||
print "$xcell";
|
||||
print "\n";
|
||||
}
|
||||
print "</pre>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$test = new table(array("a","b","c"));
|
||||
$test->addrow(array(1,2,3));
|
||||
$test->addrow(array(4,5,6));
|
||||
$test->output();
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
class Table
|
||||
{
|
||||
var $table_array = array();
|
||||
var $headers = array();
|
||||
var $cols;
|
||||
|
||||
function table($headers)
|
||||
{
|
||||
$this->headers = $headers;
|
||||
$this->cols = count($headers);
|
||||
}
|
||||
|
||||
function addrow($row)
|
||||
{
|
||||
if (count($row) != $this->cols)
|
||||
return false;
|
||||
array_push($this->table_array, $row);
|
||||
return true;
|
||||
}
|
||||
|
||||
function output()
|
||||
{
|
||||
print "<pre>";
|
||||
foreach($this->headers as $headers)
|
||||
print "<b>$headers</b>";
|
||||
print "\n";
|
||||
foreach($this->table_array as $y)
|
||||
{
|
||||
foreach($y as $xcell)
|
||||
print "$xcell";
|
||||
print "\n";
|
||||
}
|
||||
print "</pre>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$test = new table(array("a","b","c"));
|
||||
$test->addrow(array(1,2,3));
|
||||
$test->addrow(array(4,5,6));
|
||||
$test->output();
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,74 +1,74 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
echo "<table border=0 align=center>";
|
||||
|
||||
$criteri = "SELECT * FROM corsi ORDER BY nome";
|
||||
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#AAAAAA><td><b>".$myrow["nome"]."</b></td><td>".$myrow["descrizione"]."</td></tr>";
|
||||
|
||||
$criteri1 = "SELECT lezioni.progressivo, test.posizione, lezioni.nome, test.nome ";
|
||||
$criteri1 .= "FROM lezioni LEFT JOIN test ON lezioni.id = test.idlezione ";
|
||||
$criteri1 .= "WHERE (lezioni.progressivo = 0) AND (test.posizione = 'inizio') AND (idcorso = ".$myrow["id"].")";
|
||||
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
echo "<tr bgcolor=#CCCCCC><td>".$myrow1["nome"]."</td><td>".$myrow1["posizione"]."</td></tr>";
|
||||
}
|
||||
$criteri2 = "SELECT * FROM lezioni WHERE (progressivo <> 0) AND (idcorso = ".$myrow["id"].") ORDER BY progressivo";
|
||||
$result2 = mysql_query($criteri2, $db);
|
||||
if ($myrow2 = mysql_fetch_array($result2))
|
||||
{
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#EEEEEE><td>".$myrow2["nome"]."</td><td>".$myrow2["progressivo"]."</td></tr>";
|
||||
}while ($myrow2 = mysql_fetch_array($result2));
|
||||
|
||||
}
|
||||
$criteri3 = "SELECT lezioni.progressivo, test.posizione, lezioni.nome, test.nome ";
|
||||
$criteri3 .= "FROM lezioni LEFT JOIN test ON lezioni.id = test.idlezione ";
|
||||
$criteri3 .= "WHERE (lezioni.progressivo = 0) AND (test.posizione = 'fine') AND (idcorso = ".$myrow["id"].")";
|
||||
$result3 = mysql_query($criteri3, $db);
|
||||
if ($myrow3 = mysql_fetch_array($result3))
|
||||
{
|
||||
echo "<tr bgcolor=Silver><td>".$myrow3["nome"]."</td><td>".$myrow3["posizione"]."</td></tr>";
|
||||
}
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
|
||||
echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
|
||||
|
||||
SELECT prove.risultato, utenti.id, corsi.id
|
||||
FROM (corsi INNER JOIN utenti ON corsi.id = utenti.idcorso) INNER JOIN prove ON utenti.id = prove.idutente
|
||||
WHERE (((utenti.id)=5) AND ((corsi.id)=1));
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
echo "<table border=0 align=center>";
|
||||
|
||||
$criteri = "SELECT * FROM corsi ORDER BY nome";
|
||||
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#AAAAAA><td><b>".$myrow["nome"]."</b></td><td>".$myrow["descrizione"]."</td></tr>";
|
||||
|
||||
$criteri1 = "SELECT lezioni.progressivo, test.posizione, lezioni.nome, test.nome ";
|
||||
$criteri1 .= "FROM lezioni LEFT JOIN test ON lezioni.id = test.idlezione ";
|
||||
$criteri1 .= "WHERE (lezioni.progressivo = 0) AND (test.posizione = 'inizio') AND (idcorso = ".$myrow["id"].")";
|
||||
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
echo "<tr bgcolor=#CCCCCC><td>".$myrow1["nome"]."</td><td>".$myrow1["posizione"]."</td></tr>";
|
||||
}
|
||||
$criteri2 = "SELECT * FROM lezioni WHERE (progressivo <> 0) AND (idcorso = ".$myrow["id"].") ORDER BY progressivo";
|
||||
$result2 = mysql_query($criteri2, $db);
|
||||
if ($myrow2 = mysql_fetch_array($result2))
|
||||
{
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#EEEEEE><td>".$myrow2["nome"]."</td><td>".$myrow2["progressivo"]."</td></tr>";
|
||||
}while ($myrow2 = mysql_fetch_array($result2));
|
||||
|
||||
}
|
||||
$criteri3 = "SELECT lezioni.progressivo, test.posizione, lezioni.nome, test.nome ";
|
||||
$criteri3 .= "FROM lezioni LEFT JOIN test ON lezioni.id = test.idlezione ";
|
||||
$criteri3 .= "WHERE (lezioni.progressivo = 0) AND (test.posizione = 'fine') AND (idcorso = ".$myrow["id"].")";
|
||||
$result3 = mysql_query($criteri3, $db);
|
||||
if ($myrow3 = mysql_fetch_array($result3))
|
||||
{
|
||||
echo "<tr bgcolor=Silver><td>".$myrow3["nome"]."</td><td>".$myrow3["posizione"]."</td></tr>";
|
||||
}
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
|
||||
echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
|
||||
|
||||
SELECT prove.risultato, utenti.id, corsi.id
|
||||
FROM (corsi INNER JOIN utenti ON corsi.id = utenti.idcorso) INNER JOIN prove ON utenti.id = prove.idutente
|
||||
WHERE (((utenti.id)=5) AND ((corsi.id)=1));
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,18 +1,18 @@
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
function righe($tabella)
|
||||
{
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tabella";
|
||||
$result = mysql_query($criteri, $db);
|
||||
//$myrow = mysql_fetch_array($result);
|
||||
//return $myrow;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
function righe($tabella)
|
||||
{
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tabella";
|
||||
$result = mysql_query($criteri, $db);
|
||||
//$myrow = mysql_fetch_array($result);
|
||||
//return $myrow;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
?>
|
@ -1,31 +1,31 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Untitled</title>
|
||||
</head>
|
||||
|
||||
<script>
|
||||
function messaggio(n)
|
||||
{
|
||||
if (n == 1) alert ("NORD");
|
||||
if (n == 2) alert ("CENTRO");
|
||||
if (n == 3) alert ("SUD");
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<body>
|
||||
<MAP name="italymap">
|
||||
<AREA shape="rect" coords=" 0, 0,180,110" href="#" onclick="return messaggio(1);">
|
||||
<AREA shape="rect" coords=" 80,110,220,200" href="#" onclick="return messaggio(2);">
|
||||
<AREA shape="rect" coords="120,200,300,350" href="#" onclick="return messaggio(3);">
|
||||
</MAP>
|
||||
<IMG src="../images/italy.gif" border="0" align="left" usemap="#italymap" WIDTH="304" HEIGHT="350">
|
||||
<BR><BR><BR>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Untitled</title>
|
||||
</head>
|
||||
|
||||
<script>
|
||||
function messaggio(n)
|
||||
{
|
||||
if (n == 1) alert ("NORD");
|
||||
if (n == 2) alert ("CENTRO");
|
||||
if (n == 3) alert ("SUD");
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<body>
|
||||
<MAP name="italymap">
|
||||
<AREA shape="rect" coords=" 0, 0,180,110" href="#" onclick="return messaggio(1);">
|
||||
<AREA shape="rect" coords=" 80,110,220,200" href="#" onclick="return messaggio(2);">
|
||||
<AREA shape="rect" coords="120,200,300,350" href="#" onclick="return messaggio(3);">
|
||||
</MAP>
|
||||
<IMG src="../images/italy.gif" border="0" align="left" usemap="#italymap" WIDTH="304" HEIGHT="350">
|
||||
<BR><BR><BR>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,22 +1,22 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Menu</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="menu.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
</form>
|
||||
|
||||
<table border=0 cellpadding=0 cellspacing=0>
|
||||
<tr><td><a href="assegna.php" target="destra">Assegna Corsi</a></td></tr>
|
||||
<tr><td><a href="prove.php" target="destra">Prove</a></td></tr>
|
||||
<tr><td><a href="elenco.php?tbl=accessi" target="destra">Presenze</a></td></tr></tr>
|
||||
<tr><td><a href="elenco.php?tbl=utenti" target="destra">Utenti</a></td></tr></tr>
|
||||
<tr><td><a href="elenco.php?tbl=corsi" target="destra">Corsi</a></td></tr></tr>
|
||||
<tr><td><a href="elenco.php?tbl=lezioni" target="destra">Lezioni</a></td></tr></tr>
|
||||
<tr><td><a href="elenco.php?tbl=test" target="destra">Test</a></td></tr></tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Menu</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="menu.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
</form>
|
||||
|
||||
<table border=0 cellpadding=0 cellspacing=0>
|
||||
<tr><td><a href="assegna.php" target="destra">Assegna Corsi</a></td></tr>
|
||||
<tr><td><a href="prove.php" target="destra">Prove</a></td></tr>
|
||||
<tr><td><a href="elenco.php?tbl=accessi" target="destra">Presenze</a></td></tr></tr>
|
||||
<tr><td><a href="elenco.php?tbl=utenti" target="destra">Utenti</a></td></tr></tr>
|
||||
<tr><td><a href="elenco.php?tbl=corsi" target="destra">Corsi</a></td></tr></tr>
|
||||
<tr><td><a href="elenco.php?tbl=lezioni" target="destra">Lezioni</a></td></tr></tr>
|
||||
<tr><td><a href="elenco.php?tbl=test" target="destra">Test</a></td></tr></tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,41 +1,41 @@
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (isset($tbl) && isset($id))
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl WHERE id = $id ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
$num_fields = mysql_num_fields($result);
|
||||
echo "<form name=form1><table border=1 align=center>";
|
||||
for($x = 0; $x < $num_fields; $x++)
|
||||
{
|
||||
echo "<tr>";
|
||||
echo "<td>".mysql_field_name($result, $x)."</td>";
|
||||
echo "<td><input type=text name='".mysql_field_name($result, $x)."' value='".$myrow[mysql_field_name($result, $x)]."'></td>";
|
||||
echo "</tr>";
|
||||
|
||||
}
|
||||
echo "</table></form>";
|
||||
}
|
||||
|
||||
echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (isset($tbl) && isset($id))
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl WHERE id = $id ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
$num_fields = mysql_num_fields($result);
|
||||
echo "<form name=form1><table border=1 align=center>";
|
||||
for($x = 0; $x < $num_fields; $x++)
|
||||
{
|
||||
echo "<tr>";
|
||||
echo "<td>".mysql_field_name($result, $x)."</td>";
|
||||
echo "<td><input type=text name='".mysql_field_name($result, $x)."' value='".$myrow[mysql_field_name($result, $x)]."'></td>";
|
||||
echo "</tr>";
|
||||
|
||||
}
|
||||
echo "</table></form>";
|
||||
}
|
||||
|
||||
echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,65 +1,65 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
echo "<table border=0 align=center>";
|
||||
|
||||
$criteri = "SELECT prove.risultato, utenti.nome as utente, corsi.nome as corso, prove.data ";
|
||||
//$criteri .= "FROM (corsi INNER JOIN utenti ON corsi.id = utenti.idcorso) INNER JOIN prove ON utenti.id = prove.idutente ";
|
||||
//$criteri .= "FROM (corsi STRAIGHT JOIN utenti ON corsi.id = utenti.idcorso) STRAIGHT JOIN prove ON utenti.id = prove.idutente ";
|
||||
$criteri .= "FROM corsi RIGHT JOIN (utenti RIGHT JOIN prove ON utenti.id = prove.idutente) ON corsi.id = utenti.idcorso ";
|
||||
|
||||
// Selezione dei criteri di ricerca
|
||||
// Utente e Corso
|
||||
if (($corso != "") && ($utente != "")) $criteri .= "WHERE (utenti.id = $utente) AND (corsi.id = $corso) ORDER BY prove.data DESC";
|
||||
// Solo Corso
|
||||
if (($corso != "") && ($utente == "")) $criteri .= "WHERE (corsi.id = $corso) ORDER BY prove.data DESC";
|
||||
// Solo Utente
|
||||
if (($corso == "") && ($utente != "")) $criteri .= "WHERE (utenti.id = $utente) ORDER BY prove.data DESC";
|
||||
// Nessuno
|
||||
if (($corso == "") && ($utente == "")) $criteri .= "ORDER BY prove.data DESC";
|
||||
|
||||
//echo $criteri;
|
||||
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#CCCCCC><td>".$myrow["data"]."</td><td>".$myrow["risultato"]."</td><td>".$myrow["utente"]."</td><td>".$myrow["corso"]."</td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td>".$myrow["data"]."</td><td>".$myrow["risultato"]."</td><td>".$myrow["utente"]."</td><td>".$myrow["corso"]."</td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
|
||||
echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
echo "<table border=0 align=center>";
|
||||
|
||||
$criteri = "SELECT prove.risultato, utenti.nome as utente, corsi.nome as corso, prove.data ";
|
||||
//$criteri .= "FROM (corsi INNER JOIN utenti ON corsi.id = utenti.idcorso) INNER JOIN prove ON utenti.id = prove.idutente ";
|
||||
//$criteri .= "FROM (corsi STRAIGHT JOIN utenti ON corsi.id = utenti.idcorso) STRAIGHT JOIN prove ON utenti.id = prove.idutente ";
|
||||
$criteri .= "FROM corsi RIGHT JOIN (utenti RIGHT JOIN prove ON utenti.id = prove.idutente) ON corsi.id = utenti.idcorso ";
|
||||
|
||||
// Selezione dei criteri di ricerca
|
||||
// Utente e Corso
|
||||
if (($corso != "") && ($utente != "")) $criteri .= "WHERE (utenti.id = $utente) AND (corsi.id = $corso) ORDER BY prove.data DESC";
|
||||
// Solo Corso
|
||||
if (($corso != "") && ($utente == "")) $criteri .= "WHERE (corsi.id = $corso) ORDER BY prove.data DESC";
|
||||
// Solo Utente
|
||||
if (($corso == "") && ($utente != "")) $criteri .= "WHERE (utenti.id = $utente) ORDER BY prove.data DESC";
|
||||
// Nessuno
|
||||
if (($corso == "") && ($utente == "")) $criteri .= "ORDER BY prove.data DESC";
|
||||
|
||||
//echo $criteri;
|
||||
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#CCCCCC><td>".$myrow["data"]."</td><td>".$myrow["risultato"]."</td><td>".$myrow["utente"]."</td><td>".$myrow["corso"]."</td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td>".$myrow["data"]."</td><td>".$myrow["risultato"]."</td><td>".$myrow["utente"]."</td><td>".$myrow["corso"]."</td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
|
||||
echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,26 +1,26 @@
|
||||
body{background-color:#D3DCED;}
|
||||
|
||||
p{font-family:Arial; font-size:12pt; text-align:center;}
|
||||
p.titolo{font-family:Arial; font-size:14pt; text-align:center;}
|
||||
p.error{font-family:Garamond; font-size:12pt; color:red; font-weight:900; text-align:center;}
|
||||
th{font-family:Arial; font-size:10pt; background-color:Navy; color:white;}
|
||||
td{font-family:Arial; font-size:9pt; font-weight:bold;}
|
||||
td.titolo{font-family:Arial; font-size:12pt; font-weight:bold;}
|
||||
td.menu{font-family:Arial; font-size:9pt; font-weight:bold; text-align:center; color:white;}
|
||||
td.menug{font-family:Arial; font-size:12pt; font-weight:bold; text-align:center; color:Navy;}
|
||||
input{font-family:Arial; font-size:9pt; font-weight:bold;}
|
||||
input.bottoni{font-family:Arial; font-size:9pt; font-weight:bold;}
|
||||
|
||||
A:visited{color:Teal; text-decoration:none;}
|
||||
A:active{color:blue; text-decoration:none;}
|
||||
A:link{color:blue; text-decoration:none;}
|
||||
A:hover{color:red; text-decoration:underline;}
|
||||
|
||||
|
||||
/*
|
||||
TAVOLA DEI COLORI
|
||||
|
||||
#BF210B = rosso
|
||||
#D3DCED = celeste
|
||||
|
||||
body{background-color:#D3DCED;}
|
||||
|
||||
p{font-family:Arial; font-size:12pt; text-align:center;}
|
||||
p.titolo{font-family:Arial; font-size:14pt; text-align:center;}
|
||||
p.error{font-family:Garamond; font-size:12pt; color:red; font-weight:900; text-align:center;}
|
||||
th{font-family:Arial; font-size:10pt; background-color:Navy; color:white;}
|
||||
td{font-family:Arial; font-size:9pt; font-weight:bold;}
|
||||
td.titolo{font-family:Arial; font-size:12pt; font-weight:bold;}
|
||||
td.menu{font-family:Arial; font-size:9pt; font-weight:bold; text-align:center; color:white;}
|
||||
td.menug{font-family:Arial; font-size:12pt; font-weight:bold; text-align:center; color:Navy;}
|
||||
input{font-family:Arial; font-size:9pt; font-weight:bold;}
|
||||
input.bottoni{font-family:Arial; font-size:9pt; font-weight:bold;}
|
||||
|
||||
A:visited{color:Teal; text-decoration:none;}
|
||||
A:active{color:blue; text-decoration:none;}
|
||||
A:link{color:blue; text-decoration:none;}
|
||||
A:hover{color:red; text-decoration:underline;}
|
||||
|
||||
|
||||
/*
|
||||
TAVOLA DEI COLORI
|
||||
|
||||
#BF210B = rosso
|
||||
#D3DCED = celeste
|
||||
|
||||
*/
|
@ -1,57 +1,57 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
echo "<table border=0 align=center>";
|
||||
|
||||
$criteri = "SELECT prove.risultato, utenti.nome as utente, corsi.nome as corso, prove.data ";
|
||||
//$criteri .= "FROM (corsi INNER JOIN utenti ON corsi.id = utenti.idcorso) INNER JOIN prove ON utenti.id = prove.idutente ";
|
||||
//$criteri .= "FROM (corsi STRAIGHT JOIN utenti ON corsi.id = utenti.idcorso) STRAIGHT JOIN prove ON utenti.id = prove.idutente ";
|
||||
$criteri .= "FROM corsi RIGHT JOIN (utenti RIGHT JOIN prove ON utenti.id = prove.idutente) ON corsi.id = utenti.idcorso ";
|
||||
|
||||
// Selezione dei criteri di ricerca
|
||||
// Utente e Corso
|
||||
if (($corso != "") && ($utente != "")) $criteri .= "WHERE (utenti.id = $utente) AND (corsi.id = $corso) ORDER BY prove.data DESC";
|
||||
// Solo Corso
|
||||
if (($corso != "") && ($utente == "")) $criteri .= "WHERE (corsi.id = $corso) ORDER BY prove.data DESC";
|
||||
// Solo Utente
|
||||
if (($corso == "") && ($utente != "")) $criteri .= "WHERE (utenti.id = $utente) ORDER BY prove.data DESC";
|
||||
// Nessuno
|
||||
if (($corso == "") && ($utente == "")) $criteri .= "ORDER BY prove.data DESC";
|
||||
|
||||
//echo $criteri;
|
||||
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#CCCCCC><td>".$myrow["data"]."</td><td>".$myrow["risultato"]."</td><td>".$myrow["utente"]."</td><td>".$myrow["corso"]."</td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td>".$myrow["data"]."</td><td>".$myrow["risultato"]."</td><td>".$myrow["utente"]."</td><td>".$myrow["corso"]."</td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
|
||||
echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
echo "<table border=0 align=center>";
|
||||
|
||||
$criteri = "SELECT prove.risultato, utenti.nome as utente, corsi.nome as corso, prove.data ";
|
||||
//$criteri .= "FROM (corsi INNER JOIN utenti ON corsi.id = utenti.idcorso) INNER JOIN prove ON utenti.id = prove.idutente ";
|
||||
//$criteri .= "FROM (corsi STRAIGHT JOIN utenti ON corsi.id = utenti.idcorso) STRAIGHT JOIN prove ON utenti.id = prove.idutente ";
|
||||
$criteri .= "FROM corsi RIGHT JOIN (utenti RIGHT JOIN prove ON utenti.id = prove.idutente) ON corsi.id = utenti.idcorso ";
|
||||
|
||||
// Selezione dei criteri di ricerca
|
||||
// Utente e Corso
|
||||
if (($corso != "") && ($utente != "")) $criteri .= "WHERE (utenti.id = $utente) AND (corsi.id = $corso) ORDER BY prove.data DESC";
|
||||
// Solo Corso
|
||||
if (($corso != "") && ($utente == "")) $criteri .= "WHERE (corsi.id = $corso) ORDER BY prove.data DESC";
|
||||
// Solo Utente
|
||||
if (($corso == "") && ($utente != "")) $criteri .= "WHERE (utenti.id = $utente) ORDER BY prove.data DESC";
|
||||
// Nessuno
|
||||
if (($corso == "") && ($utente == "")) $criteri .= "ORDER BY prove.data DESC";
|
||||
|
||||
//echo $criteri;
|
||||
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#CCCCCC><td>".$myrow["data"]."</td><td>".$myrow["risultato"]."</td><td>".$myrow["utente"]."</td><td>".$myrow["corso"]."</td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td>".$myrow["data"]."</td><td>".$myrow["risultato"]."</td><td>".$myrow["utente"]."</td><td>".$myrow["corso"]."</td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
|
||||
echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
|
@ -1,135 +1,135 @@
|
||||
|
||||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
class Table
|
||||
{
|
||||
var $table_array = array();
|
||||
var $headers = array();
|
||||
var $cols;
|
||||
|
||||
function table($headers)
|
||||
{
|
||||
$this->headers = $headers;
|
||||
$this->cols = count($headers);
|
||||
}
|
||||
|
||||
function addrow($row)
|
||||
{
|
||||
if (count($row) != $this->cols)
|
||||
return false;
|
||||
array_push($this->table_array, $row);
|
||||
return true;
|
||||
}
|
||||
|
||||
function output()
|
||||
{
|
||||
echo "<table align=center border=0>";
|
||||
echo "<tr>";
|
||||
foreach($this->headers as $headers)
|
||||
echo "<th bgcolor=#CCCCCC>$headers</th>";
|
||||
echo "</tr>";
|
||||
foreach($this->table_array as $y)
|
||||
{
|
||||
echo "<tr>";
|
||||
foreach($y as $xcell)
|
||||
if ($xcell != "")
|
||||
echo "<td bgcolor=#DDDDDD>$xcell</td>";
|
||||
else
|
||||
echo "<td><br></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//$tabella = "domande";
|
||||
if (!isset($tbl))
|
||||
{
|
||||
echo "<form action=classe.php><select name=tbl>";
|
||||
echo "<option value=corsi>corsi</option>";
|
||||
echo "<option value=domande>domande</option>";
|
||||
echo "<option value=risposte>risposte</option>";
|
||||
echo "<option value=test>test</option>";
|
||||
echo "<option value=lezioni>lezioni</option>";
|
||||
echo "</select><input type=submit value=Visualizza></form>";
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (isset($tbl))
|
||||
{
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tbl ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
$dati = array();
|
||||
$num_fields = mysql_num_fields($result);
|
||||
for($x = 0; $x < $num_fields; $x++)
|
||||
$dati[] = mysql_field_name($result, $x);
|
||||
$tabella = new table($dati);
|
||||
do
|
||||
{
|
||||
$temp = array();
|
||||
foreach($dati as $nome)
|
||||
$temp[] = $myrow[$nome];
|
||||
$tabella -> addrow($temp);
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
|
||||
$tabella -> output();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
// Scelta del DATABASE
|
||||
if (!isset($dbs) && !isset($tbl))
|
||||
{
|
||||
include("required.php");
|
||||
$link = mysql_connect($ip, $user, $password);
|
||||
|
||||
$db_res = mysql_list_dbs($link);
|
||||
$num = mysql_num_rows($db_res);
|
||||
for ($x = 0; $x < $num; $x++)
|
||||
echo "<a href=classe.php?dbs=".mysql_tablename($db_res, $x).">".mysql_tablename($db_res, $x)."</a><br>";
|
||||
mysql_close($link);
|
||||
}
|
||||
|
||||
|
||||
// Scelta della TABELLA
|
||||
if (isset($dbs))
|
||||
{
|
||||
echo $dbs;
|
||||
include("required.php");
|
||||
$link = mysql_connect($ip, $user, $password);
|
||||
//$result = mysql_list_tables($dbs, $link);
|
||||
$result = mysql_list_tables($dbs);
|
||||
$tab_rows = mysql_fetch_row($result);
|
||||
for ($x = 0; $x < $tab_rows; $x++)
|
||||
{
|
||||
//echo "$tab_rows[$x]<br>";
|
||||
$table = mysql_tablename($result, $x);
|
||||
echo $table;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
class Table
|
||||
{
|
||||
var $table_array = array();
|
||||
var $headers = array();
|
||||
var $cols;
|
||||
|
||||
function table($headers)
|
||||
{
|
||||
$this->headers = $headers;
|
||||
$this->cols = count($headers);
|
||||
}
|
||||
|
||||
function addrow($row)
|
||||
{
|
||||
if (count($row) != $this->cols)
|
||||
return false;
|
||||
array_push($this->table_array, $row);
|
||||
return true;
|
||||
}
|
||||
|
||||
function output()
|
||||
{
|
||||
echo "<table align=center border=0>";
|
||||
echo "<tr>";
|
||||
foreach($this->headers as $headers)
|
||||
echo "<th bgcolor=#CCCCCC>$headers</th>";
|
||||
echo "</tr>";
|
||||
foreach($this->table_array as $y)
|
||||
{
|
||||
echo "<tr>";
|
||||
foreach($y as $xcell)
|
||||
if ($xcell != "")
|
||||
echo "<td bgcolor=#DDDDDD>$xcell</td>";
|
||||
else
|
||||
echo "<td><br></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//$tabella = "domande";
|
||||
if (!isset($tbl))
|
||||
{
|
||||
echo "<form action=classe.php><select name=tbl>";
|
||||
echo "<option value=corsi>corsi</option>";
|
||||
echo "<option value=domande>domande</option>";
|
||||
echo "<option value=risposte>risposte</option>";
|
||||
echo "<option value=test>test</option>";
|
||||
echo "<option value=lezioni>lezioni</option>";
|
||||
echo "</select><input type=submit value=Visualizza></form>";
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (isset($tbl))
|
||||
{
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tbl ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
$dati = array();
|
||||
$num_fields = mysql_num_fields($result);
|
||||
for($x = 0; $x < $num_fields; $x++)
|
||||
$dati[] = mysql_field_name($result, $x);
|
||||
$tabella = new table($dati);
|
||||
do
|
||||
{
|
||||
$temp = array();
|
||||
foreach($dati as $nome)
|
||||
$temp[] = $myrow[$nome];
|
||||
$tabella -> addrow($temp);
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
|
||||
$tabella -> output();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
// Scelta del DATABASE
|
||||
if (!isset($dbs) && !isset($tbl))
|
||||
{
|
||||
include("required.php");
|
||||
$link = mysql_connect($ip, $user, $password);
|
||||
|
||||
$db_res = mysql_list_dbs($link);
|
||||
$num = mysql_num_rows($db_res);
|
||||
for ($x = 0; $x < $num; $x++)
|
||||
echo "<a href=classe.php?dbs=".mysql_tablename($db_res, $x).">".mysql_tablename($db_res, $x)."</a><br>";
|
||||
mysql_close($link);
|
||||
}
|
||||
|
||||
|
||||
// Scelta della TABELLA
|
||||
if (isset($dbs))
|
||||
{
|
||||
echo $dbs;
|
||||
include("required.php");
|
||||
$link = mysql_connect($ip, $user, $password);
|
||||
//$result = mysql_list_tables($dbs, $link);
|
||||
$result = mysql_list_tables($dbs);
|
||||
$tab_rows = mysql_fetch_row($result);
|
||||
for ($x = 0; $x < $tab_rows; $x++)
|
||||
{
|
||||
//echo "$tab_rows[$x]<br>";
|
||||
$table = mysql_tablename($result, $x);
|
||||
echo $table;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,177 +1,177 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
if (isset($dbname) && ($dbname != ""))
|
||||
{
|
||||
$query = mysql_query("CREATE DATABASE $dbname");
|
||||
if (!$query)
|
||||
mysql_die();
|
||||
else
|
||||
{
|
||||
$link = mysql_connect("localhost", "root", "");
|
||||
if (!$link)
|
||||
die("Impossibile connettersi a MySQL");
|
||||
mysql_select_db($dbname, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'accessi'
|
||||
|
||||
$criteri = "CREATE TABLE accessi (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idutente int(11) NOT NULL,
|
||||
login datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
|
||||
logout datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
|
||||
descrizione text NOT NULL,
|
||||
modifica varchar(10) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idutente (idutente),
|
||||
KEY login (login),
|
||||
KEY logout (logout)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'corsi'
|
||||
|
||||
$criteri = "CREATE TABLE corsi (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
nome varchar(100) NOT NULL,
|
||||
descrizione text,
|
||||
costo bigint(20),
|
||||
immagine varchar(50) NOT NULL,
|
||||
test_prima varchar(10) DEFAULT 'Falso' NOT NULL,
|
||||
modo int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'domande'
|
||||
|
||||
$criteri = "CREATE TABLE domande (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idtest int(11) NOT NULL,
|
||||
domanda text NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idtest (idtest)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'download'
|
||||
|
||||
$criteri = "CREATE TABLE download (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idutente int(11) NOT NULL,
|
||||
idlezione int(11) NOT NULL,
|
||||
data date DEFAULT '0000-00-00' NOT NULL,
|
||||
terminato varchar(10) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idutente (idutente),
|
||||
KEY idlezione (idlezione)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'lezioni'
|
||||
|
||||
$criteri = "CREATE TABLE lezioni (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idcorso int(11) NOT NULL,
|
||||
nome varchar(255) NOT NULL,
|
||||
progressivo smallint(6) NOT NULL,
|
||||
percorso varchar(50) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idcorso (idcorso)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'prove'
|
||||
|
||||
$criteri = "CREATE TABLE prove (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idutente int(11) NOT NULL,
|
||||
idtest int(11) NOT NULL,
|
||||
data date DEFAULT '0000-00-00' NOT NULL,
|
||||
risultato varchar(20) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idutente (idutente),
|
||||
KEY idtest (idtest)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'risposte'
|
||||
|
||||
$criteri = "CREATE TABLE risposte (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
iddomanda int(11) NOT NULL,
|
||||
risposta text NOT NULL,
|
||||
valida varchar(10) NOT NULL,
|
||||
visibile varchar(10) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY iddomanda (iddomanda)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'test'
|
||||
|
||||
$criteri = "CREATE TABLE test (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idlezione int(11) NOT NULL,
|
||||
nome varchar(255) NOT NULL,
|
||||
posizione varchar(10) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idlezione (idlezione)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'utenti'
|
||||
|
||||
$criteri = "CREATE TABLE utenti (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
nome varchar(25) NOT NULL,
|
||||
cognome varchar(25) NOT NULL,
|
||||
email varchar(35) NOT NULL,
|
||||
username varchar(20) NOT NULL,
|
||||
pass varchar(20) NOT NULL,
|
||||
data date DEFAULT '0000-00-00' NOT NULL,
|
||||
idcorso varchar(5) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idcorso (idcorso)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
echo "<p class=success>Database $dbname creato con successo!</p>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<form name=creadb action=$PHP_SELF? method=post><table align=center>";
|
||||
echo "<tr><td>Nome del database</td><td><input type=text name=dbname></td></tr>";
|
||||
echo "<tr><td colspan=2 align=center><input type=submit value='Crea Database'></td></tr>";
|
||||
echo "</table></form>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
if (isset($dbname) && ($dbname != ""))
|
||||
{
|
||||
$query = mysql_query("CREATE DATABASE $dbname");
|
||||
if (!$query)
|
||||
mysql_die();
|
||||
else
|
||||
{
|
||||
$link = mysql_connect("localhost", "root", "");
|
||||
if (!$link)
|
||||
die("Impossibile connettersi a MySQL");
|
||||
mysql_select_db($dbname, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'accessi'
|
||||
|
||||
$criteri = "CREATE TABLE accessi (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idutente int(11) NOT NULL,
|
||||
login datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
|
||||
logout datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
|
||||
descrizione text NOT NULL,
|
||||
modifica varchar(10) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idutente (idutente),
|
||||
KEY login (login),
|
||||
KEY logout (logout)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'corsi'
|
||||
|
||||
$criteri = "CREATE TABLE corsi (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
nome varchar(100) NOT NULL,
|
||||
descrizione text,
|
||||
costo bigint(20),
|
||||
immagine varchar(50) NOT NULL,
|
||||
test_prima varchar(10) DEFAULT 'Falso' NOT NULL,
|
||||
modo int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'domande'
|
||||
|
||||
$criteri = "CREATE TABLE domande (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idtest int(11) NOT NULL,
|
||||
domanda text NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idtest (idtest)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'download'
|
||||
|
||||
$criteri = "CREATE TABLE download (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idutente int(11) NOT NULL,
|
||||
idlezione int(11) NOT NULL,
|
||||
data date DEFAULT '0000-00-00' NOT NULL,
|
||||
terminato varchar(10) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idutente (idutente),
|
||||
KEY idlezione (idlezione)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'lezioni'
|
||||
|
||||
$criteri = "CREATE TABLE lezioni (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idcorso int(11) NOT NULL,
|
||||
nome varchar(255) NOT NULL,
|
||||
progressivo smallint(6) NOT NULL,
|
||||
percorso varchar(50) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idcorso (idcorso)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'prove'
|
||||
|
||||
$criteri = "CREATE TABLE prove (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idutente int(11) NOT NULL,
|
||||
idtest int(11) NOT NULL,
|
||||
data date DEFAULT '0000-00-00' NOT NULL,
|
||||
risultato varchar(20) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idutente (idutente),
|
||||
KEY idtest (idtest)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'risposte'
|
||||
|
||||
$criteri = "CREATE TABLE risposte (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
iddomanda int(11) NOT NULL,
|
||||
risposta text NOT NULL,
|
||||
valida varchar(10) NOT NULL,
|
||||
visibile varchar(10) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY iddomanda (iddomanda)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'test'
|
||||
|
||||
$criteri = "CREATE TABLE test (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idlezione int(11) NOT NULL,
|
||||
nome varchar(255) NOT NULL,
|
||||
posizione varchar(10) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idlezione (idlezione)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
|
||||
# Struttura della tavola 'utenti'
|
||||
|
||||
$criteri = "CREATE TABLE utenti (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
nome varchar(25) NOT NULL,
|
||||
cognome varchar(25) NOT NULL,
|
||||
email varchar(35) NOT NULL,
|
||||
username varchar(20) NOT NULL,
|
||||
pass varchar(20) NOT NULL,
|
||||
data date DEFAULT '0000-00-00' NOT NULL,
|
||||
idcorso varchar(5) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idcorso (idcorso)
|
||||
)";
|
||||
echo "<p>".$criteri."</p>";
|
||||
$query = mysql_query($criteri, $link);
|
||||
|
||||
echo "<p class=success>Database $dbname creato con successo!</p>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<form name=creadb action=$PHP_SELF? method=post><table align=center>";
|
||||
echo "<tr><td>Nome del database</td><td><input type=text name=dbname></td></tr>";
|
||||
echo "<tr><td colspan=2 align=center><input type=submit value='Crea Database'></td></tr>";
|
||||
echo "</table></form>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
@ -1,245 +1,245 @@
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if ($mostra == 'canc')
|
||||
{
|
||||
if (isset($tbl) && isset($id))
|
||||
{
|
||||
$query = "DELETE FROM $tbl WHERE id = $id ";
|
||||
//echo $query;
|
||||
$canc = mysql_query($query, $db);
|
||||
if (!$canc)
|
||||
echo "<br><br><p class=error>Cancellazione non effettuata!</p><br><br>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset ($aggiorna))
|
||||
{
|
||||
if (isset($tbl))
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
$num_fields = mysql_num_fields($result);
|
||||
|
||||
$query = "UPDATE $tbl SET ";
|
||||
for($x = 0; $x < $num_fields-1; $x++)
|
||||
$query .= " ".mysql_field_name($result, $x)." = '".$valori[mysql_field_name($result, $x)]."',";
|
||||
$query .= " ".mysql_field_name($result, $num_fields-1)." = '".$valori[mysql_field_name($result, $num_fields-1)]."'";
|
||||
$query .= " WHERE id = $id ";
|
||||
//echo $query;
|
||||
$agg = mysql_query($query, $db);
|
||||
if (!$agg)
|
||||
echo "<br><br><p class=error>Aggiornamento non effettuato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset ($salva))
|
||||
{
|
||||
if (isset($tbl))
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
$num_fields = mysql_num_fields($result);
|
||||
|
||||
$query = "INSERT INTO $tbl (";
|
||||
for($x = 0; $x < $num_fields-1; $x++)
|
||||
$query .= " ".mysql_field_name($result, $x).",";
|
||||
$query .= " ".mysql_field_name($result, $num_fields-1)."";
|
||||
$query .= ") VALUES ( ";
|
||||
for($x = 0; $x < $num_fields-1; $x++)
|
||||
$query .= " '".$valori[mysql_field_name($result, $x)]."',";
|
||||
$query .= " '".$valori[mysql_field_name($result, $x)]."')";
|
||||
//echo $query;
|
||||
$sal = mysql_query($query, $db);
|
||||
if (!$sal)
|
||||
echo "<br><br><p class=error>Salvataggio non riuscito!</p><br><br>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//if ($mostra == 'deletesicuro')
|
||||
if ($mostra == 'mod')
|
||||
{
|
||||
if (isset($tbl))
|
||||
{
|
||||
echo "<p class=titolo>Aggiornamento dati<br></p>";
|
||||
if (isset($id)) $criteri = "SELECT * FROM $tbl WHERE id = $id ";
|
||||
else $criteri = "SELECT * FROM $tbl ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
$num_fields = mysql_num_fields($result);
|
||||
echo "<form name=form1 action=elenco.php method=post><table border=0 align=center>";
|
||||
//$valori = array();
|
||||
for($x = 0; $x < $num_fields; $x++)
|
||||
{
|
||||
//$tipo = "<td>".mysql_field_type($result, $x)."</td>"; // Visualizza il tipo del campo
|
||||
$dati = "";
|
||||
$t = ereg_replace("'", "", $myrow[mysql_field_name($result, $x)]); // Rimozione delle stringhe del singolo apice
|
||||
if (isset($id)) $dati = $t;
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr class=chiaro><td>".mysql_field_name($result, $x)."</td>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr class=scuro><td>".mysql_field_name($result, $x)."</td>";
|
||||
$riga = true;
|
||||
}
|
||||
if (mysql_field_type($result, $x) == "blob")
|
||||
//if (mysql_field_type($result, $x) == "blob" || mysql_field_len($result, $x) > 30 )
|
||||
echo "$tipo<td><textarea cols=25 rows=3 name='valori[".mysql_field_name($result, $x)."]' wrap=hard>$dati</textarea></td></tr>";
|
||||
else
|
||||
echo "$tipo</td><td><input type=text size=20 name='valori[".mysql_field_name($result, $x)."]' value='$dati'></td></tr>";
|
||||
}
|
||||
echo "<tr><td><br></td></tr>";
|
||||
echo "<tr><td align=left><input type=hidden name=tbl value=$tbl><input type=hidden name=id value=$id>";
|
||||
if (isset($id)) echo "<input type=submit name=aggiorna value=Aggiorna></td></tr>";
|
||||
else echo "<input type=submit name=salva value=Salva></td></tr>";
|
||||
echo "</table></form>";
|
||||
}
|
||||
}
|
||||
elseif ($mostra == 'delete')
|
||||
{
|
||||
echo "<table><tr><td>La tabella '$tbl' verrá vuotata. Proseguire?";
|
||||
echo "<form name=deletesicuro action=elenco.php method=post><input type=submit name=drop value=SI class=bottoni> ";
|
||||
echo "<input type=hidden name=tbl value=$tbl><input type=submit value=NO name=drop class=bottoni></form></td></tr></table>";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($drop == "SI")
|
||||
{
|
||||
if (isset($tbl))
|
||||
{
|
||||
$query = "DELETE FROM $tbl ";
|
||||
//echo $query;
|
||||
$del = mysql_query($query, $db);
|
||||
if (!$del)
|
||||
echo "<br><br><p class=error>Cancellazione non riuscita!</p><br><br>";
|
||||
}
|
||||
}
|
||||
if (isset($tbl))
|
||||
{
|
||||
if (isset($links_shown1)) $links_shown = $links_shown1;
|
||||
if (isset($links_shown_p1)) $links_shown = $links_shown_p1;
|
||||
$row_max = 30; // Numero di righe per pagina
|
||||
if (!$links_shown)
|
||||
$links_shown = 0;
|
||||
else
|
||||
$old_link = $links_shown;
|
||||
|
||||
echo "<p class=titolo>Tabella: <b>$tbl</b><br></p>";
|
||||
$sql = "SELECT count(*) as conto FROM $tbl";
|
||||
if (isset($total_result) == false)
|
||||
{
|
||||
$result1 = mysql_query($sql,$db);
|
||||
$myrow1 = mysql_fetch_array($result1);
|
||||
$total_result = $myrow1["conto"];
|
||||
}
|
||||
|
||||
$criteri = "SELECT * FROM $tbl limit $links_shown, $row_max";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
$dati = array();
|
||||
$num_fields = mysql_num_fields($result);
|
||||
//echo $total_result;
|
||||
if ($total_result > 0)
|
||||
{
|
||||
for($x = 0; $x < $num_fields; $x++)
|
||||
$dati[] = mysql_field_name($result, $x);
|
||||
$table = array();
|
||||
do
|
||||
{
|
||||
$temp = array();
|
||||
foreach($dati as $nome)
|
||||
$temp[] = $myrow[$nome];
|
||||
array_push($table,$temp);
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
|
||||
echo "<table align=center border=0>";
|
||||
echo "<tr>";
|
||||
foreach($dati as $headers)
|
||||
echo "<th>$headers</th>";
|
||||
echo "<td><br></td><td><br></td></tr>";
|
||||
foreach($table as $y)
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr class=chiaro>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr class=scuro>";
|
||||
$riga = true;
|
||||
}
|
||||
foreach($y as $xcell)
|
||||
{
|
||||
if ($xcell != "")
|
||||
echo "<td>$xcell</td>";
|
||||
else
|
||||
echo "<td><br></td>";
|
||||
|
||||
}
|
||||
//echo "<td><a href=elenco.php?mostra=mod&tbl=$tbl&id=$y[0]>Modifica</a></td><td><a href=elenco.php?mostra=canc&tbl=$tbl&id=$y[0]>Cancella</a></td></tr>";
|
||||
echo "<td><a href=elenco.php?mostra=mod&tbl=$tbl&id=$y[0]>Modifica</a></td>";
|
||||
echo "<td><a href=elenco.php?mostra=canc&tbl=$tbl&id=$y[0]>Cancella</a></td></tr>";
|
||||
}
|
||||
echo "<tr><td><br></td></tr><tr><td colspan=$num_fields align=left><a href=elenco.php?mostra=delete&tbl=$tbl>Vuota la tabella</a></td></tr>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<table align=center border=0><tr><td class=titolo>La Tabella non contiene record</font></td></tr>";
|
||||
}
|
||||
|
||||
$links_shown = $links_shown + $row_max;
|
||||
echo "<tr><td><br></td></tr><tr><td colspan=$num_fields align=left><a href=elenco.php?mostra=mod&tbl=$tbl>Aggiungi nuovo record</a></td></tr>";
|
||||
echo "</table>";
|
||||
$links_shown = $links_shown - 1;
|
||||
if (($links_shown + 1) != $row_max)
|
||||
{
|
||||
$links_on_this_page = $links_shown - $old_link;
|
||||
$links_shown_prev = $links_shown - (($row_max + $links_on_this_page));
|
||||
}
|
||||
if ($links_shown != ($total_result-1))
|
||||
$links_shown = ($links_shown + 1);
|
||||
|
||||
echo "<table align=center><tr>";
|
||||
if ($total_result > $row_max)
|
||||
{
|
||||
if (isset($links_shown_prev)==true)
|
||||
echo "<td><a href=elenco.php?tbl=$tbl&links_shown=$links_shown_prev&total_result=$total_result>Precedente</a></td>";
|
||||
echo "<td><br></td>";
|
||||
//if ($links_shown!=$total_result-1)
|
||||
if ($links_shown < ($total_result - 1))
|
||||
echo "<td><a href=elenco.php?tbl=$tbl&links_shown=$links_shown&total_result=$total_result>Successivo</a></td>";
|
||||
echo "</tr></table>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if ($mostra == 'canc')
|
||||
{
|
||||
if (isset($tbl) && isset($id))
|
||||
{
|
||||
$query = "DELETE FROM $tbl WHERE id = $id ";
|
||||
//echo $query;
|
||||
$canc = mysql_query($query, $db);
|
||||
if (!$canc)
|
||||
echo "<br><br><p class=error>Cancellazione non effettuata!</p><br><br>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset ($aggiorna))
|
||||
{
|
||||
if (isset($tbl))
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
$num_fields = mysql_num_fields($result);
|
||||
|
||||
$query = "UPDATE $tbl SET ";
|
||||
for($x = 0; $x < $num_fields-1; $x++)
|
||||
$query .= " ".mysql_field_name($result, $x)." = '".$valori[mysql_field_name($result, $x)]."',";
|
||||
$query .= " ".mysql_field_name($result, $num_fields-1)." = '".$valori[mysql_field_name($result, $num_fields-1)]."'";
|
||||
$query .= " WHERE id = $id ";
|
||||
//echo $query;
|
||||
$agg = mysql_query($query, $db);
|
||||
if (!$agg)
|
||||
echo "<br><br><p class=error>Aggiornamento non effettuato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset ($salva))
|
||||
{
|
||||
if (isset($tbl))
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
$num_fields = mysql_num_fields($result);
|
||||
|
||||
$query = "INSERT INTO $tbl (";
|
||||
for($x = 0; $x < $num_fields-1; $x++)
|
||||
$query .= " ".mysql_field_name($result, $x).",";
|
||||
$query .= " ".mysql_field_name($result, $num_fields-1)."";
|
||||
$query .= ") VALUES ( ";
|
||||
for($x = 0; $x < $num_fields-1; $x++)
|
||||
$query .= " '".$valori[mysql_field_name($result, $x)]."',";
|
||||
$query .= " '".$valori[mysql_field_name($result, $x)]."')";
|
||||
//echo $query;
|
||||
$sal = mysql_query($query, $db);
|
||||
if (!$sal)
|
||||
echo "<br><br><p class=error>Salvataggio non riuscito!</p><br><br>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//if ($mostra == 'deletesicuro')
|
||||
if ($mostra == 'mod')
|
||||
{
|
||||
if (isset($tbl))
|
||||
{
|
||||
echo "<p class=titolo>Aggiornamento dati<br></p>";
|
||||
if (isset($id)) $criteri = "SELECT * FROM $tbl WHERE id = $id ";
|
||||
else $criteri = "SELECT * FROM $tbl ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
$num_fields = mysql_num_fields($result);
|
||||
echo "<form name=form1 action=elenco.php method=post><table border=0 align=center>";
|
||||
//$valori = array();
|
||||
for($x = 0; $x < $num_fields; $x++)
|
||||
{
|
||||
//$tipo = "<td>".mysql_field_type($result, $x)."</td>"; // Visualizza il tipo del campo
|
||||
$dati = "";
|
||||
$t = ereg_replace("'", "", $myrow[mysql_field_name($result, $x)]); // Rimozione delle stringhe del singolo apice
|
||||
if (isset($id)) $dati = $t;
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr class=chiaro><td>".mysql_field_name($result, $x)."</td>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr class=scuro><td>".mysql_field_name($result, $x)."</td>";
|
||||
$riga = true;
|
||||
}
|
||||
if (mysql_field_type($result, $x) == "blob")
|
||||
//if (mysql_field_type($result, $x) == "blob" || mysql_field_len($result, $x) > 30 )
|
||||
echo "$tipo<td><textarea cols=25 rows=3 name='valori[".mysql_field_name($result, $x)."]' wrap=hard>$dati</textarea></td></tr>";
|
||||
else
|
||||
echo "$tipo</td><td><input type=text size=20 name='valori[".mysql_field_name($result, $x)."]' value='$dati'></td></tr>";
|
||||
}
|
||||
echo "<tr><td><br></td></tr>";
|
||||
echo "<tr><td align=left><input type=hidden name=tbl value=$tbl><input type=hidden name=id value=$id>";
|
||||
if (isset($id)) echo "<input type=submit name=aggiorna value=Aggiorna></td></tr>";
|
||||
else echo "<input type=submit name=salva value=Salva></td></tr>";
|
||||
echo "</table></form>";
|
||||
}
|
||||
}
|
||||
elseif ($mostra == 'delete')
|
||||
{
|
||||
echo "<table><tr><td>La tabella '$tbl' verrá vuotata. Proseguire?";
|
||||
echo "<form name=deletesicuro action=elenco.php method=post><input type=submit name=drop value=SI class=bottoni> ";
|
||||
echo "<input type=hidden name=tbl value=$tbl><input type=submit value=NO name=drop class=bottoni></form></td></tr></table>";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($drop == "SI")
|
||||
{
|
||||
if (isset($tbl))
|
||||
{
|
||||
$query = "DELETE FROM $tbl ";
|
||||
//echo $query;
|
||||
$del = mysql_query($query, $db);
|
||||
if (!$del)
|
||||
echo "<br><br><p class=error>Cancellazione non riuscita!</p><br><br>";
|
||||
}
|
||||
}
|
||||
if (isset($tbl))
|
||||
{
|
||||
if (isset($links_shown1)) $links_shown = $links_shown1;
|
||||
if (isset($links_shown_p1)) $links_shown = $links_shown_p1;
|
||||
$row_max = 30; // Numero di righe per pagina
|
||||
if (!$links_shown)
|
||||
$links_shown = 0;
|
||||
else
|
||||
$old_link = $links_shown;
|
||||
|
||||
echo "<p class=titolo>Tabella: <b>$tbl</b><br></p>";
|
||||
$sql = "SELECT count(*) as conto FROM $tbl";
|
||||
if (isset($total_result) == false)
|
||||
{
|
||||
$result1 = mysql_query($sql,$db);
|
||||
$myrow1 = mysql_fetch_array($result1);
|
||||
$total_result = $myrow1["conto"];
|
||||
}
|
||||
|
||||
$criteri = "SELECT * FROM $tbl limit $links_shown, $row_max";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
$dati = array();
|
||||
$num_fields = mysql_num_fields($result);
|
||||
//echo $total_result;
|
||||
if ($total_result > 0)
|
||||
{
|
||||
for($x = 0; $x < $num_fields; $x++)
|
||||
$dati[] = mysql_field_name($result, $x);
|
||||
$table = array();
|
||||
do
|
||||
{
|
||||
$temp = array();
|
||||
foreach($dati as $nome)
|
||||
$temp[] = $myrow[$nome];
|
||||
array_push($table,$temp);
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
|
||||
echo "<table align=center border=0>";
|
||||
echo "<tr>";
|
||||
foreach($dati as $headers)
|
||||
echo "<th>$headers</th>";
|
||||
echo "<td><br></td><td><br></td></tr>";
|
||||
foreach($table as $y)
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr class=chiaro>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr class=scuro>";
|
||||
$riga = true;
|
||||
}
|
||||
foreach($y as $xcell)
|
||||
{
|
||||
if ($xcell != "")
|
||||
echo "<td>$xcell</td>";
|
||||
else
|
||||
echo "<td><br></td>";
|
||||
|
||||
}
|
||||
//echo "<td><a href=elenco.php?mostra=mod&tbl=$tbl&id=$y[0]>Modifica</a></td><td><a href=elenco.php?mostra=canc&tbl=$tbl&id=$y[0]>Cancella</a></td></tr>";
|
||||
echo "<td><a href=elenco.php?mostra=mod&tbl=$tbl&id=$y[0]>Modifica</a></td>";
|
||||
echo "<td><a href=elenco.php?mostra=canc&tbl=$tbl&id=$y[0]>Cancella</a></td></tr>";
|
||||
}
|
||||
echo "<tr><td><br></td></tr><tr><td colspan=$num_fields align=left><a href=elenco.php?mostra=delete&tbl=$tbl>Vuota la tabella</a></td></tr>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<table align=center border=0><tr><td class=titolo>La Tabella non contiene record</font></td></tr>";
|
||||
}
|
||||
|
||||
$links_shown = $links_shown + $row_max;
|
||||
echo "<tr><td><br></td></tr><tr><td colspan=$num_fields align=left><a href=elenco.php?mostra=mod&tbl=$tbl>Aggiungi nuovo record</a></td></tr>";
|
||||
echo "</table>";
|
||||
$links_shown = $links_shown - 1;
|
||||
if (($links_shown + 1) != $row_max)
|
||||
{
|
||||
$links_on_this_page = $links_shown - $old_link;
|
||||
$links_shown_prev = $links_shown - (($row_max + $links_on_this_page));
|
||||
}
|
||||
if ($links_shown != ($total_result-1))
|
||||
$links_shown = ($links_shown + 1);
|
||||
|
||||
echo "<table align=center><tr>";
|
||||
if ($total_result > $row_max)
|
||||
{
|
||||
if (isset($links_shown_prev)==true)
|
||||
echo "<td><a href=elenco.php?tbl=$tbl&links_shown=$links_shown_prev&total_result=$total_result>Precedente</a></td>";
|
||||
echo "<td><br></td>";
|
||||
//if ($links_shown!=$total_result-1)
|
||||
if ($links_shown < ($total_result - 1))
|
||||
echo "<td><a href=elenco.php?tbl=$tbl&links_shown=$links_shown&total_result=$total_result>Successivo</a></td>";
|
||||
echo "</tr></table>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,358 +1,358 @@
|
||||
<?php
|
||||
|
||||
|
||||
// Controlla il login di un utente
|
||||
function validazione($username, $psw)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT id FROM $tbl_utenti WHERE username = '$username' AND pass = '$psw'";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
return $myrow["id"];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Restituisce il corso a cui un utente e' abilitato
|
||||
function corso($utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT idcorso FROM $tbl_utenti WHERE (id = $utente)";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
return $myrow["idcorso"];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Restituisce tutte le informazioni su un utente
|
||||
function generale($id)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tbl_utenti WHERE id = $id ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
return $myrow;
|
||||
}
|
||||
|
||||
// Scrive il login di un utente nella tabella accessi
|
||||
function login($idutente, $login)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$sql = "INSERT INTO $tbl_accessi (idutente, login, descrizione, modifica) VALUES($idutente, '$login', 'ONLINE', 'no') ";
|
||||
$ins = mysql_query($sql,$db);
|
||||
if ($ins)
|
||||
{
|
||||
$criteri = "SELECT id FROM $tbl_accessi WHERE login = '$login' ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
return $myrow["id"];
|
||||
}
|
||||
}
|
||||
|
||||
// Scrive il logout di un utente nella tabella accessi
|
||||
function logout($id, $ora)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$sql = "UPDATE $tbl_accessi SET logout = '$ora' WHERE id = $id ";
|
||||
$ins = mysql_query($sql,$db);
|
||||
}
|
||||
|
||||
// Restituisce la differenza tra due date in Ore:Minuti:Secondi
|
||||
function differenza($periodo1, $periodo2)
|
||||
{
|
||||
//string substr(string string, int start, int [length]);
|
||||
$giorno1 = substr($periodo1, 8, 2);
|
||||
$giorno2 = substr($periodo2, 8, 2);
|
||||
$ora1 = substr($periodo1, 11, 2);
|
||||
$ora2 = substr($periodo2, 11, 2);
|
||||
$min1 = substr($periodo1, 14, 2);
|
||||
$min2 = substr($periodo2, 14, 2);
|
||||
$sec1 = substr($periodo1, 17, 2);
|
||||
$sec2 = substr($periodo2, 17, 2);
|
||||
$diff = (($ora2-$ora1)*3600) + (($min2-$min1)*60) + ($sec2-$sec1);
|
||||
if ($giorno1 != $giorno2)
|
||||
$diff = $diff + (($giorno2-$giorno1)*3600*24);
|
||||
$ore = $diff;
|
||||
$O = 0;
|
||||
while ($ore > 3600):
|
||||
$ore = ($ore-3600);
|
||||
$O = $O + 1;
|
||||
endwhile;
|
||||
$resto = ($diff-($O*3600));
|
||||
$min = $resto;
|
||||
$M = 0;
|
||||
while ($min > 60):
|
||||
$min = ($min-60);
|
||||
$M = $M + 1;
|
||||
endwhile;
|
||||
$sec = ($resto-($M*60));
|
||||
if (strlen($sec) < 2)
|
||||
$sec = "0".$sec;
|
||||
if (strlen($M) < 2)
|
||||
$M = "0".$M;
|
||||
$tempo = $O.":".$M.":".$sec;
|
||||
return $tempo;
|
||||
|
||||
}
|
||||
|
||||
// Effettua la somma di due tempi in Ore:Minuti:Secondi
|
||||
function somma_tempo($tempo1, $tempo2)
|
||||
{
|
||||
if (strlen($tempo1) < 8){
|
||||
$ora1 = substr($tempo1, 0, 1);
|
||||
$min1 = substr($tempo1, 2, 2);
|
||||
$sec1 = substr($tempo1, 5, 2);
|
||||
}else{
|
||||
$ora1 = substr($tempo1, 0 ,2);
|
||||
$min1 = substr($tempo1, 3, 2);
|
||||
$sec1 = substr($tempo1, 6, 2);
|
||||
}
|
||||
if (strlen($tempo2) < 8){
|
||||
$ora2 = substr($tempo2, 0, 1);
|
||||
$min2 = substr($tempo2, 2, 2);
|
||||
$sec2 = substr($tempo2, 5, 2);
|
||||
}else{
|
||||
$ora2 = substr($tempo2, 0 ,2);
|
||||
$min2 = substr($tempo2, 3, 2);
|
||||
$sec2 = substr($tempo2, 6, 2);
|
||||
}
|
||||
$orat = ($ora1+$ora2);
|
||||
$mint = ($min1+$min2);
|
||||
$sect = ($sec1+$sec2);
|
||||
if ($sect >= 60){
|
||||
$sect = ($sect-60);
|
||||
$mint = $mint+1;
|
||||
}
|
||||
if ($mint >= 60){
|
||||
$mint = ($mint-60);
|
||||
$orat = $orat+1;
|
||||
}
|
||||
if (strlen($sect) < 2)
|
||||
$sect = "0".$sect;
|
||||
if (strlen($mint) < 2)
|
||||
$mint = "0".$mint;
|
||||
$somma = $orat.":".$mint.":".$sect;
|
||||
return $somma;
|
||||
}
|
||||
|
||||
// Stabilisce se l'utente e' abilitato a eseguire le lezioni di un corso
|
||||
function abilitato($utente, $corso)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tbl_utenti WHERE (id = $utente)";
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
if ($myrow[idcorso] == $corso)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
// Restituisce il test iniziale del corso
|
||||
function inizio($utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT $tbl_utenti.id, $tbl_test.posizione, $tbl_test.nome, $tbl_test.id as test ";
|
||||
$criteri .= "FROM (($tbl_corsi LEFT JOIN $tbl_utenti ON $tbl_corsi.id = $tbl_utenti.idcorso) LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso) LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione ";
|
||||
$criteri .= "WHERE ($tbl_utenti.id = $utente) AND ($tbl_test.posizione = '$s_inizio')";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
//$num_rows = mysql_num_rows($result);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
//if ($num_rows != 0)
|
||||
{
|
||||
$criteri1 = "SELECT * FROM $tbl_prove WHERE (idutente = $utente) AND (idtest = $myrow[test])";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
$myrow1 = mysql_fetch_array($result1);
|
||||
if ($myrow1)
|
||||
return 0;
|
||||
else
|
||||
return $myrow[test];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Restutuisce il test finale del corso se un utente puo' eseguirlo
|
||||
function fine($utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT $tbl_utenti.id, $tbl_test.posizione, $tbl_test.nome, $tbl_test.id as test, $tbl_test.idlezione as lezione ";
|
||||
$criteri .= "FROM (($tbl_corsi LEFT JOIN $tbl_utenti ON $tbl_corsi.id = $tbl_utenti.idcorso) LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso) LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione ";
|
||||
$criteri .= "WHERE ($tbl_utenti.id = $utente) AND ($tbl_test.posizione = '$s_fine')";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
{
|
||||
$criteri1 = "SELECT * FROM $tbl_prove WHERE (idutente = $utente) AND (idtest = $myrow[test])";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
$myrow1 = mysql_fetch_array($result1);
|
||||
if ($myrow1)
|
||||
return 0;
|
||||
else
|
||||
return $myrow[test];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Da il permesso di scaricare una lezione
|
||||
// Verificando, qualora fosse abilitato $test_prima, che sia stato effettuato il test iniziale della lezione,
|
||||
// Altrimenti che sia stato effettuato il test finale della lezione precedente.
|
||||
function controllo_download($lezione, $utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
if ($test_prima == 'Vero')
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl_lezioni WHERE (id = $lezione) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow[progressivo] != 0)
|
||||
{
|
||||
if ($myrow[progressivo] >= 1)
|
||||
{
|
||||
//$cur = $myrow[progressivo] - 1;
|
||||
$cur = $myrow[progressivo];
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_lezioni.nome, $tbl_test.nome, $tbl_test.posizione, $tbl_prove.id ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $cur) AND ($tbl_test.posizione = '$s_prima') AND ($tbl_prove.idutente = $utente)";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl_lezioni WHERE (id = $lezione) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//echo $myrow[progressivo];
|
||||
if ($myrow[progressivo] != 0)
|
||||
{
|
||||
if ($myrow[progressivo] >= 1)
|
||||
{
|
||||
$cur = $myrow[progressivo] - 1;
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_lezioni.nome, $tbl_test.nome, $tbl_test.posizione, $tbl_prove.id ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $cur) AND ($tbl_test.posizione = '$s_dopo') AND ($tbl_prove.idutente = $utente)";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Da il permesso di effettuare un test
|
||||
// Verificando che sia stato effettuato il test finale della lezione precedente
|
||||
function controllo_test($lezione, $utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT * FROM $tbl_lezioni WHERE (id = $lezione) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//echo $myrow[progressivo];
|
||||
if ($myrow[progressivo] != 0)
|
||||
{
|
||||
if ($myrow[progressivo] > 1)
|
||||
{
|
||||
$cur = $myrow[progressivo] - 1;
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_lezioni.nome, $tbl_test.nome, $tbl_test.posizione, $tbl_prove.id ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $cur) AND ($tbl_test.posizione = '$s_dopo') AND ($tbl_prove.idutente = $utente)";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function fine_abilita($utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri ="SELECT utenti.id, Max(lezioni.progressivo) AS ultimo ";
|
||||
$criteri .= "FROM utenti LEFT JOIN lezioni ON utenti.idcorso = lezioni.idcorso ";
|
||||
$criteri .= "GROUP BY utenti.id HAVING (utenti.id = $utente) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//echo $myrow["ultimo"];
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_test.posizione, $tbl_prove.idutente ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $myrow[ultimo]) AND ($tbl_test.posizione = '$s_dopo') AND ($tbl_prove.idutente = $utente) ";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
// Controlla il login di un utente
|
||||
function validazione($username, $psw)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT id FROM $tbl_utenti WHERE username = '$username' AND pass = '$psw'";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
return $myrow["id"];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Restituisce il corso a cui un utente e' abilitato
|
||||
function corso($utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT idcorso FROM $tbl_utenti WHERE (id = $utente)";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
return $myrow["idcorso"];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Restituisce tutte le informazioni su un utente
|
||||
function generale($id)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tbl_utenti WHERE id = $id ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
return $myrow;
|
||||
}
|
||||
|
||||
// Scrive il login di un utente nella tabella accessi
|
||||
function login($idutente, $login)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$sql = "INSERT INTO $tbl_accessi (idutente, login, descrizione, modifica) VALUES($idutente, '$login', 'ONLINE', 'no') ";
|
||||
$ins = mysql_query($sql,$db);
|
||||
if ($ins)
|
||||
{
|
||||
$criteri = "SELECT id FROM $tbl_accessi WHERE login = '$login' ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
return $myrow["id"];
|
||||
}
|
||||
}
|
||||
|
||||
// Scrive il logout di un utente nella tabella accessi
|
||||
function logout($id, $ora)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$sql = "UPDATE $tbl_accessi SET logout = '$ora' WHERE id = $id ";
|
||||
$ins = mysql_query($sql,$db);
|
||||
}
|
||||
|
||||
// Restituisce la differenza tra due date in Ore:Minuti:Secondi
|
||||
function differenza($periodo1, $periodo2)
|
||||
{
|
||||
//string substr(string string, int start, int [length]);
|
||||
$giorno1 = substr($periodo1, 8, 2);
|
||||
$giorno2 = substr($periodo2, 8, 2);
|
||||
$ora1 = substr($periodo1, 11, 2);
|
||||
$ora2 = substr($periodo2, 11, 2);
|
||||
$min1 = substr($periodo1, 14, 2);
|
||||
$min2 = substr($periodo2, 14, 2);
|
||||
$sec1 = substr($periodo1, 17, 2);
|
||||
$sec2 = substr($periodo2, 17, 2);
|
||||
$diff = (($ora2-$ora1)*3600) + (($min2-$min1)*60) + ($sec2-$sec1);
|
||||
if ($giorno1 != $giorno2)
|
||||
$diff = $diff + (($giorno2-$giorno1)*3600*24);
|
||||
$ore = $diff;
|
||||
$O = 0;
|
||||
while ($ore > 3600):
|
||||
$ore = ($ore-3600);
|
||||
$O = $O + 1;
|
||||
endwhile;
|
||||
$resto = ($diff-($O*3600));
|
||||
$min = $resto;
|
||||
$M = 0;
|
||||
while ($min > 60):
|
||||
$min = ($min-60);
|
||||
$M = $M + 1;
|
||||
endwhile;
|
||||
$sec = ($resto-($M*60));
|
||||
if (strlen($sec) < 2)
|
||||
$sec = "0".$sec;
|
||||
if (strlen($M) < 2)
|
||||
$M = "0".$M;
|
||||
$tempo = $O.":".$M.":".$sec;
|
||||
return $tempo;
|
||||
|
||||
}
|
||||
|
||||
// Effettua la somma di due tempi in Ore:Minuti:Secondi
|
||||
function somma_tempo($tempo1, $tempo2)
|
||||
{
|
||||
if (strlen($tempo1) < 8){
|
||||
$ora1 = substr($tempo1, 0, 1);
|
||||
$min1 = substr($tempo1, 2, 2);
|
||||
$sec1 = substr($tempo1, 5, 2);
|
||||
}else{
|
||||
$ora1 = substr($tempo1, 0 ,2);
|
||||
$min1 = substr($tempo1, 3, 2);
|
||||
$sec1 = substr($tempo1, 6, 2);
|
||||
}
|
||||
if (strlen($tempo2) < 8){
|
||||
$ora2 = substr($tempo2, 0, 1);
|
||||
$min2 = substr($tempo2, 2, 2);
|
||||
$sec2 = substr($tempo2, 5, 2);
|
||||
}else{
|
||||
$ora2 = substr($tempo2, 0 ,2);
|
||||
$min2 = substr($tempo2, 3, 2);
|
||||
$sec2 = substr($tempo2, 6, 2);
|
||||
}
|
||||
$orat = ($ora1+$ora2);
|
||||
$mint = ($min1+$min2);
|
||||
$sect = ($sec1+$sec2);
|
||||
if ($sect >= 60){
|
||||
$sect = ($sect-60);
|
||||
$mint = $mint+1;
|
||||
}
|
||||
if ($mint >= 60){
|
||||
$mint = ($mint-60);
|
||||
$orat = $orat+1;
|
||||
}
|
||||
if (strlen($sect) < 2)
|
||||
$sect = "0".$sect;
|
||||
if (strlen($mint) < 2)
|
||||
$mint = "0".$mint;
|
||||
$somma = $orat.":".$mint.":".$sect;
|
||||
return $somma;
|
||||
}
|
||||
|
||||
// Stabilisce se l'utente e' abilitato a eseguire le lezioni di un corso
|
||||
function abilitato($utente, $corso)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tbl_utenti WHERE (id = $utente)";
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
if ($myrow[idcorso] == $corso)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
// Restituisce il test iniziale del corso
|
||||
function inizio($utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT $tbl_utenti.id, $tbl_test.posizione, $tbl_test.nome, $tbl_test.id as test ";
|
||||
$criteri .= "FROM (($tbl_corsi LEFT JOIN $tbl_utenti ON $tbl_corsi.id = $tbl_utenti.idcorso) LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso) LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione ";
|
||||
$criteri .= "WHERE ($tbl_utenti.id = $utente) AND ($tbl_test.posizione = '$s_inizio')";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
//$num_rows = mysql_num_rows($result);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
//if ($num_rows != 0)
|
||||
{
|
||||
$criteri1 = "SELECT * FROM $tbl_prove WHERE (idutente = $utente) AND (idtest = $myrow[test])";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
$myrow1 = mysql_fetch_array($result1);
|
||||
if ($myrow1)
|
||||
return 0;
|
||||
else
|
||||
return $myrow[test];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Restutuisce il test finale del corso se un utente puo' eseguirlo
|
||||
function fine($utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT $tbl_utenti.id, $tbl_test.posizione, $tbl_test.nome, $tbl_test.id as test, $tbl_test.idlezione as lezione ";
|
||||
$criteri .= "FROM (($tbl_corsi LEFT JOIN $tbl_utenti ON $tbl_corsi.id = $tbl_utenti.idcorso) LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso) LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione ";
|
||||
$criteri .= "WHERE ($tbl_utenti.id = $utente) AND ($tbl_test.posizione = '$s_fine')";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
{
|
||||
$criteri1 = "SELECT * FROM $tbl_prove WHERE (idutente = $utente) AND (idtest = $myrow[test])";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
$myrow1 = mysql_fetch_array($result1);
|
||||
if ($myrow1)
|
||||
return 0;
|
||||
else
|
||||
return $myrow[test];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Da il permesso di scaricare una lezione
|
||||
// Verificando, qualora fosse abilitato $test_prima, che sia stato effettuato il test iniziale della lezione,
|
||||
// Altrimenti che sia stato effettuato il test finale della lezione precedente.
|
||||
function controllo_download($lezione, $utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
if ($test_prima == 'Vero')
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl_lezioni WHERE (id = $lezione) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow[progressivo] != 0)
|
||||
{
|
||||
if ($myrow[progressivo] >= 1)
|
||||
{
|
||||
//$cur = $myrow[progressivo] - 1;
|
||||
$cur = $myrow[progressivo];
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_lezioni.nome, $tbl_test.nome, $tbl_test.posizione, $tbl_prove.id ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $cur) AND ($tbl_test.posizione = '$s_prima') AND ($tbl_prove.idutente = $utente)";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl_lezioni WHERE (id = $lezione) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//echo $myrow[progressivo];
|
||||
if ($myrow[progressivo] != 0)
|
||||
{
|
||||
if ($myrow[progressivo] >= 1)
|
||||
{
|
||||
$cur = $myrow[progressivo] - 1;
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_lezioni.nome, $tbl_test.nome, $tbl_test.posizione, $tbl_prove.id ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $cur) AND ($tbl_test.posizione = '$s_dopo') AND ($tbl_prove.idutente = $utente)";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Da il permesso di effettuare un test
|
||||
// Verificando che sia stato effettuato il test finale della lezione precedente
|
||||
function controllo_test($lezione, $utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT * FROM $tbl_lezioni WHERE (id = $lezione) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//echo $myrow[progressivo];
|
||||
if ($myrow[progressivo] != 0)
|
||||
{
|
||||
if ($myrow[progressivo] > 1)
|
||||
{
|
||||
$cur = $myrow[progressivo] - 1;
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_lezioni.nome, $tbl_test.nome, $tbl_test.posizione, $tbl_prove.id ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $cur) AND ($tbl_test.posizione = '$s_dopo') AND ($tbl_prove.idutente = $utente)";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function fine_abilita($utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri ="SELECT utenti.id, Max(lezioni.progressivo) AS ultimo ";
|
||||
$criteri .= "FROM utenti LEFT JOIN lezioni ON utenti.idcorso = lezioni.idcorso ";
|
||||
$criteri .= "GROUP BY utenti.id HAVING (utenti.id = $utente) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//echo $myrow["ultimo"];
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_test.posizione, $tbl_prove.idutente ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $myrow[ultimo]) AND ($tbl_test.posizione = '$s_dopo') AND ($tbl_prove.idutente = $utente) ";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
<!-- frames -->
|
||||
<frameset cols="15%,*" border="1">
|
||||
<frame name="sinistra" src="menu.php" marginwidth="10" marginheight="10" scrolling="auto" frameborder="0">
|
||||
<frame name="destra" src="admin.php" marginwidth="10" marginheight="10" scrolling="auto" frameborder="0">
|
||||
</frameset>
|
||||
<!-- frames -->
|
||||
<frameset cols="15%,*" border="1">
|
||||
<frame name="sinistra" src="menu.php" marginwidth="10" marginheight="10" scrolling="auto" frameborder="0">
|
||||
<frame name="destra" src="admin.php" marginwidth="10" marginheight="10" scrolling="auto" frameborder="0">
|
||||
</frameset>
|
||||
|
@ -1,21 +1,21 @@
|
||||
body{background-color:#707070;}
|
||||
|
||||
p{font-family:Arial; font-size:12pt; text-align:center;}
|
||||
p.titolo{font-family:Arial; font-size:14pt; text-align:center;}
|
||||
th{font-family:Arial; font-size:10pt; background-color:Navy; color:white;}
|
||||
td{font-family:Arial; font-size:9pt; font-weight:bold;}
|
||||
td.titolo{font-family:Arial; font-size:9pt; font-weight:bold;}
|
||||
|
||||
A:visited{color:white; text-decoration:none;}
|
||||
/*A:active{color:red; text-decoration:none;}*/
|
||||
A:link{color:white; text-decoration:none;}
|
||||
A:hover{color:red; text-decoration:underline;}
|
||||
|
||||
|
||||
/*
|
||||
TAVOLA DEI COLORI
|
||||
|
||||
#BF210B = rosso
|
||||
#D3DCED = celeste
|
||||
|
||||
body{background-color:#707070;}
|
||||
|
||||
p{font-family:Arial; font-size:12pt; text-align:center;}
|
||||
p.titolo{font-family:Arial; font-size:14pt; text-align:center;}
|
||||
th{font-family:Arial; font-size:10pt; background-color:Navy; color:white;}
|
||||
td{font-family:Arial; font-size:9pt; font-weight:bold;}
|
||||
td.titolo{font-family:Arial; font-size:9pt; font-weight:bold;}
|
||||
|
||||
A:visited{color:white; text-decoration:none;}
|
||||
/*A:active{color:red; text-decoration:none;}*/
|
||||
A:link{color:white; text-decoration:none;}
|
||||
A:hover{color:red; text-decoration:underline;}
|
||||
|
||||
|
||||
/*
|
||||
TAVOLA DEI COLORI
|
||||
|
||||
#BF210B = rosso
|
||||
#D3DCED = celeste
|
||||
|
||||
*/
|
@ -1,36 +1,36 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Menu</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="menu.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<table border=0 cellpadding=0 cellspacing=0>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$tab_res = mysql_list_tables($dataname, $db);
|
||||
while ($tab_rows = mysql_fetch_row($tab_res))
|
||||
//echo "<tr><td>$tab_rows[0]</td></tr>";
|
||||
echo "<tr><td><a href=elenco.php?tbl=$tab_rows[0] target=destra>$tab_rows[0]</a></td></tr>";
|
||||
|
||||
echo "<tr><td><hr size=3></td></tr>";
|
||||
echo "<tr><td><a href=assegna.php target=destra>Assegna Corsi</a></td></tr>";
|
||||
echo "<tr><td><a href=prove.php target=destra>Prove</a></td></tr>";
|
||||
echo "<tr><td><a href=presenze.php target=destra>Presenze</a></td></tr>";
|
||||
//echo "<tr><td><a href=variabili.php target=destra>Variabili</a></td></tr>";
|
||||
echo "<tr><td><hr size=3></td></tr>";
|
||||
echo "<tr><td><a href=tuttitest.php target=destra>Tutti i Test</a></td></tr>";
|
||||
|
||||
?>
|
||||
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Menu</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="menu.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<table border=0 cellpadding=0 cellspacing=0>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$tab_res = mysql_list_tables($dataname, $db);
|
||||
while ($tab_rows = mysql_fetch_row($tab_res))
|
||||
//echo "<tr><td>$tab_rows[0]</td></tr>";
|
||||
echo "<tr><td><a href=elenco.php?tbl=$tab_rows[0] target=destra>$tab_rows[0]</a></td></tr>";
|
||||
|
||||
echo "<tr><td><hr size=3></td></tr>";
|
||||
echo "<tr><td><a href=assegna.php target=destra>Assegna Corsi</a></td></tr>";
|
||||
echo "<tr><td><a href=prove.php target=destra>Prove</a></td></tr>";
|
||||
echo "<tr><td><a href=presenze.php target=destra>Presenze</a></td></tr>";
|
||||
//echo "<tr><td><a href=variabili.php target=destra>Variabili</a></td></tr>";
|
||||
echo "<tr><td><hr size=3></td></tr>";
|
||||
echo "<tr><td><a href=tuttitest.php target=destra>Tutti i Test</a></td></tr>";
|
||||
|
||||
?>
|
||||
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,63 +1,63 @@
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (isset($nome))
|
||||
{
|
||||
$sql = "INSERT INTO $tbl_lezioni (idcorso, nome, progressivo, percorso) VALUES ("
|
||||
.$idcorso.",'"
|
||||
.$nome."',"
|
||||
.$progressivo.",'"
|
||||
.$immagine."')";
|
||||
//echo $sql;
|
||||
$ins = mysql_query($sql,$db);
|
||||
if ($ins)
|
||||
header ("location: tuttitest.php");
|
||||
//else
|
||||
//echo "<br><br><p class=error>Inserimento non effetttuato!</p><br><br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Test</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="3">
|
||||
</head>
|
||||
|
||||
<script language=javascript>
|
||||
function verifica()
|
||||
{
|
||||
esito = true;
|
||||
if (document.form1.nome.value == "") esito = false;
|
||||
if (document.form1.progressivo.value == "") esito = false;
|
||||
if (esito == false) alert('Dati inseriti non completi!');
|
||||
if (esito == true) document.form1.submit();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
echo "<form name=form1 action=n_lezione.php><table align=center>";
|
||||
echo "<tr><td><input type=text size=2 name=idcorso value=$idcorso></td></tr>";
|
||||
echo "<tr><td>Nome della lezione</td><td><input type=text name=nome value=$nome></td></tr>";
|
||||
echo "<tr><td>Progressivo</td><td><input type=text name=progressivo value=$progressivo></td></tr>";
|
||||
echo "<tr><td>Immagine</td><td><input type=file name=percorso></td></tr>";
|
||||
|
||||
echo "<tr><td> </td><td><input type=button class=bottoni value=Salva onclick='return verifica();'></td></tr>";
|
||||
|
||||
echo "</table></form>";
|
||||
|
||||
|
||||
echo "</body></html>";
|
||||
|
||||
}
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (isset($nome))
|
||||
{
|
||||
$sql = "INSERT INTO $tbl_lezioni (idcorso, nome, progressivo, percorso) VALUES ("
|
||||
.$idcorso.",'"
|
||||
.$nome."',"
|
||||
.$progressivo.",'"
|
||||
.$immagine."')";
|
||||
//echo $sql;
|
||||
$ins = mysql_query($sql,$db);
|
||||
if ($ins)
|
||||
header ("location: tuttitest.php");
|
||||
//else
|
||||
//echo "<br><br><p class=error>Inserimento non effetttuato!</p><br><br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Test</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="3">
|
||||
</head>
|
||||
|
||||
<script language=javascript>
|
||||
function verifica()
|
||||
{
|
||||
esito = true;
|
||||
if (document.form1.nome.value == "") esito = false;
|
||||
if (document.form1.progressivo.value == "") esito = false;
|
||||
if (esito == false) alert('Dati inseriti non completi!');
|
||||
if (esito == true) document.form1.submit();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
echo "<form name=form1 action=n_lezione.php><table align=center>";
|
||||
echo "<tr><td><input type=text size=2 name=idcorso value=$idcorso></td></tr>";
|
||||
echo "<tr><td>Nome della lezione</td><td><input type=text name=nome value=$nome></td></tr>";
|
||||
echo "<tr><td>Progressivo</td><td><input type=text name=progressivo value=$progressivo></td></tr>";
|
||||
echo "<tr><td>Immagine</td><td><input type=file name=percorso></td></tr>";
|
||||
|
||||
echo "<tr><td> </td><td><input type=button class=bottoni value=Salva onclick='return verifica();'></td></tr>";
|
||||
|
||||
echo "</table></form>";
|
||||
|
||||
|
||||
echo "</body></html>";
|
||||
|
||||
}
|
||||
|
@ -1,119 +1,119 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<script language="JavaScript">
|
||||
function filtro()
|
||||
{
|
||||
document.form1.submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
echo "<form name=form1 action=presenze.php method=post>";
|
||||
|
||||
echo "<p class=titolo><b>Presenze</b><br></p>";
|
||||
|
||||
$criteri = "SELECT * FROM $tbl_utenti ORDER BY cognome, nome";
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<center><select name=utente onchange='filtro();'>";
|
||||
echo "<option value=9000>Tutti gli utenti</option>";
|
||||
do
|
||||
{
|
||||
$nominativo = $myrow["cognome"]." ".$myrow["nome"];
|
||||
if (isset ($utente) && $myrow[id] == $utente)
|
||||
echo "<option value=$myrow[id] selected>$nominativo</option>";
|
||||
else
|
||||
echo "<option value=$myrow[id]>$nominativo</option>";
|
||||
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</select></center>";
|
||||
}
|
||||
|
||||
echo "</form>";
|
||||
|
||||
|
||||
echo "<table align=center border=1>";
|
||||
|
||||
$criteri = "SELECT $tbl_utenti.cognome, $tbl_utenti.nome, $tbl_utenti.id, $tbl_corsi.nome as corso ";
|
||||
$criteri .= "FROM $tbl_utenti LEFT JOIN $tbl_corsi ON $tbl_utenti.idcorso = $tbl_corsi.id ";
|
||||
if (isset ($utente) && ($utente != 9000))
|
||||
$criteri .= " WHERE $tbl_utenti.id = $utente ORDER BY $tbl_utenti.cognome, $tbl_utenti.nome";
|
||||
elseif ($utente = 9000)
|
||||
$criteri .= " ORDER BY $tbl_utenti.cognome, $tbl_utenti.nome";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
echo "<tr><td>";
|
||||
$nominativo = $myrow["cognome"]." ".$myrow["nome"];
|
||||
echo "<br><p class=titolo>$nominativo<br><i>".$myrow["corso"]."</i></p>";
|
||||
$criteri1 = "SELECT * FROM $tbl_accessi WHERE (idutente = ".$myrow["id"].") ORDER BY login, logout";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
echo "<table align=center cellpadding=2 cellspacing=1><tr><th>Login</th><th>Logout</th><th>Differenza</th><th>Descrizione</th></tr>";
|
||||
$c = 0;
|
||||
do
|
||||
{
|
||||
$tempo = differenza($myrow1["login"], $myrow1["logout"]);
|
||||
$tot = somma_tempo($tot, $tempo);
|
||||
$login = substr($myrow1["login"], 8,2) ."/". substr($myrow1["login"], 5,2) ."/" .substr($myrow1["login"], 0,4)." ".substr($myrow1["login"], 11);
|
||||
$logout = substr($myrow1["logout"], 8,2) ."/". substr($myrow1["logout"], 5,2) ."/" .substr($myrow1["logout"], 0,4)." ".substr($myrow1["logout"], 11);
|
||||
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr class=chiaro><td>".$login."</td><td>".$logout."</td><td>".$tempo."</td><td>".$myrow1["descrizione"]."</td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr class=scuro><td>".$login."</td><td>".$logout."</td><td>".$tempo."</td><td>".$myrow1["descrizione"]."</td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
$c++;
|
||||
}while ($myrow1 = mysql_fetch_array($result1));
|
||||
//echo $c;
|
||||
//echo $ris;
|
||||
//echo "<tr><td colspan=3><br></td></tr><tr><td colspan=3 align=center>Media risultati: $media/100</td></tr>";
|
||||
if ($c != 0) echo "<tr><td colspan=4><br></td></tr><tr><td colspan=4 align=center><b>$c</b> accessi - tempo totale <b>$tot</b></td></tr>";
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<p class=error>Nessun accesso trovato!</p><br>";
|
||||
}
|
||||
echo "</td></tr>";
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>Nessun utente trovato!</p><br><br>";
|
||||
|
||||
|
||||
//echo "<p><br></p><p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<script language="JavaScript">
|
||||
function filtro()
|
||||
{
|
||||
document.form1.submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
echo "<form name=form1 action=presenze.php method=post>";
|
||||
|
||||
echo "<p class=titolo><b>Presenze</b><br></p>";
|
||||
|
||||
$criteri = "SELECT * FROM $tbl_utenti ORDER BY cognome, nome";
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<center><select name=utente onchange='filtro();'>";
|
||||
echo "<option value=9000>Tutti gli utenti</option>";
|
||||
do
|
||||
{
|
||||
$nominativo = $myrow["cognome"]." ".$myrow["nome"];
|
||||
if (isset ($utente) && $myrow[id] == $utente)
|
||||
echo "<option value=$myrow[id] selected>$nominativo</option>";
|
||||
else
|
||||
echo "<option value=$myrow[id]>$nominativo</option>";
|
||||
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</select></center>";
|
||||
}
|
||||
|
||||
echo "</form>";
|
||||
|
||||
|
||||
echo "<table align=center border=1>";
|
||||
|
||||
$criteri = "SELECT $tbl_utenti.cognome, $tbl_utenti.nome, $tbl_utenti.id, $tbl_corsi.nome as corso ";
|
||||
$criteri .= "FROM $tbl_utenti LEFT JOIN $tbl_corsi ON $tbl_utenti.idcorso = $tbl_corsi.id ";
|
||||
if (isset ($utente) && ($utente != 9000))
|
||||
$criteri .= " WHERE $tbl_utenti.id = $utente ORDER BY $tbl_utenti.cognome, $tbl_utenti.nome";
|
||||
elseif ($utente = 9000)
|
||||
$criteri .= " ORDER BY $tbl_utenti.cognome, $tbl_utenti.nome";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
echo "<tr><td>";
|
||||
$nominativo = $myrow["cognome"]." ".$myrow["nome"];
|
||||
echo "<br><p class=titolo>$nominativo<br><i>".$myrow["corso"]."</i></p>";
|
||||
$criteri1 = "SELECT * FROM $tbl_accessi WHERE (idutente = ".$myrow["id"].") ORDER BY login, logout";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
echo "<table align=center cellpadding=2 cellspacing=1><tr><th>Login</th><th>Logout</th><th>Differenza</th><th>Descrizione</th></tr>";
|
||||
$c = 0;
|
||||
do
|
||||
{
|
||||
$tempo = differenza($myrow1["login"], $myrow1["logout"]);
|
||||
$tot = somma_tempo($tot, $tempo);
|
||||
$login = substr($myrow1["login"], 8,2) ."/". substr($myrow1["login"], 5,2) ."/" .substr($myrow1["login"], 0,4)." ".substr($myrow1["login"], 11);
|
||||
$logout = substr($myrow1["logout"], 8,2) ."/". substr($myrow1["logout"], 5,2) ."/" .substr($myrow1["logout"], 0,4)." ".substr($myrow1["logout"], 11);
|
||||
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr class=chiaro><td>".$login."</td><td>".$logout."</td><td>".$tempo."</td><td>".$myrow1["descrizione"]."</td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr class=scuro><td>".$login."</td><td>".$logout."</td><td>".$tempo."</td><td>".$myrow1["descrizione"]."</td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
$c++;
|
||||
}while ($myrow1 = mysql_fetch_array($result1));
|
||||
//echo $c;
|
||||
//echo $ris;
|
||||
//echo "<tr><td colspan=3><br></td></tr><tr><td colspan=3 align=center>Media risultati: $media/100</td></tr>";
|
||||
if ($c != 0) echo "<tr><td colspan=4><br></td></tr><tr><td colspan=4 align=center><b>$c</b> accessi - tempo totale <b>$tot</b></td></tr>";
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<p class=error>Nessun accesso trovato!</p><br>";
|
||||
}
|
||||
echo "</td></tr>";
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>Nessun utente trovato!</p><br><br>";
|
||||
|
||||
|
||||
//echo "<p><br></p><p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,125 +1,125 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<script language="JavaScript">
|
||||
function filtro()
|
||||
{
|
||||
document.form1.submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
echo "<form name=form1 action=prove.php method=post>";
|
||||
|
||||
echo "<p class=titolo><b>Prove</b><br></p>";
|
||||
|
||||
$criteri = "SELECT * FROM $tbl_utenti ORDER BY cognome, nome";
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<center><select name=utente onchange='filtro();'>";
|
||||
echo "<option value=9000>Tutti gli utenti</option>";
|
||||
do
|
||||
{
|
||||
$nominativo = $myrow["cognome"]." ".$myrow["nome"];
|
||||
if (isset ($utente) && $myrow[id] == $utente)
|
||||
echo "<option value=$myrow[id] selected>$nominativo</option>";
|
||||
else
|
||||
echo "<option value=$myrow[id]>$nominativo</option>";
|
||||
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</select></center>";
|
||||
}
|
||||
|
||||
echo "</form>";
|
||||
|
||||
|
||||
echo "<table align=center border=1>";
|
||||
|
||||
$criteri = "SELECT $tbl_utenti.cognome, $tbl_utenti.nome, $tbl_utenti.id, $tbl_corsi.nome as corso ";
|
||||
$criteri .= "FROM $tbl_utenti LEFT JOIN $tbl_corsi ON $tbl_utenti.idcorso = $tbl_corsi.id ";
|
||||
if (isset ($utente) && ($utente != 9000))
|
||||
$criteri .= " WHERE $tbl_utenti.id = $utente ORDER BY $tbl_utenti.cognome, $tbl_utenti.nome";
|
||||
elseif ($utente = 9000)
|
||||
$criteri .= " ORDER BY $tbl_utenti.cognome, $tbl_utenti.nome";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
echo "<tr><td>";
|
||||
$nominativo = $myrow["cognome"]." ".$myrow["nome"];
|
||||
echo "<br><p class=titolo>$nominativo<br><i>".$myrow["corso"]."</i></p>";
|
||||
$criteri1 = "SELECT * FROM $tbl_prove LEFT JOIN $tbl_test ON $tbl_prove.idtest = $tbl_test.id WHERE (idutente = ".$myrow["id"].") ORDER BY data";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
echo "<table align=center cellpadding=2 cellspacing=1><tr><th>Data</th><th>Test</th><th>Risultato</th></tr>";
|
||||
$c = 0;
|
||||
$ris = 0;
|
||||
do
|
||||
{
|
||||
$data = substr($myrow1["data"], 8,2) ."/". substr($myrow1["data"], 5,2) ."/" .substr($myrow1["data"], 0,4);
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr class=chiaro><td>".$data."</td><td>".$myrow1["nome"]."</td><td>".$myrow1["risultato"]."</td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr class=scuro><td>".$data."</td><td>".$myrow1["nome"]."</td><td>".$myrow1["risultato"]."</td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
$ris = $ris + $myrow1[risultato];
|
||||
if ($myrow1["risultato"] != "consegnato in bianco") $c++;
|
||||
}while ($myrow1 = mysql_fetch_array($result1));
|
||||
//echo $c;
|
||||
//echo $ris;
|
||||
if ($c == 0)
|
||||
$media = 0;
|
||||
else
|
||||
{
|
||||
if (($ris != 0) && ($c > 0))
|
||||
$media = $ris/($c);
|
||||
else
|
||||
$media = 0;
|
||||
}
|
||||
//echo "<tr><td colspan=3><br></td></tr><tr><td colspan=3 align=center>Media risultati: $media/100</td></tr>";
|
||||
echo "<tr><td colspan=3><br></td></tr><tr><td colspan=3 align=center>Media risultati: <b>$media</b></td></tr>";
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<p class=error>Nessuna prova trovata!</p><br>";
|
||||
}
|
||||
echo "</td></tr>";
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>Nessun utente trovato!</p><br><br>";
|
||||
|
||||
|
||||
//echo "<p><br></p><p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<script language="JavaScript">
|
||||
function filtro()
|
||||
{
|
||||
document.form1.submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
echo "<form name=form1 action=prove.php method=post>";
|
||||
|
||||
echo "<p class=titolo><b>Prove</b><br></p>";
|
||||
|
||||
$criteri = "SELECT * FROM $tbl_utenti ORDER BY cognome, nome";
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<center><select name=utente onchange='filtro();'>";
|
||||
echo "<option value=9000>Tutti gli utenti</option>";
|
||||
do
|
||||
{
|
||||
$nominativo = $myrow["cognome"]." ".$myrow["nome"];
|
||||
if (isset ($utente) && $myrow[id] == $utente)
|
||||
echo "<option value=$myrow[id] selected>$nominativo</option>";
|
||||
else
|
||||
echo "<option value=$myrow[id]>$nominativo</option>";
|
||||
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</select></center>";
|
||||
}
|
||||
|
||||
echo "</form>";
|
||||
|
||||
|
||||
echo "<table align=center border=1>";
|
||||
|
||||
$criteri = "SELECT $tbl_utenti.cognome, $tbl_utenti.nome, $tbl_utenti.id, $tbl_corsi.nome as corso ";
|
||||
$criteri .= "FROM $tbl_utenti LEFT JOIN $tbl_corsi ON $tbl_utenti.idcorso = $tbl_corsi.id ";
|
||||
if (isset ($utente) && ($utente != 9000))
|
||||
$criteri .= " WHERE $tbl_utenti.id = $utente ORDER BY $tbl_utenti.cognome, $tbl_utenti.nome";
|
||||
elseif ($utente = 9000)
|
||||
$criteri .= " ORDER BY $tbl_utenti.cognome, $tbl_utenti.nome";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
echo "<tr><td>";
|
||||
$nominativo = $myrow["cognome"]." ".$myrow["nome"];
|
||||
echo "<br><p class=titolo>$nominativo<br><i>".$myrow["corso"]."</i></p>";
|
||||
$criteri1 = "SELECT * FROM $tbl_prove LEFT JOIN $tbl_test ON $tbl_prove.idtest = $tbl_test.id WHERE (idutente = ".$myrow["id"].") ORDER BY data";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
echo "<table align=center cellpadding=2 cellspacing=1><tr><th>Data</th><th>Test</th><th>Risultato</th></tr>";
|
||||
$c = 0;
|
||||
$ris = 0;
|
||||
do
|
||||
{
|
||||
$data = substr($myrow1["data"], 8,2) ."/". substr($myrow1["data"], 5,2) ."/" .substr($myrow1["data"], 0,4);
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr class=chiaro><td>".$data."</td><td>".$myrow1["nome"]."</td><td>".$myrow1["risultato"]."</td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr class=scuro><td>".$data."</td><td>".$myrow1["nome"]."</td><td>".$myrow1["risultato"]."</td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
$ris = $ris + $myrow1[risultato];
|
||||
if ($myrow1["risultato"] != "consegnato in bianco") $c++;
|
||||
}while ($myrow1 = mysql_fetch_array($result1));
|
||||
//echo $c;
|
||||
//echo $ris;
|
||||
if ($c == 0)
|
||||
$media = 0;
|
||||
else
|
||||
{
|
||||
if (($ris != 0) && ($c > 0))
|
||||
$media = $ris/($c);
|
||||
else
|
||||
$media = 0;
|
||||
}
|
||||
//echo "<tr><td colspan=3><br></td></tr><tr><td colspan=3 align=center>Media risultati: $media/100</td></tr>";
|
||||
echo "<tr><td colspan=3><br></td></tr><tr><td colspan=3 align=center>Media risultati: <b>$media</b></td></tr>";
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<p class=error>Nessuna prova trovata!</p><br>";
|
||||
}
|
||||
echo "</td></tr>";
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>Nessun utente trovato!</p><br><br>";
|
||||
|
||||
|
||||
//echo "<p><br></p><p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,34 +1,34 @@
|
||||
<?php
|
||||
|
||||
$ip = "localhost";
|
||||
$user = "root";
|
||||
$password = "";
|
||||
$dataname = "corsi";
|
||||
|
||||
|
||||
//$test_prima = "Falso"; // Impostato su Vero indica che e' presente anche il test prima del download di una lezione.
|
||||
$test_prima = "Falso"; // Impostato su Vero indica che e' presente anche il test prima del download di una lezione.
|
||||
|
||||
|
||||
// Costanti di controllo
|
||||
$s_vero = "Vero";
|
||||
$s_falso = "Falso";
|
||||
$s_prima = "Prima";
|
||||
$s_dopo = "Dopo";
|
||||
$s_inizio = "Inizio";
|
||||
$s_fine = "Fine";
|
||||
|
||||
|
||||
// Nomi delle tabelle nel database
|
||||
$tbl_accessi = "accessi";
|
||||
$tbl_corsi = "corsi";
|
||||
$tbl_domande = "domande";
|
||||
$tbl_download = "download";
|
||||
$tbl_lezioni = "lezioni";
|
||||
$tbl_prove = "prove";
|
||||
$tbl_risposte = "risposte";
|
||||
$tbl_test = "test";
|
||||
$tbl_utenti = "utenti";
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$ip = "localhost";
|
||||
$user = "root";
|
||||
$password = "";
|
||||
$dataname = "corsi";
|
||||
|
||||
|
||||
//$test_prima = "Falso"; // Impostato su Vero indica che e' presente anche il test prima del download di una lezione.
|
||||
$test_prima = "Falso"; // Impostato su Vero indica che e' presente anche il test prima del download di una lezione.
|
||||
|
||||
|
||||
// Costanti di controllo
|
||||
$s_vero = "Vero";
|
||||
$s_falso = "Falso";
|
||||
$s_prima = "Prima";
|
||||
$s_dopo = "Dopo";
|
||||
$s_inizio = "Inizio";
|
||||
$s_fine = "Fine";
|
||||
|
||||
|
||||
// Nomi delle tabelle nel database
|
||||
$tbl_accessi = "accessi";
|
||||
$tbl_corsi = "corsi";
|
||||
$tbl_domande = "domande";
|
||||
$tbl_download = "download";
|
||||
$tbl_lezioni = "lezioni";
|
||||
$tbl_prove = "prove";
|
||||
$tbl_risposte = "risposte";
|
||||
$tbl_test = "test";
|
||||
$tbl_utenti = "utenti";
|
||||
|
||||
|
||||
?>
|
@ -1,34 +1,34 @@
|
||||
body{background-color:#fafafa;}
|
||||
|
||||
p{font-family:Arial; font-size:12pt; text-align:center;}
|
||||
p.titolo{font-family:Arial; font-size:12pt; text-align:center; color:#006699}
|
||||
p.error{font-family:Garamond; font-size:12pt; color:red; font-weight:900; text-align:center;}
|
||||
p.success{font-family:Garamond; font-size:12pt; color:#0099ff; font-weight:900; text-align:center;}
|
||||
|
||||
tr.chiaro{background-color:#d7d7d7;}
|
||||
tr.scuro{background-color:#bcbcbc;}
|
||||
|
||||
th{font-family:Arial; font-size:10pt; background-color:#5a5a5a; color:white;}
|
||||
|
||||
td{font-family:Arial; font-size:9pt;}
|
||||
|
||||
td.corso{font-size:11pt; font-weight:bold}
|
||||
td.lezione{font-size:11pt;}
|
||||
td.test{font-size:9pt;}
|
||||
|
||||
td.grande{font-family:Arial; font-size:48pt; color:#707070;}
|
||||
td.titolo{font-family:Arial; font-size:12pt;}
|
||||
td.menu{font-family:Arial; font-size:9pt; font-weight:bold; text-align:center; color:white;}
|
||||
td.menug{font-family:Arial; font-size:12pt; font-weight:bold; text-align:center; color:Navy;}
|
||||
|
||||
input{font-family:Arial; font-size:9pt; font-weight:bold;}
|
||||
input.bottoni{font-family:Tahoma; font-size:9pt; font-weight:bold;}
|
||||
|
||||
A:visited{color:blue; text-decoration:none;}
|
||||
/*A:active{color:blue; text-decoration:none;}*/
|
||||
A:link{color:blue; text-decoration:none;}
|
||||
A:hover{color:red; text-decoration:underline;}
|
||||
|
||||
option.rosso{color:red}
|
||||
|
||||
|
||||
body{background-color:#fafafa;}
|
||||
|
||||
p{font-family:Arial; font-size:12pt; text-align:center;}
|
||||
p.titolo{font-family:Arial; font-size:12pt; text-align:center; color:#006699}
|
||||
p.error{font-family:Garamond; font-size:12pt; color:red; font-weight:900; text-align:center;}
|
||||
p.success{font-family:Garamond; font-size:12pt; color:#0099ff; font-weight:900; text-align:center;}
|
||||
|
||||
tr.chiaro{background-color:#d7d7d7;}
|
||||
tr.scuro{background-color:#bcbcbc;}
|
||||
|
||||
th{font-family:Arial; font-size:10pt; background-color:#5a5a5a; color:white;}
|
||||
|
||||
td{font-family:Arial; font-size:9pt;}
|
||||
|
||||
td.corso{font-size:11pt; font-weight:bold}
|
||||
td.lezione{font-size:11pt;}
|
||||
td.test{font-size:9pt;}
|
||||
|
||||
td.grande{font-family:Arial; font-size:48pt; color:#707070;}
|
||||
td.titolo{font-family:Arial; font-size:12pt;}
|
||||
td.menu{font-family:Arial; font-size:9pt; font-weight:bold; text-align:center; color:white;}
|
||||
td.menug{font-family:Arial; font-size:12pt; font-weight:bold; text-align:center; color:Navy;}
|
||||
|
||||
input{font-family:Arial; font-size:9pt; font-weight:bold;}
|
||||
input.bottoni{font-family:Tahoma; font-size:9pt; font-weight:bold;}
|
||||
|
||||
A:visited{color:blue; text-decoration:none;}
|
||||
/*A:active{color:blue; text-decoration:none;}*/
|
||||
A:link{color:blue; text-decoration:none;}
|
||||
A:hover{color:red; text-decoration:underline;}
|
||||
|
||||
option.rosso{color:red}
|
||||
|
||||
|
||||
|
@ -1,157 +1,166 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Test</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="3">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (isset($test))
|
||||
{
|
||||
$criteri = "SELECT $tbl_test.nome, $tbl_domande.idtest, $tbl_domande.domanda, $tbl_domande.id ";
|
||||
$criteri .= "FROM $tbl_test LEFT JOIN $tbl_domande ON $tbl_test.id = $tbl_domande.idtest WHERE ($tbl_domande.idtest = $test)";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<p>".$myrow[nome]."</p>";
|
||||
echo "<form name=form1 action=verifica.php target=destra method=post>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#BF210B><td height=25><font color=white>$n) $myrow[domanda]</font></td></tr>";
|
||||
$criteri1 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow[id]) ";
|
||||
//echo $criteri01;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr class=chiaro><td><input type=checkbox name='scelte[]' value=$myrow1[id]>$myrow1[risposta]<br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr class=scuro><td><input type=checkbox name='scelte[]' value=$myrow1[id]>$myrow1[risposta]<br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow1 = mysql_fetch_array($result1));
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "<tr><td><input type=hidden name=test value=$test><input type=hidden name=verifica></td></tr>";
|
||||
echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni> <input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for($x = 1; $x < 2; $x++)
|
||||
$spazi1 = $spazi1." ";
|
||||
$spazi2 = $spazi1.$spazi1;
|
||||
|
||||
$criteri2 = "SELECT * FROM $tbl_corsi ORDER BY nome";
|
||||
$result2 = mysql_query($criteri2, $db);
|
||||
if ($myrow2 = mysql_fetch_array($result2))
|
||||
{
|
||||
//echo "<table align=center CELLSPACING=0 CELLPADDING=0 BORDER=0>";
|
||||
do
|
||||
{
|
||||
$criterix = "SELECT * FROM $tbl_lezioni LEFT JOIN $tbl_corsi ON $tbl_lezioni.idcorso = $tbl_corsi.id WHERE ($tbl_corsi.id = ".$myrow2["id"].")";
|
||||
$resultx = mysql_query($criterix, $db);
|
||||
$numx = mysql_num_rows($resultx);
|
||||
if ($numx == 0)
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=corso><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><IMG SRC=images/n.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=corso>$spazi1".$myrow2["nome"]."</TD></TR></TABLE>";
|
||||
//echo "<form action=n_lezione.php><tr><td class=corso>".$myrow2["nome"]."<input type=text size=2 name=idcorso value=".$myrow2["id"]."><input type=submit name=n_lezione value='Aggiungi lezione'></form></td></tr>";
|
||||
//echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=corso><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><IMG SRC=images/n.gif WIDTH=9 HEIGHT=21 BORDER=0></td><form action=n_lezione.php><td class=corso>".$myrow2["nome"]."<input type=text size=2 name=idcorso value=".$myrow2["id"]."><input type=submit name=n_lezione value='Aggiungi lezione'></form></td></tr></TABLE>";
|
||||
else
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=corso><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><IMG SRC=images/m.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=corso>$spazi1".$myrow2["nome"]."</TD></TR></TABLE>";
|
||||
//echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=corso><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><IMG SRC=images/m.gif WIDTH=9 HEIGHT=21 BORDER=0></td><form action=n_lezione.php><td class=corso>".$myrow2["nome"]."<input type=text size=2 name=idcorso value=".$myrow2["id"]."><input type=submit name=n_lezione value='Aggiungi lezione'></form></td></tr></TABLE>";
|
||||
$criteri3 = "SELECT * FROM $tbl_lezioni WHERE (idcorso = ".$myrow2["id"].")";
|
||||
$result3 = mysql_query($criteri3, $db);
|
||||
$num_lez = mysql_num_rows($result3);
|
||||
if ($myrow3 = mysql_fetch_array($result3))
|
||||
{
|
||||
$c = 1;
|
||||
//echo $num_lez;
|
||||
do
|
||||
{
|
||||
$criteriy = "SELECT * FROM $tbl_test LEFT JOIN $tbl_lezioni ON $tbl_test.idlezione = $tbl_lezioni.id WHERE ($tbl_lezioni.id = ".$myrow3["id"].")";
|
||||
$resulty = mysql_query($criteriy, $db);
|
||||
$numy = mysql_num_rows($resulty);
|
||||
if ($numy == 0)
|
||||
{
|
||||
if ($c == $num_lez)
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=lezione><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><img src='images/l.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/n.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=lezione>$spazi1".$myrow3["nome"]."</TD></TR></TABLE>";
|
||||
else
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=lezione><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><img src='images/t.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/n.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=lezione>$spazi1".$myrow3["nome"]."</TD></TR></TABLE>";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($c == $num_lez)
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=lezione><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><img src='images/l.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/m.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=lezione>$spazi1".$myrow3["nome"]."</TD></TR></TABLE>";
|
||||
else
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=lezione><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><img src='images/t.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/m.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=lezione>$spazi1".$myrow3["nome"]."</TD></TR></TABLE>";
|
||||
}
|
||||
$criteri4 = "SELECT * FROM $tbl_test WHERE (idlezione = ".$myrow3["id"].")";
|
||||
$result4 = mysql_query($criteri4, $db);
|
||||
$num_test = mysql_num_rows($result4);
|
||||
if ($myrow4 = mysql_fetch_array($result4))
|
||||
{
|
||||
$c1 = 1;
|
||||
//echo $num_test;
|
||||
do
|
||||
{
|
||||
if ($c == $num_lez)
|
||||
{
|
||||
if ($c1 == $num_test)
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=test><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><IMG SRC=images/trans.gif WIDTH=12 HEIGHT=21 BORDER=0><img src='images/l.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/c.gif WIDTH=5 HEIGHT=21 BORDER=0></TD><TD class=test>$spazi1<a href=tuttitest.php?test=$myrow4[id] target=destra>".$myrow4["nome"]."</a></TD></TR></TABLE>";
|
||||
else
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=test><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><IMG SRC=images/trans.gif WIDTH=12 HEIGHT=21 BORDER=0><img src='images/t.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/c.gif WIDTH=5 HEIGHT=21 BORDER=0></TD><TD class=test>$spazi1<a href=tuttitest.php?test=$myrow4[id] target=destra>".$myrow4["nome"]."</a></TD></TR></TABLE>";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($c1 == $num_test)
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=test><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><img src='images/i.gif' border=0 WIDTH=12 HEIGHT=21><img src='images/l.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/c.gif WIDTH=5 HEIGHT=21 BORDER=0></TD><TD class=test>$spazi1<a href=tuttitest.php?test=$myrow4[id] target=destra>".$myrow4["nome"]."</a></TD></TR></TABLE>";
|
||||
else
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=test><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><IMG SRC=images/i.gif WIDTH=12 HEIGHT=21 BORDER=0><img src='images/t.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/c.gif WIDTH=5 HEIGHT=21 BORDER=0></TD><TD class=test>$spazi1<a href=tuttitest.php?test=$myrow4[id] target=destra>".$myrow4["nome"]."</a></TD></TR></TABLE>";
|
||||
}
|
||||
$c1++;
|
||||
}while ($myrow4 = mysql_fetch_array($result4));
|
||||
}
|
||||
$c++;
|
||||
}while ($myrow3 = mysql_fetch_array($result3));
|
||||
}
|
||||
}while ($myrow2 = mysql_fetch_array($result2));
|
||||
//echo "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun test trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
|
||||
//echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
echo "<p><a href=$PHP_SELF target=destra>Torna</a></p>";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="3">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (isset($test))
|
||||
{
|
||||
$criteri = "SELECT $tbl_test.nome, $tbl_domande.idtest, $tbl_domande.domanda, $tbl_domande.id ";
|
||||
$criteri .= "FROM $tbl_test LEFT JOIN $tbl_domande ON $tbl_test.id = $tbl_domande.idtest WHERE ($tbl_domande.idtest = $test)";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<p>".$myrow[nome]."</p>";
|
||||
echo "<form name=form1 action=verifica.php target=destra method=post>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#BF210B><td height=25><font color=white>$n) $myrow[domanda]</font></td></tr>";
|
||||
$criteri1 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow[id]) ";
|
||||
//echo $criteri01;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr class=chiaro><td><input type=checkbox name='scelte[]' value=$myrow1[id]>$myrow1[risposta]<br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr class=scuro><td><input type=checkbox name='scelte[]' value=$myrow1[id]>$myrow1[risposta]<br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow1 = mysql_fetch_array($result1));
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "<tr><td><input type=hidden name=test value=$test><input type=hidden name=verifica></td></tr>";
|
||||
echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni> <input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for($x = 1; $x < 2; $x++)
|
||||
$spazi1 = $spazi1." ";
|
||||
$spazi2 = $spazi1.$spazi1;
|
||||
|
||||
$criteri2 = "SELECT * FROM $tbl_corsi ORDER BY nome";
|
||||
$result2 = mysql_query($criteri2, $db);
|
||||
if ($myrow2 = mysql_fetch_array($result2))
|
||||
{
|
||||
//echo "<table align=center CELLSPACING=0 CELLPADDING=0 BORDER=0>";
|
||||
do
|
||||
{
|
||||
$criterix = "SELECT * FROM $tbl_lezioni LEFT JOIN $tbl_corsi ON $tbl_lezioni.idcorso = $tbl_corsi.id WHERE ($tbl_corsi.id = ".$myrow2["id"].")";
|
||||
$resultx = mysql_query($criterix, $db);
|
||||
$numx = mysql_num_rows($resultx);
|
||||
if ($numx == 0)
|
||||
//echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=corso><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><IMG SRC=images/n.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=corso>$spazi1".$myrow2["nome"]."</TD></TR></TABLE>";
|
||||
//echo "<form action=n_lezione.php><tr><td class=corso>".$myrow2["nome"]."<input type=text size=2 name=idcorso value=".$myrow2["id"]."><input type=submit name=n_lezione value='Aggiungi lezione'></form></td></tr>";
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=corso><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><IMG SRC=images/n.gif WIDTH=9 HEIGHT=21 BORDER=0></td><form action=n_lezione.php><td class=corso>".$myrow2["nome"]."<input type=hidden size=2 name=idcorso value=".$myrow2["id"]."><input type=image src=images/n.gif name=n_lezione value='Aggiungi lezione'></form></td></tr></TABLE>";
|
||||
else
|
||||
//echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=corso><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><IMG SRC=images/m.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=corso>$spazi1".$myrow2["nome"]."</TD></TR></TABLE>";
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=corso><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><IMG SRC=images/m.gif WIDTH=9 HEIGHT=21 BORDER=0></td><form action=n_lezione.php><td class=corso>".$myrow2["nome"]."<input type=hidden size=2 name=idcorso value=".$myrow2["id"]."><input type=submit name=n_lezione value='Aggiungi lezione'></form></td></tr></TABLE>";
|
||||
$criteri3 = "SELECT * FROM $tbl_lezioni WHERE (idcorso = ".$myrow2["id"].")";
|
||||
$result3 = mysql_query($criteri3, $db);
|
||||
$num_lez = mysql_num_rows($result3);
|
||||
if ($myrow3 = mysql_fetch_array($result3))
|
||||
{
|
||||
$c = 1;
|
||||
//echo $num_lez;
|
||||
do
|
||||
{
|
||||
$criteriy = "SELECT * FROM $tbl_test LEFT JOIN $tbl_lezioni ON $tbl_test.idlezione = $tbl_lezioni.id WHERE ($tbl_lezioni.id = ".$myrow3["id"].")";
|
||||
$resulty = mysql_query($criteriy, $db);
|
||||
$numy = mysql_num_rows($resulty);
|
||||
if ($myrow3["percorso"] == "" )
|
||||
$percorso = "tuttitest.php";
|
||||
else
|
||||
$percorso = $myrow3["percorso"];
|
||||
|
||||
if ($numy == 0)
|
||||
{
|
||||
if ($c == $num_lez)
|
||||
//echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=lezione><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><img src='images/l.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/n.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=lezione>$spazi1".$myrow3["nome"]."</TD></TR></TABLE>";
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=lezione><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><img src='images/l.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/n.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=lezione>$spazi1<a href='$percorso' target=destra>".$myrow3["nome"]."</a></TD></TR></TABLE>";
|
||||
else
|
||||
//echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=lezione><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><img src='images/t.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/n.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=lezione>$spazi1".$myrow3["nome"]."</TD></TR></TABLE>";
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=lezione><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><img src='images/t.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/n.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=lezione>$spazi1<a href='$percorso' target=destra>".$myrow3["nome"]."</a></TD></TR></TABLE>";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($c == $num_lez)
|
||||
//echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=lezione><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><img src='images/l.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/m.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=lezione>$spazi1".$myrow3["nome"]."</TD></TR></TABLE>";
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=lezione><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><img src='images/l.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/m.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=lezione>$spazi1<a href='$percorso' target=destra>".$myrow3["nome"]."</a></TD></TR></TABLE>";
|
||||
else
|
||||
//echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=lezione><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><img src='images/t.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/m.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=lezione>$spazi1".$myrow3["nome"]."</TD></TR></TABLE>";
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=lezione><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><img src='images/t.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/m.gif WIDTH=9 HEIGHT=21 BORDER=0></TD><TD class=lezione>$spazi1<a href='$percorso' target=destra>".$myrow3["nome"]."</a></TD></TR></TABLE>";
|
||||
}
|
||||
$criteri4 = "SELECT * FROM $tbl_test WHERE (idlezione = ".$myrow3["id"].")";
|
||||
$result4 = mysql_query($criteri4, $db);
|
||||
$num_test = mysql_num_rows($result4);
|
||||
if ($myrow4 = mysql_fetch_array($result4))
|
||||
{
|
||||
$c1 = 1;
|
||||
//echo $num_test;
|
||||
do
|
||||
{
|
||||
if ($c == $num_lez)
|
||||
{
|
||||
if ($c1 == $num_test)
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=test><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><IMG SRC=images/trans.gif WIDTH=12 HEIGHT=21 BORDER=0><img src='images/l.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/c.gif WIDTH=5 HEIGHT=21 BORDER=0></TD><TD class=test>$spazi1<a href=tuttitest.php?test=$myrow4[id] target=destra>".$myrow4["nome"]."</a></TD></TR></TABLE>";
|
||||
else
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=test><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><IMG SRC=images/trans.gif WIDTH=12 HEIGHT=21 BORDER=0><img src='images/t.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/c.gif WIDTH=5 HEIGHT=21 BORDER=0></TD><TD class=test>$spazi1<a href=tuttitest.php?test=$myrow4[id] target=destra>".$myrow4["nome"]."</a></TD></TR></TABLE>";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($c1 == $num_test)
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=test><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><img src='images/i.gif' border=0 WIDTH=12 HEIGHT=21><img src='images/l.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/c.gif WIDTH=5 HEIGHT=21 BORDER=0></TD><TD class=test>$spazi1<a href=tuttitest.php?test=$myrow4[id] target=destra>".$myrow4["nome"]."</a></TD></TR></TABLE>";
|
||||
else
|
||||
echo "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD class=test><IMG SRC=images/trans.gif WIDTH=5 HEIGHT=21 BORDER=0><IMG SRC=images/i.gif WIDTH=12 HEIGHT=21 BORDER=0><img src='images/t.gif' border=0 WIDTH=12 HEIGHT=21><IMG SRC=images/c.gif WIDTH=5 HEIGHT=21 BORDER=0></TD><TD class=test>$spazi1<a href=tuttitest.php?test=$myrow4[id] target=destra>".$myrow4["nome"]."</a></TD></TR></TABLE>";
|
||||
}
|
||||
$c1++;
|
||||
}while ($myrow4 = mysql_fetch_array($result4));
|
||||
}
|
||||
$c++;
|
||||
}while ($myrow3 = mysql_fetch_array($result3));
|
||||
}
|
||||
}while ($myrow2 = mysql_fetch_array($result2));
|
||||
//echo "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun test trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
|
||||
//echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
echo "<p><a href=$PHP_SELF target=destra>Torna</a></p>";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,116 +1,116 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Test</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="3">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (isset($test)) // Visualizza il test da provare
|
||||
{
|
||||
$criteri = "SELECT $tbl_test.nome, $tbl_domande.idtest, $tbl_domande.domanda, $tbl_domande.id ";
|
||||
$criteri .= "FROM $tbl_test LEFT JOIN $tbl_domande ON $tbl_test.id = $tbl_domande.idtest WHERE ($tbl_domande.idtest = $test)";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<p>".$myrow[nome]."</p>";
|
||||
echo "<form name=form1 action=verifica.php target=destra method=post>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#BF210B><td height=25><font color=white>$n) $myrow[domanda]</font></td></tr>";
|
||||
$criteri1 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow[id]) ";
|
||||
//echo $criteri01;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr class=chiaro><td><input type=checkbox name='scelte[]' value=$myrow1[id]>$myrow1[risposta]<br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr class=scuro><td><input type=checkbox name='scelte[]' value=$myrow1[id]>$myrow1[risposta]<br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow1 = mysql_fetch_array($result1));
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "<tr><td><input type=hidden name=test value=$test><input type=hidden name=verifica></td></tr>";
|
||||
echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni> <input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
else // Visualizza lo schema dei corsi
|
||||
{
|
||||
//$criteri2 = "SELECT $tbl_corsi.nome as corso, $tbl_lezioni.nome as lezione, $tbl_test.nome as test ";
|
||||
//$criteri2 .= "FROM ($tbl_corsi LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso) LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione ";
|
||||
for($x = 0; $x < 10; $x++)
|
||||
$spazi1 = $spazi1." ";
|
||||
|
||||
$spazi2 = $spazi1.$spazi1;
|
||||
|
||||
$criteri2 = "SELECT * FROM $tbl_corsi ORDER BY nome";
|
||||
$result2 = mysql_query($criteri2, $db);
|
||||
if ($myrow2 = mysql_fetch_array($result2))
|
||||
{
|
||||
echo "<table border=0 align=center>";
|
||||
do
|
||||
{
|
||||
//echo "<tr><td class=corso>".$myrow2["nome"]."</td></tr>";
|
||||
echo "<form action=n_lezione.php><tr><td class=corso>".$myrow2["nome"]."<input type=text size=2 name=idcorso value=".$myrow2["id"]."><input type=submit name=n_lezione value='Aggiungi lezione'></form></td></tr>";
|
||||
$criteri3 = "SELECT * FROM $tbl_lezioni WHERE (idcorso = ".$myrow2["id"].")";
|
||||
$result3 = mysql_query($criteri3, $db);
|
||||
if ($myrow3 = mysql_fetch_array($result3))
|
||||
{
|
||||
do
|
||||
{
|
||||
echo "<tr><td class=lezione>$spazi1".$myrow3["nome"]."</td></tr>";
|
||||
$criteri4 = "SELECT * FROM $tbl_test WHERE (idlezione = ".$myrow3["id"].")";
|
||||
$result4 = mysql_query($criteri4, $db);
|
||||
if ($myrow4 = mysql_fetch_array($result4))
|
||||
{
|
||||
do
|
||||
{
|
||||
//echo "<tr class=chiaro><td><a href=tuttitest.php?test=$myrow4[id] target=destra>".$myrow4["nome"]."</a></td></tr>";
|
||||
echo "<tr class=test><td><a href=tuttitest.php?test=$myrow4[id] target=destra>$spazi2".$myrow4["nome"]."</a></td></tr>";
|
||||
}while ($myrow4 = mysql_fetch_array($result4));
|
||||
}
|
||||
}while ($myrow3 = mysql_fetch_array($result3));
|
||||
}
|
||||
}while ($myrow2 = mysql_fetch_array($result2));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun test trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
|
||||
//echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
echo "<p><a href=$PHP_SELF target=destra>Torna</a></p>";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="3">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (isset($test)) // Visualizza il test da provare
|
||||
{
|
||||
$criteri = "SELECT $tbl_test.nome, $tbl_domande.idtest, $tbl_domande.domanda, $tbl_domande.id ";
|
||||
$criteri .= "FROM $tbl_test LEFT JOIN $tbl_domande ON $tbl_test.id = $tbl_domande.idtest WHERE ($tbl_domande.idtest = $test)";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<p>".$myrow[nome]."</p>";
|
||||
echo "<form name=form1 action=verifica.php target=destra method=post>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#BF210B><td height=25><font color=white>$n) $myrow[domanda]</font></td></tr>";
|
||||
$criteri1 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow[id]) ";
|
||||
//echo $criteri01;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr class=chiaro><td><input type=checkbox name='scelte[]' value=$myrow1[id]>$myrow1[risposta]<br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr class=scuro><td><input type=checkbox name='scelte[]' value=$myrow1[id]>$myrow1[risposta]<br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow1 = mysql_fetch_array($result1));
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "<tr><td><input type=hidden name=test value=$test><input type=hidden name=verifica></td></tr>";
|
||||
echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni> <input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
else // Visualizza lo schema dei corsi
|
||||
{
|
||||
//$criteri2 = "SELECT $tbl_corsi.nome as corso, $tbl_lezioni.nome as lezione, $tbl_test.nome as test ";
|
||||
//$criteri2 .= "FROM ($tbl_corsi LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso) LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione ";
|
||||
for($x = 0; $x < 10; $x++)
|
||||
$spazi1 = $spazi1." ";
|
||||
|
||||
$spazi2 = $spazi1.$spazi1;
|
||||
|
||||
$criteri2 = "SELECT * FROM $tbl_corsi ORDER BY nome";
|
||||
$result2 = mysql_query($criteri2, $db);
|
||||
if ($myrow2 = mysql_fetch_array($result2))
|
||||
{
|
||||
echo "<table border=0 align=center>";
|
||||
do
|
||||
{
|
||||
//echo "<tr><td class=corso>".$myrow2["nome"]."</td></tr>";
|
||||
echo "<form action=n_lezione.php><tr><td class=corso>".$myrow2["nome"]."<input type=text size=2 name=idcorso value=".$myrow2["id"]."><input type=submit name=n_lezione value='Aggiungi lezione'></form></td></tr>";
|
||||
$criteri3 = "SELECT * FROM $tbl_lezioni WHERE (idcorso = ".$myrow2["id"].")";
|
||||
$result3 = mysql_query($criteri3, $db);
|
||||
if ($myrow3 = mysql_fetch_array($result3))
|
||||
{
|
||||
do
|
||||
{
|
||||
echo "<tr><td class=lezione>$spazi1".$myrow3["nome"]."</td></tr>";
|
||||
$criteri4 = "SELECT * FROM $tbl_test WHERE (idlezione = ".$myrow3["id"].")";
|
||||
$result4 = mysql_query($criteri4, $db);
|
||||
if ($myrow4 = mysql_fetch_array($result4))
|
||||
{
|
||||
do
|
||||
{
|
||||
//echo "<tr class=chiaro><td><a href=tuttitest.php?test=$myrow4[id] target=destra>".$myrow4["nome"]."</a></td></tr>";
|
||||
echo "<tr class=test><td><a href=tuttitest.php?test=$myrow4[id] target=destra>$spazi2".$myrow4["nome"]."</a></td></tr>";
|
||||
}while ($myrow4 = mysql_fetch_array($result4));
|
||||
}
|
||||
}while ($myrow3 = mysql_fetch_array($result3));
|
||||
}
|
||||
}while ($myrow2 = mysql_fetch_array($result2));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun test trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
|
||||
//echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
echo "<p><a href=$PHP_SELF target=destra>Torna</a></p>";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,115 +1,115 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Test</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="3">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (isset($test))
|
||||
{
|
||||
$criteri = "SELECT $tbl_test.nome, $tbl_domande.idtest, $tbl_domande.domanda, $tbl_domande.id ";
|
||||
$criteri .= "FROM $tbl_test LEFT JOIN $tbl_domande ON $tbl_test.id = $tbl_domande.idtest WHERE ($tbl_domande.idtest = $test)";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<p>".$myrow[nome]."</p>";
|
||||
echo "<form name=form1 action=verifica.php target=destra method=post>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#BF210B><td height=25><font color=white>$n) $myrow[domanda]</font></td></tr>";
|
||||
$criteri1 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow[id]) ";
|
||||
//echo $criteri01;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr class=chiaro><td><input type=checkbox name='scelte[]' value=$myrow1[id]>$myrow1[risposta]<br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr class=scuro><td><input type=checkbox name='scelte[]' value=$myrow1[id]>$myrow1[risposta]<br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow1 = mysql_fetch_array($result1));
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "<tr><td><input type=hidden name=test value=$test><input type=hidden name=verifica></td></tr>";
|
||||
echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni> <input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//$criteri2 = "SELECT $tbl_corsi.nome as corso, $tbl_lezioni.nome as lezione, $tbl_test.nome as test ";
|
||||
//$criteri2 .= "FROM ($tbl_corsi LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso) LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione ";
|
||||
for($x = 0; $x < 10; $x++)
|
||||
$spazi1 = $spazi1." ";
|
||||
|
||||
$spazi2 = $spazi1.$spazi1;
|
||||
|
||||
$criteri2 = "SELECT * FROM $tbl_corsi ORDER BY nome";
|
||||
$result2 = mysql_query($criteri2, $db);
|
||||
if ($myrow2 = mysql_fetch_array($result2))
|
||||
{
|
||||
echo "<table border=0 align=center>";
|
||||
do
|
||||
{
|
||||
echo "<tr><td class=corso>".$myrow2["nome"]."</td></tr>";
|
||||
$criteri3 = "SELECT * FROM $tbl_lezioni WHERE (idcorso = ".$myrow2["id"].")";
|
||||
$result3 = mysql_query($criteri3, $db);
|
||||
if ($myrow3 = mysql_fetch_array($result3))
|
||||
{
|
||||
do
|
||||
{
|
||||
echo "<tr><td class=lezione>$spazi1".$myrow3["nome"]."</td></tr>";
|
||||
$criteri4 = "SELECT * FROM $tbl_test WHERE (idlezione = ".$myrow3["id"].")";
|
||||
$result4 = mysql_query($criteri4, $db);
|
||||
if ($myrow4 = mysql_fetch_array($result4))
|
||||
{
|
||||
do
|
||||
{
|
||||
//echo "<tr class=chiaro><td><a href=tuttitest.php?test=$myrow4[id] target=destra>".$myrow4["nome"]."</a></td></tr>";
|
||||
echo "<tr class=test><td><a href=tuttitest.php?test=$myrow4[id] target=destra>$spazi2".$myrow4["nome"]."</a></td></tr>";
|
||||
}while ($myrow4 = mysql_fetch_array($result4));
|
||||
}
|
||||
}while ($myrow3 = mysql_fetch_array($result3));
|
||||
}
|
||||
}while ($myrow2 = mysql_fetch_array($result2));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun test trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
|
||||
//echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
echo "<p><a href=$PHP_SELF target=destra>Torna</a></p>";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="3">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (isset($test))
|
||||
{
|
||||
$criteri = "SELECT $tbl_test.nome, $tbl_domande.idtest, $tbl_domande.domanda, $tbl_domande.id ";
|
||||
$criteri .= "FROM $tbl_test LEFT JOIN $tbl_domande ON $tbl_test.id = $tbl_domande.idtest WHERE ($tbl_domande.idtest = $test)";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<p>".$myrow[nome]."</p>";
|
||||
echo "<form name=form1 action=verifica.php target=destra method=post>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#BF210B><td height=25><font color=white>$n) $myrow[domanda]</font></td></tr>";
|
||||
$criteri1 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow[id]) ";
|
||||
//echo $criteri01;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr class=chiaro><td><input type=checkbox name='scelte[]' value=$myrow1[id]>$myrow1[risposta]<br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr class=scuro><td><input type=checkbox name='scelte[]' value=$myrow1[id]>$myrow1[risposta]<br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow1 = mysql_fetch_array($result1));
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
echo "<tr><td><input type=hidden name=test value=$test><input type=hidden name=verifica></td></tr>";
|
||||
echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni> <input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//$criteri2 = "SELECT $tbl_corsi.nome as corso, $tbl_lezioni.nome as lezione, $tbl_test.nome as test ";
|
||||
//$criteri2 .= "FROM ($tbl_corsi LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso) LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione ";
|
||||
for($x = 0; $x < 10; $x++)
|
||||
$spazi1 = $spazi1." ";
|
||||
|
||||
$spazi2 = $spazi1.$spazi1;
|
||||
|
||||
$criteri2 = "SELECT * FROM $tbl_corsi ORDER BY nome";
|
||||
$result2 = mysql_query($criteri2, $db);
|
||||
if ($myrow2 = mysql_fetch_array($result2))
|
||||
{
|
||||
echo "<table border=0 align=center>";
|
||||
do
|
||||
{
|
||||
echo "<tr><td class=corso>".$myrow2["nome"]."</td></tr>";
|
||||
$criteri3 = "SELECT * FROM $tbl_lezioni WHERE (idcorso = ".$myrow2["id"].")";
|
||||
$result3 = mysql_query($criteri3, $db);
|
||||
if ($myrow3 = mysql_fetch_array($result3))
|
||||
{
|
||||
do
|
||||
{
|
||||
echo "<tr><td class=lezione>$spazi1".$myrow3["nome"]."</td></tr>";
|
||||
$criteri4 = "SELECT * FROM $tbl_test WHERE (idlezione = ".$myrow3["id"].")";
|
||||
$result4 = mysql_query($criteri4, $db);
|
||||
if ($myrow4 = mysql_fetch_array($result4))
|
||||
{
|
||||
do
|
||||
{
|
||||
//echo "<tr class=chiaro><td><a href=tuttitest.php?test=$myrow4[id] target=destra>".$myrow4["nome"]."</a></td></tr>";
|
||||
echo "<tr class=test><td><a href=tuttitest.php?test=$myrow4[id] target=destra>$spazi2".$myrow4["nome"]."</a></td></tr>";
|
||||
}while ($myrow4 = mysql_fetch_array($result4));
|
||||
}
|
||||
}while ($myrow3 = mysql_fetch_array($result3));
|
||||
}
|
||||
}while ($myrow2 = mysql_fetch_array($result2));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun test trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
|
||||
//echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
echo "<p><a href=$PHP_SELF target=destra>Torna</a></p>";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,33 +1,33 @@
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
echo "<table>";
|
||||
echo "<tr><th>Nome</th><th>Valore</th><th>Descrizione</th></tr>";
|
||||
//echo "<tr><td><b>s_vero</b></td><td>Vero</td><td>Indica la stringa di confronto con valore vero</td></tr>";
|
||||
echo "<tr><td><b>test_prima</b></td><td>falso</td><td>Impostato 'vero' indica che e' presente anche il test prima del download di una lezione</td></tr>";
|
||||
echo "<tr><td><b>tbl_accessi</b></td><td>$tbl_accessi</td><td>Nome della tabella degli accessi</td></tr>";
|
||||
echo "<tr><td><b>tbl_corsi</b></td><td>$tbl_corsi</td><td>Nome della tabella dei corsi</td></tr>";
|
||||
echo "<tr><td><b>tbl_domande</b></td><td>$tbl_domande</td><td>Nome della tabella delle domande</td></tr>";
|
||||
echo "<tr><td><b>tbl_download</b></td><td>$tbl_download</td><td>Nome della tabella dei download</td></tr>";
|
||||
echo "<tr><td><b>tbl_lezioni</b></td><td>$tbl_lezioni</td><td>Nome della tabella delle lezioni</td></tr>";
|
||||
echo "<tr><td><b>tbl_prove</b></td><td>$tbl_prove</td><td>Nome della tabella delle prove</td></tr>";
|
||||
echo "<tr><td><b>tbl_risposte</b></td><td>$tbl_risposte</td><td>Nome della tabella delle risposte</td></tr>";
|
||||
echo "<tr><td><b>tbl_test</b></td><td>$tbl_test</td><td>Nome della tabella dei test</td></tr>";
|
||||
echo "<tr><td><b>tbl_utenti</b></td><td>$tbl_utenti</td><td>Nome della tabella degli utenti</td></tr>";
|
||||
|
||||
echo "</table>";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
|
||||
echo "<table>";
|
||||
echo "<tr><th>Nome</th><th>Valore</th><th>Descrizione</th></tr>";
|
||||
//echo "<tr><td><b>s_vero</b></td><td>Vero</td><td>Indica la stringa di confronto con valore vero</td></tr>";
|
||||
echo "<tr><td><b>test_prima</b></td><td>falso</td><td>Impostato 'vero' indica che e' presente anche il test prima del download di una lezione</td></tr>";
|
||||
echo "<tr><td><b>tbl_accessi</b></td><td>$tbl_accessi</td><td>Nome della tabella degli accessi</td></tr>";
|
||||
echo "<tr><td><b>tbl_corsi</b></td><td>$tbl_corsi</td><td>Nome della tabella dei corsi</td></tr>";
|
||||
echo "<tr><td><b>tbl_domande</b></td><td>$tbl_domande</td><td>Nome della tabella delle domande</td></tr>";
|
||||
echo "<tr><td><b>tbl_download</b></td><td>$tbl_download</td><td>Nome della tabella dei download</td></tr>";
|
||||
echo "<tr><td><b>tbl_lezioni</b></td><td>$tbl_lezioni</td><td>Nome della tabella delle lezioni</td></tr>";
|
||||
echo "<tr><td><b>tbl_prove</b></td><td>$tbl_prove</td><td>Nome della tabella delle prove</td></tr>";
|
||||
echo "<tr><td><b>tbl_risposte</b></td><td>$tbl_risposte</td><td>Nome della tabella delle risposte</td></tr>";
|
||||
echo "<tr><td><b>tbl_test</b></td><td>$tbl_test</td><td>Nome della tabella dei test</td></tr>";
|
||||
echo "<tr><td><b>tbl_utenti</b></td><td>$tbl_utenti</td><td>Nome della tabella degli utenti</td></tr>";
|
||||
|
||||
echo "</table>";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,121 +1,121 @@
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="3">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT * FROM $tbl_domande WHERE (idtest = $test)";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<form name=form1>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
echo "<tr><td class=titolo align=center colspan=2><font color=#1058BA>Risultato del test</font></td></tr><tr><td colspan=2><br></td></tr>";
|
||||
$totale = 0;
|
||||
$punteggio = 0;
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
$vere = 0;
|
||||
$false = 0;
|
||||
$indovinate = 0;
|
||||
$sbagliate = 0;
|
||||
echo "<tr bgcolor=#1058BA><td width=5% bgcolor=#D3DCED><br></td><td height=25><font color=white>$n) $myrow[domanda]</font></td></tr>";
|
||||
//$criteri1 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow[id]) AND (visibile = 'true') ";
|
||||
$criteri1 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow[id]) ";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($myrow1[valida] == "$s_vero")
|
||||
{
|
||||
$valore = "checked";
|
||||
$vere++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$valore ="";
|
||||
$false++;
|
||||
}
|
||||
$vera = "";
|
||||
if (isset ($scelte)) if (in_array($myrow1["id"], $scelte)) $vera = "checked";
|
||||
$font = "";
|
||||
|
||||
// Risposta errata ma segnata
|
||||
if (($vera != $valore) && ($valore != "checked"))
|
||||
{
|
||||
$font = "<font color=red>";
|
||||
$sbagliate++;
|
||||
}
|
||||
// Risposta giusta non segnata
|
||||
if (($vera != $valore) && ($valore == "checked"))
|
||||
$font = "<font color=green>";
|
||||
// Risposta giusta e segnata
|
||||
if (($vera == $valore) && ($valore == "checked"))
|
||||
$indovinate++;
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB><td><input type=checkbox $valore></td><td><input type=checkbox $vera>$font$myrow1[risposta]</font><br></td></tr>";
|
||||
//echo "<tr><td><input type=checkbox $valore></td><td><input type=checkbox $vera>$font$myrow1[risposta]</font><br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td><input type=checkbox $valore></td><td><input type=checkbox $vera>$font$myrow1[risposta]</font><br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow1= mysql_fetch_array($result1));
|
||||
//echo "false =".$false;
|
||||
//echo "vere = ".$vere;
|
||||
//echo "indovinate = ".$indovinate;
|
||||
//echo "sbagliate = ".$sbagliate;
|
||||
$punteggio = $punteggio + (1/$vere)*$indovinate - (1/$false)*$sbagliate;
|
||||
//echo "punteggio =".$punteggio;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
//if ($punteggio != 0) $ris = ($punteggio/$totale) * 100;
|
||||
$n_test = $n -1;
|
||||
//echo "test =".$n_test;
|
||||
$ris = ((100 * ($punteggio + $n_test)) / $n_test)/2;
|
||||
//echo "ris =".$ris;
|
||||
if ($ris != 100)
|
||||
{
|
||||
if (substr($ris, 3,1) > 5)
|
||||
$ris = (substr($ris, 0,2) + 1); // Approssima per eccesso
|
||||
else
|
||||
$ris = substr($ris, 0,2); // Approssima per difetto
|
||||
}
|
||||
echo "<tr><td colspan=2><br></td></tr><tr><td colspan=2 align=center>Risultato del test: $ris/100</td></tr>";
|
||||
echo "</table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
|
||||
echo "<p><a href=tuttitest.php target=destra>Torna</a></p>";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="3">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT * FROM $tbl_domande WHERE (idtest = $test)";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<form name=form1>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
echo "<tr><td class=titolo align=center colspan=2><font color=#1058BA>Risultato del test</font></td></tr><tr><td colspan=2><br></td></tr>";
|
||||
$totale = 0;
|
||||
$punteggio = 0;
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
$vere = 0;
|
||||
$false = 0;
|
||||
$indovinate = 0;
|
||||
$sbagliate = 0;
|
||||
echo "<tr bgcolor=#1058BA><td width=5% bgcolor=#D3DCED><br></td><td height=25><font color=white>$n) $myrow[domanda]</font></td></tr>";
|
||||
//$criteri1 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow[id]) AND (visibile = 'true') ";
|
||||
$criteri1 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow[id]) ";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($myrow1[valida] == "$s_vero")
|
||||
{
|
||||
$valore = "checked";
|
||||
$vere++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$valore ="";
|
||||
$false++;
|
||||
}
|
||||
$vera = "";
|
||||
if (isset ($scelte)) if (in_array($myrow1["id"], $scelte)) $vera = "checked";
|
||||
$font = "";
|
||||
|
||||
// Risposta errata ma segnata
|
||||
if (($vera != $valore) && ($valore != "checked"))
|
||||
{
|
||||
$font = "<font color=red>";
|
||||
$sbagliate++;
|
||||
}
|
||||
// Risposta giusta non segnata
|
||||
if (($vera != $valore) && ($valore == "checked"))
|
||||
$font = "<font color=green>";
|
||||
// Risposta giusta e segnata
|
||||
if (($vera == $valore) && ($valore == "checked"))
|
||||
$indovinate++;
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB><td><input type=checkbox $valore></td><td><input type=checkbox $vera>$font$myrow1[risposta]</font><br></td></tr>";
|
||||
//echo "<tr><td><input type=checkbox $valore></td><td><input type=checkbox $vera>$font$myrow1[risposta]</font><br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td><input type=checkbox $valore></td><td><input type=checkbox $vera>$font$myrow1[risposta]</font><br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow1= mysql_fetch_array($result1));
|
||||
//echo "false =".$false;
|
||||
//echo "vere = ".$vere;
|
||||
//echo "indovinate = ".$indovinate;
|
||||
//echo "sbagliate = ".$sbagliate;
|
||||
$punteggio = $punteggio + (1/$vere)*$indovinate - (1/$false)*$sbagliate;
|
||||
//echo "punteggio =".$punteggio;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
//if ($punteggio != 0) $ris = ($punteggio/$totale) * 100;
|
||||
$n_test = $n -1;
|
||||
//echo "test =".$n_test;
|
||||
$ris = ((100 * ($punteggio + $n_test)) / $n_test)/2;
|
||||
//echo "ris =".$ris;
|
||||
if ($ris != 100)
|
||||
{
|
||||
if (substr($ris, 3,1) > 5)
|
||||
$ris = (substr($ris, 0,2) + 1); // Approssima per eccesso
|
||||
else
|
||||
$ris = substr($ris, 0,2); // Approssima per difetto
|
||||
}
|
||||
echo "<tr><td colspan=2><br></td></tr><tr><td colspan=2 align=center>Risultato del test: $ris/100</td></tr>";
|
||||
echo "</table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
|
||||
echo "<p><a href=tuttitest.php target=destra>Torna</a></p>";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
4754
corsi/corsi.sql
4754
corsi/corsi.sql
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 50 KiB |
Binary file not shown.
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
header("location: pages/login.php");
|
||||
|
||||
<?php
|
||||
|
||||
header("location: pages/login.php");
|
||||
|
||||
?>
|
@ -1,130 +1,130 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Nuovo accesso</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<script language="JavaScript">
|
||||
function controlla()
|
||||
{
|
||||
esito = true;
|
||||
if (document.form1.descr.value == "") esito = false;
|
||||
if (esito == false) alert("Occorre riempire tutti i campi");
|
||||
return esito;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<body>
|
||||
<p class="titolo">Nuovo Accesso</p>
|
||||
|
||||
<form action="presenze.php" method="post" name="form1">
|
||||
|
||||
<table align="center" border="1"><tr><td>
|
||||
<table cellspacing="0" cellpadding="0" border="0" align="center">
|
||||
<tr><th colspan="6" class="titolo" bgcolor="#cc0000">LOGIN</th></tr>
|
||||
<tr><td>Giorno</td><td>Mese</td><td>Anno</td><td><br></td><td>Ore</td><td>Minuti</td></tr>
|
||||
<tr>
|
||||
<td><select name="giorno_login">
|
||||
<?php
|
||||
for ($i=1; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<32; $i++)
|
||||
echo "<option value=$i>$i</option>";?>
|
||||
</select></td>
|
||||
<td><select name="mese_login">
|
||||
<?php
|
||||
for ($i=1; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<13; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
<td><select name="anno_login">
|
||||
<?php
|
||||
for ($i=2001; $i<2005; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
<td> </td>
|
||||
<td><select name="ora_login">
|
||||
<?php
|
||||
for ($i=0; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<24; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
<td><select name="minuti_login">
|
||||
<?php
|
||||
for ($i=0; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<60; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td></tr><tr><td><br></td></tr><tr><td>
|
||||
<table cellspacing="0" cellpadding="0" border="0" align="center">
|
||||
<tr><th colspan="6" class="titolo" bgcolor="#cc0000">LOGUT</th></tr>
|
||||
<tr><td>Giorno</td><td>Mese</td><td>Anno</td><td><br></td><td>Ore</td><td>Minuti</td></tr>
|
||||
<tr>
|
||||
<td><select name="giorno_logout">
|
||||
<?php
|
||||
for ($i=1; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<32; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
<td><select name="mese_logout">
|
||||
<?php
|
||||
for ($i=1; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<13; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
<td><select name="anno_logout">
|
||||
<?php
|
||||
for ($i=2001; $i<2005; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
<td> </td>
|
||||
<td><select name="ora_logout">
|
||||
<?php
|
||||
for ($i=0; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<24; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
<td><select name="minuti_logout">
|
||||
<?php
|
||||
for ($i=0; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<60; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td></tr><tr><td><br></td></tr><tr><td>
|
||||
<table cellspacing="0" cellpadding="0" border="0" align="center">
|
||||
<tr><th colspan="6">Descrizione</th></tr>
|
||||
<tr><td colspan="6"><textarea cols="25" rows="5" name="descr" wrap="hard"></textarea></td></tr>
|
||||
</table>
|
||||
</td></tr><tr><td><br></td></tr><tr><td>
|
||||
<table cellspacing="0" cellpadding="0" border="0" align="center">
|
||||
</td></tr><tr><td><br></td></tr><tr><td align="center">
|
||||
<input type="hidden" name="mostra" value="nuovo">
|
||||
<input type="submit" value="Registra" class="bottoni" onclick="return controlla();">
|
||||
</td></tr></table>
|
||||
</td></tr></table>
|
||||
</form>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Nuovo accesso</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<script language="JavaScript">
|
||||
function controlla()
|
||||
{
|
||||
esito = true;
|
||||
if (document.form1.descr.value == "") esito = false;
|
||||
if (esito == false) alert("Occorre riempire tutti i campi");
|
||||
return esito;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<body>
|
||||
<p class="titolo">Nuovo Accesso</p>
|
||||
|
||||
<form action="presenze.php" method="post" name="form1">
|
||||
|
||||
<table align="center" border="1"><tr><td>
|
||||
<table cellspacing="0" cellpadding="0" border="0" align="center">
|
||||
<tr><th colspan="6" class="titolo" bgcolor="#cc0000">LOGIN</th></tr>
|
||||
<tr><td>Giorno</td><td>Mese</td><td>Anno</td><td><br></td><td>Ore</td><td>Minuti</td></tr>
|
||||
<tr>
|
||||
<td><select name="giorno_login">
|
||||
<?php
|
||||
for ($i=1; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<32; $i++)
|
||||
echo "<option value=$i>$i</option>";?>
|
||||
</select></td>
|
||||
<td><select name="mese_login">
|
||||
<?php
|
||||
for ($i=1; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<13; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
<td><select name="anno_login">
|
||||
<?php
|
||||
for ($i=2001; $i<2005; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
<td> </td>
|
||||
<td><select name="ora_login">
|
||||
<?php
|
||||
for ($i=0; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<24; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
<td><select name="minuti_login">
|
||||
<?php
|
||||
for ($i=0; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<60; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td></tr><tr><td><br></td></tr><tr><td>
|
||||
<table cellspacing="0" cellpadding="0" border="0" align="center">
|
||||
<tr><th colspan="6" class="titolo" bgcolor="#cc0000">LOGUT</th></tr>
|
||||
<tr><td>Giorno</td><td>Mese</td><td>Anno</td><td><br></td><td>Ore</td><td>Minuti</td></tr>
|
||||
<tr>
|
||||
<td><select name="giorno_logout">
|
||||
<?php
|
||||
for ($i=1; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<32; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
<td><select name="mese_logout">
|
||||
<?php
|
||||
for ($i=1; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<13; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
<td><select name="anno_logout">
|
||||
<?php
|
||||
for ($i=2001; $i<2005; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
<td> </td>
|
||||
<td><select name="ora_logout">
|
||||
<?php
|
||||
for ($i=0; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<24; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
<td><select name="minuti_logout">
|
||||
<?php
|
||||
for ($i=0; $i<10; $i++)
|
||||
echo "<option value=0$i>0$i</option>";
|
||||
for ($i=10; $i<60; $i++)
|
||||
echo "<option value=$i>$i</option>";
|
||||
?>
|
||||
</select></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td></tr><tr><td><br></td></tr><tr><td>
|
||||
<table cellspacing="0" cellpadding="0" border="0" align="center">
|
||||
<tr><th colspan="6">Descrizione</th></tr>
|
||||
<tr><td colspan="6"><textarea cols="25" rows="5" name="descr" wrap="hard"></textarea></td></tr>
|
||||
</table>
|
||||
</td></tr><tr><td><br></td></tr><tr><td>
|
||||
<table cellspacing="0" cellpadding="0" border="0" align="center">
|
||||
</td></tr><tr><td><br></td></tr><tr><td align="center">
|
||||
<input type="hidden" name="mostra" value="nuovo">
|
||||
<input type="submit" value="Registra" class="bottoni" onclick="return controlla();">
|
||||
</td></tr></table>
|
||||
</td></tr></table>
|
||||
</form>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,111 +1,111 @@
|
||||
<?php
|
||||
|
||||
//$mostra = "";
|
||||
|
||||
if ($validato == 0) header ("location: login.php");
|
||||
|
||||
if ($logout)
|
||||
{
|
||||
include("funzioni.php");
|
||||
$ora = date("Y-m-d H:i:s");
|
||||
logout($login, $ora);
|
||||
setcookie("login", "");
|
||||
setcookie("validato", "0");
|
||||
header("location: login.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("funzioni.php");
|
||||
|
||||
echo "<table width=100% align='center' border=0 cellpadding=0 cellspacing=0>";
|
||||
echo "<tr bgcolor=Navy><td class=menu>Nome utente</td><td class=menu>Data e ora</td><td><br></td><td><br></td></tr>";
|
||||
|
||||
$myrow = generale($validato);
|
||||
//$oggi = date("d m Y, H:i");
|
||||
//$mese = substr($oggi, 3,2);
|
||||
$mese = date("m");
|
||||
switch ($mese)
|
||||
{
|
||||
case 01: $mese = "Gennaio";
|
||||
break;
|
||||
case 02: $mese = "Febbraio";
|
||||
break;
|
||||
case 03: $mese = "Marzo";
|
||||
break;
|
||||
case 04: $mese = "Aprile";
|
||||
break;
|
||||
case 05: $mese = "Maggio";
|
||||
break;
|
||||
case 06: $mese = "Giugno";
|
||||
break;
|
||||
case 07: $mese = "Luglio";
|
||||
break;
|
||||
case 08: $mese = "Agosto";
|
||||
break;
|
||||
case 09: $mese = "Settembre";
|
||||
break;
|
||||
case 10: $mese = "Ottobre";
|
||||
break;
|
||||
case 11: $mese = "Novembre";
|
||||
break;
|
||||
case 12: $mese = "Dicembre";
|
||||
break;
|
||||
}
|
||||
|
||||
$oggi = date("d")." ".$mese." ".date("Y")." - ".date("H:i");
|
||||
|
||||
echo "<tr bgcolor=#EEEEEE><td class=menug>".$myrow["nome"]." ".$myrow["cognome"]."</td><td class=menug>$oggi</td>";
|
||||
echo "<td class=menug><a href=logout.php?login=$login>Logout</a></td><td class=menug><a href=presenze.php>Presenze</a></td></tr>";
|
||||
echo "</table>";
|
||||
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT * FROM $tbl_corsi ORDER BY nome";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<br><br><table align=center border=1 cellpadding=2 cellspacing=0>";
|
||||
echo "<tr><th colspan=3>Corsi disponibili</th></tr>";
|
||||
do
|
||||
{
|
||||
$immagine = "<td><br></td>";
|
||||
if (file_exists($myrow["immagine"])) $immagine = "<td align=center><a href=lezioni.php?corso=".$myrow["id"]."><img src=".$myrow["immagine"]." border=0></a></td>";
|
||||
|
||||
$descr = "<td><br></td>";
|
||||
if ($myrow["descrizione"] != "") $descr = "<td>".$myrow["descrizione"]."</td>";
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB align=center>$immagine<td><a href=lezioni.php?corso=".$myrow["id"].">".$myrow["nome"]."</a></td>$descr</tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD align=center>$immagine<td><a href=lezioni.php?corso=".$myrow["id"].">".$myrow["nome"]."</a></td>$descr</tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}
|
||||
while ($myrow = mysql_fetch_array($result));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
|
||||
//$mostra = "";
|
||||
|
||||
if ($validato == 0) header ("location: login.php");
|
||||
|
||||
if ($logout)
|
||||
{
|
||||
include("funzioni.php");
|
||||
$ora = date("Y-m-d H:i:s");
|
||||
logout($login, $ora);
|
||||
setcookie("login", "");
|
||||
setcookie("validato", "0");
|
||||
header("location: login.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("funzioni.php");
|
||||
|
||||
echo "<table width=100% align='center' border=0 cellpadding=0 cellspacing=0>";
|
||||
echo "<tr bgcolor=Navy><td class=menu>Nome utente</td><td class=menu>Data e ora</td><td><br></td><td><br></td></tr>";
|
||||
|
||||
$myrow = generale($validato);
|
||||
//$oggi = date("d m Y, H:i");
|
||||
//$mese = substr($oggi, 3,2);
|
||||
$mese = date("m");
|
||||
switch ($mese)
|
||||
{
|
||||
case 01: $mese = "Gennaio";
|
||||
break;
|
||||
case 02: $mese = "Febbraio";
|
||||
break;
|
||||
case 03: $mese = "Marzo";
|
||||
break;
|
||||
case 04: $mese = "Aprile";
|
||||
break;
|
||||
case 05: $mese = "Maggio";
|
||||
break;
|
||||
case 06: $mese = "Giugno";
|
||||
break;
|
||||
case 07: $mese = "Luglio";
|
||||
break;
|
||||
case 08: $mese = "Agosto";
|
||||
break;
|
||||
case 09: $mese = "Settembre";
|
||||
break;
|
||||
case 10: $mese = "Ottobre";
|
||||
break;
|
||||
case 11: $mese = "Novembre";
|
||||
break;
|
||||
case 12: $mese = "Dicembre";
|
||||
break;
|
||||
}
|
||||
|
||||
$oggi = date("d")." ".$mese." ".date("Y")." - ".date("H:i");
|
||||
|
||||
echo "<tr bgcolor=#EEEEEE><td class=menug>".$myrow["nome"]." ".$myrow["cognome"]."</td><td class=menug>$oggi</td>";
|
||||
echo "<td class=menug><a href=logout.php?login=$login>Logout</a></td><td class=menug><a href=presenze.php>Presenze</a></td></tr>";
|
||||
echo "</table>";
|
||||
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT * FROM $tbl_corsi ORDER BY nome";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<br><br><table align=center border=1 cellpadding=2 cellspacing=0>";
|
||||
echo "<tr><th colspan=3>Corsi disponibili</th></tr>";
|
||||
do
|
||||
{
|
||||
$immagine = "<td><br></td>";
|
||||
if (file_exists($myrow["immagine"])) $immagine = "<td align=center><a href=lezioni.php?corso=".$myrow["id"]."><img src=".$myrow["immagine"]." border=0></a></td>";
|
||||
|
||||
$descr = "<td><br></td>";
|
||||
if ($myrow["descrizione"] != "") $descr = "<td>".$myrow["descrizione"]."</td>";
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB align=center>$immagine<td><a href=lezioni.php?corso=".$myrow["id"].">".$myrow["nome"]."</a></td>$descr</tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD align=center>$immagine<td><a href=lezioni.php?corso=".$myrow["id"].">".$myrow["nome"]."</a></td>$descr</tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}
|
||||
while ($myrow = mysql_fetch_array($result));
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,339 +1,339 @@
|
||||
# phpMyAdmin MySQL-Dump
|
||||
# http://phpwizard.net/phpMyAdmin/
|
||||
#
|
||||
# Host: localhost Database : corsi
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'accessi'
|
||||
#
|
||||
|
||||
CREATE TABLE accessi (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idutente int(11) NOT NULL,
|
||||
login datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
|
||||
logout datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'corsi'
|
||||
#
|
||||
|
||||
CREATE TABLE corsi (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
nome varchar(20) NOT NULL,
|
||||
descrizione text,
|
||||
costo bigint(20),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
#
|
||||
# Travaso dati per la tavola 'corsi'
|
||||
#
|
||||
|
||||
INSERT INTO corsi VALUES( '1', 'Internet', 'Il bello di internet', '35000');
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'domande'
|
||||
#
|
||||
|
||||
CREATE TABLE domande (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
domanda text NOT NULL,
|
||||
idtest int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
#
|
||||
# Travaso dati per la tavola 'domande'
|
||||
#
|
||||
|
||||
INSERT INTO domande VALUES( '1', 'Quali sono i vantaggi di Word per realizzare pagine HTML?', '1');
|
||||
INSERT INTO domande VALUES( '2', 'In che modo è possibile creare pagine Web con Word ?', '1');
|
||||
INSERT INTO domande VALUES( '3', 'Quando si lavora con una pagina Web:', '1');
|
||||
INSERT INTO domande VALUES( '4', 'Per inserire un testo scorrevole in una pagina Web:', '1');
|
||||
INSERT INTO domande VALUES( '5', 'Conviene usare i percorsi di collegamento relativi quando:', '1');
|
||||
INSERT INTO domande VALUES( '6', 'Lavorare contemporaneamente su più pagine Web con Word:', '1');
|
||||
INSERT INTO domande VALUES( '7', 'Esistono differenze tra l\'inserimento di immagini all\'interno di pagine Web e di normali pagine Word?', '1');
|
||||
INSERT INTO domande VALUES( '8', 'Quando un collegamento ipertestuale rimanda ad un file che non è in formato HTML:', '1');
|
||||
INSERT INTO domande VALUES( '9', 'Gli oggetti O.L.E. nelle pagine Web:', '1');
|
||||
INSERT INTO domande VALUES( '10', 'Alcune delle regole da adottare durante la consultazione dei newsgroups sono:', '2');
|
||||
INSERT INTO domande VALUES( '11', 'Sono tra le fasi per la creazione di un gruppo:', '2');
|
||||
INSERT INTO domande VALUES( '12', 'La comunicazione FTP può essere gestita:', '2');
|
||||
INSERT INTO domande VALUES( '13', 'Le possibili gestioni dei file di un sito FTP sono:', '2');
|
||||
INSERT INTO domande VALUES( '14', 'In alcuni programmi, durante la memorizzazione di file da siti FTP, viene visualizzata una barra contenente:', '2');
|
||||
INSERT INTO domande VALUES( '15', 'Quali di queste regole si dovrebbero seguire nell\'utilizzo della grafica in siti Web:', '2');
|
||||
INSERT INTO domande VALUES( '16', 'Con il browser di Paint Shop Pro è possibile:', '2');
|
||||
INSERT INTO domande VALUES( '17', 'Le immagini in formato GIF:', '2');
|
||||
INSERT INTO domande VALUES( '18', 'Lo scopo di FTP è:', '2');
|
||||
INSERT INTO domande VALUES( '19', 'I newsgroups sono', '2');
|
||||
INSERT INTO domande VALUES( '20', 'All\'apertura di Free Agent la finestra viene divisa in:', '2');
|
||||
INSERT INTO domande VALUES( '21', 'In un sito FTP è possibile interagire con:', '2');
|
||||
INSERT INTO domande VALUES( '22', 'Durante l\'upload di un file in un sito FTP:', '2');
|
||||
INSERT INTO domande VALUES( '23', 'Le immagini bitmap sono:', '2');
|
||||
INSERT INTO domande VALUES( '24', 'Con Paint Shop Pro è possibile:', '2');
|
||||
INSERT INTO domande VALUES( '25', 'In un sito FTP, selezionato un file, attraverso il browser l\'utente può:', '2');
|
||||
INSERT INTO domande VALUES( '26', 'L\'identificazione di un utente da parte di un server FTP può avvenire:', '2');
|
||||
INSERT INTO domande VALUES( '27', 'La sigla FTP significa:', '2');
|
||||
INSERT INTO domande VALUES( '28', 'Esempi di news-reader sono:', '2');
|
||||
INSERT INTO domande VALUES( '29', 'Usenet è', '2');
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'download'
|
||||
#
|
||||
|
||||
CREATE TABLE download (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idutente int(11) NOT NULL,
|
||||
idlezione int(11) NOT NULL,
|
||||
data date DEFAULT '0000-00-00' NOT NULL,
|
||||
terminato varchar(10) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'lezioni'
|
||||
#
|
||||
|
||||
CREATE TABLE lezioni (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idcorso int(11) NOT NULL,
|
||||
nome varchar(20) NOT NULL,
|
||||
progressivo smallint(6) NOT NULL,
|
||||
percorso varchar(100) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
#
|
||||
# Travaso dati per la tavola 'lezioni'
|
||||
#
|
||||
|
||||
INSERT INTO lezioni VALUES( '1', '1', 'Usare MS Word per creare pagine HTML', '3' , 'lezioni/corso1/word.zip');
|
||||
INSERT INTO lezioni VALUES( '2', '1', 'Navigare in Internet e posta elettronica', '1' , 'lezioni/corso1/internet.zip');
|
||||
INSERT INTO lezioni VALUES( '3', '1', 'Gli strumenti ed i motori di ricerca', '2' , 'lezioni/corso1/strumenti.zip');
|
||||
INSERT INTO lezioni VALUES( '4', '1', 'Newsgroups FTP Grafica', '4' , 'lezioni/corso1/ftp.zip');
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'prove'
|
||||
#
|
||||
|
||||
CREATE TABLE prove (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idutente int(11) NOT NULL,
|
||||
idtest int(11) NOT NULL,
|
||||
data date DEFAULT '0000-00-00' NOT NULL,
|
||||
risultato smallint(6) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'risposte'
|
||||
#
|
||||
|
||||
CREATE TABLE risposte (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
risposta text NOT NULL,
|
||||
iddomanda int(11) NOT NULL,
|
||||
valida varchar(10) NOT NULL,
|
||||
visibile varchar(10) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
#
|
||||
# Travaso dati per la tavola 'risposte'
|
||||
#
|
||||
|
||||
INSERT INTO risposte VALUES( '1', 'Maggiore velocità di esecuzione dei comandi', '1', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '2', 'Massima personalizzazione delle pagine Web create', '1', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '3', 'Porta ad una perfetta conoscenza del linguaggio HTML', '1', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '4', 'Facilità di realizzazione di pagine Web indipendentemente dalla conoscenza approfondita del linguaggio HTML', '1', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '5', 'Nessuna delle precedenti', '1', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '6', 'In un modo solo: scrivendo il codice HTML', '2', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '7', 'In due modi: creando un documento e poi salvandolo in formato HTML, oppure creando un documento basato su di un modello di pagina Web e personalizzandolo con gli strumenti appositi', '2', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '8', 'In due modi: copiando le pagine Web direttamente da Internet, oppure scrivendo direttamente il codice HTML per generare una pagina Web', '2', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '9', 'In nessun modo', '2', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '10', 'Nessuno dei precedenti', '2', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '11', 'Le barre degli strumenti si riducono alla sola barra Web', '3', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '12', 'Cambia la barra degli strumenti standard', '3', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '13', 'Cambia la barra degli strumenti di formattazione', '3', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '14', 'Le barre degli strumenti non cambiano rispetto a quando si lavora con una pagina .doc', '3', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '15', 'Nessuna delle precedenti', '3', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '16', 'E\' necessario digitare l\'apposita istruzione HTML; dal menu Visualizza scegli HTML Source e quindi modifica il documento', '4', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '17', 'Nel menu Formato scegli Carattere e quindi modifica l\'attributo del testo selezionando Scorrevole', '4', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '18', 'Nel menu Inserisci seleziona Testo scorrevole e quindi imposta i parametri richiesti', '4', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '19', 'Nel menu Formato scegli Paragrafo e quindi modifica l\'attributo del testo selezionando Scorrevole', '4', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '20', 'Nessuna delle precedenti', '4', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '21', 'La struttura delle directory contenenti i file collegati non debba essere modificata in futuro', '5', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '22', 'I file collegati risiedano su computer diversi', '5', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '23', 'I file collegati risiedono su un solo computer', '5', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '24', 'Copiando i file su un computer diverso si mantenga inalterata la struttura delle directory', '5', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '25', 'Nessuna delle precedenti', '5', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '26', 'E\' possibile solo quando si è collegati ad Internet', '6', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '27', 'E\' possibile solo utilizzando contemporaneamente il browser', '6', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '28', 'E\' possibile utilizzando la barra degli strumenti Web di Word', '6', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '29', 'Non è possibile; le pagine vanno aperte una per volta', '6', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '30', 'Nessuna delle precedenti', '6', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '31', 'No, è la stessa cosa', '7', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '32', 'Nelle pagine Web le possibilità di posizionamento dell\'immagine sono ridotte rispetto alle pagine Word', '7', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '33', 'Le immagini vengono inserite nelle pagine Web mentre sono solo collegate alle pagine Word', '7', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '34', 'Le immagini vengono inserite nelle pagine Word mentre sono solo collegate alle pagine Web', '7', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '35', 'Nessuna delle precedenti', '7', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '36', 'Il browser non lo riconosce e quindi non riesce ad aprirlo', '8', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '37', 'Il browser chiede se si vuole aprire il file o scaricarlo su disco', '8', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '38', 'Il browser chiede di trasformarlo in formato HTML con l\'apposito strumento di Word', '8', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '39', 'Il browser può solo scaricarlo su disco in attesa che venga poi trasformato in formato HTML per essere letto', '8', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '40', 'Nessuna delle precedenti', '8', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '41', 'Vengono inseriti come copie degli oggetti stessi in formato .gif', '9', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '42', 'Possono essere effettivamente inseriti nelle pagine Web', '9', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '43', 'Vengono aggornati automaticamente', '9', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '44', 'Non possono essere aggiornati automaticamente perchè non sono le copie originali', '9', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '45', 'Nessuna delle precedenti', '9', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '46', 'Inviare un messaggio appena ci si iscrive al newsgroup ', '10', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '47', 'Non spedire pubblicità ai newsgroup', '10', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '48', 'Pubblicare solo messaggi che siano attinenti all\'argomento del gruppo', '10', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '49', 'E\' bene pubblicare lo stesso messaggio su più gruppi per darne massima diffusione', '10', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '50', 'Nessuna delle precedenti', '10', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '51', 'La votazione', '11', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '52', 'La verifica', '11', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '53', 'La certificazione', '11', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '54', 'La discussione', '11', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '55', 'Nessuno dei precedenti', '11', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '56', 'Direttamente dal modem', '12', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '57', 'Da gestione risorse di Windows', '12', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '58', 'Dai browser', '12', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '59', 'Da programmi specifici', '12', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '60', 'Nessuna delle precedenti', '12', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '61', 'Anonimous', '13', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '62', 'Shareware', '13', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '63', 'Download', '13', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '64', 'Upload', '13', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '65', 'Nessuna delle precedenti', '13', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '66', 'La percentuale di file già salvata', '14', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '67', 'La velocità del collegamento', '14', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '68', 'La percentuale di file che rimane da salvare', '14', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '69', 'Il tempo stimato rimanente per completare l\'operazione', '14', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '70', 'Nessuna delle precedenti', '14', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '71', 'Riutilizzare le stesse immagini su pagine diverse del sito', '15', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '72', 'Non utilizzare le miniature', '15', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '73', 'Quando è possibile ridurre il numero dei colori delle immagini ', '15', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '74', 'Non usare mai immagini JPEG progressive', '15', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '75', 'Nessuna delle precedenti', '15', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '76', 'Navigare nel Web', '16', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '77', 'Aprire i file di immagini e vederne le informazioni', '16', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '78', 'Rinominare, cancellare, copiare e spostare file di immagini', '16', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '79', 'Ritoccare file di immagini', '16', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '80', 'Nessuna delle precedenti', '16', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '81', 'Dispongono di un numero elevato di colori', '17', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '82', 'Sono indicate per disegni e grafici', '17', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '83', 'Hanno una profondità massima di colore di 16 bit', '17', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '84', 'Permettono di impostare un colore come trasparente', '17', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '85', 'Nessuna delle precedenti', '17', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '86', 'Consentire a macchine remote di trasmettere file', '18', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '87', 'Consentire a macchine remote di ricevere file', '18', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '88', 'Consentire a macchine remote di condividere periferiche', '18', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '89', 'Consentire la comunicazione tra macchine remote con lo stesso sistema operativo', '18', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '90', 'Nessuna delle precedenti', '18', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '91', 'Aree di discussione alle quali ci si può iscrivere spedendo un messaggio e-mail', '19', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '92', 'Aree di discussione ai quali si può partecipare spedendo un messaggio e-mail', '19', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '93', 'Sofware che permettono di accedere all\'area di discussione', '19', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '94', 'Bacheche elettroniche specializzate in un determinato argomento', '19', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '95', 'Nessuna delle precedenti', '19', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '96', '2 parti', '20', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '97', '4 parti', '20', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '98', '6 parti', '20', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '99', 'Non viene divisa', '20', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '100', 'Nessuna delle precedenti', '20', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '101', 'Directory', '21', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '102', 'Gruppi di discussioni', '21', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '103', 'Altri utenti', '21', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '104', 'File', '21', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '105', 'Nessuna delle precedenti', '21', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '106', 'Il file viene caricato sempre nella directory principale', '22', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '107', 'Il file viene comunque inoltrato', '22', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '108', 'Il file può essere inoltrato solo se l\'utente dispone dei permessi necessari', '22', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '109', 'Il file viene caricato nella directory dove l\'utente si trova posizionato al momento dell\'operazione', '22', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '110', 'Nessuna delle precedenti', '22', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '111', 'Immagini descritte da curve e poligoni', '23', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '112', 'Immagini che mantengono sempre la stessa qualità ingrandendole più volte', '23', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '113', 'Immagini descritte da un insieme di pixel colorati ravvicinati', '23', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '114', 'Immagini che se ingrandite non mantengono la qualità originale', '23', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '115', 'Nessuna delle precedenti', '23', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '116', 'Acquisire immagini', '24', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '117', 'Creare pagine Web', '24', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '118', 'Gestire gruppi di discussione', '24', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '119', 'Catturare immagini dallo schermo', '24', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '120', 'Nessuna delle precedenti', '24', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '121', 'Aprirlo', '25', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '122', 'Eliminarlo', '25', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '123', 'Salvarlo', '25', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '124', 'Rinominarlo', '25', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '125', 'Nessuna delle precedenti', '25', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '126', 'Con un nome utente e una password', '26', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '127', 'Con solo una password', '26', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '128', 'Da parte del browser automaticamente ', '26', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '129', 'Con il solo nome utente', '26', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '130', 'Nessuna delle precedenti', '26', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '131', 'Format Trasfert Protocol', '27', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '132', 'File Trasfert Protocol', '27', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '133', 'Filename Trasfert Protocol', '27', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '134', 'Firewall Trasfert Protocol', '27', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '135', 'Nessuna delle precedenti', '27', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '136', 'Microsoft Outlook', '28', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '137', 'Free Agent', '28', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '138', 'Microsoft Internet Explorer', '28', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '139', 'Microsoft Word', '28', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '140', 'Nessuna delle precedenti', '28', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '141', 'Un gruppo di discussione', '29', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '142', 'Una fonte gratuita di news', '29', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '143', 'Un messaggio in un gruppo di discussione', '29', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '144', 'E\' un\'organizzazione con sue leggi che la regolano', '29', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '145', 'Nessuna delle precedenti', '29', 'false', 'true');
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'test'
|
||||
#
|
||||
|
||||
CREATE TABLE test (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idlezione int(11) NOT NULL,
|
||||
nome varchar(30) NOT NULL,
|
||||
progressivo smallint(6) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
#
|
||||
# Travaso dati per la tavola 'test'
|
||||
#
|
||||
|
||||
INSERT INTO test VALUES( '1', '1', 'Usare MS Word per creare pagine HTML' , 'dopo');
|
||||
INSERT INTO test VALUES( '2', '4', 'Newsgroup, Ftp, Paint Shop' , 'prima');
|
||||
INSERT INTO test VALUES( '3', '1', 'Usare MS Word per creare pagine HTML' , 'prima');
|
||||
INSERT INTO test VALUES( '4', '4', 'Newsgroup, Ftp, Paint Shop' , 'dopo');
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'utenti'
|
||||
#
|
||||
|
||||
CREATE TABLE utenti (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
nome varchar(25) NOT NULL,
|
||||
cognome varchar(25) NOT NULL,
|
||||
email varchar(35) NOT NULL,
|
||||
username varchar(20) NOT NULL,
|
||||
pass varchar(20) NOT NULL,
|
||||
data date DEFAULT '0000-00-00' NOT NULL,
|
||||
idcorso int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
# phpMyAdmin MySQL-Dump
|
||||
# http://phpwizard.net/phpMyAdmin/
|
||||
#
|
||||
# Host: localhost Database : corsi
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'accessi'
|
||||
#
|
||||
|
||||
CREATE TABLE accessi (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idutente int(11) NOT NULL,
|
||||
login datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
|
||||
logout datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'corsi'
|
||||
#
|
||||
|
||||
CREATE TABLE corsi (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
nome varchar(20) NOT NULL,
|
||||
descrizione text,
|
||||
costo bigint(20),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
#
|
||||
# Travaso dati per la tavola 'corsi'
|
||||
#
|
||||
|
||||
INSERT INTO corsi VALUES( '1', 'Internet', 'Il bello di internet', '35000');
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'domande'
|
||||
#
|
||||
|
||||
CREATE TABLE domande (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
domanda text NOT NULL,
|
||||
idtest int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
#
|
||||
# Travaso dati per la tavola 'domande'
|
||||
#
|
||||
|
||||
INSERT INTO domande VALUES( '1', 'Quali sono i vantaggi di Word per realizzare pagine HTML?', '1');
|
||||
INSERT INTO domande VALUES( '2', 'In che modo è possibile creare pagine Web con Word ?', '1');
|
||||
INSERT INTO domande VALUES( '3', 'Quando si lavora con una pagina Web:', '1');
|
||||
INSERT INTO domande VALUES( '4', 'Per inserire un testo scorrevole in una pagina Web:', '1');
|
||||
INSERT INTO domande VALUES( '5', 'Conviene usare i percorsi di collegamento relativi quando:', '1');
|
||||
INSERT INTO domande VALUES( '6', 'Lavorare contemporaneamente su più pagine Web con Word:', '1');
|
||||
INSERT INTO domande VALUES( '7', 'Esistono differenze tra l\'inserimento di immagini all\'interno di pagine Web e di normali pagine Word?', '1');
|
||||
INSERT INTO domande VALUES( '8', 'Quando un collegamento ipertestuale rimanda ad un file che non è in formato HTML:', '1');
|
||||
INSERT INTO domande VALUES( '9', 'Gli oggetti O.L.E. nelle pagine Web:', '1');
|
||||
INSERT INTO domande VALUES( '10', 'Alcune delle regole da adottare durante la consultazione dei newsgroups sono:', '2');
|
||||
INSERT INTO domande VALUES( '11', 'Sono tra le fasi per la creazione di un gruppo:', '2');
|
||||
INSERT INTO domande VALUES( '12', 'La comunicazione FTP può essere gestita:', '2');
|
||||
INSERT INTO domande VALUES( '13', 'Le possibili gestioni dei file di un sito FTP sono:', '2');
|
||||
INSERT INTO domande VALUES( '14', 'In alcuni programmi, durante la memorizzazione di file da siti FTP, viene visualizzata una barra contenente:', '2');
|
||||
INSERT INTO domande VALUES( '15', 'Quali di queste regole si dovrebbero seguire nell\'utilizzo della grafica in siti Web:', '2');
|
||||
INSERT INTO domande VALUES( '16', 'Con il browser di Paint Shop Pro è possibile:', '2');
|
||||
INSERT INTO domande VALUES( '17', 'Le immagini in formato GIF:', '2');
|
||||
INSERT INTO domande VALUES( '18', 'Lo scopo di FTP è:', '2');
|
||||
INSERT INTO domande VALUES( '19', 'I newsgroups sono', '2');
|
||||
INSERT INTO domande VALUES( '20', 'All\'apertura di Free Agent la finestra viene divisa in:', '2');
|
||||
INSERT INTO domande VALUES( '21', 'In un sito FTP è possibile interagire con:', '2');
|
||||
INSERT INTO domande VALUES( '22', 'Durante l\'upload di un file in un sito FTP:', '2');
|
||||
INSERT INTO domande VALUES( '23', 'Le immagini bitmap sono:', '2');
|
||||
INSERT INTO domande VALUES( '24', 'Con Paint Shop Pro è possibile:', '2');
|
||||
INSERT INTO domande VALUES( '25', 'In un sito FTP, selezionato un file, attraverso il browser l\'utente può:', '2');
|
||||
INSERT INTO domande VALUES( '26', 'L\'identificazione di un utente da parte di un server FTP può avvenire:', '2');
|
||||
INSERT INTO domande VALUES( '27', 'La sigla FTP significa:', '2');
|
||||
INSERT INTO domande VALUES( '28', 'Esempi di news-reader sono:', '2');
|
||||
INSERT INTO domande VALUES( '29', 'Usenet è', '2');
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'download'
|
||||
#
|
||||
|
||||
CREATE TABLE download (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idutente int(11) NOT NULL,
|
||||
idlezione int(11) NOT NULL,
|
||||
data date DEFAULT '0000-00-00' NOT NULL,
|
||||
terminato varchar(10) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'lezioni'
|
||||
#
|
||||
|
||||
CREATE TABLE lezioni (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idcorso int(11) NOT NULL,
|
||||
nome varchar(20) NOT NULL,
|
||||
progressivo smallint(6) NOT NULL,
|
||||
percorso varchar(100) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
#
|
||||
# Travaso dati per la tavola 'lezioni'
|
||||
#
|
||||
|
||||
INSERT INTO lezioni VALUES( '1', '1', 'Usare MS Word per creare pagine HTML', '3' , 'lezioni/corso1/word.zip');
|
||||
INSERT INTO lezioni VALUES( '2', '1', 'Navigare in Internet e posta elettronica', '1' , 'lezioni/corso1/internet.zip');
|
||||
INSERT INTO lezioni VALUES( '3', '1', 'Gli strumenti ed i motori di ricerca', '2' , 'lezioni/corso1/strumenti.zip');
|
||||
INSERT INTO lezioni VALUES( '4', '1', 'Newsgroups FTP Grafica', '4' , 'lezioni/corso1/ftp.zip');
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'prove'
|
||||
#
|
||||
|
||||
CREATE TABLE prove (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idutente int(11) NOT NULL,
|
||||
idtest int(11) NOT NULL,
|
||||
data date DEFAULT '0000-00-00' NOT NULL,
|
||||
risultato smallint(6) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'risposte'
|
||||
#
|
||||
|
||||
CREATE TABLE risposte (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
risposta text NOT NULL,
|
||||
iddomanda int(11) NOT NULL,
|
||||
valida varchar(10) NOT NULL,
|
||||
visibile varchar(10) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
#
|
||||
# Travaso dati per la tavola 'risposte'
|
||||
#
|
||||
|
||||
INSERT INTO risposte VALUES( '1', 'Maggiore velocità di esecuzione dei comandi', '1', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '2', 'Massima personalizzazione delle pagine Web create', '1', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '3', 'Porta ad una perfetta conoscenza del linguaggio HTML', '1', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '4', 'Facilità di realizzazione di pagine Web indipendentemente dalla conoscenza approfondita del linguaggio HTML', '1', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '5', 'Nessuna delle precedenti', '1', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '6', 'In un modo solo: scrivendo il codice HTML', '2', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '7', 'In due modi: creando un documento e poi salvandolo in formato HTML, oppure creando un documento basato su di un modello di pagina Web e personalizzandolo con gli strumenti appositi', '2', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '8', 'In due modi: copiando le pagine Web direttamente da Internet, oppure scrivendo direttamente il codice HTML per generare una pagina Web', '2', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '9', 'In nessun modo', '2', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '10', 'Nessuno dei precedenti', '2', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '11', 'Le barre degli strumenti si riducono alla sola barra Web', '3', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '12', 'Cambia la barra degli strumenti standard', '3', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '13', 'Cambia la barra degli strumenti di formattazione', '3', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '14', 'Le barre degli strumenti non cambiano rispetto a quando si lavora con una pagina .doc', '3', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '15', 'Nessuna delle precedenti', '3', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '16', 'E\' necessario digitare l\'apposita istruzione HTML; dal menu Visualizza scegli HTML Source e quindi modifica il documento', '4', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '17', 'Nel menu Formato scegli Carattere e quindi modifica l\'attributo del testo selezionando Scorrevole', '4', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '18', 'Nel menu Inserisci seleziona Testo scorrevole e quindi imposta i parametri richiesti', '4', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '19', 'Nel menu Formato scegli Paragrafo e quindi modifica l\'attributo del testo selezionando Scorrevole', '4', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '20', 'Nessuna delle precedenti', '4', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '21', 'La struttura delle directory contenenti i file collegati non debba essere modificata in futuro', '5', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '22', 'I file collegati risiedano su computer diversi', '5', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '23', 'I file collegati risiedono su un solo computer', '5', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '24', 'Copiando i file su un computer diverso si mantenga inalterata la struttura delle directory', '5', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '25', 'Nessuna delle precedenti', '5', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '26', 'E\' possibile solo quando si è collegati ad Internet', '6', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '27', 'E\' possibile solo utilizzando contemporaneamente il browser', '6', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '28', 'E\' possibile utilizzando la barra degli strumenti Web di Word', '6', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '29', 'Non è possibile; le pagine vanno aperte una per volta', '6', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '30', 'Nessuna delle precedenti', '6', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '31', 'No, è la stessa cosa', '7', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '32', 'Nelle pagine Web le possibilità di posizionamento dell\'immagine sono ridotte rispetto alle pagine Word', '7', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '33', 'Le immagini vengono inserite nelle pagine Web mentre sono solo collegate alle pagine Word', '7', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '34', 'Le immagini vengono inserite nelle pagine Word mentre sono solo collegate alle pagine Web', '7', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '35', 'Nessuna delle precedenti', '7', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '36', 'Il browser non lo riconosce e quindi non riesce ad aprirlo', '8', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '37', 'Il browser chiede se si vuole aprire il file o scaricarlo su disco', '8', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '38', 'Il browser chiede di trasformarlo in formato HTML con l\'apposito strumento di Word', '8', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '39', 'Il browser può solo scaricarlo su disco in attesa che venga poi trasformato in formato HTML per essere letto', '8', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '40', 'Nessuna delle precedenti', '8', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '41', 'Vengono inseriti come copie degli oggetti stessi in formato .gif', '9', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '42', 'Possono essere effettivamente inseriti nelle pagine Web', '9', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '43', 'Vengono aggornati automaticamente', '9', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '44', 'Non possono essere aggiornati automaticamente perchè non sono le copie originali', '9', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '45', 'Nessuna delle precedenti', '9', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '46', 'Inviare un messaggio appena ci si iscrive al newsgroup ', '10', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '47', 'Non spedire pubblicità ai newsgroup', '10', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '48', 'Pubblicare solo messaggi che siano attinenti all\'argomento del gruppo', '10', 'true', 'true');
|
||||
INSERT INTO risposte VALUES( '49', 'E\' bene pubblicare lo stesso messaggio su più gruppi per darne massima diffusione', '10', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '50', 'Nessuna delle precedenti', '10', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '51', 'La votazione', '11', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '52', 'La verifica', '11', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '53', 'La certificazione', '11', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '54', 'La discussione', '11', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '55', 'Nessuno dei precedenti', '11', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '56', 'Direttamente dal modem', '12', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '57', 'Da gestione risorse di Windows', '12', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '58', 'Dai browser', '12', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '59', 'Da programmi specifici', '12', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '60', 'Nessuna delle precedenti', '12', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '61', 'Anonimous', '13', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '62', 'Shareware', '13', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '63', 'Download', '13', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '64', 'Upload', '13', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '65', 'Nessuna delle precedenti', '13', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '66', 'La percentuale di file già salvata', '14', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '67', 'La velocità del collegamento', '14', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '68', 'La percentuale di file che rimane da salvare', '14', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '69', 'Il tempo stimato rimanente per completare l\'operazione', '14', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '70', 'Nessuna delle precedenti', '14', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '71', 'Riutilizzare le stesse immagini su pagine diverse del sito', '15', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '72', 'Non utilizzare le miniature', '15', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '73', 'Quando è possibile ridurre il numero dei colori delle immagini ', '15', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '74', 'Non usare mai immagini JPEG progressive', '15', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '75', 'Nessuna delle precedenti', '15', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '76', 'Navigare nel Web', '16', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '77', 'Aprire i file di immagini e vederne le informazioni', '16', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '78', 'Rinominare, cancellare, copiare e spostare file di immagini', '16', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '79', 'Ritoccare file di immagini', '16', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '80', 'Nessuna delle precedenti', '16', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '81', 'Dispongono di un numero elevato di colori', '17', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '82', 'Sono indicate per disegni e grafici', '17', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '83', 'Hanno una profondità massima di colore di 16 bit', '17', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '84', 'Permettono di impostare un colore come trasparente', '17', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '85', 'Nessuna delle precedenti', '17', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '86', 'Consentire a macchine remote di trasmettere file', '18', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '87', 'Consentire a macchine remote di ricevere file', '18', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '88', 'Consentire a macchine remote di condividere periferiche', '18', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '89', 'Consentire la comunicazione tra macchine remote con lo stesso sistema operativo', '18', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '90', 'Nessuna delle precedenti', '18', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '91', 'Aree di discussione alle quali ci si può iscrivere spedendo un messaggio e-mail', '19', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '92', 'Aree di discussione ai quali si può partecipare spedendo un messaggio e-mail', '19', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '93', 'Sofware che permettono di accedere all\'area di discussione', '19', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '94', 'Bacheche elettroniche specializzate in un determinato argomento', '19', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '95', 'Nessuna delle precedenti', '19', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '96', '2 parti', '20', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '97', '4 parti', '20', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '98', '6 parti', '20', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '99', 'Non viene divisa', '20', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '100', 'Nessuna delle precedenti', '20', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '101', 'Directory', '21', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '102', 'Gruppi di discussioni', '21', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '103', 'Altri utenti', '21', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '104', 'File', '21', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '105', 'Nessuna delle precedenti', '21', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '106', 'Il file viene caricato sempre nella directory principale', '22', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '107', 'Il file viene comunque inoltrato', '22', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '108', 'Il file può essere inoltrato solo se l\'utente dispone dei permessi necessari', '22', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '109', 'Il file viene caricato nella directory dove l\'utente si trova posizionato al momento dell\'operazione', '22', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '110', 'Nessuna delle precedenti', '22', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '111', 'Immagini descritte da curve e poligoni', '23', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '112', 'Immagini che mantengono sempre la stessa qualità ingrandendole più volte', '23', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '113', 'Immagini descritte da un insieme di pixel colorati ravvicinati', '23', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '114', 'Immagini che se ingrandite non mantengono la qualità originale', '23', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '115', 'Nessuna delle precedenti', '23', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '116', 'Acquisire immagini', '24', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '117', 'Creare pagine Web', '24', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '118', 'Gestire gruppi di discussione', '24', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '119', 'Catturare immagini dallo schermo', '24', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '120', 'Nessuna delle precedenti', '24', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '121', 'Aprirlo', '25', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '122', 'Eliminarlo', '25', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '123', 'Salvarlo', '25', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '124', 'Rinominarlo', '25', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '125', 'Nessuna delle precedenti', '25', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '126', 'Con un nome utente e una password', '26', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '127', 'Con solo una password', '26', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '128', 'Da parte del browser automaticamente ', '26', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '129', 'Con il solo nome utente', '26', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '130', 'Nessuna delle precedenti', '26', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '131', 'Format Trasfert Protocol', '27', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '132', 'File Trasfert Protocol', '27', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '133', 'Filename Trasfert Protocol', '27', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '134', 'Firewall Trasfert Protocol', '27', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '135', 'Nessuna delle precedenti', '27', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '136', 'Microsoft Outlook', '28', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '137', 'Free Agent', '28', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '138', 'Microsoft Internet Explorer', '28', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '139', 'Microsoft Word', '28', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '140', 'Nessuna delle precedenti', '28', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '141', 'Un gruppo di discussione', '29', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '142', 'Una fonte gratuita di news', '29', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '143', 'Un messaggio in un gruppo di discussione', '29', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '144', 'E\' un\'organizzazione con sue leggi che la regolano', '29', 'false', 'true');
|
||||
INSERT INTO risposte VALUES( '145', 'Nessuna delle precedenti', '29', 'false', 'true');
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'test'
|
||||
#
|
||||
|
||||
CREATE TABLE test (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
idlezione int(11) NOT NULL,
|
||||
nome varchar(30) NOT NULL,
|
||||
progressivo smallint(6) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
#
|
||||
# Travaso dati per la tavola 'test'
|
||||
#
|
||||
|
||||
INSERT INTO test VALUES( '1', '1', 'Usare MS Word per creare pagine HTML' , 'dopo');
|
||||
INSERT INTO test VALUES( '2', '4', 'Newsgroup, Ftp, Paint Shop' , 'prima');
|
||||
INSERT INTO test VALUES( '3', '1', 'Usare MS Word per creare pagine HTML' , 'prima');
|
||||
INSERT INTO test VALUES( '4', '4', 'Newsgroup, Ftp, Paint Shop' , 'dopo');
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Struttura della tavola 'utenti'
|
||||
#
|
||||
|
||||
CREATE TABLE utenti (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
nome varchar(25) NOT NULL,
|
||||
cognome varchar(25) NOT NULL,
|
||||
email varchar(35) NOT NULL,
|
||||
username varchar(20) NOT NULL,
|
||||
pass varchar(20) NOT NULL,
|
||||
data date DEFAULT '0000-00-00' NOT NULL,
|
||||
idcorso int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
@ -1,69 +1,69 @@
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
|
||||
$mess = "";
|
||||
|
||||
if (isset ($lezione) && ($lezione != 0))
|
||||
{
|
||||
if (controllo_download($lezione,$validato))
|
||||
{
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$oggi = date("Y-m-d");
|
||||
$sql = "INSERT INTO $tbl_download (idutente, idlezione, data) VALUES ('"
|
||||
.$validato."','"
|
||||
.$lezione."','"
|
||||
.$oggi."')";
|
||||
//echo $sql;
|
||||
$ins = mysql_query($sql,$db);
|
||||
if ($ins)
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl_lezioni WHERE (id = $lezione)";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
//echo $myrow["percorso"];
|
||||
header ("location: $myrow[percorso]");
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
$mess = "Nessun record trovato!";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo "<br><br><p class=error>Errore durante il download. Riprovare!</p><br><br>";
|
||||
$mess = "Errore durante il download. Riprovare!";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo "<br><br><p class=error>Prima di scaricare questa lezione occorre effettuare il test della lezione precedente!</p><br><br>";
|
||||
$mess = "Prima di scaricare la lezione occorre effettuare il test iniziale oppure il test finale della lezione precedente!";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<br><br><p class=error><?php echo $mess; ?></p><br><br>
|
||||
|
||||
<!-- <p><a href=corsi.php>Torna ai corsi</a></p> -->
|
||||
<p><a href=# onclick=history.back()>Torna</a></p>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
|
||||
$mess = "";
|
||||
|
||||
if (isset ($lezione) && ($lezione != 0))
|
||||
{
|
||||
if (controllo_download($lezione,$validato))
|
||||
{
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$oggi = date("Y-m-d");
|
||||
$sql = "INSERT INTO $tbl_download (idutente, idlezione, data) VALUES ('"
|
||||
.$validato."','"
|
||||
.$lezione."','"
|
||||
.$oggi."')";
|
||||
//echo $sql;
|
||||
$ins = mysql_query($sql,$db);
|
||||
if ($ins)
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl_lezioni WHERE (id = $lezione)";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
//echo $myrow["percorso"];
|
||||
header ("location: $myrow[percorso]");
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
$mess = "Nessun record trovato!";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo "<br><br><p class=error>Errore durante il download. Riprovare!</p><br><br>";
|
||||
$mess = "Errore durante il download. Riprovare!";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo "<br><br><p class=error>Prima di scaricare questa lezione occorre effettuare il test della lezione precedente!</p><br><br>";
|
||||
$mess = "Prima di scaricare la lezione occorre effettuare il test iniziale oppure il test finale della lezione precedente!";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<br><br><p class=error><?php echo $mess; ?></p><br><br>
|
||||
|
||||
<!-- <p><a href=corsi.php>Torna ai corsi</a></p> -->
|
||||
<p><a href=# onclick=history.back()>Torna</a></p>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
|
@ -1,379 +1,379 @@
|
||||
<?php
|
||||
|
||||
|
||||
// Controlla il login di un utente
|
||||
function validazione($username, $psw)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT id FROM $tbl_utenti WHERE username = '$username' AND pass = '$psw'";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
return $myrow["id"];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Restituisce il corso a cui un utente e' abilitato
|
||||
function corso($utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT idcorso FROM $tbl_utenti WHERE (id = $utente)";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
return $myrow["idcorso"];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Restituisce tutte le informazioni su un utente
|
||||
function generale($id)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tbl_utenti WHERE id = $id ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
return $myrow;
|
||||
}
|
||||
|
||||
// Scrive il login di un utente nella tabella accessi
|
||||
function login($idutente, $login)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$sql = "INSERT INTO $tbl_accessi (idutente, login, descrizione, modifica) VALUES($idutente, '$login', 'ONLINE', 'no') ";
|
||||
$ins = mysql_query($sql,$db);
|
||||
if ($ins)
|
||||
{
|
||||
$criteri = "SELECT id FROM $tbl_accessi WHERE login = '$login' ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
return $myrow["id"];
|
||||
}
|
||||
}
|
||||
|
||||
// Scrive il logout di un utente nella tabella accessi
|
||||
function logout($id, $ora)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$sql = "UPDATE $tbl_accessi SET logout = '$ora' WHERE id = $id ";
|
||||
$ins = mysql_query($sql,$db);
|
||||
}
|
||||
|
||||
// Restituisce la differenza tra due date in Ore:Minuti:Secondi
|
||||
function differenza($periodo1, $periodo2)
|
||||
{
|
||||
//string substr(string string, int start, int [length]);
|
||||
$giorno1 = substr($periodo1, 8, 2);
|
||||
$giorno2 = substr($periodo2, 8, 2);
|
||||
$ora1 = substr($periodo1, 11, 2);
|
||||
$ora2 = substr($periodo2, 11, 2);
|
||||
$min1 = substr($periodo1, 14, 2);
|
||||
$min2 = substr($periodo2, 14, 2);
|
||||
$sec1 = substr($periodo1, 17, 2);
|
||||
$sec2 = substr($periodo2, 17, 2);
|
||||
$diff = (($ora2-$ora1)*3600) + (($min2-$min1)*60) + ($sec2-$sec1);
|
||||
if ($giorno1 != $giorno2)
|
||||
$diff = $diff + (($giorno2-$giorno1)*3600*24);
|
||||
$ore = $diff;
|
||||
$O = 0;
|
||||
while ($ore > 3600):
|
||||
$ore = ($ore-3600);
|
||||
$O = $O + 1;
|
||||
endwhile;
|
||||
$resto = ($diff-($O*3600));
|
||||
$min = $resto;
|
||||
$M = 0;
|
||||
while ($min > 60):
|
||||
$min = ($min-60);
|
||||
$M = $M + 1;
|
||||
endwhile;
|
||||
$sec = ($resto-($M*60));
|
||||
if (strlen($sec) < 2)
|
||||
$sec = "0".$sec;
|
||||
if (strlen($M) < 2)
|
||||
$M = "0".$M;
|
||||
$tempo = $O.":".$M.":".$sec;
|
||||
return $tempo;
|
||||
|
||||
}
|
||||
|
||||
// Effettua la somma di due tempi in Ore:Minuti:Secondi
|
||||
function somma_tempo($tempo1, $tempo2)
|
||||
{
|
||||
if (strlen($tempo1) < 8){
|
||||
$ora1 = substr($tempo1, 0, 1);
|
||||
$min1 = substr($tempo1, 2, 2);
|
||||
$sec1 = substr($tempo1, 5, 2);
|
||||
}else{
|
||||
$ora1 = substr($tempo1, 0 ,2);
|
||||
$min1 = substr($tempo1, 3, 2);
|
||||
$sec1 = substr($tempo1, 6, 2);
|
||||
}
|
||||
if (strlen($tempo2) < 8){
|
||||
$ora2 = substr($tempo2, 0, 1);
|
||||
$min2 = substr($tempo2, 2, 2);
|
||||
$sec2 = substr($tempo2, 5, 2);
|
||||
}else{
|
||||
$ora2 = substr($tempo2, 0 ,2);
|
||||
$min2 = substr($tempo2, 3, 2);
|
||||
$sec2 = substr($tempo2, 6, 2);
|
||||
}
|
||||
$orat = ($ora1+$ora2);
|
||||
$mint = ($min1+$min2);
|
||||
$sect = ($sec1+$sec2);
|
||||
if ($sect >= 60){
|
||||
$sect = ($sect-60);
|
||||
$mint = $mint+1;
|
||||
}
|
||||
if ($mint >= 60){
|
||||
$mint = ($mint-60);
|
||||
$orat = $orat+1;
|
||||
}
|
||||
if (strlen($sect) < 2)
|
||||
$sect = "0".$sect;
|
||||
if (strlen($mint) < 2)
|
||||
$mint = "0".$mint;
|
||||
$somma = $orat.":".$mint.":".$sect;
|
||||
return $somma;
|
||||
}
|
||||
|
||||
// Stabilisce se l'utente e' abilitato a eseguire le lezioni di un corso
|
||||
function abilitato($utente, $corso)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tbl_utenti WHERE (id = $utente)";
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
{
|
||||
if ($myrow[idcorso] == $corso)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
// Restituisce il test iniziale del corso
|
||||
function inizio($utente, $corso)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT $tbl_utenti.id, $tbl_test.posizione, $tbl_test.nome, $tbl_test.id as test ";
|
||||
$criteri .= "FROM (($tbl_corsi LEFT JOIN $tbl_utenti ON $tbl_corsi.id = $tbl_utenti.idcorso) LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso) LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione ";
|
||||
$criteri .= "WHERE ($tbl_utenti.id = $utente) AND ($tbl_test.posizione = '$s_inizio')";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
//$num_rows = mysql_num_rows($result);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
//if ($num_rows != 0)
|
||||
{
|
||||
$criteri1 = "SELECT * FROM $tbl_prove WHERE (idutente = $utente) AND (idtest = $myrow[test])";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
$myrow1 = mysql_fetch_array($result1);
|
||||
if ($myrow1)
|
||||
return 0;
|
||||
else
|
||||
return $myrow[test];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Restutuisce il test finale del corso se un utente puo' eseguirlo
|
||||
function fine($utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT $tbl_utenti.id, $tbl_test.posizione, $tbl_test.nome, $tbl_test.id as test, $tbl_test.idlezione as lezione ";
|
||||
$criteri .= "FROM (($tbl_corsi LEFT JOIN $tbl_utenti ON $tbl_corsi.id = $tbl_utenti.idcorso) LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso) LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione ";
|
||||
$criteri .= "WHERE ($tbl_utenti.id = $utente) AND ($tbl_test.posizione = '$s_fine')";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
{
|
||||
$criteri1 = "SELECT * FROM $tbl_prove WHERE (idutente = $utente) AND (idtest = $myrow[test])";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
$myrow1 = mysql_fetch_array($result1);
|
||||
if ($myrow1)
|
||||
return 0;
|
||||
else
|
||||
return $myrow[test];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Da il permesso di scaricare una lezione
|
||||
// Verificando, qualora fosse abilitato $test_prima, che sia stato effettuato il test iniziale della lezione,
|
||||
// Altrimenti che sia stato effettuato il test finale della lezione precedente.
|
||||
function controllo_download($lezione, $utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
if ($test_prima == 'Vero')
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl_lezioni WHERE (id = $lezione) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow[progressivo] != 0)
|
||||
{
|
||||
if ($myrow[progressivo] >= 1)
|
||||
{
|
||||
//$cur = $myrow[progressivo] - 1;
|
||||
$cur = $myrow[progressivo];
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_lezioni.nome, $tbl_test.nome, $tbl_test.posizione, $tbl_prove.id ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $cur) AND ($tbl_test.posizione = '$s_prima') AND ($tbl_prove.idutente = $utente)";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl_lezioni WHERE (id = $lezione) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//echo $myrow[progressivo];
|
||||
if ($myrow[progressivo] != 0)
|
||||
{
|
||||
if ($myrow[progressivo] > 1)
|
||||
{
|
||||
$cur = $myrow[progressivo] - 1;
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_lezioni.nome, $tbl_test.nome, $tbl_test.posizione, $tbl_prove.id ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $cur) AND ($tbl_test.posizione = '$s_dopo') AND ($tbl_prove.idutente = $utente)";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Da il permesso di effettuare un test
|
||||
// Verificando che sia stato effettuato il test finale della lezione precedente
|
||||
function controllo_test($lezione, $utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT * FROM $tbl_lezioni WHERE (id = $lezione) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//echo $myrow[progressivo];
|
||||
if ($myrow[progressivo] != 0)
|
||||
{
|
||||
if ($myrow[progressivo] > 1)
|
||||
{
|
||||
$cur = $myrow[progressivo] - 1;
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_lezioni.nome, $tbl_test.nome, $tbl_test.posizione, $tbl_prove.id ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $cur) AND ($tbl_test.posizione = '$s_dopo') AND ($tbl_prove.idutente = $utente)";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function fine_abilita($utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri ="SELECT utenti.id, Max(lezioni.progressivo) AS ultimo ";
|
||||
$criteri .= "FROM utenti LEFT JOIN lezioni ON utenti.idcorso = lezioni.idcorso ";
|
||||
$criteri .= "GROUP BY utenti.id HAVING (utenti.id = $utente) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//echo $myrow["ultimo"];
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_test.posizione, $tbl_prove.idutente ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $myrow[ultimo]) AND ($tbl_test.posizione = '$s_dopo') AND ($tbl_prove.idutente = $utente) ";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function test_prima($lezione)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri ="SELECT $tbl_corsi.test_prima FROM $tbl_corsi LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso WHERE $tbl_lezioni.id = $lezione ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow[test_prima] == $s_falso)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
// Controlla il login di un utente
|
||||
function validazione($username, $psw)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT id FROM $tbl_utenti WHERE username = '$username' AND pass = '$psw'";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
return $myrow["id"];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Restituisce il corso a cui un utente e' abilitato
|
||||
function corso($utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT idcorso FROM $tbl_utenti WHERE (id = $utente)";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
return $myrow["idcorso"];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Restituisce tutte le informazioni su un utente
|
||||
function generale($id)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tbl_utenti WHERE id = $id ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
return $myrow;
|
||||
}
|
||||
|
||||
// Scrive il login di un utente nella tabella accessi
|
||||
function login($idutente, $login)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$sql = "INSERT INTO $tbl_accessi (idutente, login, descrizione, modifica) VALUES($idutente, '$login', 'ONLINE', 'no') ";
|
||||
$ins = mysql_query($sql,$db);
|
||||
if ($ins)
|
||||
{
|
||||
$criteri = "SELECT id FROM $tbl_accessi WHERE login = '$login' ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
return $myrow["id"];
|
||||
}
|
||||
}
|
||||
|
||||
// Scrive il logout di un utente nella tabella accessi
|
||||
function logout($id, $ora)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$sql = "UPDATE $tbl_accessi SET logout = '$ora' WHERE id = $id ";
|
||||
$ins = mysql_query($sql,$db);
|
||||
}
|
||||
|
||||
// Restituisce la differenza tra due date in Ore:Minuti:Secondi
|
||||
function differenza($periodo1, $periodo2)
|
||||
{
|
||||
//string substr(string string, int start, int [length]);
|
||||
$giorno1 = substr($periodo1, 8, 2);
|
||||
$giorno2 = substr($periodo2, 8, 2);
|
||||
$ora1 = substr($periodo1, 11, 2);
|
||||
$ora2 = substr($periodo2, 11, 2);
|
||||
$min1 = substr($periodo1, 14, 2);
|
||||
$min2 = substr($periodo2, 14, 2);
|
||||
$sec1 = substr($periodo1, 17, 2);
|
||||
$sec2 = substr($periodo2, 17, 2);
|
||||
$diff = (($ora2-$ora1)*3600) + (($min2-$min1)*60) + ($sec2-$sec1);
|
||||
if ($giorno1 != $giorno2)
|
||||
$diff = $diff + (($giorno2-$giorno1)*3600*24);
|
||||
$ore = $diff;
|
||||
$O = 0;
|
||||
while ($ore > 3600):
|
||||
$ore = ($ore-3600);
|
||||
$O = $O + 1;
|
||||
endwhile;
|
||||
$resto = ($diff-($O*3600));
|
||||
$min = $resto;
|
||||
$M = 0;
|
||||
while ($min > 60):
|
||||
$min = ($min-60);
|
||||
$M = $M + 1;
|
||||
endwhile;
|
||||
$sec = ($resto-($M*60));
|
||||
if (strlen($sec) < 2)
|
||||
$sec = "0".$sec;
|
||||
if (strlen($M) < 2)
|
||||
$M = "0".$M;
|
||||
$tempo = $O.":".$M.":".$sec;
|
||||
return $tempo;
|
||||
|
||||
}
|
||||
|
||||
// Effettua la somma di due tempi in Ore:Minuti:Secondi
|
||||
function somma_tempo($tempo1, $tempo2)
|
||||
{
|
||||
if (strlen($tempo1) < 8){
|
||||
$ora1 = substr($tempo1, 0, 1);
|
||||
$min1 = substr($tempo1, 2, 2);
|
||||
$sec1 = substr($tempo1, 5, 2);
|
||||
}else{
|
||||
$ora1 = substr($tempo1, 0 ,2);
|
||||
$min1 = substr($tempo1, 3, 2);
|
||||
$sec1 = substr($tempo1, 6, 2);
|
||||
}
|
||||
if (strlen($tempo2) < 8){
|
||||
$ora2 = substr($tempo2, 0, 1);
|
||||
$min2 = substr($tempo2, 2, 2);
|
||||
$sec2 = substr($tempo2, 5, 2);
|
||||
}else{
|
||||
$ora2 = substr($tempo2, 0 ,2);
|
||||
$min2 = substr($tempo2, 3, 2);
|
||||
$sec2 = substr($tempo2, 6, 2);
|
||||
}
|
||||
$orat = ($ora1+$ora2);
|
||||
$mint = ($min1+$min2);
|
||||
$sect = ($sec1+$sec2);
|
||||
if ($sect >= 60){
|
||||
$sect = ($sect-60);
|
||||
$mint = $mint+1;
|
||||
}
|
||||
if ($mint >= 60){
|
||||
$mint = ($mint-60);
|
||||
$orat = $orat+1;
|
||||
}
|
||||
if (strlen($sect) < 2)
|
||||
$sect = "0".$sect;
|
||||
if (strlen($mint) < 2)
|
||||
$mint = "0".$mint;
|
||||
$somma = $orat.":".$mint.":".$sect;
|
||||
return $somma;
|
||||
}
|
||||
|
||||
// Stabilisce se l'utente e' abilitato a eseguire le lezioni di un corso
|
||||
function abilitato($utente, $corso)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tbl_utenti WHERE (id = $utente)";
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
{
|
||||
if ($myrow[idcorso] == $corso)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
// Restituisce il test iniziale del corso
|
||||
function inizio($utente, $corso)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT $tbl_utenti.id, $tbl_test.posizione, $tbl_test.nome, $tbl_test.id as test ";
|
||||
$criteri .= "FROM (($tbl_corsi LEFT JOIN $tbl_utenti ON $tbl_corsi.id = $tbl_utenti.idcorso) LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso) LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione ";
|
||||
$criteri .= "WHERE ($tbl_utenti.id = $utente) AND ($tbl_test.posizione = '$s_inizio')";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
//$num_rows = mysql_num_rows($result);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
//if ($num_rows != 0)
|
||||
{
|
||||
$criteri1 = "SELECT * FROM $tbl_prove WHERE (idutente = $utente) AND (idtest = $myrow[test])";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
$myrow1 = mysql_fetch_array($result1);
|
||||
if ($myrow1)
|
||||
return 0;
|
||||
else
|
||||
return $myrow[test];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Restutuisce il test finale del corso se un utente puo' eseguirlo
|
||||
function fine($utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT $tbl_utenti.id, $tbl_test.posizione, $tbl_test.nome, $tbl_test.id as test, $tbl_test.idlezione as lezione ";
|
||||
$criteri .= "FROM (($tbl_corsi LEFT JOIN $tbl_utenti ON $tbl_corsi.id = $tbl_utenti.idcorso) LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso) LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione ";
|
||||
$criteri .= "WHERE ($tbl_utenti.id = $utente) AND ($tbl_test.posizione = '$s_fine')";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow)
|
||||
{
|
||||
$criteri1 = "SELECT * FROM $tbl_prove WHERE (idutente = $utente) AND (idtest = $myrow[test])";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
$myrow1 = mysql_fetch_array($result1);
|
||||
if ($myrow1)
|
||||
return 0;
|
||||
else
|
||||
return $myrow[test];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Da il permesso di scaricare una lezione
|
||||
// Verificando, qualora fosse abilitato $test_prima, che sia stato effettuato il test iniziale della lezione,
|
||||
// Altrimenti che sia stato effettuato il test finale della lezione precedente.
|
||||
function controllo_download($lezione, $utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
if ($test_prima == 'Vero')
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl_lezioni WHERE (id = $lezione) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow[progressivo] != 0)
|
||||
{
|
||||
if ($myrow[progressivo] >= 1)
|
||||
{
|
||||
//$cur = $myrow[progressivo] - 1;
|
||||
$cur = $myrow[progressivo];
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_lezioni.nome, $tbl_test.nome, $tbl_test.posizione, $tbl_prove.id ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $cur) AND ($tbl_test.posizione = '$s_prima') AND ($tbl_prove.idutente = $utente)";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$criteri = "SELECT * FROM $tbl_lezioni WHERE (id = $lezione) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//echo $myrow[progressivo];
|
||||
if ($myrow[progressivo] != 0)
|
||||
{
|
||||
if ($myrow[progressivo] > 1)
|
||||
{
|
||||
$cur = $myrow[progressivo] - 1;
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_lezioni.nome, $tbl_test.nome, $tbl_test.posizione, $tbl_prove.id ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $cur) AND ($tbl_test.posizione = '$s_dopo') AND ($tbl_prove.idutente = $utente)";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Da il permesso di effettuare un test
|
||||
// Verificando che sia stato effettuato il test finale della lezione precedente
|
||||
function controllo_test($lezione, $utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT * FROM $tbl_lezioni WHERE (id = $lezione) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//echo $myrow[progressivo];
|
||||
if ($myrow[progressivo] != 0)
|
||||
{
|
||||
if ($myrow[progressivo] > 1)
|
||||
{
|
||||
$cur = $myrow[progressivo] - 1;
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_lezioni.nome, $tbl_test.nome, $tbl_test.posizione, $tbl_prove.id ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $cur) AND ($tbl_test.posizione = '$s_dopo') AND ($tbl_prove.idutente = $utente)";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function fine_abilita($utente)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri ="SELECT utenti.id, Max(lezioni.progressivo) AS ultimo ";
|
||||
$criteri .= "FROM utenti LEFT JOIN lezioni ON utenti.idcorso = lezioni.idcorso ";
|
||||
$criteri .= "GROUP BY utenti.id HAVING (utenti.id = $utente) ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//echo $myrow["ultimo"];
|
||||
$criteri1 = "SELECT $tbl_lezioni.progressivo, $tbl_test.posizione, $tbl_prove.idutente ";
|
||||
$criteri1 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_lezioni.progressivo = $myrow[ultimo]) AND ($tbl_test.posizione = '$s_dopo') AND ($tbl_prove.idutente = $utente) ";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1,$db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function test_prima($lezione)
|
||||
{
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri ="SELECT $tbl_corsi.test_prima FROM $tbl_corsi LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso WHERE $tbl_lezioni.id = $lezione ";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri,$db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow[test_prima] == $s_falso)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
@ -1,159 +1,159 @@
|
||||
<?php
|
||||
|
||||
//$mostra = "";
|
||||
|
||||
if ($validato == 0) header ("location: login.php");
|
||||
|
||||
if ($presenze) header("location: presenze.php");
|
||||
|
||||
if ($logout)
|
||||
{
|
||||
include("funzioni.php");
|
||||
$ora = date("Y-m-d H:i:s");
|
||||
logout($login, $ora);
|
||||
setcookie("login", "");
|
||||
setcookie("validato", "0");
|
||||
header("location: login.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
include("funzioni.php");
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (abilitato($validato, $corso))
|
||||
{
|
||||
$inizio = inizio($validato);
|
||||
//echo $inizio;
|
||||
if ($inizio == 0)
|
||||
{
|
||||
$criteri = "SELECT $tbl_lezioni.nome, $tbl_lezioni.percorso, $tbl_lezioni.id ";
|
||||
$criteri .= "FROM ($tbl_corsi LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso) LEFT JOIN $tbl_utenti ON $tbl_corsi.id = $tbl_utenti.idcorso ";
|
||||
$criteri .= "WHERE ($tbl_utenti.id = $validato) AND ($tbl_corsi.id = $corso) AND ($tbl_lezioni.progressivo > 0) ORDER BY $tbl_lezioni.progressivo";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<br><br><table align=center border=1 cellpadding=2 cellspacing=0>";
|
||||
echo "<tr><th><br></th><th>Lezione</th><th><br></th></tr>";
|
||||
do
|
||||
{
|
||||
// echo "<form>";
|
||||
// $lezione = "<td><a href='".$myrow["percorso"]."' target=new>Scarica Lezione</a></td>";
|
||||
$lezione = "<td><form action=download.php><input type=hidden name=lezione value=".$myrow["id"]."><input type=submit value='Scarica Lezione' class=bottoni></form></td>";
|
||||
// echo $myrow["id"];
|
||||
// $test = "<td><a href=test.php?lez=".$myrow["id"].">Esegui Test</a></td>";
|
||||
$test = "<td><form action=test.php><input type=hidden name=lez value=".$myrow["id"]."><input type=submit value='Esegui Test' class=bottoni></form></td>";
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB align=center>$lezione<td>".$myrow["nome"]."</td>$test</tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD align=center>$lezione<td>".$myrow["nome"]."</td>$test</tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}
|
||||
while ($myrow = mysql_fetch_array($result));
|
||||
// echo "</form>";
|
||||
if (fine_abilita($validato))
|
||||
{
|
||||
$test_fine = fine($validato);
|
||||
if ($test_fine != 0)
|
||||
{
|
||||
echo "<tr><td colspan=3><br></td></tr>";
|
||||
echo "<tr><td colspan=3 align=center><form action=test.php><input type=hidden name=fine value=$test_fine><input type=submit value='Esegui Test Finale' class=bottoni></form></td></tr>";
|
||||
}
|
||||
else
|
||||
echo "<tr><td colspan=3><br></td></tr>";
|
||||
echo "<tr><td colspan=3>Modulo Concluso</td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
echo "<p><a href=corsi.php>Torna</a></p>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Non é abilitato a questo corso!</p><br><br>";
|
||||
echo "<p><a href=corsi.php>Torna</a></p>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><p class=titolo>Test preliminare</p><br>";
|
||||
|
||||
$criteri2 = "SELECT $tbl_domande.idtest, $tbl_domande.domanda, $tbl_domande.id ";
|
||||
$criteri2 .= "FROM $tbl_domande WHERE ($tbl_domande.idtest = $inizio)";
|
||||
//echo $criteri2;
|
||||
$result2 = mysql_query($criteri2, $db);
|
||||
if ($myrow2 = mysql_fetch_array($result2))
|
||||
{
|
||||
echo "<form action=verifica.php method=post>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#BF210B><td height=25><font color=white>$n) $myrow2[domanda]</font></td></tr>";
|
||||
$criteri3 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow2[id]) AND (visibile = '$s_vero') ";
|
||||
//echo $criteri3;
|
||||
$result3 = mysql_query($criteri3, $db);
|
||||
if ($myrow3 = mysql_fetch_array($result3))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB><td><input type=checkbox name='scelte[]' value=$myrow3[id]>$myrow3[risposta]<br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td><input type=checkbox name='scelte[]' value=$myrow3[id]>$myrow3[risposta]<br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow3= mysql_fetch_array($result3));
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow2 = mysql_fetch_array($result2));
|
||||
echo "<tr><td><input type=hidden name=test value=$inizio><input type=hidden name=verifica></td></tr>";
|
||||
//echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni><input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
echo "<tr><td align=center><input type=checkbox value=bianco name=bianco>Consegna in bianco</td></tr>";
|
||||
echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni> <input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
echo "<p><a href=corsi.php>Torna</a></p>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Non é abilitato a questo corso!</p><br><br>";
|
||||
//echo "<p><a href=corsi.php>Torna ai corsi</a></p>";
|
||||
echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
|
||||
//$mostra = "";
|
||||
|
||||
if ($validato == 0) header ("location: login.php");
|
||||
|
||||
if ($presenze) header("location: presenze.php");
|
||||
|
||||
if ($logout)
|
||||
{
|
||||
include("funzioni.php");
|
||||
$ora = date("Y-m-d H:i:s");
|
||||
logout($login, $ora);
|
||||
setcookie("login", "");
|
||||
setcookie("validato", "0");
|
||||
header("location: login.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
include("funzioni.php");
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (abilitato($validato, $corso))
|
||||
{
|
||||
$inizio = inizio($validato);
|
||||
//echo $inizio;
|
||||
if ($inizio == 0)
|
||||
{
|
||||
$criteri = "SELECT $tbl_lezioni.nome, $tbl_lezioni.percorso, $tbl_lezioni.id ";
|
||||
$criteri .= "FROM ($tbl_corsi LEFT JOIN $tbl_lezioni ON $tbl_corsi.id = $tbl_lezioni.idcorso) LEFT JOIN $tbl_utenti ON $tbl_corsi.id = $tbl_utenti.idcorso ";
|
||||
$criteri .= "WHERE ($tbl_utenti.id = $validato) AND ($tbl_corsi.id = $corso) AND ($tbl_lezioni.progressivo > 0) ORDER BY $tbl_lezioni.progressivo";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
echo "<br><br><table align=center border=1 cellpadding=2 cellspacing=0>";
|
||||
echo "<tr><th><br></th><th>Lezione</th><th><br></th></tr>";
|
||||
do
|
||||
{
|
||||
// echo "<form>";
|
||||
// $lezione = "<td><a href='".$myrow["percorso"]."' target=new>Scarica Lezione</a></td>";
|
||||
$lezione = "<td><form action=download.php><input type=hidden name=lezione value=".$myrow["id"]."><input type=submit value='Scarica Lezione' class=bottoni></form></td>";
|
||||
// echo $myrow["id"];
|
||||
// $test = "<td><a href=test.php?lez=".$myrow["id"].">Esegui Test</a></td>";
|
||||
$test = "<td><form action=test.php><input type=hidden name=lez value=".$myrow["id"]."><input type=submit value='Esegui Test' class=bottoni></form></td>";
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB align=center>$lezione<td>".$myrow["nome"]."</td>$test</tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD align=center>$lezione<td>".$myrow["nome"]."</td>$test</tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}
|
||||
while ($myrow = mysql_fetch_array($result));
|
||||
// echo "</form>";
|
||||
if (fine_abilita($validato))
|
||||
{
|
||||
$test_fine = fine($validato);
|
||||
if ($test_fine != 0)
|
||||
{
|
||||
echo "<tr><td colspan=3><br></td></tr>";
|
||||
echo "<tr><td colspan=3 align=center><form action=test.php><input type=hidden name=fine value=$test_fine><input type=submit value='Esegui Test Finale' class=bottoni></form></td></tr>";
|
||||
}
|
||||
else
|
||||
echo "<tr><td colspan=3><br></td></tr>";
|
||||
echo "<tr><td colspan=3>Modulo Concluso</td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
echo "<p><a href=corsi.php>Torna</a></p>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Non é abilitato a questo corso!</p><br><br>";
|
||||
echo "<p><a href=corsi.php>Torna</a></p>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><p class=titolo>Test preliminare</p><br>";
|
||||
|
||||
$criteri2 = "SELECT $tbl_domande.idtest, $tbl_domande.domanda, $tbl_domande.id ";
|
||||
$criteri2 .= "FROM $tbl_domande WHERE ($tbl_domande.idtest = $inizio)";
|
||||
//echo $criteri2;
|
||||
$result2 = mysql_query($criteri2, $db);
|
||||
if ($myrow2 = mysql_fetch_array($result2))
|
||||
{
|
||||
echo "<form action=verifica.php method=post>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#BF210B><td height=25><font color=white>$n) $myrow2[domanda]</font></td></tr>";
|
||||
$criteri3 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow2[id]) AND (visibile = '$s_vero') ";
|
||||
//echo $criteri3;
|
||||
$result3 = mysql_query($criteri3, $db);
|
||||
if ($myrow3 = mysql_fetch_array($result3))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB><td><input type=checkbox name='scelte[]' value=$myrow3[id]>$myrow3[risposta]<br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td><input type=checkbox name='scelte[]' value=$myrow3[id]>$myrow3[risposta]<br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow3= mysql_fetch_array($result3));
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow2 = mysql_fetch_array($result2));
|
||||
echo "<tr><td><input type=hidden name=test value=$inizio><input type=hidden name=verifica></td></tr>";
|
||||
//echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni><input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
echo "<tr><td align=center><input type=checkbox value=bianco name=bianco>Consegna in bianco</td></tr>";
|
||||
echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni> <input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
echo "<p><a href=corsi.php>Torna</a></p>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Non é abilitato a questo corso!</p><br><br>";
|
||||
//echo "<p><a href=corsi.php>Torna ai corsi</a></p>";
|
||||
echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,68 +1,68 @@
|
||||
<?php
|
||||
|
||||
$messaggio = "";
|
||||
|
||||
if ($validato == 0)
|
||||
{
|
||||
if ($username != "")
|
||||
{
|
||||
include("funzioni.php");
|
||||
$validato = validazione($username, $psw);
|
||||
if ($validato != 0)
|
||||
{
|
||||
$ora = date("Y-m-d H:i:s");
|
||||
setcookie("validato", $validato, 0);
|
||||
setcookie("login", login($validato, $ora, 0));
|
||||
setcookie("corso_utente", corso($validato));
|
||||
$username = "";
|
||||
header ("location: corsi.php");
|
||||
}
|
||||
else
|
||||
$messaggio .= "Autenticazione errata!<br>Riprovare";
|
||||
}
|
||||
}
|
||||
else
|
||||
header ("location: corsi.php");
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Login</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
function entra(){
|
||||
document.login.submit();
|
||||
return false;
|
||||
}
|
||||
|
||||
function registrati(){
|
||||
document.registrati.submit();
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<body>
|
||||
|
||||
<p class="error"><?php echo $messaggio; ?></p>
|
||||
<table align="center" border="0">
|
||||
<form action="login.php" method="post" name="login">
|
||||
<tr><td>Username</td><td><input type="text" name="username" value=<?php echo $username; ?>></td></tr>
|
||||
<tr><td>Password</td><td><input type="password" name="psw"></td></tr>
|
||||
<!-- <tr align="center"><td colspan="2"><input type="button" name="entra" onclick="return entra();" value="Entra"></td></tr> -->
|
||||
<tr align="center"><td colspan="2"><input type="submit" name="entra" value="Entra" class="bottoni"></td></tr>
|
||||
</form>
|
||||
<tr><td><br><br></td></tr>
|
||||
<form action="registrati.php" method="post" name="registrati">
|
||||
<!-- <tr align="center"><td colspan="2"><input type="button" name="registrati" onclick="return registrati();" value="Registrati"></td></tr> -->
|
||||
<tr align="center"><td colspan="2"><input type="submit" name="registrati" value="Registrati" class="bottoni"></td></tr>
|
||||
</form>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
|
||||
$messaggio = "";
|
||||
|
||||
if ($validato == 0)
|
||||
{
|
||||
if ($username != "")
|
||||
{
|
||||
include("funzioni.php");
|
||||
$validato = validazione($username, $psw);
|
||||
if ($validato != 0)
|
||||
{
|
||||
$ora = date("Y-m-d H:i:s");
|
||||
setcookie("validato", $validato, 0);
|
||||
setcookie("login", login($validato, $ora, 0));
|
||||
setcookie("corso_utente", corso($validato));
|
||||
$username = "";
|
||||
header ("location: corsi.php");
|
||||
}
|
||||
else
|
||||
$messaggio .= "Autenticazione errata!<br>Riprovare";
|
||||
}
|
||||
}
|
||||
else
|
||||
header ("location: corsi.php");
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Login</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
function entra(){
|
||||
document.login.submit();
|
||||
return false;
|
||||
}
|
||||
|
||||
function registrati(){
|
||||
document.registrati.submit();
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<body>
|
||||
|
||||
<p class="error"><?php echo $messaggio; ?></p>
|
||||
<table align="center" border="0">
|
||||
<form action="login.php" method="post" name="login">
|
||||
<tr><td>Username</td><td><input type="text" name="username" value=<?php echo $username; ?>></td></tr>
|
||||
<tr><td>Password</td><td><input type="password" name="psw"></td></tr>
|
||||
<!-- <tr align="center"><td colspan="2"><input type="button" name="entra" onclick="return entra();" value="Entra"></td></tr> -->
|
||||
<tr align="center"><td colspan="2"><input type="submit" name="entra" value="Entra" class="bottoni"></td></tr>
|
||||
</form>
|
||||
<tr><td><br><br></td></tr>
|
||||
<form action="registrati.php" method="post" name="registrati">
|
||||
<!-- <tr align="center"><td colspan="2"><input type="button" name="registrati" onclick="return registrati();" value="Registrati"></td></tr> -->
|
||||
<tr align="center"><td colspan="2"><input type="submit" name="registrati" value="Registrati" class="bottoni"></td></tr>
|
||||
</form>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
include("funzioni.php");
|
||||
$ora = date("Y-m-d H:i:s");
|
||||
logout($login, $ora);
|
||||
setcookie("login", "");
|
||||
setcookie("validato", "0");
|
||||
//setcookie("corso_utente", "");
|
||||
header("location: login.php");
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
include("funzioni.php");
|
||||
$ora = date("Y-m-d H:i:s");
|
||||
logout($login, $ora);
|
||||
setcookie("login", "");
|
||||
setcookie("validato", "0");
|
||||
//setcookie("corso_utente", "");
|
||||
header("location: login.php");
|
||||
|
||||
?>
|
||||
|
@ -1,407 +1,407 @@
|
||||
Test successivo allo svolgimento dell'unità 1: "Navigare in Internet"Contrassegnate le risposte che secondo voi sono corrette. Quando ritenete di aver completato il test
|
||||
cliccate sul pulsante <CONTROLLA RISPOSTE>. Dopo qualche secondo comparirà il vostro punteggio.
|
||||
Questo test, verrà archiviato e non potrà più essere ripetuto; fate attenzione.
|
||||
|
||||
1) Internet è definibile come:
|
||||
Una biblioteca di dati elettronica su scala mondiale
|
||||
Uno strumento per comunicare
|
||||
Una rete mondiale di computer che possono scambiare informazioni
|
||||
World Wide Web
|
||||
Nessuna delle precedenti
|
||||
2) Il World Wide Web è:
|
||||
Un indirizzo Internet generico
|
||||
La parte di Internet gestita tramite il protocollo HTML
|
||||
Uno strumento per la posta elettronica
|
||||
Uno strumento per sfogliare le pagine Web di un sito
|
||||
Nessuno dei precedenti
|
||||
3) Un sito Web è:
|
||||
Una pagina HTML su Internet
|
||||
Una collezione di pagine Web
|
||||
Un insieme di collegamenti a pagine Web
|
||||
Un insieme di pagine Web ed elementi multimediali contenuti in esse
|
||||
Nessuna delle precedenti
|
||||
4) Un browser è:
|
||||
Windows per Internet
|
||||
Il sistema operativo del Web
|
||||
L'interfaccia utente-Internet
|
||||
Uno strumento per leggere le pagine HTML
|
||||
Nessuna delle precedenti
|
||||
5) Il pulsante "Termina" (Stop) del browser:
|
||||
Disconnette l'utente dalla sessione Internet
|
||||
Interrompe temporaneamente il caricamento di una pagina Web
|
||||
Interrompe il caricamento di una pagina Web
|
||||
Consente di completare il caricamento di una pagina Web che richiede molto tempo
|
||||
Nessuna delle precedenti
|
||||
6) L'elenco "Preferiti" (Bookmarks)del browser contiene:
|
||||
Indirizzi di siti Web che mi interessano
|
||||
I collegamenti agli indirizzi dei siti Web che mi interessano
|
||||
I files che scarico da Internet e che mi interessano
|
||||
I collegamenti ai canali che mi interessano
|
||||
Nessuna delle precedenti
|
||||
7) I collegamenti, nelle pagine Web, sono:
|
||||
Rappresentati solo da pulsanti specifici
|
||||
Associati a testi sottolineati e di diverso colore
|
||||
Oggetti di tipi diversi, che consentono di passare ad altre pagine e siti
|
||||
Oggetti di tipi diversi, che consentono di muoversi solo tra le pagine dello stesso sito
|
||||
Nessuna delle precedenti
|
||||
|
||||
|
||||
|
||||
Test successivo allo svolgimento dell'unità 2: "Strumenti e motori di ricerca"Contrassegnate le risposte che secondo voi sono corrette. Quando ritenete di aver completato il testcliccate sul pulsante <CONTROLLA RISPOSTE>. Dopo qualche secondo comparirà il vostro punteggio.
|
||||
Questo test, verrà archiviato e non potrà più essere ripetuto; fate attenzione.
|
||||
|
||||
1) Cosa è una Directory ?
|
||||
Uno strumento di ricerca organizzato gerarchicamente
|
||||
Un indice di argomenti organizzato gerarchicamente
|
||||
Uno strumento di ricerca utile per quesiti molto mirati
|
||||
Uno strumento per ricerche su argomenti contenuti in categorie ampie
|
||||
Nessuna delle precedenti
|
||||
2) Cosa è un motore di ricerca ?
|
||||
Uno strumento per ricerche su argomenti contenuti in categorie ampie
|
||||
Uno strumento di ricerca utile per quesiti estremamente mirati
|
||||
Una directory la cui interfaccia contiene una casella in cui immettere il testo per la ricerca
|
||||
tra le categorie
|
||||
Uno strumento di ricerca che utilizza un indice aggiornato periodicamente
|
||||
ed una o più parole chiave per la ricerca
|
||||
Nessuno dei precedenti
|
||||
3) I meta-site:
|
||||
Sono motori di ricerca multipli
|
||||
Sono adatti per i quesiti particolarmente complessi, in modalità avanzata
|
||||
Basano le proprie ricerche sugli indici di altri motori di ricerca o directory
|
||||
Sono adatti per avere una visione completa di come è trattato un argomento sul Web
|
||||
Nessuna delle precedenti
|
||||
4) I risultati di una ricerca:
|
||||
Sono sempre visualizzati in ordine alfabetico
|
||||
Sono sempre visualizzati in ordine di data di aggiornamento
|
||||
Hanno un ordinamento dipendente dalle caratteristiche dello strumento usato
|
||||
Compaiono nella stessa sequenza con cui vengono trovati dallo strumento di ricerca
|
||||
Nessuna delle precedenti
|
||||
5) Lo strumento di ricerca (della stessa categoria) va scelto in base:
|
||||
Al tipo di interfaccia
|
||||
Al numero di motori di ricerca che utilizza
|
||||
Al numero di documenti indicizzati
|
||||
Alle caratteristiche di ricerca, controllando sull'area Help se incontrano le nostre esigenze
|
||||
Nessuna delle precedenti
|
||||
6) Il numero dei documenti indicizzati:
|
||||
E' il medesimo, inserendo le stesse parole chiave, per tutti gli strumenti di ricerca della
|
||||
stessa categoria
|
||||
Varia in base al grado di indicizzazione di una pagina Web dello strumento, inserendo le
|
||||
stesse parole chiave
|
||||
E' proporzionale all'effettivo numero dei documenti disponibili
|
||||
E' rilevato contando i titoli dei documenti indicizzati
|
||||
Nessuna delle precedenti
|
||||
7) Quando si seleziona una lingua in AltaVista:
|
||||
La ricerca riporta solo i siti scritti nella lingua selezionata
|
||||
La ricerca riporta solo i siti realizzati nei paesi dove si usa tale lingua
|
||||
Le parole chiave da inserire vanno scritte solo in quella lingua
|
||||
Viene modificato il dominio di ricerca
|
||||
Nessuna delle precedenti
|
||||
8) In AltaVista una frase:
|
||||
Deve avere un minimo di senso
|
||||
Deve essere inclusa tra le " "
|
||||
Deve contenere solo spazi bianchi tra le parole che la compongono
|
||||
Può contenere spazi bianchi e segni di punteggiatura tra le parole
|
||||
Nessuna delle precedenti
|
||||
9) AltaVista, se scriviamo le parole chiave:
|
||||
Tutte in maiuscolo, cerca sia le parole tutte in maiuscolo che quelle tutte in minuscolo
|
||||
Tutte in minuscolo, non cerca quelle tutte in maiuscolo
|
||||
Con le sole iniziali maiuscole, cerca anche le parole tutte in minuscolo
|
||||
Con le sole iniziali maiuscole, cerca anche le parole tutte in maiuscolo
|
||||
Nessuna delle precedenti
|
||||
10) Applicando le funzioni booleane nella modalità avanzata di AltaVista, l'espressione (X and (Y
|
||||
or Z)) not W (ove X,Y,Z,W rappresentano parole di ricerca!):
|
||||
Non ha senso perchè l'OR è già incluso nel precedente AND
|
||||
Cerca un documento dove sia presente X e solo uno tra Y e Z, e non sia presente W
|
||||
Cerca una pagina dove sia presente X ed almeno uno tra Y e Z, e non sia presente W
|
||||
Non ha senso perchè AND..NOT è una combinazione contradditoria
|
||||
Nessuna delle precedenti
|
||||
11) In AltaVista, i risultati di una ricerca:
|
||||
Sono ordinati automaticamente tenendo conto della data di aggiornamento ultimo
|
||||
Sono ordinati tenendo conto della presenza del testo di ricerca nel nome del sito
|
||||
Sono ordinati tenendo conto della frequenza con cui appare il testo della ricerca nei
|
||||
documenti
|
||||
Possono essere raffinati dall'utente, utilizzando un apposito strumento che viene messo a
|
||||
disposizione
|
||||
Nessuna delle precedenti
|
||||
12) L'opzione che limita una ricerca ai server posizionati in una certa area geografica:
|
||||
E' comune a tutti i principali motori di ricerca
|
||||
E' tipica di HotBot
|
||||
Non esiste
|
||||
E' tipica di Lycos
|
||||
Nessuna delle precedenti
|
||||
13) La funzione di filtraggio delle parole inutili contenute nel testo di ricerca:
|
||||
Non esiste
|
||||
E' tipica di Excite in modalità avanzata
|
||||
E' tipica di Webcrawler
|
||||
E' comune alla maggior parte dei principali motori di ricerca
|
||||
Nessuna delle precedenti
|
||||
14) Quando si procede ad una ricerca particolarmente mirata conviene:
|
||||
Se è possibile, usare un motore di ricerca specializzato nel campo della ricerca da
|
||||
effettuare
|
||||
Usare comunque un motore potente e non specializzato, per non perdere informazioni
|
||||
Usare più di un motore di ricerca non specializzato
|
||||
Usare, se possibile, più di un motore di ricerca specifico per il campo della ricerca da
|
||||
svolgere
|
||||
Nessuna delle precedenti
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Test successivo allo svolgimento dell'unità 3: "Usare MS Word per creare pagine HTML"
|
||||
Contrassegnate le risposte che secondo voi sono corrette. Quando ritenete di aver completato il test
|
||||
cliccate sul pulsante <CONTROLLA RISPOSTE>. Dopo qualche secondo comparirà il vostro punteggio.
|
||||
Questo test, verrà archiviato e non potrà più essere ripetuto; fate attenzione.
|
||||
|
||||
1) Quali sono i vantaggi dell'uso di Word per realizzare pagine HTML ?
|
||||
Maggiore velocità di esecuzione dei comandi
|
||||
Massima personalizzazione delle pagine Web create
|
||||
Porta ad una perfetta conoscenza del linguaggio HTML
|
||||
Facilità di realizzazione di pagine Web indipendentemente dalla conoscenza approfondita
|
||||
del linguaggio HTML
|
||||
Nessuna delle precedenti
|
||||
2) In che modo è possibile creare pagine Web con Word ?
|
||||
In un modo solo: scrivendo il codice HTML
|
||||
In due modi: creando un documento e poi salvandolo in formato HTML, oppure creando
|
||||
un documento basato su di un modello di pagina Web e personalizzandolo con gli strumenti
|
||||
appositi
|
||||
In due modi: copiando le pagine Web direttamente da Internet, oppure scrivendo
|
||||
direttamente il codice HTML per generare una pagina Web
|
||||
In nessun modo
|
||||
Nessuno dei precedenti
|
||||
3)Quando si lavora con una pagina Web:
|
||||
Le barre degli strumenti si riducono alla sola barra Web
|
||||
Cambia la barra degli strumenti standard
|
||||
Cambia la barra degli strumenti di formattazione
|
||||
Le barre degli strumenti non cambiano rispetto a quando si lavora con una pagina .doc
|
||||
Nessuna delle precedenti
|
||||
4) Per inserire un testo scorrevole in una pagina Web:
|
||||
E' necessario digitare l'apposita istruzione HTML; dal menu Visualizza scegli HTML
|
||||
Source e quindi modifica il documento
|
||||
Nel menu Formato scegli Carattere e quindi modifica l'attributo del testo selezionando
|
||||
Scorrevole
|
||||
Nel menu Inserisci seleziona Testo scorrevole e quindi imposta i parametri richiesti
|
||||
Nel menu Formato scegli Paragrafo e quindi modifica l'attributo del testo selezionando
|
||||
Scorrevole
|
||||
Nessuna delle precedenti
|
||||
5) Conviene usare i percorsi di collegamento relativi quando:
|
||||
La struttura delle directory contenenti i file collegati non debba essere modificata in futuro
|
||||
I file collegati risiedano su computer diversi
|
||||
I file collegati risiedono su un solo computer
|
||||
Copiando i file su un computer diverso si mantenga inalterata la struttura delle directory
|
||||
Nessuna delle precedenti
|
||||
6) Lavorare contemporaneamente su più pagine Web con Word:
|
||||
E' possibile solo quando si è collegati ad Internet
|
||||
E' possibile solo utilizzando contemporaneamente il browser
|
||||
E' possibile utilizzando la barra degli strumenti Web di Word
|
||||
Non è possibile; le pagine vanno aperte una per volta
|
||||
Nessuna delle precedenti
|
||||
7) Esistono differenze tra l'inserimento di immagini all'interno di pagine Web e di normali pagine
|
||||
Word ?
|
||||
No, è la stessa cosa
|
||||
Nelle pagine Web le possibilità di posizionamento dell'immagine sono ridotte rispetto alle
|
||||
pagine Word
|
||||
Le immagini vengono inserite nelle pagine Web mentre sono solo collegate alle pagine
|
||||
Word
|
||||
Le immagini vengono inserite nelle pagine Word mentre sono solo collegate alle pagine
|
||||
Web
|
||||
Nessuna delle precedenti
|
||||
8) Quando un collegamento ipertestuale rimanda ad un file che non è in formato HTML:
|
||||
Il browser non lo riconosce e quindi non riesce ad aprirlo
|
||||
Il browser chiede se si vuole aprire il file o scaricarlo su disco
|
||||
Il browser chiede di trasformarlo in formato HTML con l'apposito strumento di Word
|
||||
Il browser può solo scaricarlo su disco in attesa che venga poi trasformato in formato
|
||||
HTML per essere letto
|
||||
Nessuna delle precedenti
|
||||
9) Gli oggetti O.L.E. nelle pagine Web:
|
||||
Vengono inseriti come copie degli oggetti stessi in formato .gif
|
||||
Possono essere effettivamente inseriti nelle pagine Web
|
||||
Vengono aggornati automaticamente
|
||||
Non possono essere aggiornati automaticamente perchè non sono le copie originali
|
||||
Nessuna delle precedenti
|
||||
|
||||
|
||||
|
||||
|
||||
Test Newsgroup, Ftp, Paint ShopContrassegnate le risposte che secondo voi sono corrette. Quando ritenete di aver completato il testcliccate sul pulsante <CONTROLLA RISPOSTE>. Dopo qualche secondo comparirà il vostro punteggio. Se, invece, non desiderate effettuare il test, selezionate la casella <TEST IN BIANCO> posizionata alla fine del test e cliccate sul pulsante <CONTROLLA RISPOSTE>.
|
||||
Questo test, come quelli di fine unità didattica, verrà archiviato e non potrà più essere ripetuto; fate attenzione.
|
||||
|
||||
1) Alcune delle regole da adottare durante la consultazione dei newsgroups sono:
|
||||
inviare un messaggio appena ci si iscrive al newsgroup
|
||||
non spedire pubblicità ai newsgroup
|
||||
pubblicare solo messaggi che siano attinenti all'argomento del gruppo
|
||||
è bene pubblicare lo stesso messaggio su più gruppi per darne massima diffusione
|
||||
Nessuna delle precedenti
|
||||
2) Sono tra le fasi per la creazione di un gruppo:
|
||||
la votazione
|
||||
la verifica
|
||||
la certificazione
|
||||
la discussione
|
||||
Nessuno dei precedenti
|
||||
3) La comunicazione FTP può essere gestita:
|
||||
direttamente dal modem
|
||||
da gestione risorse di Windows
|
||||
dai browser
|
||||
da programmi specifici
|
||||
Nessuna delle precedenti
|
||||
4) Le possibili gestioni dei file di un sito FTP sono:
|
||||
anonimous
|
||||
shareware
|
||||
download
|
||||
upload
|
||||
Nessuna delle precedenti
|
||||
5) In alcuni programmi, durante la memorizzazione di file da siti FTP, viene visualizzata una barra contenente:
|
||||
la percentuale di file già salvata
|
||||
la velocità del collegamento
|
||||
la percentuale di file che rimane da salvare
|
||||
il tempo stimato rimanente per completare l'operazione
|
||||
Nessuna delle precedenti
|
||||
6) Quali di queste regole si dovrebbero seguire nell'utilizzo della grafica in siti Web:
|
||||
riutilizzare le stesse immagini su pagine diverse del sito
|
||||
non utilizzare le miniature
|
||||
quando è possibile ridurre il numero dei colori delle immagini
|
||||
non usare mai immagini JPEG progressive
|
||||
Nessuna delle precedenti
|
||||
7) Con il browser di Paint Shop Pro è possibile:
|
||||
navigare nel Web
|
||||
aprire i file di immagini e vederne le informazioni
|
||||
rinominare, cancellare, copiare e spostare file di immagini
|
||||
ritoccare file di immagini
|
||||
Nessuna delle precedenti
|
||||
8) Le immagini in formato GIF:
|
||||
dispongono di un numero elevato di colori
|
||||
sono indicate per disegni e grafici
|
||||
hanno una profondità massima di colore di 16 bit
|
||||
permettono di impostare un colore come trasparente
|
||||
Nessuna delle precedenti
|
||||
9) Lo scopo di FTP è:
|
||||
consentire a macchine remote di trasmettere file
|
||||
consentire a macchine remote di ricevere file
|
||||
consentire a macchine remote di condividere periferiche
|
||||
consentire la comunicazione tra macchine remote con lo stesso sistema operativo
|
||||
Nessuna delle precedenti
|
||||
10) I newsgroups sono
|
||||
aree di discussione alle quali ci si può iscrivere spedendo un messaggio e-mail
|
||||
aree di discussione ai quali si può partecipare spedendo un messaggio e-mail
|
||||
sofware che permettono di accedere all'area di discussione
|
||||
bacheche elettroniche specializzate in un determinato argomento
|
||||
Nessuna delle precedenti
|
||||
11) All'apertura di Free Agent la finestra viene divisa in:
|
||||
2 parti
|
||||
4 parti
|
||||
6 parti
|
||||
non viene divisa
|
||||
Nessuna delle precedenti
|
||||
12) In un sito FTP è possibile interagire con:
|
||||
directory
|
||||
gruppi di discussioni
|
||||
altri utenti
|
||||
file
|
||||
Nessuna delle precedenti
|
||||
13) Durante l'upload di un file in un sito FTP:
|
||||
il file viene caricato sempre nella directory principale
|
||||
il file viene comunque inoltrato
|
||||
il file può essere inoltrato solo se l'utente dispone dei permessi necessari
|
||||
il file viene caricato nella directory dove l'utente si trova posizionato al momento dell'operazione
|
||||
Nessuna delle precedenti
|
||||
14) Le immagini bitmap sono:
|
||||
immagini descritte da curve e poligoni
|
||||
immagini che mantengono sempre la stessa qualità ingrandendole più volte
|
||||
immagini descritte da un insieme di pixel colorati ravvicinati
|
||||
immagini che se ingrandite non mantengono la qualità originale
|
||||
Nessuna delle precedenti
|
||||
15) Con Paint Shop Pro è possibile:
|
||||
acquisire immagini
|
||||
creare pagine Web
|
||||
gestire gruppi di discussione
|
||||
catturare immagini dallo schermo
|
||||
Nessuna delle precedenti
|
||||
16) In un sito FTP, selezionato un file, attraverso il browser l'utente può:
|
||||
aprirlo
|
||||
eliminarlo
|
||||
salvarlo
|
||||
rinominarlo
|
||||
Nessuna delle precedenti
|
||||
17) L'identificazione di un utente da parte di un server FTP può avvenire:
|
||||
con un nome utente e una password
|
||||
con solo una password
|
||||
da parte del browser automaticamente
|
||||
con il solo nome utente
|
||||
Nessuna delle precedenti
|
||||
18) La sigla FTP significa:
|
||||
Format Trasfert Protocol
|
||||
File Trasfert Protocol
|
||||
Filename Trasfert Protocol
|
||||
Firewall Trasfert Protocol
|
||||
Nessuna delle precedenti
|
||||
19) Esempi di news-reader sono:
|
||||
Microsoft Outlook
|
||||
Free Agent
|
||||
Microsoft Internet Explorer
|
||||
Microsoft Word
|
||||
Nessuna delle precedenti
|
||||
20) Usenet è
|
||||
un gruppo di discussione
|
||||
una fonte gratuita di news
|
||||
un messaggio in un gruppo di discussione
|
||||
è un'organizzazione con sue leggi che la regolano
|
||||
Nessuna delle precedenti
|
||||
|
||||
|
||||
|
||||
|
||||
1) Il World Wide Web è:
|
||||
Il vero nome di Internet
|
||||
Lo strumento per sfogliare le pagine Web dei siti
|
||||
Il modo grafico per vedere le informazioni su Internet
|
||||
La rete Internet
|
||||
Nessuna delle precedenti
|
||||
2) Cosa è il "browser" ?
|
||||
Uno strumento per sfogliare le pagine Web
|
||||
Un programma per le ricerche Internet
|
||||
Lo strumento che gestisce la posta elettronica
|
||||
Un componente hardware del computer specifico per Internet
|
||||
Nessuno dei precedenti
|
||||
3) Cosa è un motore di ricerca ?
|
||||
Un componente hardware che si utilizza per le ricerche sul Web
|
||||
Un programma software del nostro computer che si usa per le ricerche sul Web
|
||||
Un particolare server per le ricerche sul Web
|
||||
Uno strumento di ricerca del Web
|
||||
Nessuna delle precedenti
|
||||
4) Cosa è un sito Web ?
|
||||
E' un server di rete che contiene una gran quantità di pagine Web
|
||||
Una pagina HTML sul Web
|
||||
Una collezione ordinata di pagine Web
|
||||
Un insieme di collegamenti a pagine Web
|
||||
Nessuna delle precedenti
|
||||
5) Cosa è l'HTML ?
|
||||
E' il linguaggio di programmazione di Internet
|
||||
E' un linguaggio di marcatura che consente al browser di interpretare un pagina Web
|
||||
E' un linguaggio di programmazione che consente al browser di interpretare un pagina Web
|
||||
E' un testo Web
|
||||
Nessuna delle precedenti
|
||||
6) La modifica di un file HTML:
|
||||
E' possibile solo se si possiede un server Internet
|
||||
E' possibile utilizzando un editor di testo
|
||||
E' possibile solo se abilitati dal proprio provider Internet
|
||||
E' possibile utilizzando solo editor specializzati
|
||||
Nessuna delle precedenti
|
||||
7) La modifica di una pagina Web:
|
||||
E' possibile solo se si possiede un server Internet
|
||||
E' possibile utilizzando un editor di testo
|
||||
E' consentito solo se abilitati dal proprio provider Internet
|
||||
E' possibile solo utilizzando editor specializzati
|
||||
Nessuna delle precedenti
|
||||
8) La creazione di un proprio sito Web:
|
||||
E' possibile solo acquistando un server Web
|
||||
E' possibile solo se si è esperti di programmazione in Java
|
||||
E' consentito solo se si possiede la qualifica di Provider
|
||||
E' consentito solo alle aziende o alle società che immettono pubblicità a pagamento sul
|
||||
Web
|
||||
Nessuna delle precedenti
|
||||
9) Utilizzare MS Word per creare pagine HTML:
|
||||
Non è possibile
|
||||
E' possibile solo se associato ad un programma apposito (come MS Publisher)
|
||||
E' possibile conoscendo la programmazione in HTML
|
||||
E' possibile usando una versione recente di Word
|
||||
Nessuna delle precedenti
|
||||
Test successivo allo svolgimento dell'unità 1: "Navigare in Internet"Contrassegnate le risposte che secondo voi sono corrette. Quando ritenete di aver completato il test
|
||||
cliccate sul pulsante <CONTROLLA RISPOSTE>. Dopo qualche secondo comparirà il vostro punteggio.
|
||||
Questo test, verrà archiviato e non potrà più essere ripetuto; fate attenzione.
|
||||
|
||||
1) Internet è definibile come:
|
||||
Una biblioteca di dati elettronica su scala mondiale
|
||||
Uno strumento per comunicare
|
||||
Una rete mondiale di computer che possono scambiare informazioni
|
||||
World Wide Web
|
||||
Nessuna delle precedenti
|
||||
2) Il World Wide Web è:
|
||||
Un indirizzo Internet generico
|
||||
La parte di Internet gestita tramite il protocollo HTML
|
||||
Uno strumento per la posta elettronica
|
||||
Uno strumento per sfogliare le pagine Web di un sito
|
||||
Nessuno dei precedenti
|
||||
3) Un sito Web è:
|
||||
Una pagina HTML su Internet
|
||||
Una collezione di pagine Web
|
||||
Un insieme di collegamenti a pagine Web
|
||||
Un insieme di pagine Web ed elementi multimediali contenuti in esse
|
||||
Nessuna delle precedenti
|
||||
4) Un browser è:
|
||||
Windows per Internet
|
||||
Il sistema operativo del Web
|
||||
L'interfaccia utente-Internet
|
||||
Uno strumento per leggere le pagine HTML
|
||||
Nessuna delle precedenti
|
||||
5) Il pulsante "Termina" (Stop) del browser:
|
||||
Disconnette l'utente dalla sessione Internet
|
||||
Interrompe temporaneamente il caricamento di una pagina Web
|
||||
Interrompe il caricamento di una pagina Web
|
||||
Consente di completare il caricamento di una pagina Web che richiede molto tempo
|
||||
Nessuna delle precedenti
|
||||
6) L'elenco "Preferiti" (Bookmarks)del browser contiene:
|
||||
Indirizzi di siti Web che mi interessano
|
||||
I collegamenti agli indirizzi dei siti Web che mi interessano
|
||||
I files che scarico da Internet e che mi interessano
|
||||
I collegamenti ai canali che mi interessano
|
||||
Nessuna delle precedenti
|
||||
7) I collegamenti, nelle pagine Web, sono:
|
||||
Rappresentati solo da pulsanti specifici
|
||||
Associati a testi sottolineati e di diverso colore
|
||||
Oggetti di tipi diversi, che consentono di passare ad altre pagine e siti
|
||||
Oggetti di tipi diversi, che consentono di muoversi solo tra le pagine dello stesso sito
|
||||
Nessuna delle precedenti
|
||||
|
||||
|
||||
|
||||
Test successivo allo svolgimento dell'unità 2: "Strumenti e motori di ricerca"Contrassegnate le risposte che secondo voi sono corrette. Quando ritenete di aver completato il testcliccate sul pulsante <CONTROLLA RISPOSTE>. Dopo qualche secondo comparirà il vostro punteggio.
|
||||
Questo test, verrà archiviato e non potrà più essere ripetuto; fate attenzione.
|
||||
|
||||
1) Cosa è una Directory ?
|
||||
Uno strumento di ricerca organizzato gerarchicamente
|
||||
Un indice di argomenti organizzato gerarchicamente
|
||||
Uno strumento di ricerca utile per quesiti molto mirati
|
||||
Uno strumento per ricerche su argomenti contenuti in categorie ampie
|
||||
Nessuna delle precedenti
|
||||
2) Cosa è un motore di ricerca ?
|
||||
Uno strumento per ricerche su argomenti contenuti in categorie ampie
|
||||
Uno strumento di ricerca utile per quesiti estremamente mirati
|
||||
Una directory la cui interfaccia contiene una casella in cui immettere il testo per la ricerca
|
||||
tra le categorie
|
||||
Uno strumento di ricerca che utilizza un indice aggiornato periodicamente
|
||||
ed una o più parole chiave per la ricerca
|
||||
Nessuno dei precedenti
|
||||
3) I meta-site:
|
||||
Sono motori di ricerca multipli
|
||||
Sono adatti per i quesiti particolarmente complessi, in modalità avanzata
|
||||
Basano le proprie ricerche sugli indici di altri motori di ricerca o directory
|
||||
Sono adatti per avere una visione completa di come è trattato un argomento sul Web
|
||||
Nessuna delle precedenti
|
||||
4) I risultati di una ricerca:
|
||||
Sono sempre visualizzati in ordine alfabetico
|
||||
Sono sempre visualizzati in ordine di data di aggiornamento
|
||||
Hanno un ordinamento dipendente dalle caratteristiche dello strumento usato
|
||||
Compaiono nella stessa sequenza con cui vengono trovati dallo strumento di ricerca
|
||||
Nessuna delle precedenti
|
||||
5) Lo strumento di ricerca (della stessa categoria) va scelto in base:
|
||||
Al tipo di interfaccia
|
||||
Al numero di motori di ricerca che utilizza
|
||||
Al numero di documenti indicizzati
|
||||
Alle caratteristiche di ricerca, controllando sull'area Help se incontrano le nostre esigenze
|
||||
Nessuna delle precedenti
|
||||
6) Il numero dei documenti indicizzati:
|
||||
E' il medesimo, inserendo le stesse parole chiave, per tutti gli strumenti di ricerca della
|
||||
stessa categoria
|
||||
Varia in base al grado di indicizzazione di una pagina Web dello strumento, inserendo le
|
||||
stesse parole chiave
|
||||
E' proporzionale all'effettivo numero dei documenti disponibili
|
||||
E' rilevato contando i titoli dei documenti indicizzati
|
||||
Nessuna delle precedenti
|
||||
7) Quando si seleziona una lingua in AltaVista:
|
||||
La ricerca riporta solo i siti scritti nella lingua selezionata
|
||||
La ricerca riporta solo i siti realizzati nei paesi dove si usa tale lingua
|
||||
Le parole chiave da inserire vanno scritte solo in quella lingua
|
||||
Viene modificato il dominio di ricerca
|
||||
Nessuna delle precedenti
|
||||
8) In AltaVista una frase:
|
||||
Deve avere un minimo di senso
|
||||
Deve essere inclusa tra le " "
|
||||
Deve contenere solo spazi bianchi tra le parole che la compongono
|
||||
Può contenere spazi bianchi e segni di punteggiatura tra le parole
|
||||
Nessuna delle precedenti
|
||||
9) AltaVista, se scriviamo le parole chiave:
|
||||
Tutte in maiuscolo, cerca sia le parole tutte in maiuscolo che quelle tutte in minuscolo
|
||||
Tutte in minuscolo, non cerca quelle tutte in maiuscolo
|
||||
Con le sole iniziali maiuscole, cerca anche le parole tutte in minuscolo
|
||||
Con le sole iniziali maiuscole, cerca anche le parole tutte in maiuscolo
|
||||
Nessuna delle precedenti
|
||||
10) Applicando le funzioni booleane nella modalità avanzata di AltaVista, l'espressione (X and (Y
|
||||
or Z)) not W (ove X,Y,Z,W rappresentano parole di ricerca!):
|
||||
Non ha senso perchè l'OR è già incluso nel precedente AND
|
||||
Cerca un documento dove sia presente X e solo uno tra Y e Z, e non sia presente W
|
||||
Cerca una pagina dove sia presente X ed almeno uno tra Y e Z, e non sia presente W
|
||||
Non ha senso perchè AND..NOT è una combinazione contradditoria
|
||||
Nessuna delle precedenti
|
||||
11) In AltaVista, i risultati di una ricerca:
|
||||
Sono ordinati automaticamente tenendo conto della data di aggiornamento ultimo
|
||||
Sono ordinati tenendo conto della presenza del testo di ricerca nel nome del sito
|
||||
Sono ordinati tenendo conto della frequenza con cui appare il testo della ricerca nei
|
||||
documenti
|
||||
Possono essere raffinati dall'utente, utilizzando un apposito strumento che viene messo a
|
||||
disposizione
|
||||
Nessuna delle precedenti
|
||||
12) L'opzione che limita una ricerca ai server posizionati in una certa area geografica:
|
||||
E' comune a tutti i principali motori di ricerca
|
||||
E' tipica di HotBot
|
||||
Non esiste
|
||||
E' tipica di Lycos
|
||||
Nessuna delle precedenti
|
||||
13) La funzione di filtraggio delle parole inutili contenute nel testo di ricerca:
|
||||
Non esiste
|
||||
E' tipica di Excite in modalità avanzata
|
||||
E' tipica di Webcrawler
|
||||
E' comune alla maggior parte dei principali motori di ricerca
|
||||
Nessuna delle precedenti
|
||||
14) Quando si procede ad una ricerca particolarmente mirata conviene:
|
||||
Se è possibile, usare un motore di ricerca specializzato nel campo della ricerca da
|
||||
effettuare
|
||||
Usare comunque un motore potente e non specializzato, per non perdere informazioni
|
||||
Usare più di un motore di ricerca non specializzato
|
||||
Usare, se possibile, più di un motore di ricerca specifico per il campo della ricerca da
|
||||
svolgere
|
||||
Nessuna delle precedenti
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Test successivo allo svolgimento dell'unità 3: "Usare MS Word per creare pagine HTML"
|
||||
Contrassegnate le risposte che secondo voi sono corrette. Quando ritenete di aver completato il test
|
||||
cliccate sul pulsante <CONTROLLA RISPOSTE>. Dopo qualche secondo comparirà il vostro punteggio.
|
||||
Questo test, verrà archiviato e non potrà più essere ripetuto; fate attenzione.
|
||||
|
||||
1) Quali sono i vantaggi dell'uso di Word per realizzare pagine HTML ?
|
||||
Maggiore velocità di esecuzione dei comandi
|
||||
Massima personalizzazione delle pagine Web create
|
||||
Porta ad una perfetta conoscenza del linguaggio HTML
|
||||
Facilità di realizzazione di pagine Web indipendentemente dalla conoscenza approfondita
|
||||
del linguaggio HTML
|
||||
Nessuna delle precedenti
|
||||
2) In che modo è possibile creare pagine Web con Word ?
|
||||
In un modo solo: scrivendo il codice HTML
|
||||
In due modi: creando un documento e poi salvandolo in formato HTML, oppure creando
|
||||
un documento basato su di un modello di pagina Web e personalizzandolo con gli strumenti
|
||||
appositi
|
||||
In due modi: copiando le pagine Web direttamente da Internet, oppure scrivendo
|
||||
direttamente il codice HTML per generare una pagina Web
|
||||
In nessun modo
|
||||
Nessuno dei precedenti
|
||||
3)Quando si lavora con una pagina Web:
|
||||
Le barre degli strumenti si riducono alla sola barra Web
|
||||
Cambia la barra degli strumenti standard
|
||||
Cambia la barra degli strumenti di formattazione
|
||||
Le barre degli strumenti non cambiano rispetto a quando si lavora con una pagina .doc
|
||||
Nessuna delle precedenti
|
||||
4) Per inserire un testo scorrevole in una pagina Web:
|
||||
E' necessario digitare l'apposita istruzione HTML; dal menu Visualizza scegli HTML
|
||||
Source e quindi modifica il documento
|
||||
Nel menu Formato scegli Carattere e quindi modifica l'attributo del testo selezionando
|
||||
Scorrevole
|
||||
Nel menu Inserisci seleziona Testo scorrevole e quindi imposta i parametri richiesti
|
||||
Nel menu Formato scegli Paragrafo e quindi modifica l'attributo del testo selezionando
|
||||
Scorrevole
|
||||
Nessuna delle precedenti
|
||||
5) Conviene usare i percorsi di collegamento relativi quando:
|
||||
La struttura delle directory contenenti i file collegati non debba essere modificata in futuro
|
||||
I file collegati risiedano su computer diversi
|
||||
I file collegati risiedono su un solo computer
|
||||
Copiando i file su un computer diverso si mantenga inalterata la struttura delle directory
|
||||
Nessuna delle precedenti
|
||||
6) Lavorare contemporaneamente su più pagine Web con Word:
|
||||
E' possibile solo quando si è collegati ad Internet
|
||||
E' possibile solo utilizzando contemporaneamente il browser
|
||||
E' possibile utilizzando la barra degli strumenti Web di Word
|
||||
Non è possibile; le pagine vanno aperte una per volta
|
||||
Nessuna delle precedenti
|
||||
7) Esistono differenze tra l'inserimento di immagini all'interno di pagine Web e di normali pagine
|
||||
Word ?
|
||||
No, è la stessa cosa
|
||||
Nelle pagine Web le possibilità di posizionamento dell'immagine sono ridotte rispetto alle
|
||||
pagine Word
|
||||
Le immagini vengono inserite nelle pagine Web mentre sono solo collegate alle pagine
|
||||
Word
|
||||
Le immagini vengono inserite nelle pagine Word mentre sono solo collegate alle pagine
|
||||
Web
|
||||
Nessuna delle precedenti
|
||||
8) Quando un collegamento ipertestuale rimanda ad un file che non è in formato HTML:
|
||||
Il browser non lo riconosce e quindi non riesce ad aprirlo
|
||||
Il browser chiede se si vuole aprire il file o scaricarlo su disco
|
||||
Il browser chiede di trasformarlo in formato HTML con l'apposito strumento di Word
|
||||
Il browser può solo scaricarlo su disco in attesa che venga poi trasformato in formato
|
||||
HTML per essere letto
|
||||
Nessuna delle precedenti
|
||||
9) Gli oggetti O.L.E. nelle pagine Web:
|
||||
Vengono inseriti come copie degli oggetti stessi in formato .gif
|
||||
Possono essere effettivamente inseriti nelle pagine Web
|
||||
Vengono aggornati automaticamente
|
||||
Non possono essere aggiornati automaticamente perchè non sono le copie originali
|
||||
Nessuna delle precedenti
|
||||
|
||||
|
||||
|
||||
|
||||
Test Newsgroup, Ftp, Paint ShopContrassegnate le risposte che secondo voi sono corrette. Quando ritenete di aver completato il testcliccate sul pulsante <CONTROLLA RISPOSTE>. Dopo qualche secondo comparirà il vostro punteggio. Se, invece, non desiderate effettuare il test, selezionate la casella <TEST IN BIANCO> posizionata alla fine del test e cliccate sul pulsante <CONTROLLA RISPOSTE>.
|
||||
Questo test, come quelli di fine unità didattica, verrà archiviato e non potrà più essere ripetuto; fate attenzione.
|
||||
|
||||
1) Alcune delle regole da adottare durante la consultazione dei newsgroups sono:
|
||||
inviare un messaggio appena ci si iscrive al newsgroup
|
||||
non spedire pubblicità ai newsgroup
|
||||
pubblicare solo messaggi che siano attinenti all'argomento del gruppo
|
||||
è bene pubblicare lo stesso messaggio su più gruppi per darne massima diffusione
|
||||
Nessuna delle precedenti
|
||||
2) Sono tra le fasi per la creazione di un gruppo:
|
||||
la votazione
|
||||
la verifica
|
||||
la certificazione
|
||||
la discussione
|
||||
Nessuno dei precedenti
|
||||
3) La comunicazione FTP può essere gestita:
|
||||
direttamente dal modem
|
||||
da gestione risorse di Windows
|
||||
dai browser
|
||||
da programmi specifici
|
||||
Nessuna delle precedenti
|
||||
4) Le possibili gestioni dei file di un sito FTP sono:
|
||||
anonimous
|
||||
shareware
|
||||
download
|
||||
upload
|
||||
Nessuna delle precedenti
|
||||
5) In alcuni programmi, durante la memorizzazione di file da siti FTP, viene visualizzata una barra contenente:
|
||||
la percentuale di file già salvata
|
||||
la velocità del collegamento
|
||||
la percentuale di file che rimane da salvare
|
||||
il tempo stimato rimanente per completare l'operazione
|
||||
Nessuna delle precedenti
|
||||
6) Quali di queste regole si dovrebbero seguire nell'utilizzo della grafica in siti Web:
|
||||
riutilizzare le stesse immagini su pagine diverse del sito
|
||||
non utilizzare le miniature
|
||||
quando è possibile ridurre il numero dei colori delle immagini
|
||||
non usare mai immagini JPEG progressive
|
||||
Nessuna delle precedenti
|
||||
7) Con il browser di Paint Shop Pro è possibile:
|
||||
navigare nel Web
|
||||
aprire i file di immagini e vederne le informazioni
|
||||
rinominare, cancellare, copiare e spostare file di immagini
|
||||
ritoccare file di immagini
|
||||
Nessuna delle precedenti
|
||||
8) Le immagini in formato GIF:
|
||||
dispongono di un numero elevato di colori
|
||||
sono indicate per disegni e grafici
|
||||
hanno una profondità massima di colore di 16 bit
|
||||
permettono di impostare un colore come trasparente
|
||||
Nessuna delle precedenti
|
||||
9) Lo scopo di FTP è:
|
||||
consentire a macchine remote di trasmettere file
|
||||
consentire a macchine remote di ricevere file
|
||||
consentire a macchine remote di condividere periferiche
|
||||
consentire la comunicazione tra macchine remote con lo stesso sistema operativo
|
||||
Nessuna delle precedenti
|
||||
10) I newsgroups sono
|
||||
aree di discussione alle quali ci si può iscrivere spedendo un messaggio e-mail
|
||||
aree di discussione ai quali si può partecipare spedendo un messaggio e-mail
|
||||
sofware che permettono di accedere all'area di discussione
|
||||
bacheche elettroniche specializzate in un determinato argomento
|
||||
Nessuna delle precedenti
|
||||
11) All'apertura di Free Agent la finestra viene divisa in:
|
||||
2 parti
|
||||
4 parti
|
||||
6 parti
|
||||
non viene divisa
|
||||
Nessuna delle precedenti
|
||||
12) In un sito FTP è possibile interagire con:
|
||||
directory
|
||||
gruppi di discussioni
|
||||
altri utenti
|
||||
file
|
||||
Nessuna delle precedenti
|
||||
13) Durante l'upload di un file in un sito FTP:
|
||||
il file viene caricato sempre nella directory principale
|
||||
il file viene comunque inoltrato
|
||||
il file può essere inoltrato solo se l'utente dispone dei permessi necessari
|
||||
il file viene caricato nella directory dove l'utente si trova posizionato al momento dell'operazione
|
||||
Nessuna delle precedenti
|
||||
14) Le immagini bitmap sono:
|
||||
immagini descritte da curve e poligoni
|
||||
immagini che mantengono sempre la stessa qualità ingrandendole più volte
|
||||
immagini descritte da un insieme di pixel colorati ravvicinati
|
||||
immagini che se ingrandite non mantengono la qualità originale
|
||||
Nessuna delle precedenti
|
||||
15) Con Paint Shop Pro è possibile:
|
||||
acquisire immagini
|
||||
creare pagine Web
|
||||
gestire gruppi di discussione
|
||||
catturare immagini dallo schermo
|
||||
Nessuna delle precedenti
|
||||
16) In un sito FTP, selezionato un file, attraverso il browser l'utente può:
|
||||
aprirlo
|
||||
eliminarlo
|
||||
salvarlo
|
||||
rinominarlo
|
||||
Nessuna delle precedenti
|
||||
17) L'identificazione di un utente da parte di un server FTP può avvenire:
|
||||
con un nome utente e una password
|
||||
con solo una password
|
||||
da parte del browser automaticamente
|
||||
con il solo nome utente
|
||||
Nessuna delle precedenti
|
||||
18) La sigla FTP significa:
|
||||
Format Trasfert Protocol
|
||||
File Trasfert Protocol
|
||||
Filename Trasfert Protocol
|
||||
Firewall Trasfert Protocol
|
||||
Nessuna delle precedenti
|
||||
19) Esempi di news-reader sono:
|
||||
Microsoft Outlook
|
||||
Free Agent
|
||||
Microsoft Internet Explorer
|
||||
Microsoft Word
|
||||
Nessuna delle precedenti
|
||||
20) Usenet è
|
||||
un gruppo di discussione
|
||||
una fonte gratuita di news
|
||||
un messaggio in un gruppo di discussione
|
||||
è un'organizzazione con sue leggi che la regolano
|
||||
Nessuna delle precedenti
|
||||
|
||||
|
||||
|
||||
|
||||
1) Il World Wide Web è:
|
||||
Il vero nome di Internet
|
||||
Lo strumento per sfogliare le pagine Web dei siti
|
||||
Il modo grafico per vedere le informazioni su Internet
|
||||
La rete Internet
|
||||
Nessuna delle precedenti
|
||||
2) Cosa è il "browser" ?
|
||||
Uno strumento per sfogliare le pagine Web
|
||||
Un programma per le ricerche Internet
|
||||
Lo strumento che gestisce la posta elettronica
|
||||
Un componente hardware del computer specifico per Internet
|
||||
Nessuno dei precedenti
|
||||
3) Cosa è un motore di ricerca ?
|
||||
Un componente hardware che si utilizza per le ricerche sul Web
|
||||
Un programma software del nostro computer che si usa per le ricerche sul Web
|
||||
Un particolare server per le ricerche sul Web
|
||||
Uno strumento di ricerca del Web
|
||||
Nessuna delle precedenti
|
||||
4) Cosa è un sito Web ?
|
||||
E' un server di rete che contiene una gran quantità di pagine Web
|
||||
Una pagina HTML sul Web
|
||||
Una collezione ordinata di pagine Web
|
||||
Un insieme di collegamenti a pagine Web
|
||||
Nessuna delle precedenti
|
||||
5) Cosa è l'HTML ?
|
||||
E' il linguaggio di programmazione di Internet
|
||||
E' un linguaggio di marcatura che consente al browser di interpretare un pagina Web
|
||||
E' un linguaggio di programmazione che consente al browser di interpretare un pagina Web
|
||||
E' un testo Web
|
||||
Nessuna delle precedenti
|
||||
6) La modifica di un file HTML:
|
||||
E' possibile solo se si possiede un server Internet
|
||||
E' possibile utilizzando un editor di testo
|
||||
E' possibile solo se abilitati dal proprio provider Internet
|
||||
E' possibile utilizzando solo editor specializzati
|
||||
Nessuna delle precedenti
|
||||
7) La modifica di una pagina Web:
|
||||
E' possibile solo se si possiede un server Internet
|
||||
E' possibile utilizzando un editor di testo
|
||||
E' consentito solo se abilitati dal proprio provider Internet
|
||||
E' possibile solo utilizzando editor specializzati
|
||||
Nessuna delle precedenti
|
||||
8) La creazione di un proprio sito Web:
|
||||
E' possibile solo acquistando un server Web
|
||||
E' possibile solo se si è esperti di programmazione in Java
|
||||
E' consentito solo se si possiede la qualifica di Provider
|
||||
E' consentito solo alle aziende o alle società che immettono pubblicità a pagamento sul
|
||||
Web
|
||||
Nessuna delle precedenti
|
||||
9) Utilizzare MS Word per creare pagine HTML:
|
||||
Non è possibile
|
||||
E' possibile solo se associato ad un programma apposito (come MS Publisher)
|
||||
E' possibile conoscendo la programmazione in HTML
|
||||
E' possibile usando una versione recente di Word
|
||||
Nessuna delle precedenti
|
||||
|
@ -1,109 +1,109 @@
|
||||
<?php
|
||||
|
||||
if ($validato == 0) header ("location: login.php");
|
||||
|
||||
include("funzioni.php");
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Test</title>
|
||||
<LINK rel=stylesheet type=text/css href=stile.css>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if ($mostra == 'nuovo')
|
||||
{
|
||||
$login = $anno_login."-".$mese_login."-".$giorno_login." ".$ora_login.":".$minuti_login.":00";
|
||||
|
||||
$logout = $anno_logout."-".$mese_logout."-".$giorno_logout." ".$ora_logout.":".$minuti_logout.":00";
|
||||
|
||||
$sql = "INSERT INTO $tbl_accessi (idutente, login, logout, descrizione, modifica) VALUES ('"
|
||||
.$validato."','"
|
||||
.$login."','"
|
||||
.$logout."','"
|
||||
.$descr."',
|
||||
'si')";
|
||||
//echo $sql;
|
||||
$ins = mysql_query($sql,$db);
|
||||
if (!$ins)
|
||||
echo "<br><br><p class=error>Dati non inseriti!</p><br><br>";
|
||||
|
||||
}
|
||||
|
||||
if ($mostra == 'canc')
|
||||
{
|
||||
$sql = "DELETE FROM $tbl_accessi WHERE id = $num ";
|
||||
//echo $sql;
|
||||
$ins = mysql_query($sql,$db);
|
||||
if (!$ins)
|
||||
echo "<br><br><p class=error>Eliminazione non effettuata!</p><br><br>";
|
||||
}
|
||||
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tbl_accessi WHERE idutente = $validato ORDER BY login DESC";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//if ($myrow = mysql_fetch_array($result))
|
||||
if (mysql_num_rows($result) > 1)
|
||||
{
|
||||
$num = 0;
|
||||
echo "<br><br><table align=center border=1 width=50% cellpadding=2 cellspacing=0>";
|
||||
echo "<tr><th>Login</th><th>Logout</th><th>Tempo</th><th>Descrizione</th></tr>";
|
||||
do
|
||||
{
|
||||
//string substr(string string, int start, int [length]);
|
||||
|
||||
if ($myrow["logout"] != "0000-00-00 00:00:00")
|
||||
{
|
||||
$tempo = differenza($myrow["login"], $myrow["logout"]);
|
||||
$tot = somma_tempo($tot, $tempo);
|
||||
$login = substr($myrow["login"], 8,2) ."/". substr($myrow["login"], 5,2) ."/" .substr($myrow["login"], 0,4)." ".substr($myrow["login"], 11);
|
||||
$logout = substr($myrow["logout"], 8,2) ."/". substr($myrow["logout"], 5,2) ."/" .substr($myrow["logout"], 0,4)." ".substr($myrow["logout"], 11);
|
||||
if ($myrow[modifica] == 'si')
|
||||
$mod = "<td><a href=presenze.php?mostra=canc&num=$myrow[id]>Cancella</a></td>";
|
||||
else
|
||||
$mod = "<td><br></td>";
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#AAAAAA align=center><td>$login</td><td>$logout</td><td>$tempo</td><td>".$myrow["descrizione"]."</td>$mod</tr>";
|
||||
//echo "<tr bgcolor=#777777 align=center><td nowrap>$login</td><td nowrap>$logout</td><td nowrap>$tempo</td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD align=center><td>$login</td><td>$logout</td><td>$tempo</td><td>".$myrow["descrizione"]."</td>$mod</tr>";
|
||||
$riga = true;
|
||||
}
|
||||
$num++;
|
||||
}
|
||||
}
|
||||
while ($myrow = mysql_fetch_array($result));
|
||||
if ($num != 0) echo "<tr><td colspan=5><br></td></tr><tr><td colspan=5 align=center>$num accessi - tempo totale $tot</td></tr>";
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
|
||||
//echo "<p><table align=center><tr><td><form action=presenze.php method=post><input type=hidden name=mostra value=agg><input type=submit value='Nuovo accesso' class=bottoni></form></td></tr></table></p>";
|
||||
echo "<p><a href=accesso.php>Nuovo Accesso</a></p>";
|
||||
|
||||
//echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
echo "<p><a href=corsi.php>Torna</a></p>";
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
if ($validato == 0) header ("location: login.php");
|
||||
|
||||
include("funzioni.php");
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Test</title>
|
||||
<LINK rel=stylesheet type=text/css href=stile.css>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if ($mostra == 'nuovo')
|
||||
{
|
||||
$login = $anno_login."-".$mese_login."-".$giorno_login." ".$ora_login.":".$minuti_login.":00";
|
||||
|
||||
$logout = $anno_logout."-".$mese_logout."-".$giorno_logout." ".$ora_logout.":".$minuti_logout.":00";
|
||||
|
||||
$sql = "INSERT INTO $tbl_accessi (idutente, login, logout, descrizione, modifica) VALUES ('"
|
||||
.$validato."','"
|
||||
.$login."','"
|
||||
.$logout."','"
|
||||
.$descr."',
|
||||
'si')";
|
||||
//echo $sql;
|
||||
$ins = mysql_query($sql,$db);
|
||||
if (!$ins)
|
||||
echo "<br><br><p class=error>Dati non inseriti!</p><br><br>";
|
||||
|
||||
}
|
||||
|
||||
if ($mostra == 'canc')
|
||||
{
|
||||
$sql = "DELETE FROM $tbl_accessi WHERE id = $num ";
|
||||
//echo $sql;
|
||||
$ins = mysql_query($sql,$db);
|
||||
if (!$ins)
|
||||
echo "<br><br><p class=error>Eliminazione non effettuata!</p><br><br>";
|
||||
}
|
||||
|
||||
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tbl_accessi WHERE idutente = $validato ORDER BY login DESC";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//if ($myrow = mysql_fetch_array($result))
|
||||
if (mysql_num_rows($result) > 1)
|
||||
{
|
||||
$num = 0;
|
||||
echo "<br><br><table align=center border=1 width=50% cellpadding=2 cellspacing=0>";
|
||||
echo "<tr><th>Login</th><th>Logout</th><th>Tempo</th><th>Descrizione</th></tr>";
|
||||
do
|
||||
{
|
||||
//string substr(string string, int start, int [length]);
|
||||
|
||||
if ($myrow["logout"] != "0000-00-00 00:00:00")
|
||||
{
|
||||
$tempo = differenza($myrow["login"], $myrow["logout"]);
|
||||
$tot = somma_tempo($tot, $tempo);
|
||||
$login = substr($myrow["login"], 8,2) ."/". substr($myrow["login"], 5,2) ."/" .substr($myrow["login"], 0,4)." ".substr($myrow["login"], 11);
|
||||
$logout = substr($myrow["logout"], 8,2) ."/". substr($myrow["logout"], 5,2) ."/" .substr($myrow["logout"], 0,4)." ".substr($myrow["logout"], 11);
|
||||
if ($myrow[modifica] == 'si')
|
||||
$mod = "<td><a href=presenze.php?mostra=canc&num=$myrow[id]>Cancella</a></td>";
|
||||
else
|
||||
$mod = "<td><br></td>";
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#AAAAAA align=center><td>$login</td><td>$logout</td><td>$tempo</td><td>".$myrow["descrizione"]."</td>$mod</tr>";
|
||||
//echo "<tr bgcolor=#777777 align=center><td nowrap>$login</td><td nowrap>$logout</td><td nowrap>$tempo</td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD align=center><td>$login</td><td>$logout</td><td>$tempo</td><td>".$myrow["descrizione"]."</td>$mod</tr>";
|
||||
$riga = true;
|
||||
}
|
||||
$num++;
|
||||
}
|
||||
}
|
||||
while ($myrow = mysql_fetch_array($result));
|
||||
if ($num != 0) echo "<tr><td colspan=5><br></td></tr><tr><td colspan=5 align=center>$num accessi - tempo totale $tot</td></tr>";
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
|
||||
//echo "<p><table align=center><tr><td><form action=presenze.php method=post><input type=hidden name=mostra value=agg><input type=submit value='Nuovo accesso' class=bottoni></form></td></tr></table></p>";
|
||||
echo "<p><a href=accesso.php>Nuovo Accesso</a></p>";
|
||||
|
||||
//echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
echo "<p><a href=corsi.php>Torna</a></p>";
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
@ -1,98 +1,98 @@
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
//require 'funzioni.php';
|
||||
//require 'required.php';
|
||||
|
||||
|
||||
if ($username != "")
|
||||
{
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT count(*) as conto FROM $tbl_utenti WHERE username = '$username'";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow["conto"] == 0)
|
||||
{
|
||||
$oggi = date("Y-m-d");
|
||||
$sql = "INSERT INTO $tbl_utenti(nome, cognome, email, username, pass, data) VALUES ('"
|
||||
.$nome."','"
|
||||
.$cognome."','"
|
||||
.$email."','"
|
||||
.$username."','"
|
||||
.$pass."','"
|
||||
.$oggi."')";
|
||||
//echo $sql;
|
||||
$ins = mysql_query($sql,$db);
|
||||
if ($ins)
|
||||
{
|
||||
$validato = validazione($username, $pass);
|
||||
if ($validato != 0)
|
||||
{
|
||||
setcookie("validato", $validato);
|
||||
$ora = date("Y-m-d H:i:s");
|
||||
login($validato, $ora);
|
||||
$username = "";
|
||||
header ("location: corsi.php");
|
||||
}
|
||||
}
|
||||
else
|
||||
//errore_inserimento();
|
||||
$mess = "<p class=error>Inserimento non riuscito!</p>";
|
||||
}
|
||||
else
|
||||
//errore_utente();
|
||||
$mess = "<p class=error>Username già registrato!</p>";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Registrazione</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
<script language="JavaScript">
|
||||
|
||||
function verifica()
|
||||
{
|
||||
esito = true;
|
||||
if (document.form1.nome.value == "") esito = false;
|
||||
if (document.form1.cognome.value == "") esito = false;
|
||||
if (document.form1.email.value == "") esito = false;
|
||||
if (document.form1.username.value == "") esito = false;
|
||||
if (document.form1.pass.value == "") esito = false;
|
||||
if (document.form1.c_pass.value != document.form1.pass.value) esito = false;
|
||||
if (esito == false) alert('Verificare che i dati immessi siano corretti!');
|
||||
if (esito == true) document.form1.submit();
|
||||
return false;
|
||||
}
|
||||
|
||||
function maiusc(campo)
|
||||
{
|
||||
campo.value = campo.value.toUpperCase();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<body>
|
||||
|
||||
<?php echo $mess; ?>
|
||||
|
||||
<TABLE ALIGN="CENTER">
|
||||
<FORM ACTION="registrati.php" METHOD="post" name="form1">
|
||||
<TR><TD align="right">Nome</TD><TD><INPUT type="text" name="nome" value='<?php echo $nome; ?>' onblur="maiusc(nome);"></TD></TR>
|
||||
<TR><TD align="right">Cognome</TD><TD><INPUT type="text" name="cognome" value='<?php echo $cognome; ?>' onblur="maiusc(cognome);"></TD></TR>
|
||||
<TR><TD align="right">E-mail</TD><TD><INPUT type="text" name="email" value='<?php echo $email; ?>'></TD></TR>
|
||||
<TR><TD align="right">Username</TD><TD><INPUT type="text" name="username"></TD></TR>
|
||||
<TR><TD align="right">Password</TD><TD><INPUT type="password" name="pass"></TD></TR>
|
||||
<TR><TD align="right">Conferma password</TD><TD><INPUT type="password" name="c_pass"></TD></TR>
|
||||
<tr><td><br></td></tr>
|
||||
<!-- <TR><TD COLSPAN="2" align="center"><INPUT TYPE="submit" value="Invia" class="bottoni"></TD></TR> -->
|
||||
<TR><TD COLSPAN="2" align="center"><input type="Button" value="Invia" onclick="return verifica();" class="bottoni"></TD></TR>
|
||||
</table></form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
//require 'funzioni.php';
|
||||
//require 'required.php';
|
||||
|
||||
|
||||
if ($username != "")
|
||||
{
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT count(*) as conto FROM $tbl_utenti WHERE username = '$username'";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
if ($myrow["conto"] == 0)
|
||||
{
|
||||
$oggi = date("Y-m-d");
|
||||
$sql = "INSERT INTO $tbl_utenti(nome, cognome, email, username, pass, data) VALUES ('"
|
||||
.$nome."','"
|
||||
.$cognome."','"
|
||||
.$email."','"
|
||||
.$username."','"
|
||||
.$pass."','"
|
||||
.$oggi."')";
|
||||
//echo $sql;
|
||||
$ins = mysql_query($sql,$db);
|
||||
if ($ins)
|
||||
{
|
||||
$validato = validazione($username, $pass);
|
||||
if ($validato != 0)
|
||||
{
|
||||
setcookie("validato", $validato);
|
||||
$ora = date("Y-m-d H:i:s");
|
||||
login($validato, $ora);
|
||||
$username = "";
|
||||
header ("location: corsi.php");
|
||||
}
|
||||
}
|
||||
else
|
||||
//errore_inserimento();
|
||||
$mess = "<p class=error>Inserimento non riuscito!</p>";
|
||||
}
|
||||
else
|
||||
//errore_utente();
|
||||
$mess = "<p class=error>Username già registrato!</p>";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Registrazione</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
</head>
|
||||
<script language="JavaScript">
|
||||
|
||||
function verifica()
|
||||
{
|
||||
esito = true;
|
||||
if (document.form1.nome.value == "") esito = false;
|
||||
if (document.form1.cognome.value == "") esito = false;
|
||||
if (document.form1.email.value == "") esito = false;
|
||||
if (document.form1.username.value == "") esito = false;
|
||||
if (document.form1.pass.value == "") esito = false;
|
||||
if (document.form1.c_pass.value != document.form1.pass.value) esito = false;
|
||||
if (esito == false) alert('Verificare che i dati immessi siano corretti!');
|
||||
if (esito == true) document.form1.submit();
|
||||
return false;
|
||||
}
|
||||
|
||||
function maiusc(campo)
|
||||
{
|
||||
campo.value = campo.value.toUpperCase();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<body>
|
||||
|
||||
<?php echo $mess; ?>
|
||||
|
||||
<TABLE ALIGN="CENTER">
|
||||
<FORM ACTION="registrati.php" METHOD="post" name="form1">
|
||||
<TR><TD align="right">Nome</TD><TD><INPUT type="text" name="nome" value='<?php echo $nome; ?>' onblur="maiusc(nome);"></TD></TR>
|
||||
<TR><TD align="right">Cognome</TD><TD><INPUT type="text" name="cognome" value='<?php echo $cognome; ?>' onblur="maiusc(cognome);"></TD></TR>
|
||||
<TR><TD align="right">E-mail</TD><TD><INPUT type="text" name="email" value='<?php echo $email; ?>'></TD></TR>
|
||||
<TR><TD align="right">Username</TD><TD><INPUT type="text" name="username"></TD></TR>
|
||||
<TR><TD align="right">Password</TD><TD><INPUT type="password" name="pass"></TD></TR>
|
||||
<TR><TD align="right">Conferma password</TD><TD><INPUT type="password" name="c_pass"></TD></TR>
|
||||
<tr><td><br></td></tr>
|
||||
<!-- <TR><TD COLSPAN="2" align="center"><INPUT TYPE="submit" value="Invia" class="bottoni"></TD></TR> -->
|
||||
<TR><TD COLSPAN="2" align="center"><input type="Button" value="Invia" onclick="return verifica();" class="bottoni"></TD></TR>
|
||||
</table></form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,33 +1,33 @@
|
||||
<?php
|
||||
|
||||
$ip = "localhost";
|
||||
$user = "root";
|
||||
$password = "";
|
||||
$dataname = "corsi";
|
||||
|
||||
|
||||
//$test_prima = "Falso"; // Impostato su Vero indica che e' presente anche il test prima del download di una lezione.
|
||||
|
||||
|
||||
// Costanti di controllo
|
||||
$s_vero = "Vero";
|
||||
$s_falso = "Falso";
|
||||
$s_prima = "Prima";
|
||||
$s_dopo = "Dopo";
|
||||
$s_inizio = "Inizio";
|
||||
$s_fine = "Fine";
|
||||
|
||||
|
||||
// Nomi delle tabelle nel database
|
||||
$tbl_accessi = "accessi";
|
||||
$tbl_corsi = "corsi";
|
||||
$tbl_domande = "domande";
|
||||
$tbl_download = "download";
|
||||
$tbl_lezioni = "lezioni";
|
||||
$tbl_prove = "prove";
|
||||
$tbl_risposte = "risposte";
|
||||
$tbl_test = "test";
|
||||
$tbl_utenti = "utenti";
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$ip = "localhost";
|
||||
$user = "root";
|
||||
$password = "";
|
||||
$dataname = "corsi";
|
||||
|
||||
|
||||
//$test_prima = "Falso"; // Impostato su Vero indica che e' presente anche il test prima del download di una lezione.
|
||||
|
||||
|
||||
// Costanti di controllo
|
||||
$s_vero = "Vero";
|
||||
$s_falso = "Falso";
|
||||
$s_prima = "Prima";
|
||||
$s_dopo = "Dopo";
|
||||
$s_inizio = "Inizio";
|
||||
$s_fine = "Fine";
|
||||
|
||||
|
||||
// Nomi delle tabelle nel database
|
||||
$tbl_accessi = "accessi";
|
||||
$tbl_corsi = "corsi";
|
||||
$tbl_domande = "domande";
|
||||
$tbl_download = "download";
|
||||
$tbl_lezioni = "lezioni";
|
||||
$tbl_prove = "prove";
|
||||
$tbl_risposte = "risposte";
|
||||
$tbl_test = "test";
|
||||
$tbl_utenti = "utenti";
|
||||
|
||||
|
||||
?>
|
@ -1,29 +1,29 @@
|
||||
body{background-color:#D3DCED;}
|
||||
|
||||
p{font-family:Arial; font-size:12pt; text-align:center;}
|
||||
p.titolo{font-family:Arial; font-size:14pt; text-align:center;}
|
||||
p.error{font-family:Garamond; font-size:12pt; color:red; font-weight:900; text-align:center;}
|
||||
|
||||
th{font-family:Tahoma; font-size:10pt; background-color:Navy; color:white;}
|
||||
|
||||
td{font-family:Tahoma; font-size:8pt; font-weight:bold;}
|
||||
td.titolo{font-family:Arial; font-size:12pt; font-weight:bold;}
|
||||
td.menu{font-family:Arial; font-size:8pt; font-weight:bold; text-align:center; color:white;}
|
||||
td.menug{font-family:Arial; font-size:12pt; font-weight:bold; text-align:center; color:Navy;}
|
||||
|
||||
input{font-family:Tahoma; font-size:8pt; font-weight:bold;}
|
||||
input.bottoni{font-family:Verdana; font-size:9pt; font-weight:bold;}
|
||||
|
||||
A:visited{color:Teal; text-decoration:none;}
|
||||
/*A:active{color:blue; text-decoration:none;}*/
|
||||
A:link{color:blue; text-decoration:none;}
|
||||
A:hover{color:red; text-decoration:underline;}
|
||||
|
||||
|
||||
/*
|
||||
TAVOLA DEI COLORI
|
||||
|
||||
#BF210B = rosso
|
||||
#D3DCED = celeste
|
||||
|
||||
body{background-color:#D3DCED;}
|
||||
|
||||
p{font-family:Arial; font-size:12pt; text-align:center;}
|
||||
p.titolo{font-family:Arial; font-size:14pt; text-align:center;}
|
||||
p.error{font-family:Garamond; font-size:12pt; color:red; font-weight:900; text-align:center;}
|
||||
|
||||
th{font-family:Tahoma; font-size:10pt; background-color:Navy; color:white;}
|
||||
|
||||
td{font-family:Tahoma; font-size:8pt; font-weight:bold;}
|
||||
td.titolo{font-family:Arial; font-size:12pt; font-weight:bold;}
|
||||
td.menu{font-family:Arial; font-size:8pt; font-weight:bold; text-align:center; color:white;}
|
||||
td.menug{font-family:Arial; font-size:12pt; font-weight:bold; text-align:center; color:Navy;}
|
||||
|
||||
input{font-family:Tahoma; font-size:8pt; font-weight:bold;}
|
||||
input.bottoni{font-family:Verdana; font-size:9pt; font-weight:bold;}
|
||||
|
||||
A:visited{color:Teal; text-decoration:none;}
|
||||
/*A:active{color:blue; text-decoration:none;}*/
|
||||
A:link{color:blue; text-decoration:none;}
|
||||
A:hover{color:red; text-decoration:underline;}
|
||||
|
||||
|
||||
/*
|
||||
TAVOLA DEI COLORI
|
||||
|
||||
#BF210B = rosso
|
||||
#D3DCED = celeste
|
||||
|
||||
*/
|
File diff suppressed because it is too large
Load Diff
@ -1,134 +1,134 @@
|
||||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
class Table
|
||||
{
|
||||
var $table_array = array();
|
||||
var $headers = array();
|
||||
var $cols;
|
||||
|
||||
function table($headers)
|
||||
{
|
||||
$this->headers = $headers;
|
||||
$this->cols = count($headers);
|
||||
}
|
||||
|
||||
function addrow($row)
|
||||
{
|
||||
if (count($row) != $this->cols)
|
||||
return false;
|
||||
array_push($this->table_array, $row);
|
||||
return true;
|
||||
}
|
||||
|
||||
function output()
|
||||
{
|
||||
echo "<table align=center border=0>";
|
||||
echo "<tr>";
|
||||
foreach($this->headers as $headers)
|
||||
echo "<th bgcolor=#CCCCCC>$headers</th>";
|
||||
echo "</tr>";
|
||||
foreach($this->table_array as $y)
|
||||
{
|
||||
echo "<tr>";
|
||||
foreach($y as $xcell)
|
||||
if ($xcell != "")
|
||||
echo "<td bgcolor=#DDDDDD>$xcell</td>";
|
||||
else
|
||||
echo "<td><br></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//$tabella = "domande";
|
||||
if (!isset($tbl))
|
||||
{
|
||||
echo "<form action=classe.php><select name=tbl>";
|
||||
echo "<option value=corsi>corsi</option>";
|
||||
echo "<option value=domande>domande</option>";
|
||||
echo "<option value=risposte>risposte</option>";
|
||||
echo "<option value=test>test</option>";
|
||||
echo "<option value=lezioni>lezioni</option>";
|
||||
echo "</select><input type=submit value=Visualizza></form>";
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (isset($tbl))
|
||||
{
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tbl ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
$dati = array();
|
||||
$num_fields = mysql_num_fields($result);
|
||||
for($x = 0; $x < $num_fields; $x++)
|
||||
$dati[] = mysql_field_name($result, $x);
|
||||
$tabella = new table($dati);
|
||||
do
|
||||
{
|
||||
$temp = array();
|
||||
foreach($dati as $nome)
|
||||
$temp[] = $myrow[$nome];
|
||||
$tabella -> addrow($temp);
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
|
||||
$tabella -> output();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
// Scelta del DATABASE
|
||||
if (!isset($dbs) && !isset($tbl))
|
||||
{
|
||||
include("required.php");
|
||||
$link = mysql_connect($ip, $user, $password);
|
||||
|
||||
$db_res = mysql_list_dbs($link);
|
||||
$num = mysql_num_rows($db_res);
|
||||
for ($x = 0; $x < $num; $x++)
|
||||
echo "<a href=classe.php?dbs=".mysql_tablename($db_res, $x).">".mysql_tablename($db_res, $x)."</a><br>";
|
||||
mysql_close($link);
|
||||
}
|
||||
|
||||
|
||||
// Scelta della TABELLA
|
||||
if (isset($dbs))
|
||||
{
|
||||
echo $dbs;
|
||||
include("required.php");
|
||||
$link = mysql_connect($ip, $user, $password);
|
||||
//$result = mysql_list_tables($dbs, $link);
|
||||
$result = mysql_list_tables($dbs);
|
||||
$tab_rows = mysql_fetch_row($result);
|
||||
for ($x = 0; $x < $tab_rows; $x++)
|
||||
{
|
||||
//echo "$tab_rows[$x]<br>";
|
||||
$table = mysql_tablename($result, $x);
|
||||
echo $table;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
class Table
|
||||
{
|
||||
var $table_array = array();
|
||||
var $headers = array();
|
||||
var $cols;
|
||||
|
||||
function table($headers)
|
||||
{
|
||||
$this->headers = $headers;
|
||||
$this->cols = count($headers);
|
||||
}
|
||||
|
||||
function addrow($row)
|
||||
{
|
||||
if (count($row) != $this->cols)
|
||||
return false;
|
||||
array_push($this->table_array, $row);
|
||||
return true;
|
||||
}
|
||||
|
||||
function output()
|
||||
{
|
||||
echo "<table align=center border=0>";
|
||||
echo "<tr>";
|
||||
foreach($this->headers as $headers)
|
||||
echo "<th bgcolor=#CCCCCC>$headers</th>";
|
||||
echo "</tr>";
|
||||
foreach($this->table_array as $y)
|
||||
{
|
||||
echo "<tr>";
|
||||
foreach($y as $xcell)
|
||||
if ($xcell != "")
|
||||
echo "<td bgcolor=#DDDDDD>$xcell</td>";
|
||||
else
|
||||
echo "<td><br></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//$tabella = "domande";
|
||||
if (!isset($tbl))
|
||||
{
|
||||
echo "<form action=classe.php><select name=tbl>";
|
||||
echo "<option value=corsi>corsi</option>";
|
||||
echo "<option value=domande>domande</option>";
|
||||
echo "<option value=risposte>risposte</option>";
|
||||
echo "<option value=test>test</option>";
|
||||
echo "<option value=lezioni>lezioni</option>";
|
||||
echo "</select><input type=submit value=Visualizza></form>";
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (isset($tbl))
|
||||
{
|
||||
include("required.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
$criteri = "SELECT * FROM $tbl ";
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
$dati = array();
|
||||
$num_fields = mysql_num_fields($result);
|
||||
for($x = 0; $x < $num_fields; $x++)
|
||||
$dati[] = mysql_field_name($result, $x);
|
||||
$tabella = new table($dati);
|
||||
do
|
||||
{
|
||||
$temp = array();
|
||||
foreach($dati as $nome)
|
||||
$temp[] = $myrow[$nome];
|
||||
$tabella -> addrow($temp);
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
|
||||
$tabella -> output();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
// Scelta del DATABASE
|
||||
if (!isset($dbs) && !isset($tbl))
|
||||
{
|
||||
include("required.php");
|
||||
$link = mysql_connect($ip, $user, $password);
|
||||
|
||||
$db_res = mysql_list_dbs($link);
|
||||
$num = mysql_num_rows($db_res);
|
||||
for ($x = 0; $x < $num; $x++)
|
||||
echo "<a href=classe.php?dbs=".mysql_tablename($db_res, $x).">".mysql_tablename($db_res, $x)."</a><br>";
|
||||
mysql_close($link);
|
||||
}
|
||||
|
||||
|
||||
// Scelta della TABELLA
|
||||
if (isset($dbs))
|
||||
{
|
||||
echo $dbs;
|
||||
include("required.php");
|
||||
$link = mysql_connect($ip, $user, $password);
|
||||
//$result = mysql_list_tables($dbs, $link);
|
||||
$result = mysql_list_tables($dbs);
|
||||
$tab_rows = mysql_fetch_row($result);
|
||||
for ($x = 0; $x < $tab_rows; $x++)
|
||||
{
|
||||
//echo "$tab_rows[$x]<br>";
|
||||
$table = mysql_tablename($result, $x);
|
||||
echo $table;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
@ -1,225 +1,225 @@
|
||||
<?php
|
||||
|
||||
if ($validato == 0) header ("location: login.php");
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Test</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="3">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (isset ($fine) && ($fine !=0))
|
||||
{
|
||||
echo "<br><p class=titolo>Test finale</p><br>";
|
||||
|
||||
$criteri0 = "SELECT $tbl_domande.idtest, $tbl_domande.domanda, $tbl_domande.id ";
|
||||
$criteri0 .= "FROM $tbl_domande WHERE ($tbl_domande.idtest = $fine)";
|
||||
//echo $criteri5;
|
||||
$result0 = mysql_query($criteri0, $db);
|
||||
if ($myrow0 = mysql_fetch_array($result0))
|
||||
{
|
||||
echo "<form name=form1 action=verifica.php method=post>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#BF210B><td height=25><font color=white>$n) $myrow0[domanda]</font></td></tr>";
|
||||
$criteri01 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow0[id]) ";
|
||||
//echo $criteri01;
|
||||
$result01 = mysql_query($criteri01, $db);
|
||||
if ($myrow01 = mysql_fetch_array($result01))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB><td><input type=checkbox name='scelte[]' value=$myrow01[id]>$myrow01[risposta]<br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td><input type=checkbox name='scelte[]' value=$myrow01[id]>$myrow01[risposta]<br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow01 = mysql_fetch_array($result01));
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow0 = mysql_fetch_array($result0));
|
||||
echo "<tr><td><input type=hidden name=test value=$fine><input type=hidden name=verifica></td></tr>";
|
||||
echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni> <input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$criteri = "SELECT count(*) as download ";
|
||||
$criteri .= "FROM $tbl_lezioni LEFT JOIN $tbl_download ON $tbl_lezioni.id = $tbl_download.idlezione ";
|
||||
$criteri .= "WHERE ($tbl_download.idlezione = $lez)";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//echo $myrow[download];
|
||||
if ($myrow[download] != 0)
|
||||
{
|
||||
$criteri1 = "SELECT $tbl_test.id as test, $tbl_prove.id as prove ";
|
||||
$criteri1 .= "FROM $tbl_test LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_test.idlezione = $lez) AND ($tbl_test.posizione = '$s_dopo') AND ($tbl_prove.idutente = $validato)";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
|
||||
echo "<br><br><p class=error>Impossibile accedere al corso oppure il test è stato svolto!</p><br><br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$criteri2 = "SELECT $tbl_lezioni.id, $tbl_test.posizione, $tbl_domande.domanda, $tbl_domande.id, $tbl_test.id as test, $tbl_test.nome ";
|
||||
$criteri2 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_domande ON $tbl_test.id = $tbl_domande.idtest ";
|
||||
$criteri2 .= "WHERE ($tbl_lezioni.id = $lez) AND ($tbl_test.posizione = '$s_dopo') ";
|
||||
|
||||
$result2 = mysql_query($criteri2, $db);
|
||||
if ($myrow2 = mysql_fetch_array($result2))
|
||||
{
|
||||
$num_test = $myrow2[test];
|
||||
echo "<form name=form1 action=verifica.php method=post>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
echo "<tr><td class=titolo align=center><font color=#BF210B>".$myrow2["nome"]."</font></td></tr><tr><td><br></td></tr>";
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#BF210B><td height=25><font color=white>$n) $myrow2[domanda]</font></td></tr>";
|
||||
$criteri3 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow2[id]) AND (visibile = '$s_vero') ";
|
||||
//echo $criteri3;
|
||||
$result3 = mysql_query($criteri3, $db);
|
||||
if ($myrow3 = mysql_fetch_array($result3))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB><td><input type=checkbox name='scelte[]' value=$myrow3[id]>$myrow3[risposta]<br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td><input type=checkbox name='scelte[]' value=$myrow3[id]>$myrow3[risposta]<br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow3= mysql_fetch_array($result3));
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow2 = mysql_fetch_array($result2));
|
||||
echo "<tr><td><input type=hidden name=test value=$num_test><input type=hidden name=verifica></td></tr>";
|
||||
echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni> <input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (test_prima($lez) == true)
|
||||
{
|
||||
$criteri4 = "SELECT $tbl_test.id as test, $tbl_prove.id as prove ";
|
||||
$criteri4 .= "FROM $tbl_test LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri4 .= "WHERE ($tbl_test.idlezione = $lez) AND ($tbl_test.posizione = '$s_prima')";
|
||||
//echo $criteri4;
|
||||
$result4 = mysql_query($criteri4, $db);
|
||||
$myrow4 = mysql_fetch_array($result4);
|
||||
//$num_rows = mysql_num_rows($result4);
|
||||
if ($myrow4[prove] != 0)
|
||||
//if ($num_rows != 0)
|
||||
{
|
||||
echo "<br><br><p class=error>Impossibile accedere al corso oppure il test è stato svolto!</p><br><br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (controllo_test($lez, $validato))
|
||||
{
|
||||
$num_test = $myrow4[test];
|
||||
|
||||
if ($num_test != "")
|
||||
{
|
||||
$criteri5 = "SELECT $tbl_domande.idtest, $tbl_domande.domanda, $tbl_domande.id ";
|
||||
$criteri5 .= "FROM $tbl_domande WHERE ($tbl_domande.idtest = $num_test)";
|
||||
//echo $criteri5;
|
||||
$result5 = mysql_query($criteri5, $db);
|
||||
$myrow5 = mysql_fetch_array($result5);
|
||||
//if ($myrow5 = mysql_fetch_array($result5))
|
||||
|
||||
echo "<form name=form1 action=verifica.php method=post>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#BF210B><td height=25><font color=white>$n) $myrow5[domanda]</font></td></tr>";
|
||||
//$criteri6 = "SELECT * FROM risposte WHERE (iddomanda = $myrow5[id]) AND (visibile = 'true') ";
|
||||
$criteri6 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow5[id]) ";
|
||||
//echo $criteri6;
|
||||
$result6 = mysql_query($criteri6, $db);
|
||||
if ($myrow6 = mysql_fetch_array($result6))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB><td><input type=checkbox name='scelte[]' value=$myrow6[id]>$myrow6[risposta]<br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td><input type=checkbox name='scelte[]' value=$myrow6[id]>$myrow6[risposta]<br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow6 = mysql_fetch_array($result6));
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow5 = mysql_fetch_array($result5));
|
||||
echo "<tr><td><input type=hidden name=test value=$num_test><input type=hidden name=verifica></td></tr>";
|
||||
echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni> <input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Prima di passare a questa lezione occorre concludere quella precedente!</p><br><br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Prima di effettuare il test occorre scaricare la lezione!</p><br><br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//echo "<p><a href=corsi.php>Torna ai corsi</a></p>";
|
||||
|
||||
echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
|
||||
if ($validato == 0) header ("location: login.php");
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Test</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="3">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
include("funzioni.php");
|
||||
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
if (isset ($fine) && ($fine !=0))
|
||||
{
|
||||
echo "<br><p class=titolo>Test finale</p><br>";
|
||||
|
||||
$criteri0 = "SELECT $tbl_domande.idtest, $tbl_domande.domanda, $tbl_domande.id ";
|
||||
$criteri0 .= "FROM $tbl_domande WHERE ($tbl_domande.idtest = $fine)";
|
||||
//echo $criteri5;
|
||||
$result0 = mysql_query($criteri0, $db);
|
||||
if ($myrow0 = mysql_fetch_array($result0))
|
||||
{
|
||||
echo "<form name=form1 action=verifica.php method=post>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#BF210B><td height=25><font color=white>$n) $myrow0[domanda]</font></td></tr>";
|
||||
$criteri01 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow0[id]) ";
|
||||
//echo $criteri01;
|
||||
$result01 = mysql_query($criteri01, $db);
|
||||
if ($myrow01 = mysql_fetch_array($result01))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB><td><input type=checkbox name='scelte[]' value=$myrow01[id]>$myrow01[risposta]<br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td><input type=checkbox name='scelte[]' value=$myrow01[id]>$myrow01[risposta]<br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow01 = mysql_fetch_array($result01));
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow0 = mysql_fetch_array($result0));
|
||||
echo "<tr><td><input type=hidden name=test value=$fine><input type=hidden name=verifica></td></tr>";
|
||||
echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni> <input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$criteri = "SELECT count(*) as download ";
|
||||
$criteri .= "FROM $tbl_lezioni LEFT JOIN $tbl_download ON $tbl_lezioni.id = $tbl_download.idlezione ";
|
||||
$criteri .= "WHERE ($tbl_download.idlezione = $lez)";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
$myrow = mysql_fetch_array($result);
|
||||
//echo $myrow[download];
|
||||
if ($myrow[download] != 0)
|
||||
{
|
||||
$criteri1 = "SELECT $tbl_test.id as test, $tbl_prove.id as prove ";
|
||||
$criteri1 .= "FROM $tbl_test LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri1 .= "WHERE ($tbl_test.idlezione = $lez) AND ($tbl_test.posizione = '$s_dopo') AND ($tbl_prove.idutente = $validato)";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
|
||||
echo "<br><br><p class=error>Impossibile accedere al corso oppure il test è stato svolto!</p><br><br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$criteri2 = "SELECT $tbl_lezioni.id, $tbl_test.posizione, $tbl_domande.domanda, $tbl_domande.id, $tbl_test.id as test, $tbl_test.nome ";
|
||||
$criteri2 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_domande ON $tbl_test.id = $tbl_domande.idtest ";
|
||||
$criteri2 .= "WHERE ($tbl_lezioni.id = $lez) AND ($tbl_test.posizione = '$s_dopo') ";
|
||||
|
||||
$result2 = mysql_query($criteri2, $db);
|
||||
if ($myrow2 = mysql_fetch_array($result2))
|
||||
{
|
||||
$num_test = $myrow2[test];
|
||||
echo "<form name=form1 action=verifica.php method=post>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
echo "<tr><td class=titolo align=center><font color=#BF210B>".$myrow2["nome"]."</font></td></tr><tr><td><br></td></tr>";
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#BF210B><td height=25><font color=white>$n) $myrow2[domanda]</font></td></tr>";
|
||||
$criteri3 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow2[id]) AND (visibile = '$s_vero') ";
|
||||
//echo $criteri3;
|
||||
$result3 = mysql_query($criteri3, $db);
|
||||
if ($myrow3 = mysql_fetch_array($result3))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB><td><input type=checkbox name='scelte[]' value=$myrow3[id]>$myrow3[risposta]<br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td><input type=checkbox name='scelte[]' value=$myrow3[id]>$myrow3[risposta]<br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow3= mysql_fetch_array($result3));
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow2 = mysql_fetch_array($result2));
|
||||
echo "<tr><td><input type=hidden name=test value=$num_test><input type=hidden name=verifica></td></tr>";
|
||||
echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni> <input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (test_prima($lez) == true)
|
||||
{
|
||||
$criteri4 = "SELECT $tbl_test.id as test, $tbl_prove.id as prove ";
|
||||
$criteri4 .= "FROM $tbl_test LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest ";
|
||||
$criteri4 .= "WHERE ($tbl_test.idlezione = $lez) AND ($tbl_test.posizione = '$s_prima')";
|
||||
//echo $criteri4;
|
||||
$result4 = mysql_query($criteri4, $db);
|
||||
$myrow4 = mysql_fetch_array($result4);
|
||||
//$num_rows = mysql_num_rows($result4);
|
||||
if ($myrow4[prove] != 0)
|
||||
//if ($num_rows != 0)
|
||||
{
|
||||
echo "<br><br><p class=error>Impossibile accedere al corso oppure il test è stato svolto!</p><br><br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (controllo_test($lez, $validato))
|
||||
{
|
||||
$num_test = $myrow4[test];
|
||||
|
||||
if ($num_test != "")
|
||||
{
|
||||
$criteri5 = "SELECT $tbl_domande.idtest, $tbl_domande.domanda, $tbl_domande.id ";
|
||||
$criteri5 .= "FROM $tbl_domande WHERE ($tbl_domande.idtest = $num_test)";
|
||||
//echo $criteri5;
|
||||
$result5 = mysql_query($criteri5, $db);
|
||||
$myrow5 = mysql_fetch_array($result5);
|
||||
//if ($myrow5 = mysql_fetch_array($result5))
|
||||
|
||||
echo "<form name=form1 action=verifica.php method=post>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
echo "<tr bgcolor=#BF210B><td height=25><font color=white>$n) $myrow5[domanda]</font></td></tr>";
|
||||
//$criteri6 = "SELECT * FROM risposte WHERE (iddomanda = $myrow5[id]) AND (visibile = 'true') ";
|
||||
$criteri6 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow5[id]) ";
|
||||
//echo $criteri6;
|
||||
$result6 = mysql_query($criteri6, $db);
|
||||
if ($myrow6 = mysql_fetch_array($result6))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB><td><input type=checkbox name='scelte[]' value=$myrow6[id]>$myrow6[risposta]<br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td><input type=checkbox name='scelte[]' value=$myrow6[id]>$myrow6[risposta]<br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow6 = mysql_fetch_array($result6));
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow5 = mysql_fetch_array($result5));
|
||||
echo "<tr><td><input type=hidden name=test value=$num_test><input type=hidden name=verifica></td></tr>";
|
||||
echo "<tr><td align=center><input type=Reset value=Azzera class=bottoni> <input type=submit value=Correggi class=bottoni></td></tr></table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Prima di passare a questa lezione occorre concludere quella precedente!</p><br><br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Prima di effettuare il test occorre scaricare la lezione!</p><br><br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//echo "<p><a href=corsi.php>Torna ai corsi</a></p>";
|
||||
|
||||
echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,147 +1,147 @@
|
||||
<?php
|
||||
|
||||
if ($validato == 0) header ("location: login.php");
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="3">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT * FROM $tbl_domande WHERE (idtest = $test)";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
if (!isset ($bianco))
|
||||
{
|
||||
echo "<form name=form1>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
echo "<tr><td class=titolo align=center colspan=2><font color=#1058BA>Risultato del test</font></td></tr><tr><td colspan=2><br></td></tr>";
|
||||
$totale = 0;
|
||||
$punteggio = 0;
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
$vere = 0;
|
||||
$false = 0;
|
||||
$indovinate = 0;
|
||||
$sbagliate = 0;
|
||||
echo "<tr bgcolor=#1058BA><td width=5% bgcolor=#D3DCED><br></td><td height=25><font color=white>$n) $myrow[domanda]</font></td></tr>";
|
||||
//$criteri1 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow[id]) AND (visibile = 'true') ";
|
||||
$criteri1 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow[id]) ";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($myrow1[valida] == "$s_vero")
|
||||
{
|
||||
$valore = "checked";
|
||||
$vere++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$valore ="";
|
||||
$false++;
|
||||
}
|
||||
$vera = "";
|
||||
if (isset ($scelte)) if (in_array($myrow1["id"], $scelte)) $vera = "checked";
|
||||
$font = "";
|
||||
|
||||
// Risposta errata ma segnata
|
||||
if (($vera != $valore) && ($valore != "checked"))
|
||||
{
|
||||
$font = "<font color=red>";
|
||||
$sbagliate++;
|
||||
}
|
||||
// Risposta giusta non segnata
|
||||
if (($vera != $valore) && ($valore == "checked"))
|
||||
$font = "<font color=green>";
|
||||
// Risposta giusta e segnata
|
||||
if (($vera == $valore) && ($valore == "checked"))
|
||||
$indovinate++;
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB><td><input type=checkbox $valore></td><td><input type=checkbox $vera>$font$myrow1[risposta]</font><br></td></tr>";
|
||||
//echo "<tr><td><input type=checkbox $valore></td><td><input type=checkbox $vera>$font$myrow1[risposta]</font><br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td><input type=checkbox $valore></td><td><input type=checkbox $vera>$font$myrow1[risposta]</font><br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow1= mysql_fetch_array($result1));
|
||||
//echo "false =".$false;
|
||||
//echo "vere = ".$vere;
|
||||
//echo "indovinate = ".$indovinate;
|
||||
//echo "sbagliate = ".$sbagliate;
|
||||
$punteggio = $punteggio + (1/$vere)*$indovinate - (1/$false)*$sbagliate;
|
||||
//echo "punteggio =".$punteggio;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
//if ($punteggio != 0) $ris = ($punteggio/$totale) * 100;
|
||||
$n_test = $n -1;
|
||||
//echo "test =".$n_test;
|
||||
$ris = ((100 * ($punteggio + $n_test)) / $n_test)/2;
|
||||
//echo "ris =".$ris;
|
||||
if ($ris != 100)
|
||||
{
|
||||
if (substr($ris, 3,1) > 5)
|
||||
$ris = (substr($ris, 0,2) + 1); // Approssima per eccesso
|
||||
else
|
||||
$ris = substr($ris, 0,2); // Approssima per difetto
|
||||
}
|
||||
echo "<tr><td colspan=2><br></td></tr><tr><td colspan=2 align=center>Risultato del test: $ris/100</td></tr>";
|
||||
echo "</table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p>Il test é stato consegnato in bianco</p><br><br>";
|
||||
$ris = "consegnato in bianco";
|
||||
}
|
||||
|
||||
$oggi = date("Y-m-d");
|
||||
|
||||
$query = "INSERT INTO $tbl_prove (idutente, idtest, data, risultato) VALUES ('"
|
||||
.$validato."','"
|
||||
.$test."','"
|
||||
.$oggi."','"
|
||||
.$ris."')";
|
||||
//echo $query;
|
||||
$ins = mysql_query($query,$db);
|
||||
if (!$ins) echo "<br><br><p class=error>La prova non è stata registrata!</p><br><br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
|
||||
echo "<p><a href=corsi.php>Torna ai corsi</a></p>";
|
||||
|
||||
//echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
|
||||
if ($validato == 0) header ("location: login.php");
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Corsi</title>
|
||||
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="3">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
include("required.php");
|
||||
$db = mysql_connect($ip, $user, $password);
|
||||
mysql_select_db($dataname,$db);
|
||||
|
||||
$criteri = "SELECT * FROM $tbl_domande WHERE (idtest = $test)";
|
||||
//echo $criteri;
|
||||
$result = mysql_query($criteri, $db);
|
||||
if ($myrow = mysql_fetch_array($result))
|
||||
{
|
||||
if (!isset ($bianco))
|
||||
{
|
||||
echo "<form name=form1>";
|
||||
echo "<table align=center border=1 width=80% cellpadding=2 cellspacing=0>";
|
||||
echo "<tr><td class=titolo align=center colspan=2><font color=#1058BA>Risultato del test</font></td></tr><tr><td colspan=2><br></td></tr>";
|
||||
$totale = 0;
|
||||
$punteggio = 0;
|
||||
$n = 1;
|
||||
do
|
||||
{
|
||||
$vere = 0;
|
||||
$false = 0;
|
||||
$indovinate = 0;
|
||||
$sbagliate = 0;
|
||||
echo "<tr bgcolor=#1058BA><td width=5% bgcolor=#D3DCED><br></td><td height=25><font color=white>$n) $myrow[domanda]</font></td></tr>";
|
||||
//$criteri1 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow[id]) AND (visibile = 'true') ";
|
||||
$criteri1 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow[id]) ";
|
||||
//echo $criteri1;
|
||||
$result1 = mysql_query($criteri1, $db);
|
||||
if ($myrow1 = mysql_fetch_array($result1))
|
||||
{
|
||||
do
|
||||
{
|
||||
if ($myrow1[valida] == "$s_vero")
|
||||
{
|
||||
$valore = "checked";
|
||||
$vere++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$valore ="";
|
||||
$false++;
|
||||
}
|
||||
$vera = "";
|
||||
if (isset ($scelte)) if (in_array($myrow1["id"], $scelte)) $vera = "checked";
|
||||
$font = "";
|
||||
|
||||
// Risposta errata ma segnata
|
||||
if (($vera != $valore) && ($valore != "checked"))
|
||||
{
|
||||
$font = "<font color=red>";
|
||||
$sbagliate++;
|
||||
}
|
||||
// Risposta giusta non segnata
|
||||
if (($vera != $valore) && ($valore == "checked"))
|
||||
$font = "<font color=green>";
|
||||
// Risposta giusta e segnata
|
||||
if (($vera == $valore) && ($valore == "checked"))
|
||||
$indovinate++;
|
||||
if ($riga == true)
|
||||
{
|
||||
echo "<tr bgcolor=#BBBBBB><td><input type=checkbox $valore></td><td><input type=checkbox $vera>$font$myrow1[risposta]</font><br></td></tr>";
|
||||
//echo "<tr><td><input type=checkbox $valore></td><td><input type=checkbox $vera>$font$myrow1[risposta]</font><br></td></tr>";
|
||||
$riga = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#DDDDDD><td><input type=checkbox $valore></td><td><input type=checkbox $vera>$font$myrow1[risposta]</font><br></td></tr>";
|
||||
$riga = true;
|
||||
}
|
||||
}while ($myrow1= mysql_fetch_array($result1));
|
||||
//echo "false =".$false;
|
||||
//echo "vere = ".$vere;
|
||||
//echo "indovinate = ".$indovinate;
|
||||
//echo "sbagliate = ".$sbagliate;
|
||||
$punteggio = $punteggio + (1/$vere)*$indovinate - (1/$false)*$sbagliate;
|
||||
//echo "punteggio =".$punteggio;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
$n++;
|
||||
}while ($myrow = mysql_fetch_array($result));
|
||||
//if ($punteggio != 0) $ris = ($punteggio/$totale) * 100;
|
||||
$n_test = $n -1;
|
||||
//echo "test =".$n_test;
|
||||
$ris = ((100 * ($punteggio + $n_test)) / $n_test)/2;
|
||||
//echo "ris =".$ris;
|
||||
if ($ris != 100)
|
||||
{
|
||||
if (substr($ris, 3,1) > 5)
|
||||
$ris = (substr($ris, 0,2) + 1); // Approssima per eccesso
|
||||
else
|
||||
$ris = substr($ris, 0,2); // Approssima per difetto
|
||||
}
|
||||
echo "<tr><td colspan=2><br></td></tr><tr><td colspan=2 align=center>Risultato del test: $ris/100</td></tr>";
|
||||
echo "</table></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p>Il test é stato consegnato in bianco</p><br><br>";
|
||||
$ris = "consegnato in bianco";
|
||||
}
|
||||
|
||||
$oggi = date("Y-m-d");
|
||||
|
||||
$query = "INSERT INTO $tbl_prove (idutente, idtest, data, risultato) VALUES ('"
|
||||
.$validato."','"
|
||||
.$test."','"
|
||||
.$oggi."','"
|
||||
.$ris."')";
|
||||
//echo $query;
|
||||
$ins = mysql_query($query,$db);
|
||||
if (!$ins) echo "<br><br><p class=error>La prova non è stata registrata!</p><br><br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><br><p class=error>Nessun record trovato!</p><br><br>";
|
||||
}
|
||||
|
||||
echo "<p><a href=corsi.php>Torna ai corsi</a></p>";
|
||||
|
||||
//echo "<p><a href=# onclick=history.back()>Torna</a></p>";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user