

<html>
<head>
<title>Exclusao.php</title>
</head>
<body bgcolor="#FFFFFF">
<?php
/I Tira os espaos em branco das variveis recebidas pelo formulrio $nome = trim($nome);

/I Consiste Nome
if (empty($nome {
$html = file("exclusao.html");
$html = implode(" ",$html);
$erro = "<center><font color=\"#FFOOOO\"> Preencha o campo <b>Nome</b></font></center>";
$html = str _replace("<! mensagem>" ,$erro,$html);
echo ($html);
}

else {
echo ("<p><center><img src=\"telecentro.gif\" width=\"640\" height=\"44 \"></center></p>");

/I Cria uma conexo com o servidor MySOL
$conec = mysqL connect ("Iocalhost", "root", "telecentros");

/I Declarao do SOL
$declar = "SELECT nome from alunos where nome = '$nome"';

/I Roda a query, verifica se o aluno est cadastrado
$query = mysqLdb_query ('telecentros', $declar, $conec) or die ("Erro no acesso ao banco");
$achou = mysqLnum_rows($query);
I/echo ($achou);
/I Se encontrou exclui, seno mostra mensagem
if ($achou > O) {
echo ("<BR><BR>");
echo ("<canter> Aluno: $nome </center>"); echo ("<BR>");

/I Exclui registro na tabela de alunos

$declar2 = "DELETE trom alunos where nome = '$nome"';
if (mysqLdb_quEfry ('telecentros', $declar2, $conec {
echo ("<BR><BR>");
echo ("<center> <b> <font size = 4> Excluso Efetuada </font> </b> </center>");
echo ("<BR><BR>");
echo ("<center> <b> <a href=\"exclusao.html\">Voltar</a> </b> </center>");
}

else{
echo ("<BR><BR>");
echo ("<center> <b> <font size = 4> Erro - Exclus&atilde;o n&atilde;o Efetuada
	</font>
</b> </center>");
echo ("<BR><BR>");
echo ("<center> <b> <a href=\"exclusao.html\">Voltar</a> </b> </center>");
}
}
else {
echo ("<BR><BR>");
acho ("<canter> <b> Aluno n&atilda;o cadastrado </b>
</cantar>");
echo ("<BR><BR>"); acho ("<center> <b> <a href=\"exclusao.html\">Voltar</a> </b> </canter>");
}
mysql_close ($conec);
}
?>
</body>
</html>
