Bsr a tous!
Ca fait quelques jours que je m'entraine sur ce bout de code.
En fait je voudrai afficher dans le <select> TITLE uniquement les titres de toutes les notifications qui ont ete envoye a l'employe X choisi dans le <select> EMPLOYEES. J'y arrive pas et j'ai besoin d'aide svp.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99 <?php mysql_select_db($database_projectConnect, $projectConnect); $query_sql = "SELECT IDEmp, CONCAT(firstname, lastname) AS name FROM employees ORDER BY IDEmp ASC"; $sql = mysql_query($query_sql, $projectConnect) or die(mysql_error()); $row_sql = mysql_fetch_assoc($sql); $totalRows_sql = mysql_num_rows($sql); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Document sans titre</title> <meta name="robots" content="none"> <link rel="stylesheet" href="css/style.css" type="text/css" /> </head> <body> <p> </p> <form method="POST" action="register.php"> <table align="center" class="table" border="0"> <tr> <td> <table> <tr> <td><label for="emp">EMPLOYEE</label></td> <td><select name="emp" id="emp" > <option value=""></option> <?php do { ?> <option value="<?php echo $row_sql['IDEmp']?>"><?php echo $row_sql['name']?></option> <?php } while ($row_sql = mysql_fetch_assoc($sql)); $rows = mysql_num_rows($sql); if($rows > 0) { mysql_data_seek($sql, 0); $row_sql = mysql_fetch_assoc($sql); } ?> </select></td> </tr> <tr> <td><label for="title">TITLE</label></td> <td><select name="title" id="title" > <option value=""></option> <?php if ( $row_sql['emp'] != "") { mysql_select_db($database_projectConnect, $projectConnect); $query_sql1 = "SELECT IDnot, title FROM notifs WHERE notifs.IDemp1=".$row_sql['emp']; $sql1 = mysql_query($query_sql1, $projectConnect) or die(mysql_error()); $row_sql1 = mysql_fetch_assoc($sql1); $totalRows_sql1 = mysql_num_rows($sql1); do { ?> <option value="<?php echo $row_sql1['IDnot']?>"><?php echo $row_sql1['title']?></option> <?php } while ($row_sql1 = mysql_fetch_assoc($sql1)); $rows = mysql_num_rows($sql1); if($rows > 0) { mysql_data_seek($sql1, 0); $row_sql1 = mysql_fetch_assoc($sql1); } } ?> </select></td> </tr> <tr> <td><label for="mot">TEXT</label></td> <td><textarea name="motive" id="mot" cols="38" rows="10" readonly ></textarea></td> </tr> </table> </td> <td> <table> <tr> <td><label for="mot">RESPONSE</label></td> <td><textarea name="motive" id="mot" cols="38" rows="10">Type Your Text </textarea></td> </tr> </table> </td> </tr> </table> <table align="center"> <tr> <td width="50%"></td> <td align="center" ><input id="input-btn" name="save" type="submit" value="save" onClick="ask();"/></td> </tr> </table> </FORM> </body> </html> <?php mysql_free_result($sql); mysql_free_result($sql1); ?>
Merci!
Partager