source: trunk/pages/realmlist.php@ 683

Last change on this file since 683 was 683, checked in by george, 15 years ago
  • Přidáno: Nové sloupce Enabled pro povolení/zakázání světů, přihlšaovacích serverů a počítačů.
File size: 2.1 KB
Line 
1<?php
2
3if(array_key_exists('Server', $_GET))
4{
5 $DbResult = $System->Database->query('SELECT Logon.Id, Host.Address, Logon.Port FROM Logon JOIN Host ON Host.Id=Logon.Host WHERE Logon.Id='.$_GET['Server'].' AND Logon.Enabled=1');
6 if($DbResult->num_rows > 0)
7 {
8 $Realm = $DbResult->fetch_assoc();
9 echo('set realmlist '.$Realm['Address']);
10 if($Realm['Port'] != 3724) echo(':'.$Realm['Port']);
11 echo('</div>');
12 } else echo('Neznámé Id serveru');
13} else
14{
15 $Output = '<h2 align="center">Seznam světů</h2>';
16
17 $DbResult = $System->Database->query('SELECT Logon.Name, Logon.Id, Host.Address, Logon.Port FROM Logon JOIN Host ON Host.Id=Logon.Host WHERE Logon.Enabled=1');
18 while($DbRow = $DbResult->fetch_assoc())
19 {
20 $Server = new Server($System, $DbRow['Id']);
21 $Output .= '<div style="text-align: center">'.$DbRow['Name'].' <a href="?page=realmlist&amp;Server='.$DbRow['Id'].'">'.$DbRow['Address'];
22 if($DbRow['Port'] != 3724) $Output .= ':'.$DbRow['Port'];
23 $Output .= '</a></div>';
24 $Output .= '<table class="BaseTable">'.
25 '<tr>'.
26 '<th>Název</th>'.
27 '<th>Násobek XP</th>'.
28 '<th>Zaměření</th>'.
29 '<th>Stav</th>'.
30 '<th>Hráči online / max. online / celkem</th>'.
31 '</tr>';
32
33 $DbResult2 = $System->Database->query('SELECT * FROM Realm WHERE Logon='.$Server->Id.' AND Enabled=1 ORDER BY Name');
34 while($DbRow = $DbResult2->fetch_assoc())
35 {
36 $Realm = new Realm($System, $DbRow['Id']);
37 $Output .= '<tr><td><a href="?page=online&amp;RealmIndex='.$Realm->Id.'">'.$Realm->Data['Name'].'</a></td><td>'.$Realm->Data['Rate'].'</td><td>'.$Realm->Data['Type'].'</td><td>'.$Server->OnlineStateImage($Realm->Data['Online']).'</td><td>'.$Realm->OnlineCharactersCount().' / '.$Realm->Data['MaxOnlinePlayers'].' / '.$Realm->CharacterCount().'</td></tr>';
38 $Output .= '<tr><td colspan="5">'.$Realm->Data['Description'].'</td></tr>';
39 //if(array_key_exists($Index + 1, $Config['Mangos']['RealmList']))
40 $Output .= '<tr><td colspan="5">&nbsp;</td></tr>';
41 }
42 $Output .= '</table><br/>';
43 }
44 echo($Output);
45}
46
47?>
Note: See TracBrowser for help on using the repository browser.