Files correlati : Ricompilazione Demo : [ ] Commento : Versione FAD del 11/10/2001 git-svn-id: svn://10.65.10.50/trunk@9917 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			170 lines
		
	
	
		
			10 KiB
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			170 lines
		
	
	
		
			10 KiB
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
| <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_moduli 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"].")";
 | |
| 			//$criterix = "SELECT * FROM $tbl_lezioni LEFT JOIN $tbl_moduli ON $tbl_lezioni.idmodulo = $tbl_moduli.id WHERE ($tbl_moduli.id = ".$myrow2["id"].")";
 | |
| 			
 | |
| 			$criterix = "SELECT * FROM $tbl_lezioni LEFT JOIN $tbl_moduli_righe ON $tbl_lezioni.id = $tbl_moduli_righe.idlezione WHERE ($tbl_moduli_righe.idmodulo = ".$myrow2["id"].")";
 | |
| 			//$criterix = "SELECT * FROM $tbl_moduli_righe LEFT JOIN $tbl_moduli_righe ON $tbl_lezioni.id = $tbl_moduli_righe.idlezione WHERE ($tbl_moduli_righe.idmodulo = ".$myrow2["id"].")";
 | |
| 			//echo $criterix;
 | |
| 			$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"]."><img src=images/scrivi.gif alt='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>";
 | |
| 				//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"]."><img src=images/scrivi.gif alt='Aggiungi lezione'></form></td></tr></TABLE>";
 | |
| 			
 | |
| 			//$criteri3 = "SELECT * FROM $tbl_lezioni WHERE (idmodulo = ".$myrow2["id"].")";
 | |
| 			$criteri3 = "SELECT * FROM $tbl_lezioni LEFT JOIN $tbl_moduli_righe ON $tbl_lezioni.id = $tbl_moduli_righe.idlezione WHERE ($tbl_moduli_righe.idmodulo = ".$myrow2["id"].")";
 | |
| 			//echo $criteri3;
 | |
| 			$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"].")";
 | |
| 					$criteriy = "SELECT * FROM $tbl_test LEFT JOIN $tbl_moduli_righe ON $tbl_test.id = $tbl_moduli_righe.idtest WHERE ($tbl_moduli_righe.idlezione = ".$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>";
 | |
| 							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='".$myrow3["percorso"]."' target=new>".$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<a href='".$myrow3["percorso"]."' target=new>".$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<a href='".$myrow3["percorso"]."' target=new>".$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<a href='".$myrow3["percorso"]."' target=new>".$myrow3["nome"]."</a></TD></TR></TABLE>";
 | |
| 					}
 | |
| 					//$criteri4 = "SELECT * FROM $tbl_test WHERE (idlezione = ".$myrow3["id"].")";
 | |
| 					$criteri4 = "SELECT * FROM $tbl_test LEFT JOIN $tbl_moduli_righe ON $tbl_test.id = $tbl_moduli_righe.idtest WHERE ($tbl_moduli_righe.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>
 |