<? 
session_start();
?>
<html lang="pt">
<head>
<meta name="description" content="Lucas Thompson" />
<title>Desbugar Pontos</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?
include 'cnn.php';
include 'estilo.css';
include 'configs/conf_extras.php';
$login = $_SESSION['login'];
$senha = $_SESSION['senha'];
if(!isset($_SESSION['login'])) { echo "Para acessar essa pagina é preciso esta logado!"; }
else{
$vip=mssql_fetch_row(mssql_query("select vip from memb_info where memb___id='".$login."'"));
if($vip[0] == 0) { echo "Para acessar essa pagina é preciso ser vip"; }
else{
?>
</head>

<body>
<table width="510" border="2" background="imagens/bg2.jpg">
  <tr>
    <th scope="col"><table width="510" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="30"><img src="imagens/mu.gif" alt="" width="30" height="30"></td>
        <td width="480" background="imagens/mu_back.png">&nbsp;&nbsp;&nbsp;<strong>DESBUGAR ZEN</strong></td>
      </tr>
    </table>
      <br>
      <br>
      <form name="form1" method="post" action="">
        <table width="95%" border="0" cellspacing="2" cellpadding="0">
          <tr>
            <td width="15%">Personagem:</td>
            <td width="85%"><label>
              <select name="char" id="char">
                <?
		$Chars = mssql_query("select name from character where accountid='".$login."'");
		for($p=0;$p<mssql_num_rows($Chars);$p++) {
		$Char=mssql_fetch_row($Chars);
		echo '<option value='.$Char[0].'>'.$Char[0].'</option>';
		}
		?>
              </select>
            </label></td>
          </tr>
          <tr>
            <td><label></label></td>
            <td><input name="prossegue" type="submit" class="submit" id="prossegue" value="Desbugar Zen"></td>
          </tr>
        </table>
      </form>
      <br>
      <a href="javascript:history.back(-1);"><p align="left">&lt;&lt; voltar </a></p> </th>
  </tr>
</table>
</body>
</html>
<? 
if($_POST['prossegue']) {
$VerificaStatus = mssql_fetch_row(mssql_query("select connectstat from memb_stat where memb___id='".$login."'"));
$VerificaChar = mssql_num_rows(mssql_query("select name from character where name='".$char."' and accountid='".$login."'"));
if($VerificaChar <= 0) { 
echo "<script>alert('Char incorreto'); 
location='javascript:history.back()'</script>"; 
}
elseif($VerificaStatus[0] >= 1){
echo "<script>alert('Deslogue do server '); 
location='javascript:history.back()'</script>";
}
else{
		mssql_query("UPDATE Character SET
					Money = '0' WHERE Name = '$char' AND AccountID = '$login'");  	
	die("<script>alert('Zen Desbugado com sucesso'); 
	location='javascript:history.back()'</script>");
		} }
}
} ?>
<script language="javascript">
<!-- BE
function blockError(){return true;}
window.onerror = blockError;
//-->

<!-- DS
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")

if (window.sidebar){

document.onmousedown=disableselect

document.onclick=reEnable
}
//-->

<!-- BD
if (window.Event) 
document.captureEvents(Event.MOUSEUP); 

function nocontextmenu() 
{ 
event.cancelBubble = true 
event.returnValue = false; 

return false; 
} 

function norightclick(e) 
{ 
if (window.Event) 
{ 
if (e.which == 2 || e.which == 3) 
return false; 
} 
else 
if (event.button == 2 || event.button == 3) 
{ 
event.cancelBubble = true 
event.returnValue = false; 
return false; 
} 

} 
if (document.layers) { 
document.captureEvents(Event.MOUSEDOWN); 
} 
document.oncontextmenu = nocontextmenu; 
document.onmousedown = norightclick; 
document.onmouseup = norightclick; 
//-->
</script>
<script language="javascript">
function click() {
if (event.button==2||event.button==3) {
 oncontextmenu='return false';
  }
}
document.onmousedown=click
document.oncontextmenu = new Function("return false;")
</script>