Example #1
0
<?php

require_once 'head.php';
require_once 'conexao.php';
require_once 'Model.php';
$aluno = new Model($conexao);
if (isset($_GET['excluido'])) {
    $aluno->setNome($_GET['excluido']);
    $aluno->delete();
    echo '<h2>Os dados do aluno ' . $_GET['excluido'] . ' foram excluidos!</h2>';
}
Example #2
0
     <input type="text" name="senhaUserIncluida"><br>
     <button type="submit">Cadastrar</button>
     </form>

<?php 
$aluno = new Model($conexao);
if (isset($_GET['nomeincluido'])) {
    $nomeincluido = $_GET['nomeincluido'];
} elseif (isset($_GET['notaincluida'])) {
    $notaincluida = $_GET['notaincluda'];
} elseif (isset($_GET['nome'])) {
    $busca = $_GET['nome'];
}
if (isset($nomeincluido)) {
    $notaincluida = $_GET['notaincluida'];
    $aluno->setNome($nomeincluido);
    $aluno->setNota($notaincluida);
    $aluno->insert();
    echo "<h3>Dados do aluno " . $nomeincluido . " incluidos com sucesso!";
}
?>

<form method="get" action="admin.php">

    <?php 
if (isset($_GET['nome'])) {
    echo "<h2>ALTERAR DADOS DO ALUNO: " . $busca . "</h2>";
    echo "<table>\n    <th>NOME</th>\n    <th>NOTA</th>";
    echo '<tr>';
    echo '<td><input type="text" name="namealt" value="' . $aluno->busca($busca)['nome'] . '"></input></td>';
    echo '<td><input type="number" name="notaalt" min="0" max="10" step="0.1" value="' . $aluno->busca($busca)['nota'] . '"></input></td>';
Example #3
0
<?php

require_once 'head.php';
require_once 'conexao.php';
require_once 'Model.php';
$aluno = new Model($conexao);
if (isset($_GET['nomeincluido'])) {
    $aluno->setNome($_GET['nomeincluido']);
    $aluno->setNota($_GET['notaincluida']);
    $aluno->insert();
} else {
    echo '<h5>Não há dados para inclusão! Retorne à área administrativa para realizar um novo cadastro.</h5>';
}
echo '<h3>Os dados do aluno ' . $aluno->busca($_GET['nomeincluido'])['nome'] . ' foram incluídos com sucesso! Abaixo os dados incluídos:</h3>';
echo '<table class="table table-striped">
	<tr>
		<th>NOME</th>
		<th>NOTA</th>
	</tr>';
echo '<tr>';
echo '<td>' . $aluno->busca($_GET['nomeincluido'])['nome'] . '</td>';
echo '<td>' . $aluno->busca($_GET['nomeincluido'])['nota'] . '</td></tr>';
echo '<tr>';
Example #4
0
        echo "<table class='table'>\n        <th>NOME</th>\n        <th>NOVO NOME</th>\n        <th>NOTA</th>";
        echo '<h2>Dados do Aluno: ' . $nomeatual['nome'] . '</h2>';
        echo '<tr><form method="get" action="busca.php">';
        echo '<td><input type="text" name="nomeatual" value="' . $nomeatual['nome'] . '"></input></td>';
        echo '<td><input type="text" name="nomealt" value="' . $nomeatual['nome'] . '"></input></td>';
        echo '<td><input type="number" name="notaalt" min="0" max="10" step="0.1" value="' . $nomeatual['nota'] . '"></input></td>';
        echo '<td><button type="submit">Atualizar Dados</button></td>';
        echo '</form</tr><br></table>';
        echo '<a href="exclusao.php?excluido=' . $nomeatual['nome'] . '">Excluir Aluno</a>';
    } elseif ($nomeatual == NULL) {
        echo "<h2>Nenhum aluno encontrado com os dados informados!</h2>";
    }
} elseif (isset($_GET['nomealt'])) {
    echo "<table class='table'>>\n        <th>NOME</th>\n        <th>NOVO NOME</th>\n        <th>NOTA</th>";
    $res = $aluno->busca($_GET['nomealt']);
    $aluno->setNome($_GET['nomealt']);
    $aluno->setNota($_GET['notaalt']);
    $aluno->update($_GET['nomeatual']);
    echo '<h2>Dados do Aluno: ' . $_GET['nomealt'] . '</h2>';
    echo '<tr><form method="get" action="busca.php">';
    echo '<td><input type="text" name="nomeatual" value="' . $_GET['nomealt'] . '"></input></td>';
    echo '<td><input type="text" name="nomealt" value="' . $_GET['nomealt'] . '"></input></td>';
    echo '<td><input type="number" name="notaalt" min="0" max="10" step="0.1" value="' . $_GET['notaalt'] . '"></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 Aluno</a>';
    echo '<br><br><h3>Os dados do aluno ' . $res['nome'] . " foram alterados conforme dados abaixo:";
    echo "<table class='table'>\n    <th>NOME</th>\n    <th>NOTA</th>";
    $res = $aluno->busca($_GET['nomealt']);
    echo '<tr>';
    echo '<td>' . $res['nome'] . '</td>';