Changeset 49 for trunk/statistic.php
- Timestamp:
- Jan 30, 2009, 10:33:08 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:ignore
set to
SqlTranslate.zip
-
Property svn:ignore
set to
-
trunk/statistic.php
r43 r49 1 1 <?php 2 2 3 include('includes/global.php'); 3 include('includes/global.php'); 4 5 echo('<strong>Statistika:</strong><br />'); 6 foreach($TranslationTree as $Group) 7 if($Group['TablePrefix'] != '') echo('<img alt="'.$Group['TablePrefix'].'" src="img_statistic.php?TypeText='.$Group['TablePrefix'].'" title="statistika překladů '.$Group['Name'].'" style="margin: 2px 0px 0px 0px;" /><br />'); 8 9 echo('<br /> 10 <b>Statistika v závislosti na čase: </b><a href="http://stat.zdechov.net/game/?Measure=18">Počet přeložených textů</a><br /> 11 <br /> 12 Počet stáhnutí přeložených textů v SQL souboru: <b>'); 13 14 $ID = $Database->SQLCommand("SELECT count(distinct(IP)) FROM log WHERE type = 2"); 15 $Line = mysql_fetch_row($ID); 16 echo($Line[0]); 17 18 echo('</b><br /> 19 Počet stáhnutí CZWoW pro clienta: <b>'); 20 21 $ID = $Database->SQLCommand("SELECT count(distinct(IP)) FROM log WHERE type = 0"); 22 $Line = mysql_fetch_row($ID); 23 echo($Line[0]); 24 25 echo('</b><br /><br /> 26 <b>Seznam uživatelů: </b> 27 <table border="1" cellpadding="2" cellspacing="0">'); 28 29 if(array_key_exists('order', $_GET)) 30 { 31 $order = $_GET['order']; 32 $desc = $_GET['desc']; 33 } else 34 { 35 $order = 'NumberTranslate'; 36 $desc = ''; 37 } 38 39 if($desc == '') $desc = 'desc'; else $desc = ''; 40 41 echo('<tr><th><a href="?order=user&desc='.$desc.'">Jméno</a></th> 42 <th><a href="statistic.php?order=NumberTranslate&desc='.$desc.'" title="Počet přeložených textů">Přeložených</a></th> 43 <th><a href="statistic.php?order=Vote&desc='.$desc.'" title="Průměrná známka textů">Průměrná známka</a></th> 44 <th><a href="statistic.php?order=GM&desc='.$desc.'">Oprávnění</a></th> 45 <th><a href="statistic.php?order=LastLogin&desc='.$desc.'">Poslední připojení</a></th></tr>'); 46 47 $Query = 'SELECT ID,user, LastLogin, GM, ('; 48 foreach($TranslationTree as $Group); 49 if($Group['TablePrefix'] != '') 50 $Query .= '(SELECT count(*) FROM `'.$Group['TablePrefix'].'` WHERE User = user.ID AND Complete = 1 AND Language <> 0) + '; 51 $Query .= '0) as NumberTranslate, ('; 52 foreach($TranslationTree as $Group) 53 if($Group['TablePrefix'] != '') 54 $Query .= 'IFNULL((SELECT sum(Vote) AS Vote FROM `'.$Group['TablePrefix'].'` WHERE User = user.ID AND Complete =1 AND Language <> 0), 0) + '; 55 $Query .= '0) / ('; 56 foreach($TranslationTree as $Group) 57 if($Group['TablePrefix'] != '') 58 $Query .= '(SELECT count(Vote) AS Vote FROM `'.$Group['TablePrefix'].'` WHERE User = user.ID AND Complete =1 AND Language <> 0) + '; 59 $Query .= '0) AS Vote FROM `user` ORDER BY '.$order.' '.$desc; 60 $ID = $Database->SQLCommand($Query); 61 while($Line = mysql_fetch_array($ID)) 62 { 63 if(Licence(LICENCE_MODERATOR)) 64 $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['user'].'</a>'; 65 else $Name = $Line['user']; 66 67 echo('<tr><td>'.$Name.'</td> 68 <td>'.$Line['NumberTranslate'].'</td> 69 <td>'.substr($Line['Vote'], 0, 4).'</td> 70 <td>'.$Moderators[$Line['GM']].'</td> 71 <td>'.$Line['LastLogin'].'</td></tr>'); 72 } 73 echo('</table>'); 74 75 ShowFooter(); 4 76 5 77 ?> 6 7 <b>Statistika:</b><br>8 <img alt="quests" src="img_statistic.php?TypeText=quests" title="statistika překladu úkolů" style="margin: 2px 0px 0px 0px;"><br />9 <img alt="npc_text" src="img_statistic.php?TypeText=npc_text" title="statistika překladu NPC_textů" style="margin: 2px 0px 0px 0px;"><br />10 <img alt="page_text" src="img_statistic.php?TypeText=page_text" title="statistika překladu page_textů" style="margin: 2px 0px 0px 0px;"><br />11 <?php // <img alt="page_text" src="img_statistic.php?TypeText=client_text" title="statistika překladu client_textů" style="margin: 2px 0px 0px 0px;"><br />12 ?>13 14 <br>15 <b>Statistika v závislosti na čase: </b><a href="http://stat.zdechov.net/game/?Measure=18">Počet přeložených textů</a><br>16 <br />17 Počet stáhnutí přeložených textů v SQL souboru: <b>18 <?php19 20 $ID = $Database->SQLCommand("SELECT count(distinct(IP)) FROM log WHERE type = 2");21 $Line = mysql_fetch_row($ID);22 echo $Line[0];23 ?>24 </b><br />25 Počet stáhnutí CZWoW pro clienta: <b>26 <?php27 28 $ID = $Database->SQLCommand("SELECT count(distinct(IP)) FROM log WHERE type = 0");29 $Line = mysql_fetch_row($ID);30 echo $Line[0];31 ?>32 </b><br /><br />33 <b>Seznam uživatelů: </b>34 <table border="1" cellpadding="2" cellspacing="0">35 <?php36 37 if(array_key_exists('order', $_GET)) {38 $order = $_GET['order'];39 $desc = $_GET['desc'];40 } else {41 $order = 'NumberTranslate';42 $desc = '';43 }44 45 if ($desc == '') $desc = 'desc'; else $desc = '';46 47 echo '<tr><th><a href="statistic.php?order=user&desc='.$desc.'">Jméno</a></th>48 <th><a href="statistic.php?order=NumberTranslate&desc='.$desc.'" Title="Počet přeložených textů">Přeložených</a></th>49 <th><a href="statistic.php?order=Vote&desc='.$desc.'" Title="Průměrná známka textů">Průměrná známka</a></th>50 <th><a href="statistic.php?order=GM&desc='.$desc.'">Oprávnění</a></th>51 <th><a href="statistic.php?order=LastLogin&desc='.$desc.'">Poslední připojení</a></th></tr>';52 53 /*54 SELECT user, LastLogin, GM, (55 (SELECT count(*) FROM `quests` WHERE User = user.ID AND User <> 0 AND Complete = 1) +56 (SELECT count(*) FROM `npc_text` WHERE User = user.ID AND User <> 0 AND Complete = 1) +57 (SELECT count(*) FROM `page_text` WHERE User = user.ID AND User <> 0 AND Complete = 1)58 ) as NumberTranslate, (59 SELECT IFNULL((SELECT AVG(Vote) AS Vote FROM `quests` WHERE User = user.ID AND Complete =1),0)60 + IFNULL((SELECT AVG(Vote) AS Vote FROM `page_text` WHERE User = user.ID AND Complete =1),0)61 + IFNULL((SELECT AVG(Vote) AS Vote FROM `npc_text` WHERE User = user.ID AND Complete =1),0)62 ) /3 AS Vote63 FROM `user`64 65 */66 67 $ID = $Database->SQLCommand("68 SELECT ID,user, LastLogin, GM, (69 (SELECT count(*) FROM `quests` WHERE User = user.ID AND Complete = 1 AND Language <> 0)70 + (SELECT count(*) FROM `npc_text` WHERE User = user.ID AND Complete = 1 AND Language <> 0)71 + (SELECT count(*) FROM `page_text` WHERE User = user.ID AND Complete = 1 AND Language <> 0)72 + (SELECT count(*) FROM `client_text` WHERE User = user.ID AND Complete = 1 AND Language <> 0)73 ) as NumberTranslate, (74 IFNULL((SELECT sum(Vote) AS Vote FROM `quests` WHERE User = user.ID AND Complete =1 AND Language <> 0),0)75 + IFNULL((SELECT sum(Vote) AS Vote FROM `page_text` WHERE User = user.ID AND Complete =1 AND Language <> 0),0)76 + IFNULL((SELECT sum(Vote) AS Vote FROM `npc_text` WHERE User = user.ID AND Complete =1 AND Language <> 0),0)77 + IFNULL((SELECT sum(Vote) AS Vote FROM `client_text` WHERE User = user.ID AND Complete =1 AND Language <> 0),0)78 ) / (79 (SELECT count(Vote) AS Vote FROM `quests` WHERE User = user.ID AND Complete =1 AND Language <> 0)80 + (SELECT count(Vote) AS Vote FROM `page_text` WHERE User = user.ID AND Complete =1 AND Language <> 0)81 + (SELECT count(Vote) AS Vote FROM `npc_text` WHERE User = user.ID AND Complete =1 AND Language <> 0)82 + (SELECT count(Vote) AS Vote FROM `client_text` WHERE User = user.ID AND Complete =1 AND Language <> 0)83 ) AS Vote84 FROM `user` ORDER BY $order $desc");85 86 while ($Line = mysql_fetch_array($ID)) {87 88 if (Licence(1))89 $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['user'].'</a>';90 else91 $Name = $Line['user'];92 93 echo '<tr><td>'.$Name.'</td>94 <td>'.$Line['NumberTranslate'].'</td>95 <td>'.substr($Line['Vote'], 0, 4).'</td>96 <td>'.$Moderators[$Line['GM']].'</td>97 <td>'.$Line['LastLogin'].'</td></tr>';98 99 }100 101 echo '</table>';102 103 ShowFooter();104 ?>
Note:
See TracChangeset
for help on using the changeset viewer.