1 | <? |
---|
2 | require_once( "class.page.php" ); |
---|
3 | require_once( "db.php" ); |
---|
4 | require_once( "award.php" ); |
---|
5 | require_once( "globals.php" ); |
---|
6 | |
---|
7 | $page = new Page( "Statistics" ); |
---|
8 | |
---|
9 | $dbconn = new DBConnection(); |
---|
10 | |
---|
11 | $curmonth = date( "m" ); |
---|
12 | $curyear = date( "Y" ); |
---|
13 | |
---|
14 | $html .= "<table class=kb-table>"; |
---|
15 | $html .= "<tr class=kb-table-row-even><td colspan=3><b>View:</b></td></tr>"; |
---|
16 | $html .= "<tr class=kb-table-row-even>"; |
---|
17 | $html .= "<form id=viewform name=viewform action=?a=stats method=post><td>"; |
---|
18 | $html .= "<select class=kb-select name=view id=view size=1>"; |
---|
19 | $html .= "<option value=0>Most involved pilots</option>"; |
---|
20 | $html .= "<option value=1>Most deadly pilots</option>"; |
---|
21 | $html .= "<option value=2>Most losing pilots</option>"; |
---|
22 | $html .= "<option value=3>---------------------------------------------------</option>"; |
---|
23 | $html .= "<option value=4>Most involved corporations</option>"; |
---|
24 | $html .= "<option value=5>Most deadly corporations</option>"; |
---|
25 | $html .= "<option value=6>Most losing corporations</option>"; |
---|
26 | $html .= "<option value=7>---------------------------------------------------</option>"; |
---|
27 | $html .= "<option value=8>Most involved ships</option>"; |
---|
28 | $html .= "<option value=9>Most deadly ships</option>"; |
---|
29 | $html .= "<option value=10>Most lost ship</option>"; |
---|
30 | $html .= "<option value=11>---------------------------------------------------</option>"; |
---|
31 | $html .= "<option value=12>Most violent systems</option>"; |
---|
32 | $html .= "</select>"; |
---|
33 | $html .= "</td><td>"; |
---|
34 | $html .= "<input class=kb-input name=submit type=submit value=Go></td></form>"; |
---|
35 | $html .= "</tr>"; |
---|
36 | $html .= "</table>"; |
---|
37 | |
---|
38 | switch ( $_POST['view'] ) { |
---|
39 | case 1: // most deadly pilots |
---|
40 | $html .= "<div class=block-header2>Most deadly pilots</div>"; |
---|
41 | $sql = "select plt.plt_id, plt.plt_name, count(distinct(inv.inv_kll_id)) as kills |
---|
42 | from kb3_pilots plt, _".KB_SITE."_involved inv, _".KB_SITE."_kills kll |
---|
43 | where inv.inv_plt_id = plt.plt_id |
---|
44 | and kll.kll_id = inv.inv_kll_id"; |
---|
45 | |
---|
46 | if ( CORP_ID != "" ) |
---|
47 | $sql .= " and inv.inv_crp_id in ( ".CORP_ID." )"; |
---|
48 | |
---|
49 | if ( ALLIANCE_ID ) |
---|
50 | $sql .= " and inv.inv_all_id = ".ALLIANCE_ID; |
---|
51 | |
---|
52 | $sql .= " and inv.inv_final_blow = 1 |
---|
53 | and date_format( kll.kll_timestamp, \"%c\" ) = ".$curmonth." |
---|
54 | and date_format( kll.kll_timestamp, \"%Y\" ) = ".$curyear." |
---|
55 | group by plt.plt_name |
---|
56 | order by kills desc |
---|
57 | limit 25"; |
---|
58 | |
---|
59 | $qry = new DBQuery( $dbconn, $sql ); |
---|
60 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
61 | |
---|
62 | $html .= "<table width=\"99%\"><tr><td align=center valign=top>"; |
---|
63 | |
---|
64 | $html .= "<div class=block-header>This month</div>"; |
---|
65 | $html .= "<table class=kb-table>"; |
---|
66 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Pilot</td><td align=center>Final blows</td></tr>"; |
---|
67 | |
---|
68 | $odd = false; |
---|
69 | $counter = 1; |
---|
70 | while ( $row = $qry->getRow() ) { |
---|
71 | if ( !$odd ) { |
---|
72 | $odd = true; |
---|
73 | $rowclass = 'kb-table-row-odd'; |
---|
74 | } |
---|
75 | else { |
---|
76 | $odd = false; |
---|
77 | $rowclass = 'kb-table-row-even'; |
---|
78 | } |
---|
79 | |
---|
80 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell width=180><a href=\"?a=pilot_detail&plt_id=".$row['plt_id']."\">".$row['plt_name']."</a></td><td align=center>".$row['kills']."</td></tr>"; |
---|
81 | $counter++; |
---|
82 | } |
---|
83 | |
---|
84 | $html .= "</table>"; |
---|
85 | |
---|
86 | $html .= "</td><td align=center valign=top>"; |
---|
87 | |
---|
88 | $sql = "select plt.plt_id, plt.plt_name, count(distinct(inv.inv_kll_id)) as kills |
---|
89 | from kb3_pilots plt, _".KB_SITE."_involved inv, _".KB_SITE."_kills kll |
---|
90 | where inv.inv_plt_id = plt.plt_id |
---|
91 | and kll.kll_id = inv.inv_kll_id"; |
---|
92 | |
---|
93 | if ( CORP_ID != "" ) |
---|
94 | $sql .= " and inv.inv_crp_id in ( ".CORP_ID." )"; |
---|
95 | |
---|
96 | |
---|
97 | if ( ALLIANCE_ID ) |
---|
98 | $sql .= " and inv.inv_all_id = ".ALLIANCE_ID; |
---|
99 | |
---|
100 | $sql .= " and inv.inv_final_blow = 1 |
---|
101 | group by plt.plt_name |
---|
102 | order by kills desc |
---|
103 | limit 25"; |
---|
104 | |
---|
105 | $qry = new DBQuery( $dbconn, $sql ); |
---|
106 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
107 | |
---|
108 | $html .= "<div class=block-header>All-Time</div>"; |
---|
109 | $html .= "<table class=kb-table>"; |
---|
110 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Pilot</td><td align=center>Final blows</td></tr>"; |
---|
111 | |
---|
112 | $odd = false; |
---|
113 | $counter = 1; |
---|
114 | while ( $row = $qry->getRow() ) { |
---|
115 | if ( !$odd ) { |
---|
116 | $odd = true; |
---|
117 | $rowclass = 'kb-table-row-odd'; |
---|
118 | } |
---|
119 | else { |
---|
120 | $odd = false; |
---|
121 | $rowclass = 'kb-table-row-even'; |
---|
122 | } |
---|
123 | |
---|
124 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell><a href=\"?a=pilot_detail&plt_id=".$row['plt_id']."\">".$row['plt_name']."</a></td><td align=center>".$row['kills']."</td></tr>"; |
---|
125 | $counter++; |
---|
126 | } |
---|
127 | |
---|
128 | $html .= "</table>"; |
---|
129 | |
---|
130 | $html .= "</td></tr></table>"; |
---|
131 | |
---|
132 | break; |
---|
133 | case 2: // most losing pilots |
---|
134 | $html .= "<div class=block-header2>Most losing pilots</div>"; |
---|
135 | $sql = "select plt.plt_id, plt.plt_name, count(kll.kll_id) as kills |
---|
136 | from kb3_pilots plt, _".KB_SITE."_kills kll |
---|
137 | where kll.kll_victim_id = plt.plt_id"; |
---|
138 | |
---|
139 | if ( CORP_ID != "" ) |
---|
140 | $sql .= " and kll.kll_crp_id in ( ".CORP_ID." )"; |
---|
141 | |
---|
142 | |
---|
143 | if ( ALLIANCE_ID ) |
---|
144 | $sql .= " and kll.kll_all_id = ".ALLIANCE_ID; |
---|
145 | |
---|
146 | $sql .= " and date_format( kll.kll_timestamp, \"%c\" ) = ".$curmonth." |
---|
147 | and date_format( kll.kll_timestamp, \"%Y\" ) = ".$curyear." |
---|
148 | group by plt.plt_name |
---|
149 | order by kills desc |
---|
150 | limit 25"; |
---|
151 | |
---|
152 | $qry = new DBQuery( $dbconn, $sql ); |
---|
153 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
154 | |
---|
155 | $html .= "<table width=\"99%\"><tr><td align=center valign=top>"; |
---|
156 | |
---|
157 | $html .= "<div class=block-header>This month</div>"; |
---|
158 | $html .= "<table class=kb-table>"; |
---|
159 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Pilot</td><td align=center>Losses</td></tr>"; |
---|
160 | |
---|
161 | $odd = false; |
---|
162 | $counter = 1; |
---|
163 | while ( $row = $qry->getRow() ) { |
---|
164 | if ( !$odd ) { |
---|
165 | $odd = true; |
---|
166 | $rowclass = 'kb-table-row-odd'; |
---|
167 | } |
---|
168 | else { |
---|
169 | $odd = false; |
---|
170 | $rowclass = 'kb-table-row-even'; |
---|
171 | } |
---|
172 | |
---|
173 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell width=180><a href=\"?a=pilot_detail&plt_id=".$row['plt_id']."\">".$row['plt_name']."</a></td><td align=center>".$row['kills']."</td></tr>"; |
---|
174 | $counter++; |
---|
175 | } |
---|
176 | |
---|
177 | $html .= "</table>"; |
---|
178 | |
---|
179 | $html .= "</td><td align=center valign=top>"; |
---|
180 | |
---|
181 | $sql = "select plt.plt_id, plt.plt_name, count(kll.kll_id) as kills |
---|
182 | from kb3_pilots plt, _".KB_SITE."_kills kll |
---|
183 | where kll.kll_victim_id = plt.plt_id"; |
---|
184 | |
---|
185 | if ( CORP_ID != "" ) |
---|
186 | $sql .= " and kll.kll_crp_id in ( ".CORP_ID. ")"; |
---|
187 | |
---|
188 | if ( ALLIANCE_ID ) |
---|
189 | $sql .= " and kll.kll_all_id = ".ALLIANCE_ID; |
---|
190 | |
---|
191 | $sql .= " group by plt.plt_name |
---|
192 | order by kills desc |
---|
193 | limit 25"; |
---|
194 | |
---|
195 | $qry = new DBQuery( $dbconn, $sql ); |
---|
196 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
197 | |
---|
198 | $html .= "<div class=block-header>All-Time</div>"; |
---|
199 | $html .= "<table class=kb-table>"; |
---|
200 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Pilot</td><td align=center>Losses</td></tr>"; |
---|
201 | |
---|
202 | $odd = false; |
---|
203 | $counter = 1; |
---|
204 | while ( $row = $qry->getRow() ) { |
---|
205 | if ( !$odd ) { |
---|
206 | $odd = true; |
---|
207 | $rowclass = 'kb-table-row-odd'; |
---|
208 | } |
---|
209 | else { |
---|
210 | $odd = false; |
---|
211 | $rowclass = 'kb-table-row-even'; |
---|
212 | } |
---|
213 | |
---|
214 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell><a href=\"?a=pilot_detail&plt_id=".$row['plt_id']."\">".$row['plt_name']."</a></td><td align=center>".$row['kills']."</td></tr>"; |
---|
215 | $counter++; |
---|
216 | } |
---|
217 | |
---|
218 | $html .= "</table>"; |
---|
219 | |
---|
220 | $html .= "</td></tr></table>"; |
---|
221 | |
---|
222 | break; |
---|
223 | case 0: // most involved pilots |
---|
224 | $html .= "<div class=block-header2>Most involved pilots</div>"; |
---|
225 | $sql = "select plt.plt_id, plt.plt_name, count(distinct(inv.inv_kll_id)) as kills |
---|
226 | from kb3_pilots plt, _".KB_SITE."_involved inv, _".KB_SITE."_kills kll |
---|
227 | where inv.inv_plt_id = plt.plt_id |
---|
228 | and kll.kll_id = inv.inv_kll_id"; |
---|
229 | |
---|
230 | if ( CORP_ID != "" ) |
---|
231 | $sql .= " and inv.inv_crp_id in ( ".CORP_ID." )"; |
---|
232 | |
---|
233 | |
---|
234 | if ( ALLIANCE_ID ) |
---|
235 | $sql .= " and inv.inv_all_id = ".ALLIANCE_ID; |
---|
236 | |
---|
237 | $sql .= " and date_format( kll.kll_timestamp, \"%c\" ) = ".$curmonth." |
---|
238 | and date_format( kll.kll_timestamp, \"%Y\" ) = ".$curyear." |
---|
239 | group by plt.plt_name |
---|
240 | order by kills desc |
---|
241 | limit 25"; |
---|
242 | |
---|
243 | $qry = new DBQuery( $dbconn, $sql ); |
---|
244 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
245 | |
---|
246 | $html .= "<table width=\"99%\"><tr><td align=center valign=top>"; |
---|
247 | |
---|
248 | $html .= "<div class=block-header>This month</div>"; |
---|
249 | $html .= "<table class=kb-table>"; |
---|
250 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Pilot</td><td align=center width=40>Kills</td></tr>"; |
---|
251 | |
---|
252 | $odd = false; |
---|
253 | $counter = 1; |
---|
254 | while ( $row = $qry->getRow() ) { |
---|
255 | if ( !$odd ) { |
---|
256 | $odd = true; |
---|
257 | $rowclass = 'kb-table-row-odd'; |
---|
258 | } |
---|
259 | else { |
---|
260 | $odd = false; |
---|
261 | $rowclass = 'kb-table-row-even'; |
---|
262 | } |
---|
263 | |
---|
264 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell width=180><a href=\"?a=pilot_detail&plt_id=".$row['plt_id']."\">".$row['plt_name']."</a></td><td align=center>".$row['kills']."</td></tr>"; |
---|
265 | $counter++; |
---|
266 | } |
---|
267 | |
---|
268 | $html .= "</table>"; |
---|
269 | |
---|
270 | $html .= "</td><td align=center valign=top>"; |
---|
271 | |
---|
272 | $sql = "select plt.plt_id, plt.plt_name, count(distinct(inv.inv_kll_id)) as kills |
---|
273 | from kb3_pilots plt, _".KB_SITE."_involved inv, _".KB_SITE."_kills kll |
---|
274 | where inv.inv_plt_id = plt.plt_id |
---|
275 | and kll.kll_id = inv.inv_kll_id"; |
---|
276 | |
---|
277 | if ( CORP_ID != "" ) |
---|
278 | $sql .= " and inv.inv_crp_id in ( ".CORP_ID." )"; |
---|
279 | |
---|
280 | |
---|
281 | if ( ALLIANCE_ID ) |
---|
282 | $sql .= " and inv.inv_all_id = ".ALLIANCE_ID; |
---|
283 | |
---|
284 | $sql .= " group by plt.plt_name |
---|
285 | order by kills desc |
---|
286 | limit 25"; |
---|
287 | |
---|
288 | $qry = new DBQuery( $dbconn, $sql ); |
---|
289 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
290 | |
---|
291 | $html .= "<div class=block-header>All-Time</div>"; |
---|
292 | $html .= "<table class=kb-table>"; |
---|
293 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Pilot</td><td align=center width=40>Kills</td></tr>"; |
---|
294 | |
---|
295 | $odd = false; |
---|
296 | $counter = 1; |
---|
297 | while ( $row = $qry->getRow() ) { |
---|
298 | if ( !$odd ) { |
---|
299 | $odd = true; |
---|
300 | $rowclass = 'kb-table-row-odd'; |
---|
301 | } |
---|
302 | else { |
---|
303 | $odd = false; |
---|
304 | $rowclass = 'kb-table-row-even'; |
---|
305 | } |
---|
306 | |
---|
307 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell><a href=\"?a=pilot_detail&plt_id=".$row['plt_id']."\">".$row['plt_name']."</a></td><td align=center>".$row['kills']."</td></tr>"; |
---|
308 | $counter++; |
---|
309 | } |
---|
310 | |
---|
311 | $html .= "</table>"; |
---|
312 | |
---|
313 | $html .= "</td></tr></table>"; |
---|
314 | |
---|
315 | break; |
---|
316 | case 4: // most involved corps |
---|
317 | $html .= "<div class=block-header2>Most involved corporations</div>"; |
---|
318 | $sql = "select crp.crp_id, crp.crp_name, count(distinct(inv.inv_kll_id)) as kills |
---|
319 | from kb3_corps crp, _".KB_SITE."_involved inv, _".KB_SITE."_kills kll |
---|
320 | where inv.inv_crp_id = crp.crp_id |
---|
321 | and kll.kll_id = inv.inv_kll_id"; |
---|
322 | |
---|
323 | if ( CORP_ID != "" ) |
---|
324 | $sql .= " and inv.inv_crp_id in ( ".CORP_ID." )"; |
---|
325 | |
---|
326 | |
---|
327 | if ( ALLIANCE_ID ) |
---|
328 | $sql .= " and inv.inv_all_id = ".ALLIANCE_ID; |
---|
329 | |
---|
330 | $sql .= " and date_format( kll.kll_timestamp, \"%c\" ) = ".$curmonth." |
---|
331 | and date_format( kll.kll_timestamp, \"%Y\" ) = ".$curyear." |
---|
332 | group by crp.crp_name |
---|
333 | order by kills desc |
---|
334 | limit 25"; |
---|
335 | |
---|
336 | $qry = new DBQuery( $dbconn, $sql ); |
---|
337 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
338 | |
---|
339 | $html .= "<table width=\"99%\"><tr><td align=center valign=top>"; |
---|
340 | |
---|
341 | $html .= "<div class=block-header>This month</div>"; |
---|
342 | $html .= "<table class=kb-table>"; |
---|
343 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Corporation</td><td align=center width=40>Kills</td></tr>"; |
---|
344 | |
---|
345 | $odd = false; |
---|
346 | $counter = 1; |
---|
347 | while ( $row = $qry->getRow() ) { |
---|
348 | if ( !$odd ) { |
---|
349 | $odd = true; |
---|
350 | $rowclass = 'kb-table-row-odd'; |
---|
351 | } |
---|
352 | else { |
---|
353 | $odd = false; |
---|
354 | $rowclass = 'kb-table-row-even'; |
---|
355 | } |
---|
356 | |
---|
357 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell width=180><a href=\"?a=corp_detail&crp_id=".$row['crp_id']."\">".$row['crp_name']."</a></td><td align=center>".$row['kills']."</td></tr>"; |
---|
358 | $counter++; |
---|
359 | } |
---|
360 | |
---|
361 | $html .= "</table>"; |
---|
362 | |
---|
363 | $html .= "</td><td align=center valign=top>"; |
---|
364 | |
---|
365 | $sql = "select crp.crp_id, crp.crp_name, count(distinct(inv.inv_kll_id)) as kills |
---|
366 | from kb3_corps crp, _".KB_SITE."_involved inv, _".KB_SITE."_kills kll |
---|
367 | where inv.inv_crp_id = crp.crp_id |
---|
368 | and kll.kll_id = inv.inv_kll_id"; |
---|
369 | |
---|
370 | if ( CORP_ID != "" ) |
---|
371 | $sql .= " and inv.inv_crp_id in ( ".CORP_ID." )"; |
---|
372 | |
---|
373 | |
---|
374 | if ( ALLIANCE_ID ) |
---|
375 | $sql .= " and inv.inv_all_id = ".ALLIANCE_ID; |
---|
376 | |
---|
377 | $sql .= " |
---|
378 | group by crp.crp_name |
---|
379 | order by kills desc |
---|
380 | limit 25"; |
---|
381 | |
---|
382 | $qry = new DBQuery( $dbconn, $sql ); |
---|
383 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
384 | |
---|
385 | $html .= "<div class=block-header>All-Time</div>"; |
---|
386 | $html .= "<table class=kb-table>"; |
---|
387 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Corporation</td><td align=center width=40>Kills</td></tr>"; |
---|
388 | |
---|
389 | $odd = false; |
---|
390 | $counter = 1; |
---|
391 | while ( $row = $qry->getRow() ) { |
---|
392 | if ( !$odd ) { |
---|
393 | $odd = true; |
---|
394 | $rowclass = 'kb-table-row-odd'; |
---|
395 | } |
---|
396 | else { |
---|
397 | $odd = false; |
---|
398 | $rowclass = 'kb-table-row-even'; |
---|
399 | } |
---|
400 | |
---|
401 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell><a href=\"?a=corp_detail&crp_id=".$row['crp_id']."\">".$row['crp_name']."</a></td><td align=center>".$row['kills']."</td></tr>"; |
---|
402 | $counter++; |
---|
403 | } |
---|
404 | |
---|
405 | $html .= "</table>"; |
---|
406 | |
---|
407 | $html .= "</td></tr></table>"; |
---|
408 | |
---|
409 | break; |
---|
410 | case 5: |
---|
411 | $html .= "<div class=block-header2>Most deadly corporations</div>"; |
---|
412 | $sql = "select crp.crp_id, crp.crp_name, count(distinct(inv.inv_kll_id)) as kills |
---|
413 | from kb3_corps crp, _".KB_SITE."_involved inv, _".KB_SITE."_kills kll |
---|
414 | where inv.inv_crp_id = crp.crp_id |
---|
415 | and kll.kll_id = inv.inv_kll_id"; |
---|
416 | |
---|
417 | if ( CORP_ID != "" ) |
---|
418 | $sql .= " and inv.inv_crp_id in ( ".CORP_ID." )"; |
---|
419 | |
---|
420 | |
---|
421 | if ( ALLIANCE_ID ) |
---|
422 | $sql .= " and inv.inv_all_id = ".ALLIANCE_ID; |
---|
423 | |
---|
424 | $sql .= " |
---|
425 | and inv.inv_final_blow = 1 |
---|
426 | and date_format( kll.kll_timestamp, \"%c\" ) = ".$curmonth." |
---|
427 | and date_format( kll.kll_timestamp, \"%Y\" ) = ".$curyear." |
---|
428 | group by crp.crp_name |
---|
429 | order by kills desc |
---|
430 | limit 25"; |
---|
431 | |
---|
432 | $qry = new DBQuery( $dbconn, $sql ); |
---|
433 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
434 | |
---|
435 | $html .= "<table width=\"99%\"><tr><td align=center valign=top>"; |
---|
436 | |
---|
437 | $html .= "<div class=block-header>This month</div>"; |
---|
438 | $html .= "<table class=kb-table>"; |
---|
439 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Corporation</td><td align=center>Final blows</td></tr>"; |
---|
440 | |
---|
441 | $odd = false; |
---|
442 | $counter = 1; |
---|
443 | while ( $row = $qry->getRow() ) { |
---|
444 | if ( !$odd ) { |
---|
445 | $odd = true; |
---|
446 | $rowclass = 'kb-table-row-odd'; |
---|
447 | } |
---|
448 | else { |
---|
449 | $odd = false; |
---|
450 | $rowclass = 'kb-table-row-even'; |
---|
451 | } |
---|
452 | |
---|
453 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell width=180><a href=\"?a=corp_detail&crp_id=".$row['crp_id']."\">".$row['crp_name']."</a></td><td align=center>".$row['kills']."</td></tr>"; |
---|
454 | $counter++; |
---|
455 | } |
---|
456 | |
---|
457 | $html .= "</table>"; |
---|
458 | |
---|
459 | $html .= "</td><td align=center valign=top>"; |
---|
460 | |
---|
461 | $sql = "select crp.crp_id, crp.crp_name, count(distinct(inv.inv_kll_id)) as kills |
---|
462 | from kb3_corps crp, _".KB_SITE."_involved inv, _".KB_SITE."_kills kll |
---|
463 | where inv.inv_crp_id = crp.crp_id |
---|
464 | and kll.kll_id = inv.inv_kll_id"; |
---|
465 | |
---|
466 | if ( CORP_ID != "" ) |
---|
467 | $sql .= " and inv.inv_crp_id in ( ".CORP_ID." )"; |
---|
468 | |
---|
469 | |
---|
470 | if ( ALLIANCE_ID ) |
---|
471 | $sql .= " and inv.inv_all_id = ".ALLIANCE_ID; |
---|
472 | |
---|
473 | $sql .= " |
---|
474 | and inv.inv_final_blow = 1 |
---|
475 | group by crp.crp_name |
---|
476 | order by kills desc |
---|
477 | limit 25"; |
---|
478 | |
---|
479 | $qry = new DBQuery( $dbconn, $sql ); |
---|
480 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
481 | |
---|
482 | $html .= "<div class=block-header>All-Time</div>"; |
---|
483 | $html .= "<table class=kb-table>"; |
---|
484 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Corporation</td><td align=center>Final blows</td></tr>"; |
---|
485 | |
---|
486 | $odd = false; |
---|
487 | $counter = 1; |
---|
488 | while ( $row = $qry->getRow() ) { |
---|
489 | if ( !$odd ) { |
---|
490 | $odd = true; |
---|
491 | $rowclass = 'kb-table-row-odd'; |
---|
492 | } |
---|
493 | else { |
---|
494 | $odd = false; |
---|
495 | $rowclass = 'kb-table-row-even'; |
---|
496 | } |
---|
497 | |
---|
498 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell><a href=\"?a=corp_detail&crp_id=".$row['crp_id']."\">".$row['crp_name']."</a></td><td align=center>".$row['kills']."</td></tr>"; |
---|
499 | $counter++; |
---|
500 | } |
---|
501 | |
---|
502 | $html .= "</table>"; |
---|
503 | |
---|
504 | $html .= "</td></tr></table>"; |
---|
505 | |
---|
506 | break; |
---|
507 | case 6: // most losing corps |
---|
508 | $html .= "<div class=block-header2>Most losing corporations</div>"; |
---|
509 | $sql = "select crp.crp_id, crp.crp_name, count(kll.kll_id) as kills |
---|
510 | from kb3_corps crp, _".KB_SITE."_kills kll |
---|
511 | where kll.kll_crp_id = crp.crp_id"; |
---|
512 | |
---|
513 | if ( CORP_ID != "" ) |
---|
514 | $sql .= " and kll.kll_crp_id in ( ".CORP_ID." )"; |
---|
515 | |
---|
516 | if ( ALLIANCE_ID ) |
---|
517 | $sql .= " and kll.kll_all_id = ".ALLIANCE_ID; |
---|
518 | |
---|
519 | $sql .= " |
---|
520 | and date_format( kll.kll_timestamp, \"%c\" ) = ".$curmonth." |
---|
521 | and date_format( kll.kll_timestamp, \"%Y\" ) = ".$curyear." |
---|
522 | group by crp.crp_name |
---|
523 | order by kills desc |
---|
524 | limit 25"; |
---|
525 | |
---|
526 | $qry = new DBQuery( $dbconn, $sql ); |
---|
527 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
528 | |
---|
529 | $html .= "<table width=\"99%\"><tr><td align=center valign=top>"; |
---|
530 | |
---|
531 | $html .= "<div class=block-header>This month</div>"; |
---|
532 | $html .= "<table class=kb-table>"; |
---|
533 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Corporation</td><td width=40 align=center>Losses</td></tr>"; |
---|
534 | |
---|
535 | $odd = false; |
---|
536 | $counter = 1; |
---|
537 | while ( $row = $qry->getRow() ) { |
---|
538 | if ( !$odd ) { |
---|
539 | $odd = true; |
---|
540 | $rowclass = 'kb-table-row-odd'; |
---|
541 | } |
---|
542 | else { |
---|
543 | $odd = false; |
---|
544 | $rowclass = 'kb-table-row-even'; |
---|
545 | } |
---|
546 | |
---|
547 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell width=180><a href=\"?a=corp_detail&crp_id=".$row['crp_id']."\">".$row['crp_name']."</a></td><td align=center>".$row['kills']."</td></tr>"; |
---|
548 | $counter++; |
---|
549 | } |
---|
550 | |
---|
551 | $html .= "</table>"; |
---|
552 | |
---|
553 | $html .= "</td><td align=center valign=top>"; |
---|
554 | |
---|
555 | $sql = "select crp.crp_id, crp.crp_name, count(kll.kll_id) as kills |
---|
556 | from kb3_corps crp, _".KB_SITE."_kills kll |
---|
557 | where kll.kll_crp_id = crp.crp_id"; |
---|
558 | |
---|
559 | if ( CORP_ID != "" ) |
---|
560 | $sql .= " and kll.kll_crp_id in ( ".CORP_ID." )"; |
---|
561 | |
---|
562 | if ( ALLIANCE_ID ) |
---|
563 | $sql .= " and kll.kll_all_id = ".ALLIANCE_ID; |
---|
564 | |
---|
565 | $sql .= " |
---|
566 | group by crp.crp_name |
---|
567 | order by kills desc |
---|
568 | limit 25"; |
---|
569 | |
---|
570 | $qry = new DBQuery( $dbconn, $sql ); |
---|
571 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
572 | |
---|
573 | $html .= "<div class=block-header>All-Time</div>"; |
---|
574 | $html .= "<table class=kb-table>"; |
---|
575 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Corporation</td><td width=40 align=center>Losses</td></tr>"; |
---|
576 | |
---|
577 | $odd = false; |
---|
578 | $counter = 1; |
---|
579 | while ( $row = $qry->getRow() ) { |
---|
580 | if ( !$odd ) { |
---|
581 | $odd = true; |
---|
582 | $rowclass = 'kb-table-row-odd'; |
---|
583 | } |
---|
584 | else { |
---|
585 | $odd = false; |
---|
586 | $rowclass = 'kb-table-row-even'; |
---|
587 | } |
---|
588 | |
---|
589 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell><a href=\"?a=corp_detail&crp_id=".$row['crp_id']."\">".$row['crp_name']."</a></td><td align=center>".$row['kills']."</td></tr>"; |
---|
590 | $counter++; |
---|
591 | } |
---|
592 | |
---|
593 | $html .= "</table>"; |
---|
594 | |
---|
595 | $html .= "</td></tr></table>"; |
---|
596 | |
---|
597 | break; |
---|
598 | case 8: // most involved ship |
---|
599 | $html .= "<div class=block-header2>Most involved ship</div>"; |
---|
600 | $sql = "select shp.shp_name, count(inv.inv_kll_id) as kills |
---|
601 | from kb3_ships shp, _".KB_SITE."_involved inv, _".KB_SITE."_kills kll |
---|
602 | where inv.inv_shp_id = shp.shp_id |
---|
603 | and kll.kll_id = inv.inv_kll_id"; |
---|
604 | |
---|
605 | if ( CORP_ID != "" ) |
---|
606 | $sql .= " and inv.inv_crp_id in ( ".CORP_ID." )"; |
---|
607 | |
---|
608 | if ( ALLIANCE_ID ) |
---|
609 | $sql .= " and inv.inv_all_id = ".ALLIANCE_ID; |
---|
610 | |
---|
611 | $sql .= " |
---|
612 | and date_format( kll.kll_timestamp, \"%c\" ) = ".$curmonth." |
---|
613 | and date_format( kll.kll_timestamp, \"%Y\" ) = ".$curyear." |
---|
614 | group by shp.shp_name |
---|
615 | order by kills desc |
---|
616 | limit 25"; |
---|
617 | |
---|
618 | $qry = new DBQuery( $dbconn, $sql ); |
---|
619 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
620 | |
---|
621 | $html .= "<table width=\"99%\"><tr><td align=center valign=top>"; |
---|
622 | |
---|
623 | $html .= "<div class=block-header>This month</div>"; |
---|
624 | $html .= "<table class=kb-table>"; |
---|
625 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Ship</td><td align=center width=40>Kills</td></tr>"; |
---|
626 | |
---|
627 | $odd = false; |
---|
628 | $counter = 1; |
---|
629 | while ( $row = $qry->getRow() ) { |
---|
630 | if ( !$odd ) { |
---|
631 | $odd = true; |
---|
632 | $rowclass = 'kb-table-row-odd'; |
---|
633 | } |
---|
634 | else { |
---|
635 | $odd = false; |
---|
636 | $rowclass = 'kb-table-row-even'; |
---|
637 | } |
---|
638 | |
---|
639 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell width=180><b>".$row['shp_name']."</b></td><td align=center>".$row['kills']."</td></tr>"; |
---|
640 | $counter++; |
---|
641 | } |
---|
642 | |
---|
643 | $html .= "</table>"; |
---|
644 | |
---|
645 | $html .= "</td><td align=center valign=top>"; |
---|
646 | |
---|
647 | $sql = "select shp.shp_name, count(inv.inv_kll_id) as kills |
---|
648 | from kb3_ships shp, _".KB_SITE."_involved inv, _".KB_SITE."_kills kll |
---|
649 | where inv.inv_shp_id = shp.shp_id |
---|
650 | and kll.kll_id = inv.inv_kll_id"; |
---|
651 | |
---|
652 | if ( CORP_ID != "" ) |
---|
653 | $sql .= " and inv.inv_crp_id in ( ".CORP_ID." )"; |
---|
654 | |
---|
655 | |
---|
656 | if ( ALLIANCE_ID ) |
---|
657 | $sql .= " and inv.inv_all_id = ".ALLIANCE_ID; |
---|
658 | |
---|
659 | $sql .= " |
---|
660 | group by shp.shp_name |
---|
661 | order by kills desc |
---|
662 | limit 25"; |
---|
663 | |
---|
664 | $qry = new DBQuery( $dbconn, $sql ); |
---|
665 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
666 | |
---|
667 | $html .= "<div class=block-header>All-Time</div>"; |
---|
668 | $html .= "<table class=kb-table>"; |
---|
669 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Ship</td><td align=center width=40>Kills</td></tr>"; |
---|
670 | |
---|
671 | $odd = false; |
---|
672 | $counter = 1; |
---|
673 | while ( $row = $qry->getRow() ) { |
---|
674 | if ( !$odd ) { |
---|
675 | $odd = true; |
---|
676 | $rowclass = 'kb-table-row-odd'; |
---|
677 | } |
---|
678 | else { |
---|
679 | $odd = false; |
---|
680 | $rowclass = 'kb-table-row-even'; |
---|
681 | } |
---|
682 | |
---|
683 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell><b>".$row['shp_name']."</b></td><td align=center>".$row['kills']."</td></tr>"; |
---|
684 | $counter++; |
---|
685 | } |
---|
686 | |
---|
687 | $html .= "</table>"; |
---|
688 | |
---|
689 | $html .= "</td></tr></table>"; |
---|
690 | |
---|
691 | break; |
---|
692 | case 9: // most deadly ship |
---|
693 | $html .= "<div class=block-header2>Most deadly ship</div>"; |
---|
694 | $sql = "select shp.shp_name, count(inv.inv_kll_id) as kills |
---|
695 | from kb3_ships shp, _".KB_SITE."_involved inv, _".KB_SITE."_kills kll |
---|
696 | where inv.inv_shp_id = shp.shp_id |
---|
697 | and kll.kll_id = inv.inv_kll_id"; |
---|
698 | |
---|
699 | if ( CORP_ID != "" ) |
---|
700 | $sql .= " and inv.inv_crp_id in ( ".CORP_ID." )"; |
---|
701 | |
---|
702 | |
---|
703 | if ( ALLIANCE_ID ) |
---|
704 | $sql .= " and inv.inv_all_id = ".ALLIANCE_ID; |
---|
705 | |
---|
706 | $sql .= " |
---|
707 | and inv.inv_final_blow = 1 |
---|
708 | and date_format( kll.kll_timestamp, \"%c\" ) = ".$curmonth." |
---|
709 | and date_format( kll.kll_timestamp, \"%Y\" ) = ".$curyear." |
---|
710 | group by shp.shp_name |
---|
711 | order by kills desc |
---|
712 | limit 25"; |
---|
713 | |
---|
714 | $qry = new DBQuery( $dbconn, $sql ); |
---|
715 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
716 | |
---|
717 | $html .= "<table width=\"99%\"><tr><td align=center valign=top>"; |
---|
718 | |
---|
719 | $html .= "<div class=block-header>This month</div>"; |
---|
720 | $html .= "<table class=kb-table>"; |
---|
721 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Ship</td><td align=center >Final blows</td></tr>"; |
---|
722 | |
---|
723 | $odd = false; |
---|
724 | $counter = 1; |
---|
725 | while ( $row = $qry->getRow() ) { |
---|
726 | if ( !$odd ) { |
---|
727 | $odd = true; |
---|
728 | $rowclass = 'kb-table-row-odd'; |
---|
729 | } |
---|
730 | else { |
---|
731 | $odd = false; |
---|
732 | $rowclass = 'kb-table-row-even'; |
---|
733 | } |
---|
734 | |
---|
735 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell width=180><b>".$row['shp_name']."</b></td><td align=center>".$row['kills']."</td></tr>"; |
---|
736 | $counter++; |
---|
737 | } |
---|
738 | |
---|
739 | $html .= "</table>"; |
---|
740 | |
---|
741 | $html .= "</td><td align=center valign=top>"; |
---|
742 | |
---|
743 | $sql = "select shp.shp_name, count(inv.inv_kll_id) as kills |
---|
744 | from kb3_ships shp, _".KB_SITE."_involved inv, _".KB_SITE."_kills kll |
---|
745 | where inv.inv_shp_id = shp.shp_id |
---|
746 | and kll.kll_id = inv.inv_kll_id"; |
---|
747 | |
---|
748 | if ( CORP_ID != "" ) |
---|
749 | $sql .= " and inv.inv_crp_id in ( ".CORP_ID." )"; |
---|
750 | |
---|
751 | |
---|
752 | if ( ALLIANCE_ID ) |
---|
753 | $sql .= " and inv.inv_all_id = ".ALLIANCE_ID; |
---|
754 | |
---|
755 | $sql .= " |
---|
756 | and inv.inv_final_blow = 1 |
---|
757 | group by shp.shp_name |
---|
758 | order by kills desc |
---|
759 | limit 25"; |
---|
760 | |
---|
761 | $qry = new DBQuery( $dbconn, $sql ); |
---|
762 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
763 | |
---|
764 | $html .= "<div class=block-header>All-Time</div>"; |
---|
765 | $html .= "<table class=kb-table>"; |
---|
766 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Ship</td><td align=center>Final blows</td></tr>"; |
---|
767 | |
---|
768 | $odd = false; |
---|
769 | $counter = 1; |
---|
770 | while ( $row = $qry->getRow() ) { |
---|
771 | if ( !$odd ) { |
---|
772 | $odd = true; |
---|
773 | $rowclass = 'kb-table-row-odd'; |
---|
774 | } |
---|
775 | else { |
---|
776 | $odd = false; |
---|
777 | $rowclass = 'kb-table-row-even'; |
---|
778 | } |
---|
779 | |
---|
780 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell><b>".$row['shp_name']."</b></td><td align=center>".$row['kills']."</td></tr>"; |
---|
781 | $counter++; |
---|
782 | } |
---|
783 | |
---|
784 | $html .= "</table>"; |
---|
785 | |
---|
786 | $html .= "</td></tr></table>"; |
---|
787 | |
---|
788 | break; |
---|
789 | case 10: // most lost ship |
---|
790 | $html .= "<div class=block-header2>Most lost ship</div>"; |
---|
791 | $sql = "select shp.shp_name, count(kll.kll_id) as kills |
---|
792 | from kb3_ships shp, _".KB_SITE."_kills kll |
---|
793 | where kll.kll_ship_id = shp.shp_id"; |
---|
794 | |
---|
795 | if ( CORP_ID != "" ) |
---|
796 | $sql .= " and kll.kll_crp_id in ( ".CORP_ID." )"; |
---|
797 | |
---|
798 | if ( ALLIANCE_ID ) |
---|
799 | $sql .= " and kll.kll_all_id = ".ALLIANCE_ID; |
---|
800 | |
---|
801 | $sql .= " |
---|
802 | and date_format( kll.kll_timestamp, \"%c\" ) = ".$curmonth." |
---|
803 | and date_format( kll.kll_timestamp, \"%Y\" ) = ".$curyear." |
---|
804 | and shp.shp_id != 6 |
---|
805 | group by shp.shp_name |
---|
806 | order by kills desc |
---|
807 | limit 25"; |
---|
808 | |
---|
809 | $qry = new DBQuery( $dbconn, $sql ); |
---|
810 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
811 | |
---|
812 | $html .= "<table width=\"99%\"><tr><td align=center valign=top>"; |
---|
813 | |
---|
814 | $html .= "<div class=block-header>This month</div>"; |
---|
815 | $html .= "<table class=kb-table>"; |
---|
816 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Ship</td><td width=40 align=center >Losses</td></tr>"; |
---|
817 | |
---|
818 | $odd = false; |
---|
819 | $counter = 1; |
---|
820 | while ( $row = $qry->getRow() ) { |
---|
821 | if ( !$odd ) { |
---|
822 | $odd = true; |
---|
823 | $rowclass = 'kb-table-row-odd'; |
---|
824 | } |
---|
825 | else { |
---|
826 | $odd = false; |
---|
827 | $rowclass = 'kb-table-row-even'; |
---|
828 | } |
---|
829 | |
---|
830 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell width=180><b>".$row['shp_name']."</b></td><td align=center>".$row['kills']."</td></tr>"; |
---|
831 | $counter++; |
---|
832 | } |
---|
833 | |
---|
834 | $html .= "</table>"; |
---|
835 | |
---|
836 | $html .= "</td><td align=center valign=top>"; |
---|
837 | |
---|
838 | $sql = "select shp.shp_name, count(kll.kll_id) as kills |
---|
839 | from kb3_ships shp, _".KB_SITE."_kills kll |
---|
840 | where kll.kll_ship_id = shp.shp_id"; |
---|
841 | |
---|
842 | if ( CORP_ID != "" ) |
---|
843 | $sql .= " and kll.kll_crp_id in ( ".CORP_ID." )"; |
---|
844 | |
---|
845 | if ( ALLIANCE_ID ) |
---|
846 | $sql .= " and kll.kll_all_id = ".ALLIANCE_ID; |
---|
847 | |
---|
848 | $sql .= " |
---|
849 | and shp.shp_id != 6 |
---|
850 | group by shp.shp_name |
---|
851 | order by kills desc |
---|
852 | limit 25"; |
---|
853 | |
---|
854 | $qry = new DBQuery( $dbconn, $sql ); |
---|
855 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
856 | |
---|
857 | $html .= "<div class=block-header>All-Time</div>"; |
---|
858 | $html .= "<table class=kb-table>"; |
---|
859 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>Ship</td><td width=40 align=center>Losses</td></tr>"; |
---|
860 | |
---|
861 | $odd = false; |
---|
862 | $counter = 1; |
---|
863 | while ( $row = $qry->getRow() ) { |
---|
864 | if ( !$odd ) { |
---|
865 | $odd = true; |
---|
866 | $rowclass = 'kb-table-row-odd'; |
---|
867 | } |
---|
868 | else { |
---|
869 | $odd = false; |
---|
870 | $rowclass = 'kb-table-row-even'; |
---|
871 | } |
---|
872 | |
---|
873 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell><b>".$row['shp_name']."</b></td><td align=center>".$row['kills']."</td></tr>"; |
---|
874 | $counter++; |
---|
875 | } |
---|
876 | |
---|
877 | $html .= "</table>"; |
---|
878 | |
---|
879 | $html .= "</td></tr></table>"; |
---|
880 | |
---|
881 | break; |
---|
882 | case 12: // most violent system |
---|
883 | $html .= "<div class=block-header2>Most violent systems</div>"; |
---|
884 | $sql = "select sys.sys_name, sys.sys_sec, count(distinct kll.kll_id) as kills |
---|
885 | from kb3_systems sys, _".KB_SITE."_kills kll, _".KB_SITE."_involved inv |
---|
886 | where kll.kll_system_id = sys.sys_id |
---|
887 | and inv.inv_kll_id = kll.kll_id"; |
---|
888 | |
---|
889 | if ( CORP_ID != "" ) |
---|
890 | $sql .= " and inv.inv_crp_id in ( ".CORP_ID." )"; |
---|
891 | |
---|
892 | |
---|
893 | if ( ALLIANCE_ID ) |
---|
894 | $sql .= " and inv.inv_all_id = ".ALLIANCE_ID; |
---|
895 | |
---|
896 | $sql .= " |
---|
897 | and date_format( kll.kll_timestamp, \"%c\" ) = ".$curmonth." |
---|
898 | and date_format( kll.kll_timestamp, \"%Y\" ) = ".$curyear." |
---|
899 | group by sys.sys_name |
---|
900 | order by kills desc |
---|
901 | limit 25"; |
---|
902 | |
---|
903 | $qry = new DBQuery( $dbconn, $sql ); |
---|
904 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
905 | |
---|
906 | $html .= "<table width=\"99%\"><tr><td align=center valign=top>"; |
---|
907 | |
---|
908 | $html .= "<div class=block-header>This month</div>"; |
---|
909 | $html .= "<table class=kb-table>"; |
---|
910 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>System</td><td width=40 align=center >Kills</td></tr>"; |
---|
911 | |
---|
912 | $odd = false; |
---|
913 | $counter = 1; |
---|
914 | while ( $row = $qry->getRow() ) { |
---|
915 | if ( !$odd ) { |
---|
916 | $odd = true; |
---|
917 | $rowclass = 'kb-table-row-odd'; |
---|
918 | } |
---|
919 | else { |
---|
920 | $odd = false; |
---|
921 | $rowclass = 'kb-table-row-even'; |
---|
922 | } |
---|
923 | |
---|
924 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell width=180><b>".$row['sys_name']."</b> (".roundsec( $row['sys_sec'] ).")</td><td align=center>".$row['kills']."</td></tr>"; |
---|
925 | $counter++; |
---|
926 | } |
---|
927 | |
---|
928 | $html .= "</table>"; |
---|
929 | |
---|
930 | $html .= "</td><td align=center valign=top>"; |
---|
931 | |
---|
932 | $sql = "select sys.sys_name, sys.sys_sec, count(distinct kll.kll_id) as kills |
---|
933 | from kb3_systems sys, _".KB_SITE."_kills kll, _".KB_SITE."_involved inv |
---|
934 | where kll.kll_system_id = sys.sys_id |
---|
935 | and inv.inv_kll_id = kll.kll_id"; |
---|
936 | |
---|
937 | if ( CORP_ID != "" ) |
---|
938 | $sql .= " and inv.inv_crp_id in ( ".CORP_ID." )"; |
---|
939 | |
---|
940 | |
---|
941 | if ( ALLIANCE_ID ) |
---|
942 | $sql .= " and inv.inv_all_id = ".ALLIANCE_ID; |
---|
943 | |
---|
944 | $sql .= " |
---|
945 | group by sys.sys_name |
---|
946 | order by kills desc |
---|
947 | limit 25"; |
---|
948 | |
---|
949 | $qry = new DBQuery( $dbconn, $sql ); |
---|
950 | if ( !$qry->execute() ) die( $qry->getErrorMsg() ); |
---|
951 | |
---|
952 | $html .= "<div class=block-header>All-Time</div>"; |
---|
953 | $html .= "<table class=kb-table>"; |
---|
954 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>System</td><td width=40 align=center>Kills</td></tr>"; |
---|
955 | |
---|
956 | $odd = false; |
---|
957 | $counter = 1; |
---|
958 | while ( $row = $qry->getRow() ) { |
---|
959 | if ( !$odd ) { |
---|
960 | $odd = true; |
---|
961 | $rowclass = 'kb-table-row-odd'; |
---|
962 | } |
---|
963 | else { |
---|
964 | $odd = false; |
---|
965 | $rowclass = 'kb-table-row-even'; |
---|
966 | } |
---|
967 | |
---|
968 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell><b>".$row['sys_name']."</b> (".roundsec( $row['sys_sec'] ).")</td><td align=center>".$row['kills']."</td></tr>"; |
---|
969 | $counter++; |
---|
970 | } |
---|
971 | |
---|
972 | $html .= "</table>"; |
---|
973 | |
---|
974 | $html .= "</td></tr></table>"; |
---|
975 | |
---|
976 | break; |
---|
977 | } |
---|
978 | |
---|
979 | |
---|
980 | if ( $_POST['view'] ) |
---|
981 | $page->setOnLoad( "document.getElementById( 'view' ).options[".$_POST['view']."].selected=true;" ); |
---|
982 | |
---|
983 | $page->generate( $html ); |
---|
984 | |
---|
985 | ?> |
---|