﻿<html>
<head>
<title>Tk - cible2</title>
</head>
<body>
CIBLE 2<br/>
<form method="post" action="cible3.php">
<?php

$titre=$_POST['titre'];
$soustitre=$_POST['sous_titre'];
$nb_textes=$_POST['texte'];
$nb_boolean=$_POST['boolean'];
$nb_nombres=$_POST['nombres'];
$nb_listes=$_POST['listes'];
$nb_options=$_POST['options'];
$page=$_POST['page'];
$cible=$_POST['cible'];
$nb_choix=$_POST['nb_choix'];
$nb_checkbox=$_POST['nb_checkbox'];



print_r($_POST);
// $dateuuuu= date('a b c d e f g h i j k l m n o p q r s t u v w x y z  A B C DE F G H I J K L M N O P Q R S T U V W X Y Z');
echo " $dateuuuu <h1>$titre </h1><h2>$soustitre</h2> <br/> ";

if ($_POST['demander_pseudo']=='oui')	{echo'Votre pseudo?<input type="text" name="pseudo"/><br/><br/>';	}
else {echo"";}

$compteur_checkbox = $nb_checkbox;
$while = 1;



echo "<br/> <strong> Checkboxes ( $nb_checkbox )</strong> <br/>";
while($compteur_checkbox >0)
{ 
$texte_box=$_POST['checkbox'.$while.''];
$nom_box= $_POST['checkbox'.$while.'_name'];
$value_box= $_POST['checkbox'.$while.'_value'];
echo "$while ";
echo' <input type="checkbox" /> box n° '.$while.': texte: '.$texte_box.' <input type="checkbox" name="'.$nom_box.'" value="'.$value_box.'"/>  nom: '.$nom_box.' valeur: '.$value_box.'<br/>';
$while++;
$compteur_checkbox--;
}



$nb_graduations=$_POST['nb_graduations'];
$nb_grades=$_POST['nb_grades'];
echo "<strong>nombre de graduations: ( $nb_graduations ) de 0 à ($nb_grades)</strong><br/>";

		for($i=0;$i<$nb_graduations;$i++) //vote par grades
			{
			$graduation_name= $_POST['graduations'.$i.''];
		echo'name = graduation'.$i.', question du grade n°'.$i.': <input type="text" name="graduation'.$i.'"/> , réponse de 0 à '.$nb_grades.'';
		$compteur_grades=0;
						while($compteur_grades<$nb_grades)
{ echo ', '.$compteur_grades.':<input type="radio" name="'.$graduation_name.'" value="'.$compteur_grades.'" /> ';
$compteur_grades++;
}
		echo'<br/>';
		}







$nbchoix=$_POST['nb_choix'];
echo "<strong>nb de choix à voter: $nb_choix <br/></strong>";
for($i=0;$i<$nbchoix;$i++)
{
$truc=$_POST['choix'.$i.''];
$name= "choix".$i;
echo'<br/> liste des choix à voter n° '.$i.' ('.$truc.' choix): <br/>';
$compteur_while=0;
		while($compteur_while<$truc)
		{ 
		$compteur_while++;
		echo' '.$compteur_while.' <input type="texte" name="choix_'.$i.'_'.$compteur_while.'" value="choix_'.$i.'_'.$compteur_while.'""/> choix_'.$i.'_'.$compteur_while.'<br/>';
		}
}


echo "<strong>nb de textes à remplir: $nb_textes <br/></strong>";

for($i=0;$i<$nb_textes;$i++)
{
$truc=$_POST['texte'.$i.''];
$name= "texte".$i;
echo''.$truc.': <input type="text" name="texte'.$i.'"/> <br/>';
}


echo' <br/>';
		for($i=0;$i<$nb_boolean;$i++) // boolean
		{$radio=$_POST['radio'.$i.''];
		echo''.$radio.': <input type="radio" name="nombres'.$i.'" value="oui"/> Oui, <input type="radio" name="nombres'.$i.'" value="non"/> Non.<br/>';}

		
		
		
echo' <br/>';
		for($i=0;$i<$nb_textes;$i++) // textes
		{$texte=$_POST['nombres'.$i.''];
		echo''.$texte.': <input type="text" name="texte'.$i.'" /><br/>';}	
	
	
	
	
	
					echo"<br/><strong>listes à cliquer ( $nb_listes de $nb_options choix )<br/></strong>";
		for($i=0;$i<$nb_listes;$i++) // listes
		{
			$liste=$_POST['liste'.$i.''];
			echo''.$liste.': <select name="liste'.$i.'">';
				for($compteur=0;$compteur<$nb_options;$compteur++) 
			{
			$option=$_POST['liste'.$i.'option'.$compteur.''];
			
			echo'<option value="'.$option.'">'.$option.'</option><br/>';
			}
		echo "</select><br/>";
		}
	
	
	
	
	
	
	
foreach ($_POST as $k => $v) 

{ echo'
<input type="hidden" name="'.$k.'" value="'.$v.'" />

';}

?>
<input type="submit" value="enregistrer le sondage"/>
</form>
ouiiiiiiii<br/>
<form method="post" action="cible.php">

<?php
foreach ($_POST as $k => $v) 

{ echo'
<input type="hidden" name="'.$k.'" value="'.$v.'" />

';}
?>
<input type="submit" value="retour page précédente"/>
ouiiiiiiii<br/>
</form>


<form method="post" action="createur.php">

<?php
foreach ($_POST as $k => $v) 

{ echo'
<input type="hidden" name="'.$k.'" value="'.$v.'" />

';}
?>
<input type="submit" value="retour createur.php"/>

</form>
</body>
</html>