Bonjour, c'est encore moi ^^ je vous consulte cette foi pour un souci de tri dynamique de tableau , revoila ma fonction tableau ( on va finir par la connaitre par coeur xd )

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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
function tableau_session($rq,$ligne,$resultat)
{
	$TabTitre = array 
		(
			"NUM","SITE","SOUS-RÉSEAU","ORDI","LOGIN","NOM COMPLET","IP","DOMAINE ORDINATEUR","DOMAINE UTILISATEUR",
			"SYSTEME","SYSTEME PACK","MODELE","CPU","MHZ","RAM","DATE LOGIN","DERNIER BOOT","ORDI","LOGIN",
			"NOM COMPLET","ANTIVIRUS","SIGNATURE","DATE SIGNATURE","AGE","VNC","VNC START","REP KIXDIR","REP MYSQLDIR","OUTILS"
		);
 
echo "<TABLE BORDER=1 ALIGN='CENTER' class=onglets_table>
		<TR>";
		foreach($TabTitre as $element)
			{
				echo"<TD align = center class='onglet_td'>".$element."</TD>";
			}
		echo"</TR>";
 
	$numBoucle = 1;
 
	while($ligne)
		{
			$age = $ligne["naidatdate"];
			if (is_null($age) || $age=='' || $age==' ' || $age=="nt/")
				{
					$age = "<font color='red'>nc</font>";
				}
			else
				{
					$age = ecart_date_now($age);
					if ($age < 31)
						$age = "<font color='green'>".$age."</font>";
					elseif ($age < 61)
						$age = "<font color='orange'>".$age."</font>";
					else
						$age = "<font color='red'>".$age."</font>";
				}
				if ($ligne["site"]=='' || $ligne["site"]== null)
					{
						$ligne["site"] = "<font color='red'>site inconnu</font>";
					}
				if ($ligne["ip"]=='' || $ligne["ip"]== null)
					{
						$ligne["ip"] = "<font color='red'>nc</font>";
					}
				if ($ligne["ipsubnet"]=='' || $ligne["ipsubnet"]== null)
					{
						$ligne["ipsubnet"] = "<font color='red'>sous r&eacute;seau inconnu</font>";
					}
				if ($ligne["sp"]=='' || $ligne["sp"]== null)
					{
						$ligne["sp"] = "<font color='red'>nc</font>";
					}
				if ($ligne["smodel"]=='' || $ligne["smodel"]== null)
					{
						$ligne["smodel"] = "<font color='red'>nc</font>";
					}
				if ($ligne["cpu"]=='' || $ligne["cpu"]== null)
					{
						$ligne["cpu"] = "<font color='red'>nc</font>";
					}
				if ($ligne["mhz"]=='' || $ligne["mhz"]== null)
					{
						$ligne["mhz"] = "<font color='red'>nc</font>";
					}
				if ($ligne["ram"]=='' || $ligne["ram"]== null)
					{
						$ligne["ram"] = "<font color='red'>nc</font>";
					}
				if ($ligne["naiver"]=='' || $ligne["naiver"]== null)
					{
						$ligne["naiver"] = "<font color='red'>nc</font>";
					}
				if ($ligne["naidatver"]=='' || $ligne["naidatver"]== null)
					{
						$ligne["naidatver"] = "<font color='red'>nc</font>";
					}
				if ($ligne["naidatdate"]=='' || $ligne["naidatdate"]== null || $ligne["naidatdate"]=='nt/')
					{
						$date = $ligne["naidatdate"] = "<font color='red'>nc</font>";
					}
					else
						{
							$date = date_format_JJMMAAAA($ligne["naidatdate"]);
						}
				if ($ligne["vnc"]=='' || $ligne["vnc"]== null)
					{
						$ligne["vnc"] = "<font color='red'>nc</font>";
					}
				if ($ligne["outils"]=='' || $ligne["outils"]== null)
					{
						$ligne["outils"] = "<font color='red'>nc</font>";
					}
 
				if ($ligne["os"] =='' || $ligne["os"]== null || $ligne["os"] =='Unknown OS')
					{
						$ligne["os"] = "<font color='red'>non inventori&eacute; dans OCS</font>";
					}
					elseif (($ligne["os"] == 'Microsoft Windows XP Professional') && ($ligne["sp"] <> 'Service Pack 3'))
						{
							$ligne["os"] = $ligne["os"];
							$ligne["sp"] = "<font color='red'>".$ligne["sp"]."</font>";
						}
						elseif (($ligne["os"] == 'Microsoft Windows XP Professional x64 Edition') && ($ligne["sp"] <> 'Service Pack 2'))
							{
								$ligne["os"] = $ligne["os"];
								$ligne["sp"] = "<font color='red'>".$ligne["sp"]."</font>";
							}
							else
								{
									$ligne["os"] = $ligne["os"];
									$ligne["sp"] = $ligne["sp"];
								}
 
				if (substr($ligne["naiver"], 0, 2) == '11')
					{
						$ligne["naiver"] = "<font color='blue'>" . $ligne["naiver"] . "</font>";
					}
 
				$ligne["timestamp"] = date_format_JJ_MM_AAAA($ligne["timestamp"]);
				$ligne["lastboot"] = date_format_JJ_MM_AAAA($ligne["lastboot"]);
 
				// si numéro de ligne pair ( colorisation 1 lignes sur 2)
				if($numBoucle %2 == 1)
					{
						$bgcolor = '#F3F8ED';
					}
					else
						{
							$bgcolor = '#C4D7ED';
						}
 
				$TabLigne = array 
					(
						$numBoucle,$ligne["site"],$ligne["ipsubnet"],$ligne["compname"],
						$ligne["userid"],$ligne["userfullname"],$ligne["ip"],$ligne["domain"],$ligne["userdomain"],
						$ligne["os"],$ligne["sp"],$ligne["smodel"],$ligne["cpu"],$ligne["mhz"],$ligne["ram"],
						$ligne["timestamp"],$ligne["lastboot"],$ligne["compname"],$ligne["userid"],
						$ligne["userfullname"],$ligne["naiver"],$ligne["naidatver"],$date,$age,$ligne["vnc"],
						$ligne["vncstart"],$ligne["kixdir"],$ligne["mysqldir"],$ligne["outils"]
					);
 
				echo"<TR bgcolor=".$bgcolor." align = center>";
				foreach($TabLigne as $element2)
					{
						echo"<TD nowrap='nowrap'>".$element2."</TD>";
					}
				echo"</TR>";
				$ligne = mysql_fetch_assoc($resultat);$numBoucle++;
		}
	echo "</TABLE>";
}
jai mis pour ceux qui s 'en rendron compte un $rq en parametre de fonction afin d appeler ma requete pour la modifier avec un parametre de tri en fonction de la colone du tableau cliké, il n'y a rien de fait pour l instant a ce niveau la, jai netoyer mon code des essai que j avai fait sans succes c'est pour sa que je fait appel a vous, pourriez vous m'aidez a mettre en place le systeme de tri dynamique par colone , merci bcp