Changeset 410 for trunk/export/index.php
- Timestamp:
- Mar 31, 2010, 9:11:05 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/index.php
r398 r410 567 567 } 568 568 569 function ExportViewStat() 570 { 571 global $Database, $System; 572 573 $Export = new Export($System); 574 $Export->Id = $_GET['ExportId']; 575 $Export->Init(); 576 $Export->LoadFilters(); 577 578 $GroupListQuery = 'SELECT `Group`.* FROM `Group` '. 579 ' JOIN `ExportGroup` ON (`ExportGroup`.`Export`='.$Export->Id.') AND (`ExportGroup`.`Group`=`Group`.`Id`)'; 580 $Query = ''; 581 $DbResult = $Database->SQLCommand($GroupListQuery); 582 while($DbRow = mysql_fetch_assoc($DbResult)) 583 { 584 $Query .= 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('. 585 ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'. 586 ' JOIN `ExportUser` ON (`ExportUser`.`User`=`T`.`User`) AND (`ExportUser`.`Export`='.$Export->Id.') '. 587 ' JOIN `ExportLanguage` ON (`ExportLanguage`.`Export`='.$Export->Id.')'. 588 ' WHERE (`Complete` = 1) AND (`VersionStart` <= '.$Export->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$Export->ClientVersion['BuildNumber'].')'. 589 ') AS `C1`) AS `Translated`, '. 590 '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('. 591 ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'. 592 ' WHERE (`Language` = 0) AND (`VersionStart` <= '.$Export->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$Export->ClientVersion['BuildNumber'].')'. 593 ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name` UNION '; 594 } 595 $Query = substr($Query, 0, - 6); 596 597 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$GroupListQuery.') AS `T`'); 598 $DbRow = mysql_fetch_row($DbResult); 599 $PageList = GetPageList($DbRow[0]); 600 echo('<h3>Statistika dokončení vybraných skupin</h3>'); 601 echo($PageList['Output']); 602 603 echo('<table class="BaseTable">'); 604 $TableColumns = array( 605 array('Name' => 'Name', 'Title' => 'Jméno'), 606 array('Name' => 'Translated', 'Title' => 'Přeložených'), 607 array('Name' => 'Total', 'Title' => 'Anglických'), 608 array('Name' => 'Percent', 'Title' => 'Procenta'), 609 ); 610 611 $Order = GetOrderTableHeader($TableColumns, 'Name', 0); 612 echo($Order['Output']); 613 614 $Translated = 0; 615 $Total = 0; 616 $ID = $Database->SQLCommand('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.$Query.') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']); 617 while($Group = mysql_fetch_assoc($ID)) 618 { 619 echo('<tr><td>'.$Group['Name'].'</td><td>'.$Group['Translated'].'</td><td>'.$Group['Total'].'</td><td>'.ProgressBar(150, $Group['Percent']).'</td></tr>'); 620 $Translated += $Group['Translated']; 621 $Total += $Group['Total']; 622 } 623 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>'); 624 echo('</table>'); 625 } 626 569 627 function ExportView() 570 628 { … … 576 634 $UserLine = mysql_fetch_assoc($DbResult); 577 635 echo('Export <strong><a href="?Action=View&Tab=6&ExportId='.$Export['Id'].'">'.$_GET['ExportId'].'</a></strong> překladatele <strong>'.$UserLine['Name'].'</strong> s označením <strong>'.$Export['Title'].'</strong>'); 578 ShowTabs(array('Obecné', 'Překladatelé', 'Překlady', 'Jazyky', 'Formát', 'Verze', ' Výstup'));636 ShowTabs(array('Obecné', 'Překladatelé', 'Překlady', 'Jazyky', 'Formát', 'Verze', 'Statistika', 'Výstup')); 579 637 echo('<div id="content">'); 580 638 if($_SESSION['Tab'] == 0) ExportViewGeneral(); … … 584 642 else if($_SESSION['Tab'] == 4) ExportViewOutputFormat(); 585 643 else if($_SESSION['Tab'] == 5) ExportViewVersion(); 586 else if($_SESSION['Tab'] == 6) ExportViewOutput(); 644 else if($_SESSION['Tab'] == 6) ExportViewStat(); 645 else if($_SESSION['Tab'] == 7) ExportViewOutput(); 587 646 588 647 echo('</div>');
Note:
See TracChangeset
for help on using the changeset viewer.