<?php 
if(!isset($_SESSION["logado"]) == 1) {
	exit('<div class="box_conteudo">Voc&ecirc; n&atilde;o pode acessar esta p&aacute;gina</div>');
}
else{
$vip = mssql_fetch_row(mssql_query("select ".colum_vip." from memb_info where memb___id='".$_SESSION["login"]."'"));
if($vip[0] < ultima_conexao) {
	exit('<div class="box_conteudo">Voc&ecirc; n&atilde;o tem benef&iacute;cio para acessar esta p&aacute;gina</div>');
}
else{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<div class="about-team-page-top-wrap" style="padding-bottom: 0px; margin-top: -5px;">
    <div class="top-title" style="width: 100%;">
      <h2 style="color: #fff; font-size: 30px; margin-left: 30px; border-color: darkgray;">Historico de Acesso.</h2>
    </div>
</div>
<div class="match-list-wrap">
<br />
<br />

<table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td style="color: #FFF"><div align="center"><strong>PERSONAGEM</strong></div></td>
    <td style="color: #FFF"><div align="center"><strong>ADRESS</strong></div></td>
    <td style="color: #FFF"><div align="center"><strong>SERVER</strong></div></td>
    <td style="color: #FFF"><div align="center"><strong>MAPA</strong></div></td>
  </tr>
  <?php
  $busca = mssql_query("select ip,servername from memb_stat where memb___id='".$_SESSION["login"]."'");
  if(mssql_num_rows($busca) < 1) {
	echo $bbcode->bbcode('<table width="55%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center">Não teve conexão nessa conta</td></tr></table>');
}
  for($i=0;$i<mssql_num_rows($busca);$i++) {
  	$pega = mssql_fetch_row($busca);
  	$dados = mssql_fetch_row(mssql_query("select gameidc from accountcharacter where id='".$_SESSION["login"]."'"));
  	$mapa = mssql_fetch_row(mssql_query("select mapnumber from character where name='".$dados[0]."'"));
  	switch($mapa[0]) {
		case 0: $map = "Lorencia"; break;
		case 1: $map = "Dungeon"; break;
		case 2: $map = "Devias"; break;
		case 3: $map = "Noria"; break;
	}
	echo $bbcode->bbcode('<tr>
    <td  style="color: #FFF"><div align="center">'.$dados[0].'</div></td>
    <td  style="color: #FFF"><div align="center">'.$pega[0].'</div></td>
    <td  style="color: #FFF"><div align="center">'.$pega[1].'</div></td>
    <td  style="color: #FFF"><div align="center">'.$map.'</div></td>
  </tr>');
}
  ?>
</table>
<br>
<table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td style="color: #FFF"><strong>Observação</strong>: ferramenta muito útil para saber se alguem esta usando sua conta sem seu conhecimento.</td>
  </tr>
</table>
<br />
<br />
</div>
</body>
</html>
<? }} ?>