lyim | Bonjour,
Je suis en train de réaliser une base de données. Cependant, je bute sur un petit problème d'affichage. En fait quand je clique sur un bouton, celà lance l'affichage d'une liste de nom avec a coté de chacun, un bouton pour afficher son profil. Cepndant, quand je lance un tri sur cette liste, et que j'appuie sur le bouton profil, cela m'affiche la page profil, mais vierge, sans données... et le pire, c'est que j'ai fait un copier coller... donc je ne vois pas pourquoi ca marche pour l'un et pas pour l'autre...
Voici le code, si vous pouviez y jeter un coup d'oeil et m'aider à trouver mon erreur...
Code :
- table width="900px" style="margin-left:7px; margin-right:7px; margin-top:7px; margin-bottom:7px; background-color:#99CCFF;" cellpadding="10px" cellspacing="0">
- <caption>Employees</caption>
- <tr valign="middle">
- <td width="100px" valign="middle">See/Modify</td>
- <td style="margin-left:7px; border-left:1px solid; border-bottom:1px solid;" width="120px" valign="middle"><big>Name</big></td>
- <td style="margin-left:7px; border-left:1px solid; border-bottom:1px solid;" valign="middle"><big>Firstname</big></td>
- <td style="margin-left:7px; border-left:1px solid; border-bottom:1px solid;" valign="middle"><big>Function</big></td>
- <td style="margin-left:7px; border-left:1px solid; border-bottom:1px solid;" valign="middle"><big>Group</big></td>
- </tr>
- <?php
-
- if (isset($_GET['i']))
- {
- $test=$_GET['i'];
- switch ($test)
- {
- case 'f':
-
- $sql="SELECT E.EMP_CODE AS CODE, EMP_NAME, EMP_FIRSTNAME, FUN_DESIGNATION, DES_NAME FROM EMPLOYEE E, FUNCTION, DESIGN_GROUP WHERE E.DES_CODE = DESIGN_GROUP.DES_CODE AND E.FUN_CODE = FUNCTION.FUN_CODE AND FUNCTION.FUN_CODE = ".$_POST['employee_function']." ORDER BY `DES_NAME` ASC;";
- $result=mysql_query($sql);
- for($j=0; $j<mysql_num_rows($result); $j++)
- {
- $num = mysql_result($result, $j, "EMP_CODE" );
- $name = mysql_result($result, $j, "EMP_NAME" );
- $first = mysql_result($result, $j, "EMP_FIRSTNAME" );
- $func = mysql_result($result, $j, "FUN_DESIGNATION" );
- $dg = mysql_result($result, $j, "DES_NAME" );
- echo '<tr height="75px">';
- echo '<td align="center" valign="middle"><form method="POST" action="../?i=3e"><input name="designer" type="hidden" value="'.$num.'"><input type="submit" value="×" class="bouton"></form></td>';
- echo '<td style="margin-left:7px; border-left:1px solid;" valign="middle">'.$name.'</td>';
- echo '<td style="margin-left:10px; border-left:1px solid;" valign="middle">'.$first.'</td>';
- echo '<td style="margin-left:7px; border-left:1px solid;" valign="middle">'.$func.'</td>';
- echo '<td style="margin-left:10px; border-left:1px solid;" valign="middle">'.$dg.'</td>';
- echo '<td style="margin-left:7px; border-left:1px solid;" valign="middle">';
- echo '</tr>';
- }
- break;
-
- case 'g':
-
- $sql="SELECT E.EMP_CODE AS CODE, EMP_NAME, EMP_FIRSTNAME, FUN_DESIGNATION, DES_NAME FROM EMPLOYEE E, FUNCTION, DESIGN_GROUP WHERE E.DES_CODE = DESIGN_GROUP.DES_CODE AND E.FUN_CODE = FUNCTION.FUN_CODE AND DESIGN_GROUP.DES_CODE = ".$_POST['employee_group']." ORDER BY `EMP_NAME` ASC;";
- $result=mysql_query($sql);
- for($j=0; $j<mysql_num_rows($result); $j++)
- {
- $num = mysql_result($result, $j, "EMP_CODE" );
- $name = mysql_result($result, $j, "EMP_NAME" );
- $first = mysql_result($result, $j, "EMP_FIRSTNAME" );
- $func = mysql_result($result, $j, "FUN_DESIGNATION" );
- $dg = mysql_result($result, $j, "DES_NAME" );
- echo '<tr height="75px">';
- echo '<td align="center" valign="middle"><form method="POST" action="../?i=3e"><input name="designer" type="hidden" value="'.$num.'"><input type="submit" value="×" class="bouton"></form></td>';
- echo '<td style="margin-left:7px; border-left:1px solid;" valign="middle">'.$name.'</td>';
- echo '<td style="margin-left:10px; border-left:1px solid;" valign="middle">'.$first.'</td>';
- echo '<td style="margin-left:7px; border-left:1px solid;" valign="middle">'.$func.'</td>';
- echo '<td style="margin-left:10px; border-left:1px solid;" valign="middle">'.$dg.'</td>';
- echo '<td style="margin-left:7px; border-left:1px solid;" valign="middle">';
- echo '</tr>';
- }
- break;
-
- default:
-
- $sql="SELECT `EMP_CODE`, `EMP_NAME`, `EMP_FIRSTNAME`, `FUN_DESIGNATION`, `DES_NAME` FROM `EMPLOYEE`, `FUNCTION`, `DESIGN_GROUP` WHERE EMPLOYEE.FUN_CODE = FUNCTION.FUN_CODE AND EMPLOYEE.DES_CODE = DESIGN_GROUP.DES_CODE ORDER BY `DES_NAME` ASC;";
- $result=mysql_query($sql);
- for($j=0; $j<mysql_num_rows($result); $j++)
- {
- $num = mysql_result($result, $j, "EMP_CODE" );
- $name = mysql_result($result, $j, "EMP_NAME" );
- $first = mysql_result($result, $j, "EMP_FIRSTNAME" );
- $func = mysql_result($result, $j, "FUN_DESIGNATION" );
- $dg = mysql_result($result, $j, "DES_NAME" );
-
- echo '<tr height="75px">';
- echo '<td align="center" valign="middle"><form method="POST" action="../?i=3e"><input name="designer" type="hidden" value="'.$num.'"><input type="submit" value="×" class="bouton"></form></td>';
- echo '<td style="margin-left:7px; border-left:1px solid;" valign="middle">'.$name.'</td>';
- echo '<td style="margin-left:10px; border-left:1px solid;" valign="middle">'.$first.'</td>';
- echo '<td style="margin-left:7px; border-left:1px solid;" valign="middle">'.$func.'</td>';
- echo '<td style="margin-left:10px; border-left:1px solid;" valign="middle">'.$dg.'</td>';
- echo '<td style="margin-left:7px; border-left:1px solid;" valign="middle">';
- echo '</tr>';
- }
- break;
- }
- }
- else
- {
- $sql="SELECT `EMP_CODE`, `EMP_NAME`, `EMP_FIRSTNAME`, `FUN_DESIGNATION`, `DES_NAME` FROM `EMPLOYEE`, `FUNCTION`, `DESIGN_GROUP` WHERE EMPLOYEE.FUN_CODE = FUNCTION.FUN_CODE AND EMPLOYEE.DES_CODE = DESIGN_GROUP.DES_CODE ORDER BY `DES_NAME` ASC;";
- $result=mysql_query($sql);
- for($j=0; $j<mysql_num_rows($result); $j++)
- {
- $num = mysql_result($result, $j, "EMP_CODE" );
- $name = mysql_result($result, $j, "EMP_NAME" );
- $first = mysql_result($result, $j, "EMP_FIRSTNAME" );
- $func = mysql_result($result, $j, "FUN_DESIGNATION" );
- $dg = mysql_result($result, $j, "DES_NAME" );
-
- echo '<tr height="75px">';
- echo '<td align="center" valign="middle"><form method="POST" action="../?i=3e"><input name="designer" type="hidden" value="'.$num.'"><input type="submit" value="×" class="bouton"></form></td>';
- echo '<td style="margin-left:7px; border-left:1px solid;" valign="middle">'.$name.'</td>';
- echo '<td style="margin-left:10px; border-left:1px solid;" valign="middle">'.$first.'</td>';
- echo '<td style="margin-left:7px; border-left:1px solid;" valign="middle">'.$func.'</td>';
- echo '<td style="margin-left:10px; border-left:1px solid;" valign="middle">'.$dg.'</td>';
- echo '<td style="margin-left:7px; border-left:1px solid;" valign="middle">';
- echo '</tr>';
- }
- }
- ?>
|
Je vous remercie d'avance
Lyim |