Bonjour,

Je veux faire une page avec plusieurs onglets jquery ... le problème étant qu'il faut charger 5 pages de données ... et c'est long

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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
 
<div id="tabs">
	<ul>
		<li><a id="onglet" href="#tabs-1">Joueurs</a></li>
		<li><a id="onglet" href="#tabs-2">Alliances</a></li>
		<li><a id="onglet" href="#tabs-3">Combattant</a></li>
		<li><a id="onglet" href="#tabs-4">Attaquant</a></li>
		<li><a id="onglet" href="#tabs-5">Défenseur</a></li>
	</ul>
	<div id="tabs-1">
<?php
$select = "SELECT numero, name FROM infos WHERE name= '".$_GET['monde']."'";
$result = mysql_query($select,$link_stats) or die ('Erreur : '.mysql_error() );
$total = mysql_num_rows($result);
 
if($total) {
    while($row = mysql_fetch_array($result)) {
$monde=$row["name"];
$numero_monde=$row["numero"];
    }
 
}
else echo 'Ce monde n\'existe pas!';
mysql_free_result($result);
 
?>
<?php
$player = mysql_query('SELECT p.id AS id, 
	p.name, 
	a.id AS alliance_id, 
	a.alliance_name AS alliance_name,
	p.points, 
	p.rank, 
	p.towns 
FROM '.$_GET['monde'].'_players p
INNER JOIN '.$_GET['monde'].'_alliances a ON (a.id = p.alliance_id)
ORDER BY rank ASC
LIMIT 0,10');
$totalp = mysql_num_rows($player);
 
if($totalp) {
 
    // debut du tableau
    echo '<table id=mytable>'."\n";
        // premi? ligne on affiche les titres pr?m et surnom dans 2 colonnes
        echo '<tr>';
        echo '<th scope="col"><b><u>Rang</u></b></td>' ;
        echo '<th scope="col"><b><u>Pseudo</u></b></td>';
      echo '<th scope="col"><b><u>Alliance</u></b></td>';
        echo '<th scope="col"><b><u>Points</u></b></td>';
		echo '<th scope="col"><b><u>Villes</u></b></td>';
      echo '</tr>'."\n";
    // lecture et affichage des r?ltats sur 2 colonnes, 1 r?ltat par ligne.    
    while($row = mysql_fetch_array($player)) {
        echo '<tr>';
        echo '<td scope="row">'.$row["rank"].'</td>';
        echo '<td scope="row"><a href="'.append_sid('player/'.$monde.'/'.$row["id"]).'">'.urldecode($row["name"]).'</a></td>';
        echo '<td scope="row"><a href="'.append_sid('alliance/'.$monde.'/'.$row["alliance_id"]).'">'.urldecode($row["alliance_name"]).'</a></td>';
      echo '<td scope="row">'.$english_format_number = number_format($row["points"]).'</td>';
	  echo '<td scope="row">'.$row["towns"].'</td>';
      echo '</tr>'."\n";
    }
    echo '</table>'."\n";
    // fin du tableau.
 
 
 
}
else echo 'Pas d\'enregistrements dans cette table...';
// on lib‚re le r‚sultat
mysql_free_result($player);
?>
</div>
	<div id="tabs-2">
<?php
$alliance = mysql_query('SELECT a.id AS id, 
	a.alliance_name	, 
	a.points, 
	a.rank, 
	a.villages,
	a.members 
FROM '.$_GET['monde'].'_alliances a
ORDER BY rank ASC
LIMIT 0,10');
$totala = mysql_num_rows($alliance);
 
if($totala) {
 
    // debut du tableau
    echo '<table id=mytable>'."\n";
        // premi? ligne on affiche les titres pr?m et surnom dans 2 colonnes
        echo '<tr>';
        echo '<th scope="col"><b><u>Rang</u></b></td>' ;
        echo '<th scope="col"><b><u>Nom</u></b></td>';
		echo '<th scope="col"><b><u>Points</u></b></td>';
        echo '<th scope="col"><b><u>Membres</u></b></td>';
        echo '<th scope="col"><b><u>Villes</u></b></td>';
		echo '<th scope="col"><b><u>Moy. membres</u></b></td>';
		echo '<th scope="col"><b><u>Moy.villes</u></b></td>';
        echo '</tr>'."\n";
    // lecture et affichage des r?ltats sur 2 colonnes, 1 r?ltat par ligne.    
    while($row = mysql_fetch_array($alliance)) {
 
	$average_cities_points=$row["points"] / $row["villages"];
	$average_members_points=$row["points"] / $row["members"];
 
        echo '<tr>';
        echo '<td scope="row">'.$row["rank"].'</td>';
        echo '<td scope="row"><a href="'.append_sid('alliance/'.$monde.'/'.$row["id"]).'">'.urldecode($row["alliance_name"]).'</a></td>';
        echo '<td scope="row">'.$english_format_number = number_format($row["points"]).'</a></td>';
        echo '<td scope="row">'.$row["members"].'</td>';
	    echo '<td scope="row">'.$english_format_number = number_format($row["villages"]).'</td>';
	    echo '<td scope="row">'.$english_format_number = number_format($average_members_points).'</td>';
	    echo '<td scope="row">'.$english_format_number = number_format($average_cities_points).'</td>';
        echo '</tr>'."\n";
    }
    echo '</table>'."\n";
    // fin du tableau.
 
 
 
}
else echo 'Pas d\'enregistrements dans cette table...';
// on lib‚re le r‚sultat
mysql_free_result($alliance);
?>
	</div>
	<div id="tabs-3">
<?php
$combattant = mysql_query('SELECT a.rank, 
	a.player_id	, 
	a.points,
	p.id AS id,
	p.name AS name
FROM '.$_GET['monde'].'_player_kills_all a
LEFT JOIN '.$_GET['monde'].'_players p ON (p.id=a.player_id)
ORDER BY rank ASC
LIMIT 0,10');
$totalc = mysql_num_rows($combattant);
 
if($totalc) {
 
    // debut du tableau
    echo '<table id=mytable>'."\n";
        // premi? ligne on affiche les titres pr?m et surnom dans 2 colonnes
        echo '<tr>';
        echo '<th scope="col"><b><u>Rang</u></b></td>' ;
        echo '<th scope="col"><b><u>Nom</u></b></td>';
		echo '<th scope="col"><b><u>Points</u></b></td>';
        echo '</tr>'."\n";
    // lecture et affichage des r?ltats sur 2 colonnes, 1 r?ltat par ligne.    
    while($row = mysql_fetch_array($combattant)) {
 
        echo '<tr>';
        echo '<td scope="row">'.$row["rank"].'</td>';
        echo '<td scope="row"><a href="'.append_sid('player/'.$monde.'/'.$row["id"]).'">'.urldecode($row["name"]).'</a></td>';
        echo '<td scope="row">'.$english_format_number = number_format($row["points"]).'</a></td>';
      echo '</tr>'."\n";
    }
    echo '</table>'."\n";
    // fin du tableau.
 
 
 
}
else echo 'Pas d\'enregistrements dans cette table...';
 
mysql_free_result($combattant);
?>	
	</div>
 
<div id="tabs-4">	
<?php
$attaquant = mysql_query('SELECT a.rank, 
	a.player_id	, 
	a.points,
	p.id AS id,
	p.name AS name
FROM '.$_GET['monde'].'_player_kills_att a
LEFT JOIN '.$_GET['monde'].'_players p ON (p.id=a.player_id)
ORDER BY rank ASC
LIMIT 0,10');
$totalat = mysql_num_rows($attaquant);
 
if($totalat) {
 
    // debut du tableau
    echo '<table id=mytable>'."\n";
        // premi? ligne on affiche les titres pr?m et surnom dans 2 colonnes
        echo '<tr>';
        echo '<th scope="col"><b><u>Rang</u></b></td>' ;
        echo '<th scope="col"><b><u>Nom</u></b></td>';
		echo '<th scope="col"><b><u>Points</u></b></td>';
        echo '</tr>'."\n";
    // lecture et affichage des r?ltats sur 2 colonnes, 1 r?ltat par ligne.    
    while($row = mysql_fetch_array($attaquant)) {
 
        echo '<tr>';
        echo '<td scope="row">'.$row["rank"].'</td>';
        echo '<td scope="row"><a href="'.append_sid('player/'.$monde.'/'.$row["id"]).'">'.urldecode($row["name"]).'</a></td>';
        echo '<td scope="row">'.$english_format_number = number_format($row["points"]).'</a></td>';
      echo '</tr>'."\n";
    }
    echo '</table>'."\n";
    // fin du tableau.
 
 
 
}
else echo 'Pas d\'enregistrements dans cette table...';
 
mysql_free_result($attaquant);
?>	
	</div>
<div id="tabs-5">
<?php
$defenseur = mysql_query('SELECT a.rank, 
	a.player_id	, 
	a.points,
	p.id AS id,
	p.name AS name
FROM '.$_GET['monde'].'_player_kills_def a
LEFT JOIN '.$_GET['monde'].'_players p ON (p.id=a.player_id)
ORDER BY rank ASC
LIMIT 0,10');
$totald = mysql_num_rows($defenseur);
 
if($totald) {
 
    // debut du tableau
    echo '<table id=mytable>'."\n";
        // premi? ligne on affiche les titres pr?m et surnom dans 2 colonnes
        echo '<tr>';
        echo '<th scope="col"><b><u>Rang</u></b></td>' ;
        echo '<th scope="col"><b><u>Nom</u></b></td>';
		echo '<th scope="col"><b><u>Points</u></b></td>';
        echo '</tr>'."\n";
    // lecture et affichage des r?ltats sur 2 colonnes, 1 r?ltat par ligne.    
    while($row = mysql_fetch_array($defenseur)) {
 
        echo '<tr>';
        echo '<td scope="row">'.$row["rank"].'</td>';
        echo '<td scope="row"><a href="'.append_sid('player/'.$monde.'/'.$row["id"]).'">'.urldecode($row["name"]).'</a></td>';
        echo '<td scope="row">'.$english_format_number = number_format($row["points"]).'</a></td>';
      echo '</tr>'."\n";
    }
    echo '</table>'."\n";
    // fin du tableau.
 
 
 
}
else echo 'Pas d\'enregistrements dans cette table...';
 
mysql_free_result($defenseur);
?>	
	</div>
</div>
Comment allèger tout ça ?