<head>
<meta name="description" content="NunaH" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?
session_start();
$login = $_SESSION['login'];
$senha = $_SESSION['senha'];
if(!(isset($_SESSION['login']) OR isset($_SESSION['senha']))) { 
echo "<table width='100%' height='41' cellpadding='0' cellspacing='0'>
  <tr>
    <td height='25' valign='middle' background='images/menu_meio.jpg'><table width='99%' height='18' cellpadding='0' cellspacing='0'>
      <tr>
        <td width='6%' valign='middle'>&nbsp;</td>
        <td width='94%' height='16' valign='middle'><strong>Erro</strong></td>

      </tr>
    </table></td>
  </tr><tr>
        <td width='94%' height='13' valign='top'><table width='100%' border='0' align='center' cellpadding='0' style='border-collapse: collapse; border: 1px dashed #FF0000; padding: 0'>
          <tr>
            <td height='19' bgcolor='#FFD2D2'><div align='left' class='style24'>- Para acessar essa página é preciso estar logado.
</div></td>

        </tr>
        </table></td>
        </tr>
        </table></td>";
}
else{
$vip=mssql_fetch_row(mssql_query("select vip from memb_info where memb___id='".$login."'"));
if($vip[0] == 0) { 
echo "<table width='100%' height='41' cellpadding='0' cellspacing='0'>
  <tr>
    <td height='25' valign='middle' background='images/menu_meio.jpg'><table width='99%' height='18' cellpadding='0' cellspacing='0'>
      <tr>
        <td width='6%' valign='middle'>&nbsp;</td>
        <td width='94%' height='16' valign='middle'><strong>Erro</strong></td>

      </tr>
    </table></td>
  </tr><tr>
        <td width='94%' height='13' valign='top'><table width='100%' border='0' align='center' cellpadding='0' style='border-collapse: collapse; border: 1px dashed #FF0000; padding: 0'>
          <tr>
            <td height='19' bgcolor='#FFD2D2'><div align='left' class='style24'>- Para acessar essa página é preciso ser VIP.
</div></td>

        </tr>
        </table></td>
        </tr>
        </table></td>";
}
else{
?>
<?
$query_dados = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id = '$login'");
$dados = mssql_fetch_array($query_dados);
?>
<style type="text/css">
<!--
.style3 {color: #666666;
	font-weight: bold;
}
.style24 {	color: #BB0000;
	font-weight: bold;
}
-->
</style>
</head>

<body>

<table width="100%" height="16" cellpadding="0" cellspacing="0">

  <tr>
    <td height="14" valign="middle"><h1><strong>Alterar Informa&ccedil;&otilde;es</strong></h1>
      <table width="100%" height="15" cellpadding="0" cellspacing="0">
      <tr>
        <td width="94%" height="13" valign="top"><form name="form1" method="post" action="">
              <table width="100%" border="0" cellspacing="2" cellpadding="0">
                <tr> 
                  <td width="20%">Nome: </td>
                  <td width="80%"><label> 
                    <input name="nome" type="text" id="nome" value="<?=$dados[memb_name]?>" maxlength="50">
                    </label></td>
                </tr>
                <tr> 
                  <td width="20%">Pergunta Secreta:</td>
                  <td width="80%"><label> 
                    <input name="ques" type="text" id="ques" value="<?=$dados[fpas_ques]?>" maxlength="50">
                    </label></td>
                </tr>
                <tr> 
                  <td width="20%">Resposta Secreta:</td>
                  <td width="80%"><label> 
                    <input name="answ" type="text" id="answ" value="<?=$dados[fpas_answ]?>" maxlength="50">
                    </label></td>
                </tr>
                <tr> 
                  <td width="20%">ID N&uacute;mero: </td>
                  <td width="80%"><label> 
                    <input name="deta" type="text" id="deta" value="<?=$dados[addr_deta]?>" maxlength="50">
                    </label></td>
                </tr>
                <tr> 
                  <td><label></label></td>
                  <td><input name="prossegue" type="submit" class="submit" id="prossegue" value="Alterar"></td>
                </tr>
              </table>
</form></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
<? 
if($_POST['prossegue']) {
$nome = $_POST['nome'];
$ques = $_POST['ques'];
$answ = $_POST['answ'];
$deta = $_POST['deta'];
$VerificaStatus = mssql_fetch_row(mssql_query("select connectstat from memb_stat where memb___id='".$login."'"));
if($VerificaStatus[0] >= 1){
echo "<script>alert('Saia da conta'); 
location='javascript:history.back()'</script>";	
}
else {
mssql_query("update memb_info set memb_name='".$nome."', fpas_ques='".$ques."', fpas_answ='".$answ."', addr_deta='".$deta."' where memb___id='".$login."'");
echo "<script>alert('Informações alterada com sucesso.'); 
	location='javascript:history.back()'</script>";	
} } } 
} ?>