source: branches/posledni/pages/gmteam.php

Last change on this file 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.7 KB
Line 
1<?php
2
3function ShowGMList($Realm)
4{
5 global $db, $db2, $Config;
6
7 $Result = $db->query('SELECT * FROM `GmTeam` WHERE (`RealmId` = '.$Realm['Id'].') AND (`TimeTo` IS NULL) ORDER BY `RealmId`, `Nick`');
8 if($Realm['Id'] == 0) $Output = '<h3 class="PageTitle">'.$Realm['Name'].'</h3>';
9 else $Output = '<h3 class="PageTitle">Svět '.$Realm['Name'].'</h3>';
10 $Output .= '<table class="BaseTable">'.
11 '<tr><th>Jméno</th><th>Pověření</th><th>Postavy</th></tr>';
12 if($Result->num_rows == 0) return('');
13
14 while($Line = $Result->fetch_array())
15 {
16 // Create link from name if ForumId defined
17 if($Line['ForumId'] != 0) $Line['Nick'] = '<a href="'.$Config['Web']['BaseURL'].'forum/memberlist.php?mode=viewprofile&amp;u='.$Line['ForumId'].'">'.$Line['Nick'].'</a>';
18
19 $Output .= '<tr><td>'.$Line['Nick'].'</td>'.
20 '<td>'.$Line['Delegation'].'</td>';
21 $Output .= '<td>';
22 $Characters = array();
23 $ResultMangos = $db2->query('SELECT * FROM `characters` WHERE `account` = "'.$Line['AccountId'].'"');
24 while($LineMangos = $ResultMangos->fetch_array())
25 {
26 if($LineMangos['online'] == 1) $Characters[] = $LineMangos['name'].'(online)';
27 else $Characters[] = $LineMangos['name'];
28 }
29 $Output .= implode(', ', $Characters);
30 $Output .= '</td>';
31
32/*
33 * // $Database->select_db($Config['Mangos']['DatabaseRealmd']);
34 if($Line['ForumId'] != 0)
35 {
36 echo('<tr><th>Profil na foru:</th>');
37 echo('<td><strong><a href="'.$Config['Web']['BaseURL'].'forum/memberlist.php?mode=viewprofile&u='.$Line['ForumId'].'">Profil</a></strong></td>');
38 echo '</tr>';
39 }
40 //echo('<tr><td colspan="2"><hr></td></tr>');
41 */
42 $Output .= '</tr>';
43 }
44 $Output .= '</table>';
45 return($Output);
46}
47
48//$Role = array('Hráč', 'Moderátor', 'Game Master', 'Kontrolor chyb', 'Vedoucí Tábora', 'Administrátor', 'Správce Systému');
49//$_COOKIE['RealmIndex']
50
51$Realm = new Realm($System, $_COOKIE['RealmIndex']);
52$db2 = $Realm->CharactersDatabase;
53
54$Output = '<h2 class="PageTitle">GM tým</h2>';
55
56$Output .= ShowGMList(array('Id' => 0, 'Name' => 'Všechny světy'));
57$DbResult = $System->Database->query('SELECT * FROM Realm WHERE Enabled=1');
58while($Realm = $DbResult->fetch_assoc())
59{
60 $Output .= ShowGMList($Realm);
61}
62$Output .= '<br />'.$server->RealmSelection();
63
64$Output .= '<h3 class="PageTitle">Dřívější GM</h3>';
65$List = array();
66$DbResult = $db->query('SELECT * FROM `GmTeam` WHERE `TimeTo` IS NOT NULL');
67while($DbRow = $DbResult->fetch_assoc())
68{
69 $List[] = $DbRow['Nick'].' ('.$server->HumanDate($DbRow['TimeFrom'], 0).' - '.$server->HumanDate($DbRow['TimeTo'], 0).')';
70}
71$Output .= implode(', ', $List);
72
73echo($Output);
74
75?>
Note: See TracBrowser for help on using the repository browser.