<?php 
if(!isset($_SESSION["logado"]) == 1) {
	exit('<header style="background: url(images/page-fon-bg.jpg) center top no-repeat; height: 507px;">
  
<div class="container">
<div class="hero"></div>
</div>

</header>
<div class="container">
<div style="position: absolute; top:-400px; left:370px; z-index:10;"><img src="images/dl.png"/></div>
    
<div id="content">
<div id="box1">
 <div class="title1">
 <h1>SEM REGISTRO.</h1>
 </div>
        
	<br><br><br><br><br><br>	
<TABLE>
<TD align="right">

<TD align="left" valign="top"><div class="or"><span>LOGUE-SE PARA ACESSAR.</span></div>
	O Conteudo a seguir, não pode ser acessado por voce.. <br><br>
	  Opcionais restritas a usuarios registrados. <br><div class="i_note">Registre-se gratuitamente, agora mesmo..</div><br><br><br><br><br><br><br><br><br><br></TD>
	</TABLE>
    </div>
</div>


        </div>');
}
else{
$cargo = mssql_fetch_row(mssql_query("select cargo from ct_equipe where login='".$_SESSION["login"]."'"));
if($cargo[0] < 2) {
	exit('<header style="background: url(images/page-fon-bg.jpg) center top no-repeat; height: 507px;">
  
<div class="container">
<div class="hero"></div>
</div>

</header>
<div class="container">
<div style="position: absolute; top:-400px; left:370px; z-index:10;"><img src="images/elf.png"/></div>
    
<div id="content">
<div id="box1">
 <div class="title1">
 <h1>SEM AUTORIDADE.</h1>
 </div>
        
	<br><br><br><br><br><br>	
<TABLE>
<TD align="right">

<TD align="left" valign="top"><div class="or"><span>Ops! PAGINA RESTRITA.</span></div>
	O Conteudo a seguir, não pode ser acessado por voce.. <br><br>
	  Opcionais restritas para administrador, e gestor de conteudo. <br><div class="i_note">Informe-se junto a equipe tecnica..</div><br><br><br><br><br><br><br><a class="custom_button" href="javascript: void(0);" onclick="loading(\'?go=paineluser\', \'conteudo\');">PAINEL USER</a>
            
             | <a class="custom_button" href="paginas/logout.php" target="_parent">DESLOGAR-ME</a></TD>
	</TABLE>
    </div>
</div>


        </div>');
}
else{
?>

<header style="background: url(images/page-fon-bg.jpg) center top no-repeat;
  height: 507px;">
  


<div class="container">
	
	<div class="hero"></div>
</div><!--container-->
</header><!--header-->

	<div class="container">
    
    <!-- FIM HEADER -->
    <!-- INICIO MEIO -->






<div style="position: absolute; top:-450px; left:300px; z-index:10;"><img src="images/mg.png"/></div>
<div id="content">
    <div id="box1">
        <div class="title1">
            <h1>Painel do Gestor !</h1>
        </div>
        <div id="content_center">
            <div class="box-style1" style="margin-bottom: 20px;">
                <h2 class="title">Olá Administrador, <?php 
	  $char = mssql_query("select memb_name from memb_info where memb___id='".$_SESSION["login"]."'");
	  for($i=0;$i<mssql_num_rows($char);$i++) {
		$pega = mssql_fetch_row($char);
		echo ''.$pega[0].'';
	}
	  ?></h2>
                <div class="entry">
                    <div id="ucp_info">
                        <div class="half">
                            
                            
                            
                            
                           <table width="100%">
                                <tr>
                                    <td width="5%"><img
                                                src="images/icons/user.png"/>
                                    </td>
                                    <td width="45%">Login de acesso</td>
                                    <td width="50%"><?php 
	  $char = mssql_query("select memb___id from memb_info where memb___id='".$_SESSION["login"]."'");
	  for($i=0;$i<mssql_num_rows($char);$i++) {
		$pega = mssql_fetch_row($char);
		echo ''.$pega[0].'';
	}
	  ?></td>
                                </tr>
                                <tr>
                                    <td><img
                                                src="images/icons/email.png"/>
                                    </td>
                                    <td>E-mail</td>
                                    <td><?php 
	  $char = mssql_query("select mail_addr from memb_info where memb___id='".$_SESSION["login"]."'");
	  for($i=0;$i<mssql_num_rows($char);$i++) {
		$pega = mssql_fetch_row($char);
		echo ''.$pega[0].'';
	}
	  ?></td>
                                </tr>
                                <tr>
                                    <td><img
                                                src="images/icons/award_star_bronze_1.png"/>
                                    </td>
                                    <td>Status da Conta</td>
                                    <td><?   if(!isset($_SESSION['login'])) {
		echo ''; }
		elseif(isset($_SESSION['login'])) {
		$login = $_SESSION['login'];
		$senha = $_SESSION['senha'];
		$tipoconta = mssql_fetch_row(mssql_query("select connectstat from memb_stat where memb___id='".$login.""));
		switch($tipoconta[1]) {
			case 2: $sintaxe = " Dias";
				break;
			case 1: $sintaxe = " Dias";
				break;
			case 0: $sintaxe = " Dias";
				break;
			default: $sintaxe = " Dias";
		}
		switch($tipoconta[0]) {
			case 0: $tipodeconta = "<img src='images/off-icon.png'/> Offline"; 
				break;
			case 1: $tipodeconta = "<img src='images/off-icon.png'/> Online";
				break;
			case 2: $tipodeconta = "Vip Silver";
				break;
			default : $tipodeconta = "Error";
		}
		echo ''.$tipodeconta.'';
		}
		?></td>
                                </tr>
                                <tr>
                                    <td><img
                                                src="images/icons/server.png"/>
                                    </td>
                                    <td>Tipo de Conta</td>
                                    <td><?   if(!isset($_SESSION['login'])) {
		echo ''; }
		elseif(isset($_SESSION['login'])) {
		$login = $_SESSION['login'];
		$senha = $_SESSION['senha'];
		$tipoconta = mssql_fetch_row(mssql_query("select AccountLevel, Accountexpiredate from memb_info where memb___id='".$login."' AND memb__pwd='".$senha."'"));
		switch($tipoconta[1]) {
			case 2: $sintaxe = " Dias";
				break;
			case 1: $sintaxe = " Dias";
				break;
			case 0: $sintaxe = " Dias";
				break;
			default: $sintaxe = " Dias";
		}
		switch($tipoconta[0]) {
			case 0: $tipodeconta = "<font color='red'>Free</font>"; 
				break;
			case 1: $tipodeconta = "<font color='#3C0'>VIP Silver</font>";
				break;
			case 2: $tipodeconta = "<font color='#0CF'>VIP Platinum</font>";
				break;
			default : $tipodeconta = "Error";
		}
		echo ''.$tipodeconta.'';
		}
		?></td>
                                </tr>
                                
                                    <tr>
                                        <td><img
                                                    src="images/icons/shield.png"/>
                                        </td>
                                        <td>Vencimento</td>
                                        <td> ( <a href="javascript: void(0);" onclick="loading('?go=paineladmin', 'conteudo');"><?php 
	  $char = mssql_query("select accountexpiredate from memb_info where memb___id='".$_SESSION["login"]."'");
	  for($i=0;$i<mssql_num_rows($char);$i++) {
		$pega = mssql_fetch_row($char);
		echo ''.$pega[0].'';
	}
	  ?></a> )</td>
                                    </tr>
                             
                            </table>
                        </div>
                        <div class="half">
                            <table width="100%">
                                <tr>
                                    <td width="5%"><img
                                                src="images/icons/gear.png"/>
                                    </td>
                                    <td width="40%">Usuarios Conectados</td>
                                    <td width="55%"><?php 
								   $on = mssql_num_rows(mssql_query("select * from memb_stat where connectstat > 0"));
								   if($on <= 1) { $pl = ""; } else{ $pl = "players"; }
								   ?> <?php echo $on; ?> <?php echo $pl; ?></td>
                                </tr>
                                <tr>
                                    <td><img
                                                src="images/icons/gear.png"/>
                                    </td>
                                    <td>Total de Contas</td>
                                    <td><?php echo mssql_num_rows(mssql_query("select * from memb_info")); ?>
                                        
                                    </td>
                                </tr>
                                <tr>
                                    <td><img
                                                src="images/icons/link.png"/>
                                    </td>
                                    <td>Total de Personagens</td>
                                    <td><?php echo mssql_num_rows(mssql_query("select * from character")); ?></td>
                                </tr>
                                <tr>
                                    <td><img
                                                src="images/icons/user.png"/>
                                    </td>
                                    <td>Personagens banidos</td>
                                    <td><?php echo mssql_num_rows(mssql_query("select * from character where ctlcode = 1")); ?></td>
                                </tr>
                            
                                    <tr>
                                        <td><img
                                                    src="images/icons/user.png"/>
                                        </td>
                                        <td>Contas banidas</td>
                                        <td><?php echo mssql_num_rows(mssql_query("select * from memb_info where bloc_code = 1")); ?></td>
                                    </tr>
                                
                            </table>
		
                            
                            
                        </div>
                        <div style="clear:both;"></div>
                        
                    </div>
                </div>
            </div>
             <a class="custom_button" href="javascript: void(0);" onclick="loading('?go=gehelp', 'menu');">GERENCIAR SUPORTE</a> | <a class="custom_button" href="javascript: void(0);" onclick="loading('?go=geserver', 'menu');">GERENCIAR SERVIDOR</a> | <a class="custom_button" href="javascript: void(0);" onclick="loading('?go=paineluser', 'conteudo');">PAINEL USER</a>
            
             | <a class="custom_button" href="paginas/logout.php" target="_parent">DESLOGAR-ME</a>
             
            <div class="box-style4" id="menu">
                <br>
                <h2 class="title">Escolha uma opcao administrativa acima.</h2>
               
            </div>
        </div>
    </div>
</div>




        
        
        <!--FIM MEIO-->
        <!--INICIO FOOTER-->
        </div>
        
        <? }} ?>