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

require_once "configs/sql_inject.php";
require_once "configs/sql_check.php";
require_once "configs/sql_protect.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>";
	}
}
?><!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=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
body { background-color:#FFFFFF; }
a { font-size:11px; color:#333333; text-decoration:none; font-family:"Tahoma"; }
a:hover { color:gray; text-decoration:underline;}
body,th,tr { font-size:11px; color:#333; font-family:"Tahoma" }
input { font-size:11px; color:#666; font-family:"Tahoma"; border:1px solid #999; }
select { font-size:11px; color:#666; font-family:"Tahoma"; border:1px solid #FFF; }
.submit { font-size:11px; color:#666; font-family:"Tahoma"; border:1px solid #999; background-color:;}

.style1 {
	color: #990000;
	font-weight: bold;
}
.quote {
	font-family: "Verdana";
	font-size: 10px;
	color: #000000;
	background-color: ;
	border: 1px solid #FFFFFF;
	padding: 7px;
}
</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>
<p><font color="#333333">
  <? if(!isset($_COOKIE['ckUserLogin'])) {
		echo '
		<table width="144" border="0" align="center" cellpadding="0" cellspacing="0">
		 <tr>
            </tr>
          <form name="frmpainel" method="post" onSubmit="CamposLogin();" action="" id="frmpainel">
		  <tr>
            <td width="144"><img src="imagens/seta.gif"> <font color="#333333">Login: </font><br>
                <input name="login" type="text" class="textbox" id="login" maxlength="16"></td>
            </tr>
          <tr>
            <td><img src="imagens/seta.gif"> <font color="#333333">Senha: </font><br>
              <input name="senha" type="password" class="textbox" id="senha" maxlength="16"></td>
            </tr>
          <tr>
		  <td><input name="prossegue_login" type="submit" class="button" class="submit" id="prossegue_login" value="LOGAR">  <input name="reset" type="reset"  value="LIMPAR" /></td>
            </tr>
			</form>
        </table>
		'; }
		elseif(isset($_COOKIE['ckUserLogin'])) {
		$login = $_COOKIE['ckUserLogin'];
		$senha = $_COOKIE['ckUserSenha'];
		$tipoconta = mssql_fetch_row(mssql_query("select vip,creditos from memb_info where memb___id='".$login."'"));
		switch($tipoconta[1]) {
			case 1: $sintaxe = "dia";
				break;
			case 0: $sintaxe = "dia";
				break;
			default: $sintaxe = "dias";
		}
		switch($tipoconta[0]) {
			case 0: $tipodeconta = "Free"; 
				break;
			case 1: $tipodeconta = "Vip";
				break;
			case 2: $tipodeconta = "Vip2";
				break;
			case 3: $tipodeconta = "Vip3";
				break;
			default : $tipodeconta = "Error";
		}
		echo '<table width="144" border="0" align="center" cellpadding="0" cellspacing="0">
		 <tr>
            </tr>
          <form name="frmpainel" method="post" onSubmit="CamposLogin();" action="" id="frmpainel">
		  <tr>
            <td width="144"><b><font color="#333333">Logado :</b> </font>
          <font color="#777777">'.$login.'</font></td>
            </tr>
          <tr>
            <td><font color="#333333"><b>Tipo :</b> </font>
             <font color="#777777">'.$tipodeconta.' - '.$tipoconta[1].'  '.$tipoconta[2].'  '.$tipoconta[3].'  '.$sintaxe.'</font></td>
            </tr>
			 <tr>
            <td>&nbsp;</td>
            </tr>
          <tr>
            <td><img src="imagens/icone_painel.jpg" width="21" height="19" /><a href="painel/painel.php" target="home"><font color=#333333><b>Painel </b><span class="style3">[Ver...]</span></font></a><br> <br> <img src="imagens/icone_logoff.jpg" width="21" height="19" /><a href="sair.php"><font color=#333333><b> Sair</b></font>
			<td></td>
            </tr>
			</form>
        </table>';
		}
		?>
</font></p>

</body>
</html>
