<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0032)http://localhost/news//index.php -->
<?php 
	include "cnn.php";
 	include "config/config_info.php";
 ?>
<HTML><HEAD><TITLE>Dados do Cadastro - </TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

</HEAD>
<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>

<BODY bgcolor="#222222" leftMargin=9 topMargin=9>
<div align="left">
  <h2>Dados de cadastro do Craft Mu</h2>
<br>
  <blockquote>
  <table width="447" border="0" cellpadding="0" cellspacing="0">
    <!--DWLayoutTable-->
    <tr>
      <td width="447" height="18" valign="top" class="style22" scope="col">   <span class="style24">
      <?php
$login = stripslashes($_POST['login']);
$name = stripslashes($_POST['name']);
$email = stripslashes($_POST['email']);
$idnumb = stripslashes($_POST['idnumb']);
$pw = stripslashes($_POST['pw']);
$cpw = stripslashes($_POST['cpw']);
$sques = stripslashes($_POST['squest']);
$sansw = stripslashes($_POST['sansw']);
$sql_email_check = mssql_query("SELECT mail_addr FROM MEMB_INFO WHERE mail_addr='$email'"); 
$sql_username_check = mssql_query("SELECT memb___id FROM MEMB_INFO WHERE memb___id='$login'"); 
$email_check = mssql_num_rows($sql_email_check); 
$username_check = mssql_num_rows($sql_username_check); 

if (($email_check > 0) || ($username_check > 0) || empty($login) || empty($name) || empty($email) || empty($idnumb) || empty($pw) || empty($cpw) || empty($sques) || empty($sansw)) 
{ 
    echo "Aten&ccedil;&atilde;o: <br> <br />";
	
	if (empty($login) || empty($name) || empty($email) || empty($idnumb) || empty($pw) || empty($cpw) || empty($sques) || empty($sansw))
{ 
echo "Por favor preencha todos os campos";
}

    elseif($email_check > 0){ 
        echo "'$email' esse e-mail ja esta sendo usando por outro membro.<br />"; 
        $Error=1;
    } 
    elseif ($username_check > 0)
	{ 
        echo "'$login' esse login ja esta sendo usado por outro membro.<br />"; 
         $Error=1;
    } 
elseif ($pw != $cpw) 
{
	echo "<br />As Senhas devem ser iguais.";  $Error=1;
}

}
else
{
$msquery2 = "SET IDENTITY_INSERT MEMB_INFO ON";
$msquery3 = "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) VALUES ('1','$login','$pw','$name', '1','1234','11111','$idnumb','12343','$email','$email','$sques','$sansw','1','2003-11-23','2003-11-23','2003-11-23','2003-11-23','1','0','1')";
$msquery4 = "INSERT INTO VI_CURR_INFO (ends_days,chek_code,used_time,memb___id,memb_name,memb_guid,sno__numb,Bill_Section,Bill_value,Bill_Hour,Surplus_Point,Surplus_Minute,Increase_Days )  VALUES ('2005','1',1234,'$login','$name',1,'7','6','3','6','6','2003-11-23 10:36:00','0' )";
$msresults= mssql_query($msquery2);
$msresults= mssql_query($msquery3);
$msresults= mssql_query($msquery4);
echo "<p align='center'>Conta criada com sucesso. <br> Obrigado por se cadastrar no $nomedomu<br></p>
 <br><p align='left'>Login: $login<br>
          Nome:  $name <br>
          E-mail: $email<br>
          ID Numero: $idnumb<br>
          Senha: $pw<br>
          Pergunta secreta: $sques<br>
          Resposta secreta: $sansw </p>";
}
?>
      </span></td>
      <a href="index.php?go=cadastro2">Voltar</a>
    </tr>
  </table>
  </blockquote>
  <span class="style21"><br>
  </span><span class="style3"><br>
  </span><br>
  <br>
<span class="style3"></span></div>
</BODY>
</HTML>
