Votre question

Pb php requête base de données [Résolu]

Tags :
  • MySQL
  • Programmation
Dernière réponse : dans Programmation
9 Avril 2008 08:54:50

Bonjour à tous.

J'ai une erreur, a l'affichage ça donne ça :

SELECT * FROM poste whereCoef between 0 and 1000 order by Total desc

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\Program Files\EasyPHP 2.0b1\www\Site_HAY\tableau.php on line 182

mais je comprend pas à quoi cela signifie.

Voici le bout de code auquel sa correspond :

  1. // requête SQL qui compte le nombre total d'enregistrement dans la table et qui récupère tous les enregistrements
  2. $select = 'SELECT * FROM poste order by Total desc';
  3. echo $select;
  4. $result = mysql_query($select);
  5. echo $result;
  6. $total = mysql_num_rows($result); // ligne 182
  7. echo $total;


Merci

Autres pages sur : php requete base donnees resolu

9 Avril 2008 13:35:11

il est en ligne ton site? sinon c'est normal...
9 Avril 2008 13:41:14

le bout de code ne correspond pas à l'erreur
et l'erreur porte sur le "whereCoef" attaché, il faut un espace
Contenus similaires
9 Avril 2008 14:36:00

Mon site (en fait c'est une petite appli avec interface web), est en local pour l'instant.

Je fais comment pour séparé le "whereCoef" vu que ce n'est que l'affichage de ma variable select ?

Je peux mettre le code complet si vous le souhaitez.

Personnelement je suis un débutant total en php, je ne fait que poursuivre le developpement de cette mini appli.
9 Avril 2008 16:07:37

bruenor911 a dit :

Je fais comment pour séparé le "whereCoef" vu que ce n'est que l'affichage de ma variable select ?


Tu mets un espace entre "where" et "Coef" ta requête devrait être:

SELECT * FROM poste where Coef between 0 and 1000 order by Total desc
9 Avril 2008 16:30:04

Re

ça change rien,

Je met mon code en entier pour ce fichier des fois que ça aide :

  1. <?php
  2. // inclusion du logo
  3. include ("logo.php");
  4.  
  5. //inclusion de l'en-tête de page
  6. // By me
  7. //if (!array_key_exists('print',$_GET)) $_GET['print']=0;
  8. if (!$_GET['print']) include ("_top.php");
  9.  
  10. //inclusion du fichier contenant les différentes fonctions
  11. include ("fonctions.php");
  12. ?>
  13. <!--Page de répartition des postes -->
  14.  
  15. <h2 align = "center">Répartition des postes</h2>
  16. <!--Formulaire de tri -->
  17. <?php
  18. // By me
  19. //if (!array_key_exists('print',$_GET)) $_GET['print']=0;
  20. if (!$_GET['print'])
  21. {
  22. ?>
  23. <form method="post" name="tri">
  24. <div align="center"><strong><em>Sélectionnez vos critères de tri :</em></strong></div>
  25. <table border="1" align = "center">
  26. <tr>
  27. <td colspan="4" align="center" bordercolor="#FFFFFF">
  28. <?php $listeClassif=array("Tous"=>"Tous","Non Cadre"=>"Non Cadre","Cadre"=>"Cadre");
  29. echo 'Classification : <select name="triClassif" onchange="document.tri.submit()">';
  30. foreach ($listeClassif as $key=>$value)
  31. {
  32. $selected = ($_POST['triClassif'] == $key)?'selected':'';
  33. echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
  34. }
  35. echo '</select>';
  36.  
  37. $listeEtat=array("Tous"=>"Tous","Actif"=>"Actif","Non Actif"=>"Non Actif");
  38. echo ' Etat : <select name="triEtat">';
  39. foreach ($listeEtat as $key=>$value)
  40. {
  41. $selected = ($_POST['triEtat'] == $key)?'selected':'';
  42. echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
  43. }
  44. echo '</select>';
  45.  
  46. $listeStat=array("Tous"=>"Tous","Simulé"=>"Simulé","Validé"=>"Validé");
  47. echo ' Statut : <select name="triStat">';
  48. foreach ($listeStat as $key=>$value)
  49. {
  50. $selected = ($_POST['triStat'] == $key)?'selected':'';
  51. echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
  52. }
  53. echo '</select>';
  54. ?>
  55. </td>
  56. </tr>
  57. <tr>
  58. <td colspan="6" align="center" bordercolor="#FFFFFF">
  59. Coefficient entre :
  60. <input name="triCoefMin" type="text" size=1 maxlength="3"
  61. value="<?php if (isset($_POST['triClassif'])) echo $_POST['triCoefMin'];?>">
  62. et :
  63. <input name="triCoefMax" type="text" size=1 maxlength="3"
  64. value="<?php if (isset($_POST['triClassif'])) echo $_POST['triCoefMax'];?>">
  65. Point HAY entre :
  66. <input name="triHAYMin" type="text" size=1 maxlength="3"
  67. value="<?php if (isset($_POST['triClassif'])) echo $_POST['triHAYMin'];?>">
  68. et :
  69. <input name="triHAYMax" type="text" size=1 maxlength="3"
  70. value="<?php if (isset($_POST['triClassif'])) echo $_POST['triHAYMax'];?>">
  71. <?php
  72. if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre')
  73. {
  74. $listeClasse=array("A"=>"A","B"=>"B","C"=>"C","D"=>"D","E"=>"E","F"=>"F","G"=>"G");
  75. echo 'Classe : <select name="triClassMin">';
  76. foreach ($listeClasse as $key=>$value)
  77. {
  78. $selected = ($_POST['triClassMin'] == $key)?'selected':'';
  79. echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
  80. }
  81. echo '</select>';
  82. $listeClasseR=array("G"=>"G","F"=>"F","E"=>"E","D"=>"D","C"=>"C","B"=>"B","A"=>"A");
  83. echo 'à : <select name="triClassMax">';
  84. foreach ($listeClasseR as $key=>$value)
  85. {
  86. $selected = ($_POST['triClassMax'] == $key)?'selected':'';
  87. echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
  88. }
  89. echo '</select>';
  90. }
  91. else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre')
  92. {
  93. $listeGroupe=array("I"=>"I","II"=>"II","III"=>"III","IV"=>"IV","V"=>"V","VI"=>"VI","VII"=>"VII");
  94. echo 'Groupe : <select name="triClassMin">';
  95. foreach ($listeGroupe as $key=>$value)
  96. {
  97. $selected = ($_POST['triClassMin'] == $key)?'selected':'';
  98. echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
  99. }
  100. echo '</select>';
  101. $listeGroupeR=array("VII"=>"VII","VI"=>"VI","V"=>"V","IV"=>"IV","III"=>"III","II"=>"II","I" =>"I");
  102. echo 'à : <select name="triClassMax">';
  103. foreach ($listeGroupeR as $key=>$value)
  104. {
  105. $selected = ($_POST['triClassMax'] == $key)?'selected':'';
  106. echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
  107. }
  108. echo '</select>';
  109. }
  110. ?>
  111. </td>
  112. </tr>
  113. <tr align="center">
  114. <td align="center" bordercolor="#FFFFFF"><input type="submit" name="ok" value="Ok"></td>
  115. </tr>
  116. </table>
  117. </form>
  118. <?php
  119. }
  120. if (isset($_POST["ok"]))
  121. {
  122. $select = 'SELECT * FROM poste where';
  123. if ($_POST['triCoefMin'] == '' && $_POST['triCoefMax'] == '')
  124. $select .= 'Coef between 0 and 1000';
  125. else if ($_POST['triCoefMin'] <> '' && !is_numeric($_POST['triCoefMin']))
  126. {alert("Le coefficient minimum doit être un chiffre!");
  127. retour();}
  128. else if ($_POST['triCoefMax'] <> '' && !is_numeric($_POST['triCoefMax']))
  129. {alert("Le coefficient maximum doit être un chiffre!");
  130. retour();}
  131. else if ($_POST['triCoefMin'] <> '' && $_POST['triCoefMax'] <> '' && $_POST['triCoefMin'] > $_POST['triCoefMax'])
  132. {alert("Le coefficient minimum doit être inférieur au coefficient maximum!");
  133. retour();}
  134. else if ($_POST['triCoefMin'] <> '' && $_POST['triCoefMax'] == '')
  135. $select .= ' Coef="'.$_POST['triCoefMin'].'"';
  136. else if ($_POST['triCoefMax'] <> '' && $_POST['triCoefMin'] == '')
  137. $select .= ' Coef="'.$_POST['triCoefMax'].'"';
  138. else if ($_POST['triCoefMin'] <> '' && $_POST['triCoefMax'] <> '')
  139. $select .= ' Coef between "'.$_POST['triCoefMin'].'" and "'.$_POST['triCoefMax'].'"';
  140.  
  141. if ($_POST['triClassif'] == 'Cadre')
  142. $select .= ' and Classification="Cadre"';
  143. if ($_POST['triClassif'] == 'Non Cadre')
  144. $select .= ' and Classification="Non Cadre"';
  145.  
  146. if ($_POST['triEtat'] == 'Actif')
  147. $select .= ' and Etat="Actif"';
  148. if ($_POST['triEtat'] == 'Non Actif')
  149. $select .= ' and Etat="Non Actif"';
  150.  
  151. if ($_POST['triStat'] == 'Simulé')
  152. $select .= ' and Statut="Simulé"';
  153. if ($_POST['triStat'] == 'Validé')
  154. $select .= ' and Statut="Validé"';
  155.  
  156. if ($_POST['triHayMin'] <> '' && !is_numeric($_POST['triHayMin']))
  157. {alert("Le total HAY minimum doit être un chiffre!");
  158. retour();}
  159. else if ($_POST['triHayMax'] <> '' && !is_numeric($_POST['triHayMax']))
  160. {alert("Le total HAY maximum doit être un chiffre!");
  161. retour();}
  162. else if ($_POST['triHayMin'] <> '' && $_POST['triHayMax'] <> '' && $_POST['triHayMin'] > $_POST['triHayMax'])
  163. {alert("Le total HAY minimum doit être inférieur au total HAY maximum!");
  164. retour();}
  165. else if ($_POST['triHAYMin'] <> '' && $_POST['triHAYMax'] == '')
  166. $select .= ' and Total='.$_POST['triHAYMin'];
  167. else if ($_POST['triHAYMax'] <> '' && $_POST['triHAYMin'] == '')
  168. $select .= ' and Total='.$_POST['triHAYMax'];
  169. else if ($_POST['triHAYMin'] <> '' && $_POST['triHAYMax'] <> '')
  170. $select .= ' and Total between '.$_POST['triHAYMin'].' and '.$_POST['triHAYMax'];
  171.  
  172. if (isset($_POST['triClassMin']) || $_POST['triClassMax'])
  173. $select .= ' and Classement between "'.$_POST['triClassMin'].'" and "'.$_POST['triClassMax'].'"';
  174.  
  175. $select .= ' order by Total desc';
  176. }
  177. else
  178. // requête SQL qui compte le nombre total d'enregistrement dans la table et qui récupère tous les enregistrements
  179. $select = 'SELECT * FROM poste order by Total desc';
  180. echo $select;
  181. $result = mysql_query($select, $link);
  182. echo $result;
  183. $total = mysql_num_rows($result);
  184. echo $total;
  185.  
  186. if($total)
  187. {
  188. while ($row = mysql_fetch_array($result))
  189. {
  190. if ($row['Direction'] == "DC" && ($row['Classement'] == "VII" || $row['Classement'] == "G"))
  191. $txtDCG .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  192.  
  193. if ($row['Direction'] == "DG" && ($row['Classement'] == "VII" || $row['Classement'] == "G"))
  194. $txtDGG .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  195.  
  196. if ($row['Direction'] == "DLM" && ($row['Classement'] == "VII" || $row['Classement'] == "G"))
  197. $txtDLMG .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  198.  
  199. if ($row['Direction'] == "DO" && ($row['Classement'] == "VII" || $row['Classement'] == "G"))
  200. $txtDOG .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  201.  
  202. if ($row['Direction'] == "DT" && ($row['Classement'] == "VII" || $row['Classement'] == "G"))
  203. $txtDTG .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  204.  
  205. if ($row['Direction'] == "INFO" && ($row['Classement'] == "VII" || $row['Classement'] == "G"))
  206. $txtINFOG .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  207.  
  208. if ($row['Direction'] == "MKG" && ($row['Classement'] == "VII" || $row['Classement'] == "G"))
  209. $txtMKGG .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  210.  
  211. if ($row['Direction'] == "RH" && ($row['Classement'] == "VII" || $row['Classement'] == "G"))
  212. $txtRHG .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  213.  
  214. if ($row['Direction'] == "SG" && ($row['Classement'] == "VII" || $row['Classement'] == "G"))
  215. $txtSGG .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  216.  
  217. /***********************************************************************************************/
  218.  
  219. if ($row['Direction'] == "DC" && ($row['Classement'] == "VI" || $row['Classement'] == "F"))
  220. $txtDCF .= $row['NumDP']." ".$row['Intitule']." - ".$row['Total']." - ".$row['Coef']."<BR>";
  221.  
  222. if ($row['Direction'] == "DG" && ($row['Classement'] == "VI" || $row['Classement'] == "F"))
  223. $txtDGF .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  224.  
  225. if ($row['Direction'] == "DLM" && ($row['Classement'] == "VI" || $row['Classement'] == "F"))
  226. $txtDLMF .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  227.  
  228. if ($row['Direction'] == "DO" && ($row['Classement'] == "VI" || $row['Classement'] == "F"))
  229. $txtDOF .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  230.  
  231. if ($row['Direction'] == "DT" && ($row['Classement'] == "VI" || $row['Classement'] == "F"))
  232. $txtDTF .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  233.  
  234. if ($row['Direction'] == "INFO" && ($row['Classement'] == "VI" || $row['Classement'] == "F"))
  235. $txtINFOF .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  236.  
  237. if ($row['Direction'] == "MKG" && ($row['Classement'] == "VI" || $row['Classement'] == "F"))
  238. $txtMKGF .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  239.  
  240. if ($row['Direction'] == "RH" && ($row['Classement'] == "VI" || $row['Classement'] == "F"))
  241. $txtRHF .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  242.  
  243. if ($row['Direction'] == "SG" && ($row['Classement'] == "VI" || $row['Classement'] == "F"))
  244. $txtSGF .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  245.  
  246. /***********************************************************************************************/
  247.  
  248. if ($row['Direction'] == "DC" && ($row['Classement'] == "V" || $row['Classement'] == "E"))
  249.  
  250. $txtDCE .= $row['NumDP']." ".$row['Intitule']." - ".$row['Total']." - ".$row['Coef']."<BR>";
  251.  
  252. if ($row['Direction'] == "DG" && ($row['Classement'] == "V" || $row['Classement'] == "E"))
  253. $txtDGE .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  254.  
  255. if ($row['Direction'] == "DLM" && ($row['Classement'] == "V" || $row['Classement'] == "E"))
  256. $txtDLME .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  257.  
  258. if ($row['Direction'] == "DO" && ($row['Classement'] == "V" || $row['Classement'] == "E"))
  259. $txtDOE .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  260.  
  261. if ($row['Direction'] == "DT" && ($row['Classement'] == "V" || $row['Classement'] == "E"))
  262. $txtDTE .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  263.  
  264. if ($row['Direction'] == "INFO" && ($row['Classement'] == "V" || $row['Classement'] == "E"))
  265. $txtINFOE .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  266.  
  267. if ($row['Direction'] == "MKG" && ($row['Classement'] == "V" || $row['Classement'] == "E"))
  268. $txtMKGE .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  269.  
  270. if ($row['Direction'] == "RH" && ($row['Classement'] == "V" || $row['Classement'] == "E"))
  271. $txtRHE .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  272.  
  273. if ($row['Direction'] == "SG" && ($row['Classement'] == "V" || $row['Classement'] == "E"))
  274. $txtSGE .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  275.  
  276. /***********************************************************************************************/
  277.  
  278. if ($row['Direction'] == "DC" && ($row['Classement'] == "IV" || $row['Classement'] == "D"))
  279. $txtDCD .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  280.  
  281. if ($row['Direction'] == "DG" && ($row['Classement'] == "IV" || $row['Classement'] == "D"))
  282. $txtDGD .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  283.  
  284. if ($row['Direction'] == "DLM" && ($row['Classement'] == "IV" || $row['Classement'] == "D"))
  285. $txtDLMD .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  286.  
  287. if ($row['Direction'] == "DO" && ($row['Classement'] == "IV" || $row['Classement'] == "D"))
  288. $txtDOD .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  289.  
  290. if ($row['Direction'] == "DT" && ($row['Classement'] == "IV" || $row['Classement'] == "D"))
  291. $txtDTD .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  292.  
  293. if ($row['Direction'] == "INFO" && ($row['Classement'] == "IV" || $row['Classement'] == "D"))
  294. $txtINFOD .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  295.  
  296. if ($row['Direction'] == "MKG" && ($row['Classement'] == "IV" || $row['Classement'] == "D"))
  297. $txtMKGD .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  298.  
  299. if ($row['Direction'] == "RH" && ($row['Classement'] == "IV" || $row['Classement'] == "D"))
  300. $txtRHD .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  301.  
  302. if ($row['Direction'] == "SG" && ($row['Classement'] == "IV" || $row['Classement'] == "D"))
  303. $txtSGD .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  304.  
  305. /***********************************************************************************************/
  306.  
  307. if ($row['Direction'] == "DC" && ($row['Classement'] == "III" || $row['Classement'] == "C"))
  308. $txtDCC .= $row['NumDP']." ".$row['Intitule']." - ".$row['Total']." - ".$row['Coef']."<BR>";
  309.  
  310.  
  311. if ($row['Direction'] == "DG" && ($row['Classement'] == "III" || $row['Classement'] == "C"))
  312. $txtDGC .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  313.  
  314. if ($row['Direction'] == "DLM" && ($row['Classement'] == "III" || $row['Classement'] == "C"))
  315. $txtDLMC .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  316.  
  317. if ($row['Direction'] == "DO" && ($row['Classement'] == "III" || $row['Classement'] == "C"))
  318. $txtDOC .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  319.  
  320. if ($row['Direction'] == "DT" && ($row['Classement'] == "III" || $row['Classement'] == "C"))
  321. $txtDTC .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  322.  
  323. if ($row['Direction'] == "INFO" && ($row['Classement'] == "III" || $row['Classement'] == "C"))
  324. $txtINFOC .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  325.  
  326. if ($row['Direction'] == "MKG" && ($row['Classement'] == "III" || $row['Classement'] == "C"))
  327. $txtMKGC .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  328.  
  329. if ($row['Direction'] == "RH" && ($row['Classement'] == "III" || $row['Classement'] == "C"))
  330. $txtRHC .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  331.  
  332. if ($row['Direction'] == "SG" && ($row['Classement'] == "III" || $row['Classement'] == "C"))
  333. $txtSGC .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  334.  
  335. /***********************************************************************************************/
  336.  
  337. if ($row['Direction'] == "DC" && ($row['Classement'] == "II" || $row['Classement'] == "B"))
  338. $txtDCB .= $row['NumDP']." ".$row['Intitule']." - ".$row['Total']." - ".$row['Coef']."<BR>";
  339.  
  340. if ($row['Direction'] == "DG" && ($row['Classement'] == "II" || $row['Classement'] == "B"))
  341. $txtDGB .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  342.  
  343. if ($row['Direction'] == "DLM" && ($row['Classement'] == "II" || $row['Classement'] == "B"))
  344. $txtDLMB .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  345.  
  346. if ($row['Direction'] == "DO" && ($row['Classement'] == "II" || $row['Classement'] == "B"))
  347. $txtDOB .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  348.  
  349. if ($row['Direction'] == "DT" && ($row['Classement'] == "II" || $row['Classement'] == "B"))
  350. $txtDTB .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  351.  
  352. if ($row['Direction'] == "INFO" && ($row['Classement'] == "II" || $row['Classement'] == "B"))
  353. $txtINFOB .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  354.  
  355. if ($row['Direction'] == "MKG" && ($row['Classement'] == "II" || $row['Classement'] == "B"))
  356. $txtMKGB .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  357.  
  358. if ($row['Direction'] == "RH" && ($row['Classement'] == "II" || $row['Classement'] == "B"))
  359. $txtRHB .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  360.  
  361. if ($row['Direction'] == "SG" && ($row['Classement'] == "II" || $row['Classement'] == "B"))
  362. $txtSGB .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  363.  
  364. /***********************************************************************************************/
  365.  
  366. if ($row['Direction'] == "DC" && ($row['Classement'] == "I" || $row['Classement'] == "A"))
  367. $txtDCA .= $row['NumDP']." ".$row['Intitule']." - ".$row['Total']." - ".$row['Coef']."<BR>";
  368.  
  369. if ($row['Direction'] == "DG" && ($row['Classement'] == "I" || $row['Classement'] == "A"))
  370. $txtDGA .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  371.  
  372. if ($row['Direction'] == "DLM" && ($row['Classement'] == "I" || $row['Classement'] == "A"))
  373. $txtDLMA .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  374.  
  375. if ($row['Direction'] == "DO" && ($row['Classement'] == "I" || $row['Classement'] == "A"))
  376. $txtDOA .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  377.  
  378. if ($row['Direction'] == "DT" && ($row['Classement'] == "I" || $row['Classement'] == "A"))
  379. $txtDTA .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  380.  
  381. if ($row['Direction'] == "INFO" && ($row['Classement'] == "I" || $row['Classement'] == "A"))
  382. $txtINFOA .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  383.  
  384. if ($row['Direction'] == "MKG" && ($row['Classement'] == "I" || $row['Classement'] == "A"))
  385. $txtMKGA .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  386.  
  387. if ($row['Direction'] == "RH" && ($row['Classement'] == "I" || $row['Classement'] == "A"))
  388. $txtRHA .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  389.  
  390. if ($row['Direction'] == "SG" && ($row['Classement'] == "I" || $row['Classement'] == "A"))
  391. $txtSGA .= $row['NumDP']." ".$row['Intitule']." ".$row['Total']." ".$row['Coef']."<BR>";
  392. }
  393. }
  394. ?>
  395. <form name="tableau" method="post" action="">
  396. <table width="1000" align="center" border="1" cellspacing="0" cellpadding="1">
  397. <caption align="center" style="border:double">
  398. Légende :<br />
  399. N°DP Intitulé Points Hay Coefficient
  400. <tr>
  401. <th scope="col"> </th>
  402. <th scope="col">DC</th>
  403. <th scope="col">DG</th>
  404. <th scope="col">DLM</th>
  405. <th scope="col">DO</th>
  406. <th scope="col">DT</th>
  407. <th scope="col">INFO</th>
  408. <th scope="col">MKG</th>
  409. <th scope="col">RH</th>
  410. <th scope="col">SG</th>
  411. </tr>
  412. <tr>
  413. <th scope="row"><?php if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre') echo "VII";
  414. else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre') echo "G";
  415. else echo " ";?>
  416. </th>
  417. <td><?php if (isset($txtDCG)) echo $txtDCG; else echo " ";?></td>
  418. <td><?php if (isset($txtDGG)) echo $txtDGG; else echo " ";?></td>
  419. <td><?php if (isset($txtDLMG)) echo $txtDLMG; else echo " ";?></td>
  420. <td><?php if (isset($txtDOG)) echo $txtDOG; else echo " ";?></td>
  421. <td><?php if (isset($txtDTG)) echo $txtDTG; else echo " ";?></td>
  422. <td><?php if (isset($txtINFOG)) echo $txtINFOG; else echo " ";?></td>
  423. <td><?php if (isset($txtMKGG)) echo $txtMKGG; else echo " ";?></td>
  424. <td><?php if (isset($txtRHG)) echo $txtRHG; else echo " ";?></td>
  425. <td><?php if (isset($txtSGG)) echo $txtSGCG; else echo " ";?></td>
  426. </tr>
  427. <tr>
  428. <th scope="row"><?php if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre') echo "VI";
  429. else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre') echo "F";
  430. else echo " ";?>
  431. </th>
  432. <td><?php if (isset($txtDCF)) echo $txtDCF; else echo " ";?></td>
  433. <td><?php if (isset($txtDGF)) echo $txtDGF; else echo " ";?></td>
  434. <td><?php if (isset($txtDLMF)) echo $txtDLMF; else echo " ";?></td>
  435. <td><?php if (isset($txtDOF)) echo $txtDOF; else echo " ";?></td>
  436. <td><?php if (isset($txtDTF)) echo $txtDTF; else echo " ";?></td>
  437. <td><?php if (isset($txtINFOF)) echo $txtINFOF; else echo " ";?></td>
  438. <td><?php if (isset($txtMKGF)) echo $txtMKGF; else echo " ";?></td>
  439. <td><?php if (isset($txtRHF)) echo $txtRHF; else echo " ";?></td>
  440. <td><?php if (isset($txtSGF)) echo $txtSGCF; else echo " ";?></td>
  441. </tr>
  442. <tr>
  443. <th scope="row"><?php if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre') echo "V";
  444. else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre') echo "E";
  445. else echo " ";?>
  446. </th>
  447. <td><?php if (isset($txtDCE)) echo $txtDCE; else echo " ";?></td>
  448. <td><?php if (isset($txtDGE)) echo $txtDGE; else echo " ";?></td>
  449. <td><?php if (isset($txtDLME)) echo $txtDLME; else echo " ";?></td>
  450. <td><?php if (isset($txtDOE)) echo $txtDOE; else echo " ";?></td>
  451. <td><?php if (isset($txtDTE)) echo $txtDTE; else echo " ";?></td>
  452. <td><?php if (isset($txtINFOE)) echo $txtINFOE; else echo " ";?></td>
  453. <td><?php if (isset($txtMKGE)) echo $txtMKGE; else echo " ";?></td>
  454. <td><?php if (isset($txtRHE)) echo $txtRHE; else echo " ";?></td>
  455. <td><?php if (isset($txtSGE)) echo $txtSGCE; else echo " ";?></td>
  456. </tr>
  457. <tr>
  458. <th scope="row"><?php if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre') echo "IV";
  459. else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre') echo "D";
  460. else echo " ";?>
  461. </th>
  462. <td><?php if (isset($txtDCD)) echo $txtDCD; else echo " ";?></td>
  463. <td><?php if (isset($txtDGD)) echo $txtDGD; else echo " ";?></td>
  464. <td><?php if (isset ($txtDLMD)) echo $txtDLMD; else echo " ";?></td>
  465. <td><?php if (isset ($txtDOD)) echo $txtDOD; else echo " ";?></td>
  466. <td><?php if (isset($txtDTD)) echo $txtDTD; else echo " ";?></td>
  467. <td><?php if (isset($txtINFOD)) echo $txtINFOD; else echo " ";?></td>
  468. <td><?php if (isset($txtMKGD)) echo $txtMKGD; else echo " ";?></td>
  469. <td><?php if (isset($txtRHD)) echo $txtRHD; else echo " ";?></td>
  470. <td><?php if (isset($txtSGD)) echo $txtSGCD; else echo " ";?></td>
  471. </tr>
  472. <tr>
  473. <th scope="row"><?php if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre') echo "III";
  474. else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre') echo "C";
  475. else echo " ";?>
  476. </th>
  477. <td><?php if (isset($txtDCC)) echo $txtDCC; else echo " ";?></td>
  478. <td><?php if (isset($txtDGC)) echo $txtDGC; else echo " ";?></td>
  479. <td><?php if (isset($txtDLMC)) echo $txtDLMC; else echo " ";?></td>
  480. <td><?php if (isset($txtDOC)) echo $txtDOC; else echo " ";?></td>
  481. <td><?php if (isset($txtDTC)) echo $txtDTC; else echo " ";?></td>
  482. <td><?php if (isset($txtINFOC)) echo $txtINFOC; else echo " ";?></td>
  483. <td><?php if (isset($txtMKGC)) echo $txtMKGC; else echo " ";?></td>
  484. <td><?php if (isset($txtRHC)) echo $txtRHC; else echo " ";?></td>
  485. <td><?php if (isset($txtSGC)) echo $txtSGCC; else echo " ";?></td>
  486. </tr>
  487. <tr>
  488. <th scope="row"><?php if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre') echo "II";
  489. else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre') echo "B";
  490. else echo " ";?>
  491. </th>
  492. <td><?php if (isset($txtDCB)) echo $txtDCB; else echo " ";?></td>
  493. <td><?php if (isset($txtDGB)) echo $txtDGB; else echo " ";?></td>
  494. <td><?php if (isset($txtDLMB)) echo $txtDLMB; else echo " ";?></td>
  495. <td><?php if (isset($txtDOB)) echo $txtDOB; else echo " ";?></td>
  496. <td><?php if (isset($txtDTB)) echo $txtDTB; else echo " ";?></td>
  497. <td><?php if (isset($txtINFOB)) echo $txtINFOB; else echo " ";?></td>
  498. <td><?php if (isset($txtMKGB)) echo $txtMKGB; else echo " ";?></td>
  499. <td><?php if (isset($txtRHB)) echo $txtRHB; else echo " ";?></td>
  500. <td><?php if (isset($txtSGB)) echo $txtSGCB; else echo " ";?></td>
  501. </tr>
  502. <tr>
  503. <th scope="row"><?php if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre') echo "I";
  504. else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre') echo "A";
  505. else echo " ";?>
  506. </th>
  507. <td><?php if (isset($txtDCA)) echo $txtDCA; else echo " ";?></td>
  508. <td><?php if (isset($txtDGA)) echo $txtDGA; else echo " ";?></td>
  509. <td><?php if (isset($txtDLMA)) echo $txtDLMA; else echo " ";?></td>
  510. <td><?php if (isset($txtDOA)) echo $txtDOA; else echo " ";?></td>
  511. <td><?php if (isset($txtDTA)) echo $txtDTA; else echo " ";?></td>
  512. <td><?php if (isset($txtINFOA)) echo $txtINFOA; else echo " ";?></td>
  513. <td><?php if (isset($txtMKGA)) echo $txtMKGA; else echo " ";?></td>
  514. <td><?php if (isset($txtRHA)) echo $txtRHA; else echo " ";?></td>
  515. <td><?php if (isset($txtSGA)) echo $txtSGCA; else echo " ";?></td>
  516. </tr>
  517.  
  518. <?php if (!$_GET['print']){?>
  519. <tr align="center">
  520. <td colspan="10"><input name="printtab" type="submit" value="Imprimer le tableau"
  521. onclick="window.document.tableau.action='tableau.php?print=TRUE';"></td>
  522. </tr>
  523. <?php
  524. }
  525. ?>
  526. </table>
  527. </form>
  528. <?php
  529. if ($_GET['print']) { echo '<div align="center"><a href="tableau.php">Revenir au tableau de répartition</a></div>'; imprimer();}
  530. if (!$_GET['print']) include ("_btm.php");
  531. ?>



Merci bien de prendre du temps pour moi.
9 Avril 2008 16:47:23

ligne 124: espace entre ' et C
ou mieux lg 122 espace après le where
9 Avril 2008 16:53:00

En plus t'as pas fait l'erreur apres :

  1. . $select .= 'Coef between 0 and 1000'; // ligne 124 sur ton post
  2. . $select .= ' Coef="'.$_POST['triCoefMin'].'"'; //ligne 135 sur ton post


Spoiler
J'en profite pour dire bonjour à coca25 ! Ça va m'sieur ? :D 
9 Avril 2008 17:37:46

:jap:  zen, tranquille

bon retour (t'avais disparu des écrans :) )
9 Avril 2008 17:39:31

coca25 a dit :
bon retour (t'avais disparu des écrans :) )


C'est pas un vrai retour ... Je m'ennuie un peu au taff donc je passe voir ce qu'y ce passe ...

Spoiler
IDN's lover ... snif ... [:zoon62:2]
10 Avril 2008 09:02:54

Merci beaucoup, ça m'aide vraiment et peut-être qu'à force je serais moins nul.
Tom's guide dans le monde
  • Allemagne
  • Italie
  • Irlande
  • Royaume Uni
  • Etats Unis
Suivre Tom's Guide
Inscrivez-vous à la Newsletter
  • ajouter à twitter
  • ajouter à facebook
  • ajouter un flux RSS