<? session_start();
include "../configs/config.php";
include "../configs/includecrypt.inc";
include "../configs/functionbb.php";
include "../configs/js.js";

require_once "../configs/sql_check.php";


$bDestroy_session = TRUE;
$url_redirect = '../index.php';

// querys //

$idnoticia = $_GET['id'];
$PegaNoticia = mssql_query("SELECT Titulo,Data,Noticia,Por,Id,Tipo FROM Noticias WHERE Id='".$idnoticia."'");
$Exibe = mssql_fetch_row($PegaNoticia);

$Contas=mssql_fetch_row(mssql_query("select count(*) from memb_info"));
$Chares=mssql_fetch_row(mssql_query("select count(*) from character"));
$Jogando=mssql_fetch_row(mssql_query("select count(*) from memb_stat where connectstat>0"));
$Vips=mssql_fetch_row(mssql_query("select count(*) from memb_info where vip=1"));
$Guilds=mssql_fetch_row(mssql_query("select count(*) from guild"));
$Pks=mssql_fetch_row(mssql_query("select count(*) from character where pklevel>3"));
$Herois=mssql_fetch_row(mssql_query("select count(*) from character where pklevel<3"));
$L350=mssql_fetch_row(mssql_query("select count(*) from character where clevel=350"));
$Lorencia=mssql_fetch_row(mssql_query("select count(*) from character where mapnumber=0"));
$Stadium=mssql_fetch_row(mssql_query("select count(*) from character where mapnumber=6"));
if($_POST['prossegue_login']) {
$login = $_POST['login'];
$senha = $_POST['senha'];
$VerificaLogin = mssql_num_rows(mssql_query("select memb___id from memb_info where memb___id='".$login."'"));
$VerificaSenha = mssql_num_rows(mssql_query("select memb__pwd from memb_info where memb__pwd='".$senha."' and memb___id='".$login."'"));

	if(empty($login) || empty($senha)) {
	echo "<script>alert('Preencha todos os campos'); 
	location='javascript:history.back()'</script>";
	}
	elseif($VerificaLogin <= 0) {
	echo "<script>alert('Login ou Senha incorreto'); 
	location='javascript:history.back()'</script>";
	}
	elseif($VerificaSenha <= 0) {
	echo "<script>alert('Login ou Senha incorreto'); 
	location='javascript:history.back()'</script>";
	}
	else {
	setcookie("ckUserLogin",$login);
	setcookie("ckUserSenha",$senha);
	echo "<script>location='?i=painel'</script>";
	}
}
?>
<link rel="stylesheet" href="../images/Techmania.css" type="text/css" />
<? 
$login = $_COOKIE['ckUserLogin'];
$senha = $_COOKIE['ckUserSenha'];
if(!isset($_COOKIE['ckUserLogin'])) { echo "Para acessar essa pagina é preciso estar logado!"; }
else{
$vip=mssql_fetch_row(mssql_query("select vip from memb_info where memb___id='".$login."'"));


if($in == 'resetar') { include 'resetar.php'; } 
if($in == 'pontos') { include 'pontos.php'; } 
if($in == 'pk') { include 'pk.php'; }
if($in == 'senha') { include 'senha.php'; } 
if($in == 'classe') { include 'classe.php'; } 
if($in == 'nick') { include 'nick.php'; } 
if($in == 'teleportar') { include 'teleport.php'; }
if($in == 'desbugar') { include 'desbugar.php'; }

?>
<style type="text/css">
<!--
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #333333;
}
a:link {
	color:#CCC;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #CCC;
}
a:hover {
	text-decoration: none;
	color: #FF0000;
}
a:active {
	text-decoration: none;
	color: #FF0000;
}
.style1 {
	color: #FF0000;
	font-weight: bold;
}
a {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
}
.style2 {font-size: 12px}
.style4 {color: #FFFFFF}
-->
</style>
<script>
/*
	Script desenvolvido por Leandro Martins - leandro.martins@sankhya.com.br
	Não permite seleção de campos especificados.
*/
var tagsAbertas =["input", "textarea", "select", "div"]; // CAMPOS QUE NAO SERAM BLOQUEADOS
tagsAbertas = tagsAbertas.join("|");

function fechaCamposFF(e){
var elemento = (e.target)?e.target:e.srcElement;
	if (tagsAbertas.indexOf(elemento.tagName.toLowerCase())==-1)
		return false;
}

function abreCamposFF(){
return true
}

function fechaCamposIE(){
var elemento = event.srcElement;
	if(tagsAbertas.indexOf(elemento.tagName.toLowerCase()) == -1)
		document.onselectstart = new Function ("return false");
}

function abreCamposIE(){
var elemento = event.srcElement;
	if(tagsAbertas.indexOf(elemento.tagName.toLowerCase()) == -1){
		document.onselectstart = new Function ("return false");
	}else{
		document.onselectstart = new Function ("return true");
	}
}

if (typeof document.onselectstart != "undefined"){
document.onmousedown	=	fechaCamposIE;
document.onmouseup		=	abreCamposIE;
document.onselectstart  = new Function ("return false");
}else{
document.onmousedown	=	fechaCamposFF;
document.onmouseup		=	abreCamposFF;
}
</script>
<script language="JavaScript">
 function blockError(){return true;}
 window.onerror = blockError;
 </script>
<script language=JavaScript>
 function disableselect(e) {
    return false
 } 
 function reEnable() {
    return true
 }
 //if IE4+
 document.onselectstart=new Function ("return false")
 //if NS6
 if (window.sidebar) { 
    document.onmousedown=disableselect
    document.onclick=reEnable
 }
 </script>
<SCRIPT language=JavaScript>
<!--

var message="Botão Direito Desativado";


function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// --> 
</SCRIPT>


<script>
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}
function mouseDown(e) {
var shiftPressed=0;
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape")
shiftPressed=(e.modifiers-0>3);
else shiftPressed=event.shiftKey;
if (shiftPressed) {
alert ('Shift esta desabilitado.')
return false;
}
}
return true;
}
if (parseInt(navigator.appVersion)>3) {
document.onmousedown = mouseDown;
if (navigator.appName=="Netscape")
document.captureEvents(Event.MOUSEDOWN);
}
 function blockError(){return true;}
 window.onerror = blockError;
 </script>
 <script language=JavaScript>
 function disableselect(e)
 {
    return false
 }
 function reEnable()
 {
    return true
 }
 document.onselectstart=new Function ("return false")
 if (window.sidebar)
 {
    document.onmousedown=disableselect
    document.onclick=reEnable
 }

var mensagem="Botão Direito Desativado";//protege o botao direito do mouse
function click(mouse) {
  if (document.all) {
     if (event.button==2||event.button==3) {
        alert(mensagem);
        return false;
     }
  }
  if (document.layers) {
     if (mouse.which == 3) {
        alert(mensagem);
        return false;
     }
  }
}
document.onmousedown=click;
document.onkeydown=keypressed;

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 
function ss(id) {


var left = 50;
var top = 50;

window.open('modulos/outros/verscreenshot.php?id='+id+'','SS', 'width=802, height=604, top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, LOCATION=NO, directories=no, menubar=no, RESISABLE=NO, fullscreen=no');

}
</script></head>
<body>
<LINK REL="StyleSheet" HREF="../barra.css" TYPE="text/css">
<span class="style2"><strong style="color: #FF0000">Seu Painel de Controle :</strong></span>
<form name="form1" method="post" action="">
  <span class="style2"><br />
  </span>
  <div align="center">
    <table width="95%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="21" bgcolor="#333333"><div align="left" class="style4"><font size="2"><strong>Nome</div></td>
        <td height="21" bgcolor="#333333"><div align="left" class="style4"><font size="2"><strong>Level</div></td>
        <td height="21" bgcolor="#333333"><div align="left" class="style4"><font size="2"><strong>Resets</div></td>
       <td height="21" bgcolor="#333333"><div align="left" class="style4"><font size="2"><strong>Pontos</div></td>
        <td bgcolor="#F4F4F4"><div align="left"><font size="2"><strong></div></td>
      </tr>
      <?
  $Personagens = mssql_query("select name,clevel,resets,leveluppoint,resets from character where accountid='".$login."'");
  for($i=0;$i<mssql_num_rows($Personagens);$i++) {
  $MostraP = mssql_fetch_row($Personagens);
  echo '
   <tr>
    <td><div align="left"><font color="#fff">'.$MostraP[0].'</font></div></td>
    <td><div align="left">'.$MostraP[1].'</div></td>
	<td><div align="left"><font color="#FF6600">'.$MostraP[2].'</font></div></td>
    
	<td><div align="left"><font color="#339900"><b>'.$MostraP[3].'</b></font></div></td>
  </tr>
  	   ';
  }
  ?>
    </table>
    <br>
    <strong style="color: #FFF">Op&ccedil;&otilde;es:</strong> <br>
    <table width="95%" border="0" cellspacing="0" cellpadding="0">
      <? if($mostraroptreset == 1) { 
  ?>
          <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=resetar" >Resetar</a></td>
    </tr>
      <? }else echo ''; ?>
      <? if($mostraroptresetao == 1) {
   ?>
      <? }else echo ''; ?>
      <tr>
        <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=pontos" >Distribuir Pontos</a></td>
    </tr>
      <tr>
        <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=senha" >Alterar Senha</a></td>
    </tr>
      <?
  if($vip[0] == 1) { 
  ?>
      <tr>
        <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=pk" >Limpar Pk </a></td>
    </tr>
      <tr>
        <td height="21" bgcolor="#FFFFFF"><a href="?i=painel&in=classe" >Mudar Classe </a></td>
    </tr>
      <tr>
        <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=nick" >Mudar Nick </a></td>
    </tr>
      <tr>
        <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=teleportar" >Teleportar</a></td>
    </tr>
      <tr>
        <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=desbugar" >Desbugar Pontos </a></td>
    </tr>
      <? }else{ echo''; } ?>
    </table>
    <table width="95%" border="0" cellspacing="0" cellpadding="0">
      </tr>
      
      <?
  if($vip[0] == 2) { 
  ?>
      <tr>
        <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=pk" >Limpar Pk </a></td>
    </tr>
      <tr>
        <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=classe" >Mudar Classe </a></td>
    </tr>
      <tr>
        <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=nick" >Mudar Nick </a></td>
    </tr>
      <tr>
        <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=teleportar" >Teleportar</a></td>
    </tr>
      <tr>
        <td bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=desbugar" >Desbugar Pontos </a></td>
    </tr>
      <? }else{ echo''; } ?>
    </table>
    <table width="95%" border="0" cellspacing="0" cellpadding="0">
      </tr>
      
      <?
  if($vip[0] == 3) { 
  ?>
      <tr>
        <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=pk" >Limpar Pk </a></td>
    </tr>
      <tr>
        <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=classe" >Mudar Classe </a></td>
    </tr>
      <tr>
        <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=nick" >Mudar Nick </a></td>
    </tr>
      <tr>
        <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=teleportar" >Teleportar</a></td>
    </tr>
      <tr>
        <td height="21" bgcolor="#0C0C0C" style="color: #CCC"><a href="?i=painel&in=desbugar" >Desbugar Pontos </a></td>
    </tr>
      <? }else{ echo''; } ?>
    </table>
  </div>
  <p align="center">&nbsp;</p>
  <p align="center">&nbsp;</p>
</form>
</body>
</html>
<? } ?>