Changeset 410 for trunk/statistic.php
- Timestamp:
- Mar 31, 2010, 9:11:05 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/statistic.php
r402 r410 3 3 include('includes/global.php'); 4 4 5 function ShowStatTable() 6 { 7 global $Database, $Config; 8 9 $LanguageId = LoadLanguageIdParameter(); 10 $BuildNumber = GetBuildNumber($Config['Web']['GameVersion']); 11 12 $GroupListQuery = 'SELECT `Group`.* FROM `Group`'; 13 $Query = ''; 14 $DbResult = $Database->SQLCommand($GroupListQuery); 15 while($DbRow = mysql_fetch_assoc($DbResult)) 16 { 17 $Query .= 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('. 18 ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'. 19 ' WHERE (`Complete` = 1) AND (`Language`='.$LanguageId.') AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'. 20 ') AS `C1`) AS `Translated`, '. 21 '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('. 22 ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'. 23 ' WHERE (`Language` = 0) AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'. 24 ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name` UNION '; 25 } 26 $Query = substr($Query, 0, - 6); 27 28 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$GroupListQuery.') AS `T`'); 29 $DbRow = mysql_fetch_row($DbResult); 30 $PageList = GetPageList($DbRow[0]); 31 echo($PageList['Output']); 32 33 echo('<table class="BaseTable">'); 34 $TableColumns = array( 35 array('Name' => 'Name', 'Title' => 'Jméno'), 36 array('Name' => 'Translated', 'Title' => 'Přeložených'), 37 array('Name' => 'Total', 'Title' => 'Anglických'), 38 array('Name' => 'Percent', 'Title' => 'Procenta'), 39 ); 40 41 $Order = GetOrderTableHeader($TableColumns, 'Name', 0); 42 echo($Order['Output']); 43 44 $Translated = 0; 45 $Total = 0; 46 $ID = $Database->SQLCommand('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.$Query.') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']); 47 while($Group = mysql_fetch_assoc($ID)) 48 { 49 echo('<tr><td>'.$Group['Name'].'</td><td>'.$Group['Translated'].'</td><td>'.$Group['Total'].'</td><td>'.ProgressBar(150, $Group['Percent']).'</td></tr>'); 50 $Translated += $Group['Translated']; 51 $Total += $Group['Total']; 52 } 53 echo('<tr><td><strong>Celkem</strong></td><td><strong>'.$Translated.'</strong></td><td><strong>'.$Total.'</strong></td><td><strong>'.ProgressBar(150, round($Translated / $Total * 100, 2)).'</strong></td></tr>'); 54 echo('</table>'); 55 } 56 5 57 ShowPage(); 6 58 7 $LanguageId = LoadLanguageIdParameter(); 8 if($LanguageId > 0) $language = '&language='.$LanguageId; 9 else $language = ''; 10 11 echo('<strong>Statistika:</strong> <a href="statistic.php">Všechny</a>'); 59 echo('<h3>Statistika dokončení překladů pro verzi '.$Config['Web']['GameVersion'].'</h3><br/>Jazyk: <a href="statistic.php">Dohromady</a>'); 12 60 foreach($LanguageList as $Language) 13 61 if($Language['Enabled'] == 1) echo(' <a href="?language='.$Language['Id'].'">'.$Language['Name'].'</a>'); 14 62 63 echo('<br/><br/>'); 15 64 16 foreach($TranslationTree as $Group) 17 if($Group['TablePrefix'] != '') 18 echo('<div class="state-image"><img alt="'.$Group['TablePrefix'].'" src="img_statistic.php?group='.$Group['Id'].$language.'" title="Statistika překladů '.$Group['Name'].'"/></div>'); 65 ShowStatTable(); 19 66 20 echo('< 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>67 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> 21 68 <div>Počet stáhnutí přeložených textů v SQL souboru: <strong>'); 22 69
Note:
See TracChangeset
for help on using the changeset viewer.