2 include_once("include/functions.php");
3 include_once("include/report_generator.php");
5 function getGuildEmblem($guild)
7 $back = $guild['BackgroundColor'];
8 $emblem = $guild['EmblemStyle'];
9 $ecolor = $guild['EmblemColor'];
10 $border = $guild['BorderStyle'];
11 $bcolor = $guild['BorderColor'];
12 return "images/player_info/guild_ico.php?back=$back&emblem=$emblem&ecolor=$ecolor&border=$border&bcolor=$bcolor";
15 $guildid = intval(@$_REQUEST['guild']);
18 $FindRefrence = "?guild=$guildid";
20 $guild = getGuild($guildid);
23 // Create guild info table
26 $allow_show_all_info = 0;
27 echo '<table class=report width=500>';
29 echo '<tr><td colspan=2 class=head>'.$guild['name'].'</td></tr>';
31 echo '<td rowspan=4 class=emblem><img src='.getGuildEmblem($guild).'></td>';
32 echo '<td>'.$guild['info'].' </td>';
34 if ($allow_show_all_info)
35 echo '<tr><td>'.$guild['motd'].' </td></tr>';
36 echo '<tr><td>'.$lang['guild_create_at'].' '.date('d-m-y', $guild['createdate']).' </td></tr>';
37 echo '<tr><td>'.$lang['guild_money'].' '.money($guild['BankMoney']).' </td></tr>';
41 // Create guild members list report
42 $show_fields= array('PL_REPORT_LEVEL', 'PL_REPORT_RACE', 'PL_REPORT_CLASS', 'PL_REPORT_NAME', 'PL_REPORT_GRANK', 'PL_REPORT_NOTE');
43 $members =& new PlayerReportGenerator('guild');
44 $members->disableMark();
45 $members->Init($show_fields, $FindRefrence, 'guildMembers', $config['fade_limit'], 'name');
46 $members->guildMembers($guildid);
47 $members->createReport($lang['guild_members']);
52 $page = intval(@$_REQUEST['page']);
53 $sort = @$_REQUEST['sort'];
55 $FindRefrence = "?guild";
58 $rows = $cDB->selectPage($number, "SELECT *
60 LIMIT ?d, ?d", getPageOffset($page), $config['fade_limit']);
63 echo "<table class=report width=500>";
65 echo "<tr><td colspan=5 class=head>$lang[guild_list] $number</td></tr>\n";
66 // Делаем ссылку для сортировки
67 $SortRefrence = $FindRefrence;
68 if ($page>1) $SortRefrence.="&page=$page";
72 echo "<th width=100%>$lang[guild_name]</th>";
73 echo "<th>$lang[guild_create]</th>";
74 echo "<th>$lang[guild_leader]</th>";
77 foreach ($rows as $guild)
79 $leader = getCharacter($guild['leaderguid'], '`name`, `race`');
83 echo "<td><img src=".getGuildEmblem($guild)." width=48></td>";
84 echo "<td class=guild>«<a href=\"?guild=$guild[guildid]\">".$guild['name']."</a>»</td>";
85 echo "<td align=center><font size=-3>".date("d-m-y", $guild['createdate'])."</font></td>";
86 echo "<td class=player><a href=\"?player=$guild[leaderguid]\">".$leader['name']."</a></td>";
87 echo "<td class=pfaction><img width=48 src=\"".getFactionImage($leader['race'])."\"></td>";
90 $pageRefrence = $FindRefrence;
91 if ($sort) $pageRefrence.="&sort=$sort";
92 generatePage($number, $page, "<a href=\"$pageRefrence&page=%d\">%d </a>", 5);
93 echo "</tbody></table>";
96 echo $lang['guild_noexist'];