Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1097 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  Remplir listes deroulantes ouverture de l'application

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Remplir listes deroulantes ouverture de l'application

n°1515983
je t aime
Quand tu aimes, ne comptes pas
Posté le 17-02-2007 à 15:20:41  profilanswer
 

salut,
Je vraiment besoin de vous. Probleme pas vraiment facil a expliqué.
J ai un formulaire avec des listes deroulantes qui sont dependantes les unes des autres! quand je change une liste ça me rempli l autre liste en rapport avec le changement effectué!!
J ai eu tout plein de probleme avant, j'ai quand mêm reussi a rafficher ma page mais le soucie maintenant c est que dans mes listes deroulantes j'ai "notice undenied...." Elles sont alimenté avec une base de donnée Mysql. Je voi pas ou est le probleme. C est lors du lancement de l'application. Car hier j avais fait des modifs et tout, et j arrivais a l'utiliser mais lors de l'ouverture ça merde.
Je voudrais bien poster le code mais j arrive pas a trouvé les balises pour. Si vous pouvez me dire ou les trouver
Merci a tous de votre aider

mood
Publicité
Posté le 17-02-2007 à 15:20:41  profilanswer
 

n°1515988
sielfried
Posté le 17-02-2007 à 15:45:17  profilanswer
 

Notice undefined blabla c'est quand tu tentes d'accéder à une variable non définie...
 
(Pour poster du code, [code=php ]ton code[/code ] sans les espaces.)


---------------
StarCraft Professional Gaming Database | [Ze Topic] Starcraft/BroodWar
n°1515990
je t aime
Quand tu aimes, ne comptes pas
Posté le 17-02-2007 à 15:48:35  profilanswer
 

Code :
  1. <?
  2.     $link = mysql_connect("localhost","root","" ) or die("Pas de connexion" );
  3.     mysql_select_db("caserne" ) or die("Pas de base" );
  4.  
  5.     $heuredeb = 1;
  6.     $mindeb = 0;
  7.     $nompomp = "BOURGIN";
  8.     $nompompremplac = "FRATER";
  9.     $heurefin = 2;
  10.     $minfin = 15;
  11.     
  12.     if (!empty($_POST))
  13.     {
  14.     $heuredeb = $_POST['heuredeb'];
  15.     $mindeb = $_POST['mindeb'];
  16.     $nompomp = $_POST['pompierrempl'];
  17.     $nompompremplac = $_POST['pompierremplaçant'];
  18.     $heurefin = $_POST['heurefin'];
  19.     $minfin = $_POST['minfin'];
  20.     }
  21.     
  22.     $query = "Select nom FROM pompier";
  23.     $respompier = mysql_query($query,$link) or die (mysql_error());
  24.  
  25.     $query = "Select heures FROM heure";
  26.     $reshd = mysql_query($query,$link) or die (mysql_error());
  27.  
  28.     $query = "Select minutes FROM minute";
  29.     $resmd = mysql_query($query,$link) or die (mysql_error());
  30.     
  31.     //if ($_POST['heuredeb']>=22)
  32.     if (23>=22)
  33.     {
  34.     $query = "Select heures FROM heure";
  35.     $reshf = mysql_query($query,$link) or die (mysql_error());
  36.     }
  37.     else
  38.     {
  39.     $query = "Select heures FROM heure WHERE heures >= $heuredeb";
  40.     $reshf = mysql_query($query,$link) or die (mysql_error());
  41.     }
  42.     
  43.     //if ($_POST['heuredeb'] == $_POST['heurefin'])
  44.     if (11 == 12)
  45.     {        
  46.     $query = "Select minutes FROM minute WHERE minutes > $mindeb";
  47.     $resmf = mysql_query($query,$link) or die (mysql_error());
  48.     }
  49.     else
  50.     {        
  51.     $query = "Select minutes FROM minute";
  52.     $resmf = mysql_query($query,$link) or die (mysql_error());
  53.     }
  54.     
  55.     
  56.     $query = "Select id_fonction,groupe FROM multi,pompier WHERE multi.id_pompier = pompier.id_pompier AND nom = '$nompomp'";
  57.     $res = mysql_query($query,$link) or die (mysql_error());
  58.     $datapomparemp = mysql_fetch_array($res);
  59.  
  60.     $interfon = $datapomparemp['id_fonction'];
  61.     $intergroup = $datapomparemp['groupe'];
  62.     
  63.     $query = "Select nom FROM multi,pompier WHERE multi.id_pompier = pompier.id_pompier AND id_fonction = $interfon AND nom <> '$nompomp'";
  64.     $respomp = mysql_query($query,$link) or die (mysql_error());
  65.     
  66.     $id=0;
  67. ?>
  68.  
  69. <html>
  70. <head>
  71. <title>Planning pout les pompiers</title>
  72. </head>
  73.  
  74. <a href="planning.php?id=<?=1?>">Jour</a></br>
  75. <a href="planning.php?id=<?=2?>">Nuit</a></br>
  76.  
  77. <?
  78. if  ($_GET['id'] == 1)
  79. {
  80. ?>
  81. <table width="900" border="1" cellpadding="2" cellspacing="0" align="center">
  82.  
  83. <?
  84. $jour = date ("l" );
  85. $date = date ("d" );
  86. $mois = date ("F" );
  87.  
  88. echo "Jour : $jour. Mois: $mois";
  89.  
  90. $y = 6;
  91. $i = 00;
  92. $x = 0;
  93.  
  94. ?>
  95.  
  96. <tr>
  97. <td></td>
  98. <td>Vendredi</td>
  99. <td>Samedi</td>
  100. <td>Dimanche</td>
  101. <td>Lundi</td>
  102. <td>Mardi</td>
  103. <td>Mercredi</td>
  104. <td>Jeudi</td>
  105. </tr>
  106.  
  107. <tr>
  108. <td></td>
  109. <td></td>
  110. <td></td>
  111. <td></td>
  112. <td></td>
  113. <td></td>
  114. <td></td>
  115. <td></td>
  116. </tr>
  117.  
  118.  
  119. <?
  120. while ($y<20)
  121. {
  122.     while ($x<4)
  123.     {
  124.     ?>
  125.         <tr>
  126.         <td><?echo "$y"?>h<?echo "$i"?>  </td>
  127.         <td></td>
  128.         <td></td>
  129.         <td></td>
  130.         <td></td>
  131.         <td></td>
  132.         <td></td>
  133.         <td></td>
  134.         </tr>
  135.         <?
  136.         $i =$i + 15;
  137.         $x = $x + 1;
  138.     }
  139.     $y = $y + 1;
  140.     $i = 00;
  141.     $x = 0;
  142. }
  143.  
  144.     if ($y == 20)
  145.     {
  146.     $i = 0;    
  147.     ?>
  148.         <tr>
  149.         <td><?echo "$y"?>h<?echo "$i"?> </td>
  150.         <td></td>
  151.         <td></td>
  152.         <td></td>
  153.         <td></td>
  154.         <td></td>
  155.         <td></td>
  156.         <td></td>
  157.         </tr>
  158.     <?}?>
  159. </table>
  160. <?
  161. }
  162.  
  163. if  ($_GET['id'] == 2)
  164. {
  165. ?>
  166.  
  167. <table width="900" border="1" cellpadding="2" cellspacing="0" align="center">
  168.  
  169. <tr>
  170. <td></td>
  171. <td>Vendredi</td>
  172. <td>Samedi</td>
  173. <td>Dimanche</td>
  174. <td>Lundi</td>
  175. <td>Mardi</td>
  176. <td>Mercredi</td>
  177. <td>Jeudi</td>
  178. </tr>
  179.  
  180.  
  181. <?
  182. }
  183. ?>
  184.  
  185. </br>
  186. </br>
  187. </br>
  188. </br>
  189.  
  190.  
  191. Formulaire de  modification
  192.  
  193. <form method="POST" name="modification">
  194.  
  195. <table width="400" border="1" cellpadding="2" cellspacing="0" align="center">
  196.  
  197. <script language ="JavaScript">
  198. function test(champ)
  199. {
  200. if (champ.selectedIndex>=0)
  201. modification.submit()
  202. }
  203. </script>
  204.  
  205.  
  206. <tr>
  207. <td>Date</td>
  208. <td></td>
  209. </tr>
  210.  
  211. <tr>
  212. <td>Heure debut</td>
  213. <td>
  214. <select name="heuredeb" style="width:115px" onchange="test(this)">
  215. <?
  216. while ($datahd = mysql_fetch_array($reshd))
  217. {  
  218. ?>
  219. <option
  220. <?if ($_POST['heuredeb'] == $datahd["heures"]) echo "selected";?>><?echo $datahd["heures"];?></option>
  221. <?
  222. }
  223. ?>
  224. </select>
  225. </td>
  226. </tr>
  227.  
  228. <tr>
  229. <td>Minute debut</td>
  230. <td>
  231. <select name="mindeb" style="width:115px" onchange="test(this)">
  232. <?
  233. while ($datamd = mysql_fetch_array($resmd))
  234. {
  235. ?>
  236. <option
  237. <?if ($_POST['mindeb'] == $datamd["minutes"]) echo "selected";?>><?echo $datamd['minutes'];?></option>
  238. <?
  239. }
  240. ?>
  241. </select>
  242. </td>
  243. </tr>
  244.  
  245. <tr>
  246. <td>Heure de fin</td>
  247. <td>
  248. <select name="heurefin" style="width:115px" onchange="test(this)">
  249. <?
  250. while ($datahf = mysql_fetch_array($reshf))
  251. {
  252. ?>
  253. <option
  254. <?if ($_POST['heurefin'] == $datahf["heures"]) echo "selected";?>><?echo $datahf['heures'];?></option>
  255. <?
  256. }
  257. ?>
  258. </select>
  259. </td>
  260. </tr>
  261.  
  262. <tr>
  263. <td>Minute fin</td>
  264. <td>
  265. <select name="minfin" style="width:115px" onchange="test(this)">
  266. <?
  267. while ($datamf = mysql_fetch_array($resmf))
  268. {
  269. ?>
  270. <option
  271. <?if ($_POST['minfin'] == $datamf["minutes"]) echo "selected";?>><?echo $datamf['minutes'];?></option>
  272.  
  273. <?
  274. }
  275. ?>
  276. </select>
  277. </td>
  278. </tr>
  279.  
  280. <tr>
  281. <td>Pompier à remplacer</td>
  282. <td>
  283. <select name="pompierrempl" style="width:115px" onchange="test(this)">
  284. <?
  285. while ($datapompier = mysql_fetch_array($respompier))
  286. {  
  287. ?>
  288. <option
  289. <?if ($_POST['pompierrempl'] == $datapompier["nom"]) echo "selected";?>><?echo $datapompier["nom"];?></option>
  290. <?
  291. }
  292. ?>
  293. </select>
  294. </td>
  295. </tr>
  296.  
  297. <tr>
  298. <td>Pompier remplaçant</td>
  299. <td>
  300. <select name="pompierremplaçant" style="width:115px" onchange="test(this)">
  301. <?
  302. while ($datapompierremplaçant = mysql_fetch_array($respomp))
  303. {  
  304. ?>
  305. <option
  306. <?if ($_POST['pompierremplaçant'] == $datapompierremplaçant ["nom"]) echo "selected";?>><?echo $datapompierremplaçant ["nom"];?></option>
  307. <?
  308. }
  309. ?>
  310. </select>
  311. </td>
  312. </tr>
  313. </table>
  314.  
  315. <?
  316. echo "<td><input type=\"submit\" style=\"width:85px\" value=\"Valider\" onclick=\"document.location.href='verification.php??heuredeb=$heuredeb&heurefin=$heurefin&mindeb=$mindeb&minfin=$minfin&nomp=$nompomp&nompr=$nompompremplac&group=$intergroup'\"/></td>";
  317. ?>
  318. </form>
  319. </html>


 
 
voici mon code. Ouai mais je voi pas pourquoi elles sont pas definies mes varibles.


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  Remplir listes deroulantes ouverture de l'application

 

Sujets relatifs
VBA - application.match et Majuscules [Résolu][VBA-Excel] Options pour rendre l'ouverture d'un classeur plus rapide
application java en deamonConnaitre heure d'ouverture d'une processus
Regler le retrait des listes <ul>[Résolu] [Batch] Création d'un dossier à l'ouverture de Windows
[Webapps][noob]Portage d'une application java en webappsPrblème : 2 listes deroulante dependantes
Introspection d'une applicationOuverture fichier php pas possible
Plus de sujets relatifs à : Remplir listes deroulantes ouverture de l'application


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR