source: trunk/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
RevLine 
[532]1<?php
2
[625]3function ShowGMList($Realm)
[419]4{
[630]5 global $db, $db2, $Config;
[419]6
[627]7 $Result = $db->query('SELECT * FROM `GmTeam` WHERE (`RealmId` = '.$Realm['Id'].') AND (`TimeTo` IS NULL) ORDER BY `RealmId`, `Nick`');
[625]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())
[627]15 {
16 // Create link from name if ForumId defined
[635]17 if($Line['ForumId'] != 0) $Line['Nick'] = '<a href="'.$Config['Web']['BaseURL'].'forum/memberlist.php?mode=viewprofile&amp;u='.$Line['ForumId'].'">'.$Line['Nick'].'</a>';
[627]18
19 $Output .= '<tr><td>'.$Line['Nick'].'</td>'.
[625]20 '<td>'.$Line['Delegation'].'</td>';
21 $Output .= '<td>';
22 $Characters = array();
[630]23 $ResultMangos = $db2->query('SELECT * FROM `characters` WHERE `account` = "'.$Line['AccountId'].'"');
[625]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>';
[419]31
[625]32/*
33 * // $Database->select_db($Config['Mangos']['DatabaseRealmd']);
[419]34 if($Line['ForumId'] != 0)
35 {
[583]36 echo('<tr><th>Profil na foru:</th>');
[576]37 echo('<td><strong><a href="'.$Config['Web']['BaseURL'].'forum/memberlist.php?mode=viewprofile&u='.$Line['ForumId'].'">Profil</a></strong></td>');
[419]38 echo '</tr>';
39 }
[583]40 //echo('<tr><td colspan="2"><hr></td></tr>');
[625]41 */
42 $Output .= '</tr>';
43 }
44 $Output .= '</table>';
45 return($Output);
[419]46}
[532]47
[625]48//$Role = array('Hráč', 'Moderátor', 'Game Master', 'Kontrolor chyb', 'Vedoucí Tábora', 'Administrátor', 'Správce Systému');
49//$_COOKIE['RealmIndex']
50
[630]51$Realm = new Realm($System, $_COOKIE['RealmIndex']);
[681]52$db2 = $Realm->CharactersDatabase;
[630]53
[635]54$Output = '<h2 class="PageTitle">GM tým</h2>';
[625]55
56$Output .= ShowGMList(array('Id' => 0, 'Name' => 'Všechny světy'));
[683]57$DbResult = $System->Database->query('SELECT * FROM Realm WHERE Enabled=1');
[682]58while($Realm = $DbResult->fetch_assoc())
[625]59{
60 $Output .= ShowGMList($Realm);
61}
62$Output .= '<br />'.$server->RealmSelection();
63
[627]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
[625]73echo($Output);
74
[532]75?>
Note: See TracBrowser for help on using the repository browser.