﻿<html>
<head>
<title>Tk - éditez les questions</title>
</head>
<body>

<form method="post" action="cible2.php">

<?php


print_r($_POST);






$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'];
$demander_pseudo=$_POST['demander_pseudo'];
$demander_h_f=$_POST['radio_homme_femme'];
$demander_age=$_POST['age'];
$nb_checkbox=$_POST['nb_checkbox'];

//hidden boucle
foreach ($_POST as $k => $v) 

{ echo'<input type="text" name="'.$k.'" value="'.$v.'" />';}

$i=0;

echo " <h1>$titre </h1><h2>$soustitre</h2> <br/> ";

	if ($demander_pseudo == 'oui')
		{
		echo'On demande le pseudo. <input type="hidden" name="pseudo" value="oui"/> <br/>
		peseudo par défaut: <input type="text" name="pseudo_defaut"/> <br/>';
		}

	if ($demander_age == 'oui')
		{
		echo'Votre âge: <input type="text" name="age"/><br/>';
		}
	if ($demander_h_f == 'oui')
		{
		echo'Vous êtes: <input type="radio" name="sexe" value="homme"/> Homme <input type="radio" name="sexe" value="femme"/> Femme <br/>';
		}
		
$compteur_checkbox = $nb_checkbox;
$while = 1;

echo "<br/> <strong> Intitulés des Checkboxes ( $nb_checkbox )</strong> <br/>";
while($compteur_checkbox >0)
{ 
echo "$while ";
echo' <input type="checkbox" /> Texte n° '.$while.': <input type="text" name="checkbox'.$while.'"/> Name:<input type="text" name="checkbox'.$while.'_name" value="checkbox'.$while.'_name"/> Value: <input type="text" name="checkbox'.$while.'_value" value="checkbox'.$while.'_value"/><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
		{echo'question du grade n°'.$i.': <input type="text" name="graduations'.$i.'"/> , réponse de 0 à '.$nb_grades.' <br/>';}



$nbchoix=$_POST['nb_choix'];
echo "<strong>nombre de choix à voter: ( $nbchoix ) </strong><br/>";

		for($i=0;$i<$nbchoix;$i++) //vote par choix
		{echo'nombres de choix à voter n°'.$i.': <input type="text" name="choix'.$i.'"/> <br/>';}


echo"<strong>intitulé de la question à réponse texte ( $nb_textes )</strong><br/>";
		for($i=0;$i<$nb_textes;$i++) // textes
		{echo' n°'.$i.': <input type="text" name="texte'.$i.'"/> <br/>';}

		echo"<br/><strong>intitulé de la question à réponse à nombres ( $nb_nombres )</strong><br/>";
		for($i=0;$i<$nb_nombres;$i++) // nombres
		{echo' n°'.$i.': <input type="text" name="nombres'.$i.'"/> <br/>';}
		
		echo"<br/><strong>intitulé de la question à réponse à radio ( $nb_boolean )</strong><br/>";
		for($i=0;$i<$nb_boolean;$i++) // oui/non
		{echo' oui/non n°'.$i.': <input type="text" name="radio'.$i.'"/> <br/>';}

		
		
				echo"<br/><strong>listes à cliquer ( $nb_listes )<br/></strong>";
		for($i=0;$i<$nb_listes;$i++) // listes
		{
		echo' nom de la liste n°'.$i.': <input type="text" name="liste'.$i.'"/> <br/><br/>';
				for($compteur=0;$compteur<$nb_options;$compteur++) 
			{echo'liste'.$i.', option'.$compteur.':	<input type="text" name="liste'.$i.'option'.$compteur.'"/> <br/>';
			}
		echo "<br/>";
		}





?>
<input type="hidden" name="nb_choix" value="<?php echo "$nbchoix"; ?>"/>
<input type="submit" value="tadam"/>
</form>
<form method="post" action="createur.php">

<?php
foreach ($_POST as $k => $v) 

{ echo'<input type="text" name="'.$k.'" value="'.$v.'" />';}
?>
<input type="submit" value="retour"/>
</form>
<a href="createur.php"> Retour</a>
</body>
</html>