Beispiel #1
0
        echo "<table class='table'>\n        <th>NOME</th>\n        <th>NOVO NOME</th>\n        <th>SENHA</th>";
        echo '<h2>Dados do Usuario: ' . $nomeatual['nome'] . '</h2>';
        echo '<tr><form method="get" action="buscaUser.php">';
        echo '<td><input type="text" name="nomeUserAtual" value="' . $nomeatual['nome'] . '"></input></td>';
        echo '<td><input type="text" name="nomeUserAlt" value="' . $nomeatual['nome'] . '"></input></td>';
        echo '<td><input type="text" name="senhaUserAlt" value="' . $nomeatual['senha'] . '"></input></td>';
        echo '<td><button type="submit">Atualizar Dados</button></td>';
        echo '</form</tr><br></table>';
        echo '<a href="exclusaoUser.php?excluido=' . $nomeatual['nome'] . '">Excluir Usuario</a>';
    } elseif ($nomeatual == NULL) {
        echo "<h2>Nenhum Usuario encontrado com os dados informados!</h2>";
    }
} elseif (isset($_GET['nomeUserAlt'])) {
    echo "<table class='table'>\n        <th>NOME</th>\n        <th>NOVO NOME</th>\n        <th>SENHA</th>";
    $res = $usuario->busca($_GET['nomeUserAlt']);
    $usuario->setNome($_GET['nomeUserAlt']);
    $usuario->setSenha($_GET['senhaUserAlt']);
    $usuario->update($_GET['nomeUserAtual']);
    echo '<h2>Dados do Usuario: ' . $_GET['nomeUserAtual'] . '</h2>';
    echo '<tr><form method="get" action="buscaUser.php">';
    echo '<td><input type="text" name="nomeatual" value="' . $_GET['nomeUserAtual'] . '"></input></td>';
    echo '<td><input type="text" name="nomealt" value="' . $_GET['nomeUserAlt'] . '"></input></td>';
    echo '<td><input type="number" name="SenhaUseralt" min="0" max="10" step="0.1" value="' . $_GET['senhaUserAlt'] . '"></input></td>';
    echo '<td><button type="submit">Atualizar Dados</button></td>';
    echo '</form</tr><br></table>';
    echo '<a href="exclusao.php?excluido=' . $res['nome'] . '">Excluir Usuario</a>';
    echo '<br><br><h3>Os dados do usuario ' . $res['nome'] . " foram alterados conforme dados abaixo:";
    echo "<table class='table'>\n    <th>NOME</th>\n    <th>SENHA</th>";
    $res = $usuario->busca($_GET['nomeUserAlt']);
    echo '<tr>';
    echo '<td>' . $res['nome'] . '</td>';
<?php

require_once 'head.php';
require_once 'conexao.php';
require_once 'ModelUser.php';
$usuario = new ModelUser($conexao);
if (isset($_GET['excluido'])) {
    $usuario->setNome($_GET['excluido']);
    $usuario->delete();
    echo '<h2>Os dados do aluno ' . $_GET['excluido'] . ' foram excluidos!</h2>';
}
<?php

require_once 'head.php';
require_once 'conexao.php';
require_once 'ModelUser.php';
$usuario = new ModelUser($conexao);
if (isset($_GET['nomeUserIncluido'])) {
    $usuario->setNome($_GET['nomeUserIncluido']);
    $usuario->setSenha($_GET['senhaUserIncluida']);
    $usuario->insert();
} else {
    echo '<h5>Nao ha dados para inclusao! Retorne para a area administrativa para realizar um novo cadastro.</h5>';
}
echo '<h3>Os dados do aluno ' . $usuario->busca($_GET['nomeUserIncluido'])['nome'] . ' foram incluidos com sucesso! Abaixo os dados incluidos:</h3>';
echo '<table class="table table-striped">
	<tr>
		<th>NOME</th>
		<th>SENHA</th>
	</tr>';
echo '<tr>';
echo '<td>' . $usuario->busca($_GET['nomeUserIncluido'])['nome'] . '</td>';
echo '<td>' . $usuario->busca($_GET['nomeUserIncluido'])['senha'] . '</td></tr>';
echo '<tr>';