1 | <?php
|
---|
2 |
|
---|
3 | include('includes/global.php');
|
---|
4 |
|
---|
5 | if(array_key_exists('Version', $_GET)) $_SESSION['StatVersion'] = $_GET['Version'];
|
---|
6 | if(!array_key_exists('StatVersion', $_SESSION)) $_SESSION['StatVersion'] = $Config['Web']['GameVersion'];
|
---|
7 |
|
---|
8 | function ShowStatTable()
|
---|
9 | {
|
---|
10 | global $Database, $Config;
|
---|
11 |
|
---|
12 | $LanguageId = LoadLanguageIdParameter();
|
---|
13 | $BuildNumber = GetBuildNumber($_SESSION['StatVersion']);
|
---|
14 |
|
---|
15 | $GroupListQuery = 'SELECT `Group`.* FROM `Group`';
|
---|
16 | $Query = '';
|
---|
17 | $DbResult = $Database->SQLCommand($GroupListQuery);
|
---|
18 | while($DbRow = mysql_fetch_assoc($DbResult))
|
---|
19 | {
|
---|
20 | $Query .= 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
|
---|
21 | ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'.
|
---|
22 | ' WHERE (`Complete` = 1) AND (`Language`='.$LanguageId.') AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.
|
---|
23 | ') AS `C1`) AS `Translated`, '.
|
---|
24 | '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
|
---|
25 | ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'.
|
---|
26 | ' WHERE (`Language` = 0) AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.
|
---|
27 | ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name` UNION ';
|
---|
28 | }
|
---|
29 | $Query = substr($Query, 0, - 6);
|
---|
30 |
|
---|
31 | $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$GroupListQuery.') AS `T`');
|
---|
32 | $DbRow = mysql_fetch_row($DbResult);
|
---|
33 | $PageList = GetPageList($DbRow[0]);
|
---|
34 | echo($PageList['Output']);
|
---|
35 |
|
---|
36 | echo('<table class="BaseTable">');
|
---|
37 | $TableColumns = array(
|
---|
38 | array('Name' => 'Name', 'Title' => 'Jméno'),
|
---|
39 | array('Name' => 'Translated', 'Title' => 'Přeložených'),
|
---|
40 | array('Name' => 'Total', 'Title' => 'Anglických'),
|
---|
41 | array('Name' => 'Percent', 'Title' => 'Procenta'),
|
---|
42 | );
|
---|
43 |
|
---|
44 | $Order = GetOrderTableHeader($TableColumns, 'Name', 0);
|
---|
45 | echo($Order['Output']);
|
---|
46 |
|
---|
47 | $Translated = 0;
|
---|
48 | $Total = 0;
|
---|
49 | $ID = $Database->SQLCommand('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.$Query.') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']);
|
---|
50 | while($Group = mysql_fetch_assoc($ID))
|
---|
51 | {
|
---|
52 | echo('<tr><td>'.$Group['Name'].'</td><td>'.$Group['Translated'].'</td><td>'.$Group['Total'].'</td><td>'.ProgressBar(150, $Group['Percent']).'</td></tr>');
|
---|
53 | $Translated += $Group['Translated'];
|
---|
54 | $Total += $Group['Total'];
|
---|
55 | }
|
---|
56 | if($Total <> 0) $TotalCount = round($Translated / $Total * 100, 2);
|
---|
57 | else $Total = 0;
|
---|
58 | echo('<tr><td><strong>Celkem</strong></td><td><strong>'.$Translated.'</strong></td><td><strong>'.$Total.'</strong></td><td><strong>'.ProgressBar(150, $Total).'</strong></td></tr>');
|
---|
59 | echo('</table>');
|
---|
60 | }
|
---|
61 |
|
---|
62 | ShowPage();
|
---|
63 |
|
---|
64 | // Show client version selection
|
---|
65 | echo('Zobrazit statistiku pro verzi: ');
|
---|
66 | $DbResult = $System->Database->query('SELECT `Version`, `Title` FROM `ClientVersion` WHERE `Imported`=1 ORDER BY `Version`');
|
---|
67 | while($DbRow = $DbResult->fetch_assoc())
|
---|
68 | {
|
---|
69 | echo('<a href="?Version='.$DbRow['Version'].'" title="'.$DbRow['Title'].'">'.$DbRow['Version'].'</a> ');
|
---|
70 | }
|
---|
71 |
|
---|
72 | // Show language selection
|
---|
73 | echo('<br /><br /><h3>Statistika dokončení překladů pro verzi '.$_SESSION['StatVersion'].'</h3><br/>');
|
---|
74 | echo('Jazyk: <a href="statistic.php">Dohromady</a>');
|
---|
75 | foreach($LanguageList as $Language)
|
---|
76 | if($Language['Enabled'] == 1) echo(' <a href="?language='.$Language['Id'].'">'.$Language['Name'].'</a>');
|
---|
77 |
|
---|
78 | echo('<br/><br/>');
|
---|
79 |
|
---|
80 | ShowStatTable();
|
---|
81 |
|
---|
82 | echo('<br/><p><strong>Celková statistika v závislosti na čase: </strong><a href="http://stat.zdechov.net/game/?Measure=18">Počet přeložených textů</a></p>
|
---|
83 | <div>Počet stáhnutí přeložených textů v SQL souboru: <strong>');
|
---|
84 |
|
---|
85 | $ID = $Database->SQLCommand('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 2');
|
---|
86 | $Line = mysql_fetch_row($ID);
|
---|
87 | echo($Line[0]);
|
---|
88 |
|
---|
89 | echo('</strong></div>
|
---|
90 | <div>Počet stáhnutí: <strong>');
|
---|
91 |
|
---|
92 | $ID = $Database->SQLCommand('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 0');
|
---|
93 | $Line = mysql_fetch_row($ID);
|
---|
94 | echo($Line[0]);
|
---|
95 |
|
---|
96 | echo('</strong></div>');
|
---|
97 |
|
---|
98 | ShowFooter();
|
---|
99 |
|
---|
100 | ?>
|
---|