<?php
include 'cnn.php';
include 'estilo.css';
include 'configs/conf_extras.php';
include 'configs/conf_reset.php';
include 'configs/conf_opcoes.php';
$login = stripslashes($_POST['login']);
$oldpwd = stripslashes($_POST['oldpwd']);
$newpwd = stripslashes($_POST['newpwd']);
$email = stripslashes($_POST['email']);	
?>

<html><style type="text/css">
<!--
a:link {
	color: #2180BC;
	text-decoration: none;
}
a:visited {
	color: #2180BC;
	text-decoration: none;
}
a:hover {
	text-decoration: none;
}
a:active {
	text-decoration: none;
}
.style1 {
	color: #88ac0b;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px;
.style9 {
	font-size: 16;
	font-weight: bold;
}
.style11 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
}
body {
	background-color: #B4B6C9;
}
-->
</style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table width="500" border="1" background="../imagens/bg2.jpg">
  <tr>
    <th scope="col"><div align="left">
      <table width="520" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="30"><img src="imagens/mu.gif" alt="" width="30" height="30"></td>
          <td width="584" background="imagens/mu_back.png">&nbsp;&nbsp;&nbsp;<strong>ALTERAR SENHA 2/2</strong></td>
        </tr>
      </table>
    </div>
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><span class="style11">
            <?  
$sql_vip_check = mssql_query("SELECT vip FROM MEMB_INFO WHERE memb___id='$login'");
list($vip_code) = mssql_fetch_array($sql_vip_check);

$sql_username_check = mssql_query("SELECT memb___id FROM MEMB_INFO WHERE memb___id='$login'"); 
$username_check = mssql_num_rows($sql_username_check); 


$sql_mail_check = mssql_query("SELECT mail_addr FROM MEMB_INFO WHERE mail_addr='$email' and memb___id='$login'"); 
$sql_pw_check = mssql_query("SELECT memb__pwd, fpas_ques FROM MEMB_INFO WHERE fpas_ques='$oldpwd' and memb___id='$login' and fpas_answ='$newpwd' "); 
$sql_pw_get = mssql_query("SELECT memb__pwd, fpas_ques FROM MEMB_INFO WHERE memb___id='$login' "); 
$pw_check = mssql_num_rows($sql_pw_check);
$pw_retrieval = mssql_fetch_row( $sql_pw_get );
$mail_check = mssql_num_rows($sql_mail_check);
 

if (empty($login) || empty($newpwd) || empty($oldpwd) || empty($email)) {
    echo "Preencha todos os campos.<br>";
}

elseif ($username_check <= 0)
	{ 
        echo "Sua conta n&atilde;o existe em nosso banco de dados.<br>"; 
	}

elseif ($pw_check <= 0)
	{ 
        echo 	"Sua pergunta secreta esta errada.<br>"; }
		
elseif ($vip_code == 0){
echo "Desculpe, mas este recurso s&oacute; pode ser utilizado por contas VIP.<br>"; }
	
	
elseif ($mail_check <= 0)
    { 
    echo "Seu e-mail esta errado!<br>
    "; 
    }

else 
	{	
	echo "Sua senha &eacute; |$pw_retrieval[0]|<br>
	Vá no Painel de Controle e mude sua Senha!!!";
	}


?>
          </span></td>
        </tr>
      </table></th>
  </tr>
</table>
</body>
</html>