<? session_start();
include 'cnn.php';
include 'config/conf_extras.php';
@$login = $_SESSION['login'];
@$senha = $_SESSION['senha'];
if(!isset($_SESSION['login'])) { echo "Para acessar essa pagina é preciso estar logado!"; }
else{
$Gms = mssql_fetch_row(mssql_query("select painelgm from memb_info where memb___id='".$login."'"));
if($Gms[0] <= 0) { echo "Você não faz parte da Administração"; }
else{  ?>
<html>
<head>
<SCRIPT language=JavaScript>
var message="";
function clickIE()
{
    if (document.all)
    {
        (message);
        return false;
    }
}
function clickNS(e)
{
    if(document.layers||(document.getElementById&&!document.all))
    {
        if (e.which==2||e.which==3)
        {
            (message);
            return false;
        }
    }
}
if (document.layers)
{
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickNS;
}
else
{
    document.onmouseup=clickNS;
    document.oncontextmenu=clickIE;
}
document.oncontextmenu=new Function("return false")
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Editar Personagem - Painel ADM</title>
</head>

<body>
<h1>Editar Char</h1>
</body>

</html>
		
<?php
	$nome= stripslashes($_POST['nome']);
	
		$checa_char = mssql_query("SELECT * FROM Character WHERE Name='$nome'");
		$dados = mssql_fetch_array($checa_char);
		
		if (empty($nome)) {
			echo "<script>alert('Você esqueceu o Campo Nome em Branco.')</script>";
			echo "<script>window.location='?i=1539ffbedfe&in=9c508c0d17a'</script>";
		} elseif (mssql_num_rows($checa_char) == 0) {
			echo "<script>alert('Esse Personagem não Existe, re-digite.')</script>";
			echo "<script>window.location='?i=1539ffbedfe&in=9c508c0d17a'</script>";
		} else {
			if ($dados['Class'] == 0) { $classe0 = 'checked'; }
			if ($dados['Class'] == 1) { $classe1 = 'checked'; }
			if ($dados['Class'] == 2) { $classe2 = 'checked'; }
			if ($dados['Class'] == 16) { $classe16 = 'checked'; }
			if ($dados['Class'] == 17) { $classe17 = 'checked'; }
			if ($dados['Class'] == 18) { $classe18 = 'checked'; }
			if ($dados['Class'] == 32) { $classe32 = 'checked'; }
			if ($dados['Class'] == 33) { $classe33 = 'checked'; }
			if ($dados['Class'] == 34) { $classe34 = 'checked'; }
			if ($dados['Class'] == 48) { $classe48 = 'checked'; }
			if ($dados['Class'] == 49) { $classe49 = 'checked'; }
			if ($dados['Class'] == 64) { $classe64 = 'checked'; }
			if ($dados['Class'] == 65) { $classe65 = 'checked'; }
			if ($dados['Class'] == 80) { $classe80 = 'checked'; }
			if ($dados['Class'] == 81) { $classe81 = 'checked'; }
			if ($dados['Class'] == 82) { $classe82 = 'checked'; }

			if ($dados['PkLevel'] == 1) { $pkstatus1 = "selected"; }
			if ($dados['PkLevel'] == 2) { $pkstatus2 = "selected"; }
			if ($dados['PkLevel'] == 3) { $pkstatus3 = "selected"; }
			if ($dados['PkLevel'] == 4) { $pkstatus4 = "selected"; }
			if ($dados['PkLevel'] == 5) { $pkstatus5 = "selected"; }
			if ($dados['PkLevel'] == 6) { $pkstatus6 = "selected"; }
			
			if ($dados['MapNumber'] == 0) { $mapa0="selected"; }
			if ($dados['MapNumber'] == 1) { $mapa1="selected"; }
			if ($dados['MapNumber'] == 2) { $mapa2="selected"; }
			if ($dados['MapNumber'] == 3) { $mapa3="selected"; }
			if ($dados['MapNumber'] == 4) { $mapa4="selected"; }
			if ($dados['MapNumber'] == 5) { $mapa5="selected"; }
			if ($dados['MapNumber'] == 6) { $mapa6="selected"; }
			if ($dados['MapNumber'] == 7) { $mapa7="selected"; }
			if ($dados['MapNumber'] == 8) { $mapa8="selected"; }
			if ($dados['MapNumber'] == 10) { $mapa10="selected"; }
			if ($dados['MapNumber'] == 24) { $mapa24="selected"; }
			if ($dados['MapNumber'] == 25) { $mapa25="selected"; }
			if ($dados['MapNumber'] == 26) { $mapa26="selected"; }
			if ($dados['MapNumber'] == 27) { $mapa27="selected"; }
			if ($dados['MapNumber'] == 28) { $mapa28="selected"; }
			if ($dados['MapNumber'] == 29) { $mapa29="selected"; }
			if ($dados['MapNumber'] == 30) { $mapa30="selected"; }
			if ($dados['MapNumber'] == 31) { $mapa31="selected"; }
			if ($dados['MapNumber'] == 33) { $mapa33="selected"; }
			if ($dados['MapNumber'] == 34) { $mapa34="selected"; }

			if ($dados['CtlCode'] == 0) { $ctlcode0 = 'checked';}
			if ($dados['CtlCode'] == 1) { $ctlcode1 = 'checked';}
			if ($dados['CtlCode'] == 8) { $ctlcode8 = 'checked';}
			if ($dados['CtlCode'] == 32) { $ctlcode32 = 'checked';}

			echo "<div align='center'><b>&nbsp;Personagem:</b> $nome<br><br> 
<form name='form2' method='post' action='?go=painel/editchar2'>
					 <table width='100%' height='174' border='0' cellpadding='0' cellspacing='0'>
    <tr> 
      <td width='823'><table width='100%' border='0' cellspacing='2' cellpadding='0'>
          <tr> 
            <td width='18%'>Nome: </td>
            <td width='82%'><input name='nome' type='text' class='input03' id='nome' value='$nome' size=10 disabled='disabled'><input name='nome' type='hidden' class='input03' id='nome' value='$nome' size=10 hidden=hidden></td>
          </tr>
          <tr> 
            <td width='18%'>Level: </td>
            <td width='82%'><input name='level' type='text' class='input03' id='level' value='$dados[cLevel]' size=10></td>
          </tr>
          <tr> 
            <td width='18%'>Resets: </td>
            <td width='82%'><input name='resets' type='text' class='input03' id='resets' value='$dados[Resets]' size=10></td>
          </tr>
          <tr> 
            <td>Pontos: </td>
            <td><input name='pontos' class='input03' type='text' id='pontos' value='$dados[LevelUpPoint]' size=10></td>
          </tr>
          <tr> 
            <td>Experiencia: </td>
            <td><input name='exp' class='input03' type='text' id='exp' value='$dados[Experience]' size=10></td>
          </tr>
          <tr> 
            <td>Zen: </td>
            <td><input name='zen' class='input03' type='text' id='zen' value='$dados[Money]' size=10></td>
          </tr>
          <tr> 
            <td>For&ccedil;a: </td>
            <td><input name='forca' class='input03' type='text' id='forca' value='$dados[Strength]' size=10></td>
          </tr>
          <tr> 
            <td>Agilidade: </td>
            <td><input name='agi' class='input03' type='text' id='agi' value='$dados[Dexterity]' size=10></td>
          </tr>
          <tr> 
            <td>Vitalidade: </td>
            <td><input name='vit' class='input03' type='text' id='vit' value='$dados[Vitality]' size=10></td>
          </tr>
          <tr> 
            <td>Energia: </td>
            <td><input name='ene' class='input03' type='text' id='ene' value='$dados[Energy]' size=10></td>
          </tr>
          <tr> 
            <td>Command: </td>
            <td><input name='cmd' class='input03' type='text' id='cmd' value='$dados[$commanddlcoluna]' size=10></td>
          </tr>
		  <tr> 
            <td>Assassinatos: </td>
            <td><input name='pkcount' class='input03' type='text' id='pkcount' value='$dados[PkCount]' size=10></td>
          </tr>
		  <tr>
		  <td>PK Level: </td>
		  <td><select name='pk' class='input03' id='pk'>
                <option value='1' $pkstatus1>Hero 2</option>
                <option value='2' $pkstatus2>Hero 1</option>
                <option value='3' $pkstatus3>Normal</option>
                <option value='4' $pkstatus4>PlayerK 1</option>
                <option value='5' $pkstatus5>PlayerK 2</option>
                <option value='6' $pkstatus6>Murder</option>
              </select></td>
		 </tr>
		 <tr>
		 <td>Mapa: </td>
		 <td><select name='mapa' class='input03' id='mapa'>
             <option value='0' $mapa0>Lorencia</option>
             <option value='1' $mapa1>Dungeon</option>
             <option value='2' $mapa2>Davias</option>
             <option value='3' $mapa3>Noria</option>
             <option value='4' $mapa4>Losttower</option>
             <option value='5' $mapa5>Exile</option>
             <option value='6' $mapa6>Stadium</option>
             <option value='7' $mapa7>Atlans</option>
             <option value='8' $mapa8>Tarkan</option>
             <option value='10' $mapa10>Icarus</option>
             <option value='24' $mapa24>Kalima</option>
             <option value='25' $mapa25>Kalima 2</option>
             <option value='26' $mapa26>Kalima 3</option>
			 <option value='27' $mapa27>Kalima 4</option>
			 <option value='28' $mapa28>Kalima 5</option>
			 <option value='29' $mapa29>Kalima 6</option>
             <option value='30' $mapa30>V. of Loren</option>
             <option value='31' $mapa31>L. of Trial</option>
             <option value='33' $mapa33>Aida</option>
             <option value='34' $mapa34>CryWolf</option>
             </select></td></tr>
		  <tr> 
            <td>Cord X: </td>
            <td><input name='cordx' class='input03' type='text' id='cordx' value='$dados[MapPosX]' size=10></td>
          </tr>
		  <tr> 
            <td>Cord Y: </td>
            <td><input name='cordy' class='input03' type='text' id='cordy' value='$dados[MapPosY]' size=10></td>
          </tr>
		  		 <td>Classe: </td>
		 <td><select name='classe' class='input03' id='classe'>
             <option value='0' $classe0>Dark Wizard</option>
             <option value='1' $classe1>Soul Master</option>
             <option value='16' $classe16>Dark Knight</option>
             <option value='17' $classe17>Blade Knight</option>
             <option value='32' $classe32>Elf</option>
             <option value='33' $classe33>Muse Elf</option>
             <option value='48' $classe48>M. Gladiator</option>
             <option value='64' $classe64>Dark Lord</option>
             </select></td></tr>
			 		 <tr>
		 <td>GM: </td>
		 <td><select name='GM' class='input03' id='GM'>
             <option value='0' $ctlcode0>Normal</option>
             <option value='1' $ctlcode1>Banido</option>
             <option value='32' $ctlcode32>Game Master</option>
             <option value='8' $ctlcode8>Game Master / INVISIVEL</option>
             </select></td></tr>
		</table></td>
      <td width='180'>
        <table width='147' border='0' cellspacing='10' cellpadding='0'>
          </table></td>
    </tr>
  </table>
  <br><div align='center'><input name='Submit' type='submit' class='submit' value='Editar'></div></form>";
		
		}
		}
}
?>