Example #1
0
<?php

require_once 'head.php';
require_once 'conexao.php';
require_once 'Model.php';
$aluno = new Model($conexao);
if (isset($_GET['nome'])) {
    $nomeatual = $aluno->busca($_GET['nome']);
    if ($nomeatual != NULL) {
        echo '<h2>Dados do Aluno: ' . $nomeatual['nome'] . '</h2>';
        echo "<table class='table'>\n        <th>NOME</th>\n        <th>NOTA</th><tr>";
        echo '<td>' . $nomeatual['nome'] . '</td>';
        echo '<td>' . $nomeatual['nota'] . '</td></tr></table>';
    } elseif ($nomeatual == NULL) {
        echo "<h2>Nenhum aluno encontrado com os dados informados!</h2>";
    }
} else {
    echo '<form method="get" action="buscaSimples.php">
    Busca por Nome<br>
    <input type="text" name="nome"><br>
    <button type="submit">Buscar</button>
    </form>';
}
Example #2
0
    $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>';
    echo '<td><button type="submit">Atualizar Dados</button></td>';
    echo '</tr>';
}
?>

</form>


</table>
</html>
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
<?php

require_once 'head.php';
require_once 'conexao.php';
require_once 'Model.php';
$aluno = new Model($conexao);
if (isset($_GET['nome'])) {
    $nomeatual = $aluno->busca($_GET['nome']);
    if ($nomeatual != NULL) {
        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>';