<?
include("config.php");
	header("Content-Type: text/html;  charset=iso-8859-1",true);
if(!$_SESSION['paineladm']){ include("logar.php"); die(); } ?>
<html>
<head>
<title><?=$titulo_pg;?></title>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<div align="center"><? if(!isset($_GET['login']) && !isset($_GET['desejo'])){?>
  <p>Login a ser Removido!:
    <select id="login">
      <option value="">Selecione Login</option>
	  <?
	$q = mssql_query("Select * From MEMB_INFO WHERE vip>0");
	for($i=1;$i<=mssql_num_rows($q);$i++){
	$a=mssql_fetch_array($q);
print("<option value=\"" .$a['memb___id']. "\">" .$a['memb___id']. "</option>"); }?>
      </select>  
  </p>
  <p>
    <input type="submit" name="Submit" value="Retirar vip!" OnClick="Carregar('removervips.php?' +
      'login=' + document.getElementById('login').value,'result_rem');"/>
  <br /><div align="center" id="result_rem"></div>
  </p>
  <h1>
  <? }
  if(!empty($_GET['login']) && !isset($_GET['desejo'])){
 $login	=	$_GET['login'];
  if(mssql_result(mssql_query("select vip from MEMB_INFO where memb___id='" .$login. "'"), 0, 0) <=0) { die("Esta conta nao esta  vip, ou no existe!<br>"); $er=1; }
  ?>
  <div align="center"><font size="+1"><b>Tem Certeza Que Quer Remover o Vip de:  <?=$_GET['login'];?>  ?<br><br><br> </b></font>
   <input type="image" src="images/cancel.jpg" width="16" height="15" OnClick="Carregar('removervips.php','padmin');"/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="image" src="images/enter.jpg" width="16" height="15" OnClick="Carregar('removervips.php?desejo=sim&' +
      'login=' + document.getElementById('login').value ,'result_rem');"/>
  </div>
  <h1><br />
  <br />
    <?
  
  }
  if(isset($_GET['login']) && isset($_GET['desejo'])){
  $login	=	$_GET['login'];
  $er=0;
  $check=mssql_num_rows(mssql_query("select memb___id from MEMB_INFO where memb___id='" .$login . "'"));
  if($check<=0){ echo"Login Invalido<br>"; $er=1; }
  if($er!=1){
  mssql_query("UPDATE MEMB_INFO SET 
							vip = '0',
							datavip='',
							diasdevip = '',
							vencimento = ''
							WHERE memb___id = '$login'");
							print("<center>o Login $login foi Removido Para ".vip($login)." com sucesso!</center>");
  }
  
  }
   ?>
    </h1>
</div>
</body>
</html>
