1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
| <html>
<head>
<title>Sondage</title>
</head>
<?
if (@file_exists("./Sondage_Qu.php3")) {include("./Sondage_Qu.php3");}
if (@file_exists("./Sondage_Res.php3")) {include("./Sondage_Res.php3");}
?>
<body>
<?
if ($AjRep) {
$T[0][$Q0]++;
$T[1][$Q1]++;
$T[2][$Q2]++;
$FVok=fopen("Sondage_Res.php3","w");
if ($FVok) {
$IVok=0;
if (!fwrite($FVok,"<?\n")) $IVok=1;
reset($T);
while (list($a) = each($T)) {
if (!fwrite($FVok,"\$T[$a][0]=".$T[$a][0].";\n")) $IVok=1;
if (!fwrite($FVok,"\$T[$a][1]=".$T[$a][1].";\n")) $IVok=1;
if (!fwrite($FVok,"\$T[$a][2]=".$T[$a][2].";\n")) $IVok=1;
if (!fwrite($FVok,"\n")) $IVok=1;
}
if (!fwrite($FVok,"?")) $IVok=1;
if (!fwrite($FVok,">\n")) $IVok=1;
echo "";
if ($IVok) echo "Insertion des donnees dans le fichier échouée";
if (!fclose($FVok)) echo "Fermeture du fichier Echouée<br>";
}
else echo "Echec de la creation du fichier !!!!";
}
?>
<div align="center"><center><h1>Sondage :</h1>
<!-- Affichage du questionnaire -->
<? if (!$ar) { ?>
<form method="POST" action="index.php3?ar=1">
<table border="2" cellspacing="5" cellpadding="5" bgcolor="#C0C0C0">
<?
while (list($ind, $Qu) = each($Q)) {
?>
<tr><th width="100%" colspan="3" align="center" nowrap><? echo $Q[$ind]; ?></th></tr>
<tr>
<td bgcolor="#008080"><input type="radio" name="Q<? echo $ind; ?>" value="0"> <? echo $R[$ind][0]; ?></td>
<td bgcolor="#008080"><input type="radio" name="Q<? echo $ind; ?>" value="1"> <? echo $R[$ind][1]; ?></td>
<td bgcolor="#008080"><input type="radio" name="Q<? echo $ind; ?>" value="2" checked> <? echo $R[$ind][2]; ?></td>
</tr>
<?
}
?>
</table>
<p><input type="submit" value="Envoyer" name="AjRep"><input type="reset" value="Effacer" name="B2"><br>
<a href="index.php3?ar=1">Affichez les résultats</a></p>
</form>
<? } ?>
<!-- Affichage des resultats -->
<? if ($ar) { ?>
<table border="2" cellspacing="5" cellpadding="5" bgcolor="#C0C0C0">
<?
reset($Q);
while (list($ind, $Qu) = each($Q)) {
?>
<tr><th width="100%" colspan="3" align="center" nowrap><? echo $Q[$ind]; ?></th></tr>
<tr>
<td bgcolor="#008080"><? echo $R[$ind][0]; ?> : <? echo $T[$ind][0]; ?></td>
<td bgcolor="#008080"><? echo $R[$ind][1]; ?> : <? echo $T[$ind][1]; ?></td>
<td bgcolor="#008080"><? echo $R[$ind][2]; ?> : <? echo $T[$ind][2]; ?></td>
</tr>
<?
}
?>
</table>
<? } ?>
</center></div>
</body>
</html> |
Partager