CharactersDatabase;
$id = (isset($_GET['id'])) ? $_GET['id'] : 0;
if($id != 0)
{
$guild_id = $id;
$DbResult = $db2->query('SELECT `guildid`, `name`, FROM_UNIXTIME(`createdate`) AS `createdate` FROM `guild` WHERE `guildid` = '.$guild_id.' LIMIT 1');
$guild_data = $DbResult->fetch_assoc();
$members = $db2->query('SELECT `guild_member`.`guid`, `guild_member`.`rank` AS `mrank`, `characters`.`name`, `characters`.`level`, (SELECT `rname` FROM `guild_rank` WHERE `guildid` ='.$guild_id.' AND `rid` = `mrank` + 1) AS `rname`, `guild_member`.`pnote`, `guild_member`.`offnote` FROM `guild_member`,`characters` LEFT JOIN `guild_member` AS `k1` ON `k1`.`guid`=`characters`.`guid` WHERE `guild_member`.`guildid` = '.$guild_id.' AND `guild_member`.`guid`=`characters`.`guid` ORDER BY `mrank`');
$total_members = $members->num_rows;
$DbResult = $db2->query('SELECT count(*) AS `online_mem` FROM `guild_member`, `characters`, `guild` WHERE `guild`.`guildid` = '.$guild_id.' AND `guild_member`.`guildid` = `guild`.`guildid` AND `guild_member`.`guid` = `characters`.`guid` AND `characters`.`online` = 1');
$online_mem = $DbResult->fetch_assoc();
// guild info
$date_arr = explode(' ', $guild_data['createdate']);
$date = explode('-', $date_arr[0]);
$time_stp = explode(':', $date_arr[1]);
$time = mktime($time_stp[0], $time_stp[1], $time_stp[2], $date[1], $date[2], $date[0]);
$human_date = date('d.m.Y H:i:s', $time);
//echo('<- Zpět na výpis
');
echo('
Spolek '.$guild_data['name'].' |
Datum založení: |
'.$human_date.' |
Celkem členů: |
'.$total_members.' (Online : '.$online_mem['online_mem'].') |
');
$DbResult = $db->query('SELECT `Homepage` FROM `GuildInfo` WHERE `Guild`='.$guild_id.' AND `Realm`='.$Realm->Id);
$DbRow = $DbResult->fetch_assoc();
$Homepage = $DbRow['Homepage'];
if($Homepage != '')
{
echo('
Webové stránky: |
'.$Homepage.' |
');
}
echo('
');
// members info
echo('
Jméno |
Rasa |
Třída |
Úroveň |
Hodnost |
Poslední přihlášení (dny) |
Online |
');
while($member = $members->fetch_row())
{
$query = $db2->query('SELECT `race`,`class`,`online`, `account`, `logout_time`, `level`, `gender` FROM `characters` WHERE `guid` = '.$member[0].' LIMIT 1;');
$online = $query->fetch_assoc();
$accid = $online['account'];
$LogoutTime = count_days($online['logout_time'], time());
$LogoutTimeColorList = array(0 => '#0000CC', 5 => '#FFFF00', 15 => '#FF8000', 30 => '#FF0000', 60 => '#FF00FF', 90 => '#8000FF');
$LogoutTimeColor = '#009900';
foreach($LogoutTimeColorList as $Time => $Color)
{
if($LogoutTime > $Time) $LogoutTimeColor = $Color;
}
$Level = $online['level'];
$LevelColorList = array(9 => '#858585', 19 => '#339900', 29 => '#3300CC', 39 => '#5552FF', 49 => '#FF8000', 59 => '#FF0000', 69 => '#FF00CC', 70 => '#FFF000');
$LevelColor = '#FFFFFF';
foreach($LevelColorList as $Index => $Color)
{
if($Level > $Index) $LevelColor = $Color;
}
if($online['gender'] == 0) $gender = 0;
else $gender = 1;
echo(''.
''.$member[2].' | '.
' | '.
' | '.
''.$Level.' | '.
''.$member[4].' ('.$member[1].') | '.
''.$LogoutTime.' | '.
''.(($online['online']) ? '' : '').' | '.
'
');
}
echo('
');
} else echo('');
?>