Changeset 411 for trunk/team.php
- Timestamp:
- Apr 1, 2010, 1:57:47 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/team.php
r376 r411 177 177 function TeamShow() 178 178 { 179 global $Database, $TranslationTree, $User ;180 181 if(array_key_exists('id', $_GET) )179 global $Database, $TranslationTree, $User, $Config; 180 181 if(array_key_exists('id', $_GET) and is_numeric($_GET['id'])) 182 182 { 183 183 ImgLevelUpdate(); 184 184 185 $Team = mysql_fetch_assoc($Database->SQLCommand('SELECT *, (SELECT COUNT(*) FROM `User` WHERE `Team` = `Team`.`Id`) AS `NumberUser`, (SELECT SUM(`TranslatedCount`) FROM `User` WHERE `team` = `Team`.`Id`) AS `NumberTranslate` FROM `Team` WHERE `Id`='.$_GET['id'])); 186 $DbResult = $Database->SQLCommand('SELECT `Name` FROM `User` WHERE `ID`='.$Team['Leader']); 187 if(mysql_num_rows($DbResult) > 0) 188 { 189 $Leader = mysql_fetch_assoc($DbResult); 190 $Leader = $Leader['Name']; 191 } else $Leader = ''; 185 $DbResult = $Database->SQLCommand('SELECT *, (SELECT COUNT(*) FROM `User` WHERE `Team` = `Team`.`Id`) AS `NumberUser`, (SELECT SUM(`TranslatedCount`) FROM `User` WHERE `team` = `Team`.`Id`) AS `NumberTranslate` FROM `Team` WHERE `Id`='.$_GET['id']); 186 if(mysql_num_rows($DbResult) > 0) 187 { 188 $Team = mysql_fetch_assoc($DbResult); 189 $DbResult = $Database->SQLCommand('SELECT `Name` FROM `User` WHERE `ID`='.$Team['Leader']); 190 if(mysql_num_rows($DbResult) > 0) 191 { 192 $Leader = mysql_fetch_assoc($DbResult); 193 $Leader = $Leader['Name']; 194 } else $Leader = ''; 192 195 193 echo('<strong>Překladatelský tým '.$Team['Name'].'</strong><br />'. 194 'Webové stránky: <a href="http://'.$Team['URL'].'">'.$Team['URL'].'</a><br/>'. 195 'Vedoucí: <strong>'.$Leader.'</strong><br/>'. 196 $Team['Description'].'<br /><br />'); 197 //echo('<a href="export/?team='.$Team['Id'].'">Exportovat překlad týmu</a> '); 198 if($User->Licence(LICENCE_USER)) echo('<a href="?action=gointeam&id='.$Team['Id'].'">Vstoupit do týmu</a><br /><br />'); 199 echo('<fieldset><legend>Statistika</legend>'. 200 'Počet členů týmu: <a href="userlist.php?team='.$Team['Id'].'" title="Zobrazit členy týmu">'.$Team['NumberUser'].'</a><br />'. 201 'Počet přeložených textů týmu: <strong>'.$Team['NumberTranslate'].'</strong><br />'. 202 'Průměrná úroveň překladatelů v týmu: <img src="tmp/team/'.$Team['Name'].'/level.png" /><br /><br />'. 203 '<strong>Stav dokončení pro tým:</strong><br />'); 204 foreach($TranslationTree as $Group) 205 if($Group['TablePrefix'] != '') 206 echo('<div class="state-image"><img alt="'.$Group['TablePrefix'].'" src="img_statistic.php?group='.$Group['Id'].'&team='.$Team['Id'].'" title="statistika překladů '.$Group['Name'].'"/></div>'); 207 echo('</fieldset>'); 196 echo('<strong>Překladatelský tým '.$Team['Name'].'</strong><br />'. 197 'Webové stránky: <a href="http://'.$Team['URL'].'">'.$Team['URL'].'</a><br/>'. 198 'Vedoucí: <strong>'.$Leader.'</strong><br/>'. 199 $Team['Description'].'<br /><br />'); 200 //echo('<a href="export/?team='.$Team['Id'].'">Exportovat překlad týmu</a> '); 201 if($User->Licence(LICENCE_USER)) echo('<a href="?action=gointeam&id='.$Team['Id'].'">Vstoupit do týmu</a><br /><br />'); 202 echo('<fieldset><legend>Statistika</legend>'. 203 'Počet členů týmu: <a href="userlist.php?team='.$Team['Id'].'" title="Zobrazit členy týmu">'.$Team['NumberUser'].'</a><br />'. 204 'Počet přeložených textů týmu: <strong>'.$Team['NumberTranslate'].'</strong><br />'. 205 'Průměrná úroveň překladatelů v týmu: <img src="tmp/team/'.$Team['Name'].'/level.png" /><br /><br />'. 206 '<strong>Stav dokončení týmu pro verzi '.$Config['Web']['GameVersion'].'</strong><br />'); 207 208 $BuildNumber = GetBuildNumber($Config['Web']['GameVersion']); 209 210 $GroupListQuery = 'SELECT `Group`.* FROM `Group`'; 211 $Query = ''; 212 $DbResult = $Database->SQLCommand($GroupListQuery); 213 while($DbRow = mysql_fetch_assoc($DbResult)) 214 { 215 $Query .= 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('. 216 ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'. 217 ' WHERE (`User` IN (SELECT `ID` FROM `User` WHERE `Team` = '.$Team['Id'].')) AND (`Complete` = 1) AND (`T`.`Language`!=0) AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'. 218 ') AS `C1`) AS `Translated`, '. 219 '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('. 220 ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'. 221 ' WHERE (`Language` = 0) AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'. 222 ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name` UNION '; 223 } 224 $Query = substr($Query, 0, - 6); 225 226 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$GroupListQuery.') AS `T`'); 227 $DbRow = mysql_fetch_row($DbResult); 228 $PageList = GetPageList($DbRow[0]); 229 echo($PageList['Output']); 230 231 echo('<table class="BaseTable">'); 232 $TableColumns = array( 233 array('Name' => 'Name', 'Title' => 'Jméno'), 234 array('Name' => 'Translated', 'Title' => 'Přeložených'), 235 array('Name' => 'Total', 'Title' => 'Anglických'), 236 array('Name' => 'Percent', 'Title' => 'Procenta'), 237 ); 238 239 $Order = GetOrderTableHeader($TableColumns, 'Name', 0); 240 echo($Order['Output']); 241 242 $Translated = 0; 243 $Total = 0; 244 $ID = $Database->SQLCommand('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.$Query.') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']); 245 while($Group = mysql_fetch_assoc($ID)) 246 { 247 echo('<tr><td>'.$Group['Name'].'</td><td>'.$Group['Translated'].'</td><td>'.$Group['Total'].'</td><td>'.ProgressBar(150, $Group['Percent']).'</td></tr>'); 248 $Translated += $Group['Translated']; 249 $Total += $Group['Total']; 250 } 251 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>'); 252 echo('</table>'); 253 254 echo('</fieldset>'); 255 } else echo('Team nenalezen'); 208 256 } else echo('Musíte zadat id týmu'); 209 257 }
Note:
See TracChangeset
for help on using the changeset viewer.