source: quests/statistic.php@ 293

Last change on this file since 293 was 293, checked in by maron, 17 years ago

úprava statistiky

File size: 4.0 KB
Line 
1<?php
2
3 include('includes/global.php');
4
5?>
6
7<b>Statistika:</b><br>
8 <img alt="quests" src="img_statistic.php?TypeText=quests" title="statistika pøekladu úkolù" style="margin: 5px 0px 0px 0px;"><br />
9 <img alt="npc_text" src="img_statistic.php?TypeText=npc_text" title="statistika pøekladu NPC_textù" style="margin: 5px 0px 0px 0px;"><br />
10 <img alt="page_text" src="img_statistic.php?TypeText=page_text" title="statistika pøekladu page_textù" style="margin: 5px 0px 0px 0px;"><br />
11
12<br>
13<b>Statistika v závislosti na èase: </b><a href="http://game-server.zdechov.net/statistic/?Measure=18">Pøelo¾ených textù</a><br>
14<br />
15Poèet stáhnutí pøelo¾ených textù: <b>
16<?php
17
18 $ID = $Database->SQLCommand("SELECT count(distinct(IP)) FROM log WHERE type = 2");
19 $Line = mysql_fetch_row($ID);
20 echo $Line[0];
21?>
22</b><br /><br />
23<b>Seznam u¾ivatelù: </b>
24<table border="1" cellpadding="2" cellspacing="0">
25<?php
26
27 if(array_key_exists('order', $_GET)) {
28 $order = $_GET['order'];
29 $desc = $_GET['desc'];
30 } else {
31 $order = 'NumberTranslate';
32 $desc = '';
33 }
34
35 if ($desc == '') $desc = 'desc'; else $desc = '';
36
37 echo '<tr><th><a href="statistic.php?order=user&amp;desc='.$desc.'">Jméno</a></th>
38 <th><a href="statistic.php?order=NumberTranslate&amp;desc='.$desc.'" Title="Poèet pøelo¾ených questù">Pøelo¾ených</a></th>
39 <th><a href="statistic.php?order=Vote&amp;desc='.$desc.'" Title="Prùmìrná známka questù">Prùmìrná známka</a></th>
40 <th><a href="statistic.php?order=GM&amp;desc='.$desc.'">Oprávnìní</a></th>
41 <th><a href="statistic.php?order=LastLogin&amp;desc='.$desc.'">Poslední pøipojení</a></th></tr>';
42
43/*
44SELECT user, LastLogin, GM, (
45 (SELECT count(*) FROM `quests` WHERE User = user.ID AND User <> 0 AND Complete = 1) +
46 (SELECT count(*) FROM `npc_text` WHERE User = user.ID AND User <> 0 AND Complete = 1) +
47 (SELECT count(*) FROM `page_text` WHERE User = user.ID AND User <> 0 AND Complete = 1)
48 ) as NumberTranslate, (
49 SELECT IFNULL((SELECT AVG(Vote) AS Vote FROM `quests` WHERE User = user.ID AND Complete =1),0)
50 + IFNULL((SELECT AVG(Vote) AS Vote FROM `page_text` WHERE User = user.ID AND Complete =1),0)
51 + IFNULL((SELECT AVG(Vote) AS Vote FROM `npc_text` WHERE User = user.ID AND Complete =1),0)
52 ) /3 AS Vote
53 FROM `user`
54
55 */
56
57 $ID = $Database->SQLCommand("
58 SELECT ID,user, LastLogin, GM, (
59 (SELECT count(*) FROM `quests` WHERE User = user.ID AND Complete = 1 AND Language <> 0) +
60 (SELECT count(*) FROM `npc_text` WHERE User = user.ID AND Complete = 1 AND Language <> 0) +
61 (SELECT count(*) FROM `page_text` WHERE User = user.ID AND Complete = 1 AND Language <> 0)
62 ) as NumberTranslate, (
63 IFNULL((SELECT sum(Vote) AS Vote FROM `quests` WHERE User = user.ID AND Complete =1 AND Language <> 0),0)
64 + IFNULL((SELECT sum(Vote) AS Vote FROM `page_text` WHERE User = user.ID AND Complete =1 AND Language <> 0),0)
65 + IFNULL((SELECT sum(Vote) AS Vote FROM `npc_text` WHERE User = user.ID AND Complete =1 AND Language <> 0),0)
66 ) / (
67 (SELECT count(Vote) AS Vote FROM `quests` WHERE User = user.ID AND Complete =1 AND Language <> 0)
68 + (SELECT count(Vote) AS Vote FROM `page_text` WHERE User = user.ID AND Complete =1 AND Language <> 0)
69 + (SELECT count(Vote) AS Vote FROM `npc_text` WHERE User = user.ID AND Complete =1 AND Language <> 0)
70 ) AS Vote
71 FROM `user` ORDER BY $order $desc");
72
73 while ($Line = mysql_fetch_array($ID)) {
74
75 if (Licence(1))
76 $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['user'].'</a>';
77 else
78 $Name = $Line['user'];
79
80 echo '<tr><td>'.$Name.'</td>
81 <td>'.$Line['NumberTranslate'].'</td>
82 <td>'.substr($Line['Vote'], 0, 4).'</td>
83 <td>'.$Moderators[$Line['GM']].'</td>
84 <td>'.$Line['LastLogin'].'</td></tr>';
85
86 }
87
88 echo '</table>';
89
90 ShowFooter();
91?>
Note: See TracBrowser for help on using the repository browser.