Ejemplo n.º 1
0
<?php

require_once 'Conecta.php';
require_once 'Alunos.php';
$alunos = new Alunos($conexao);
if (isset($_GET['id'])) {
    $id = $_GET['id'];
    $result = $alunos->find($id);
    $nome = $result['nome'];
    $nota = $result['nota'];
}
if (isset($_POST['enviar'])) {
    $id = $_POST['id'];
    $nome = $_POST['nome'];
    $nota = $_POST['nota'];
    echo $id;
    echo $nome;
    echo $nota;
    $alunos->setId($id)->setNome($nome)->setNota($nota);
    if ($alunos->alterar()) {
        header("location:/");
    } else {
        echo "Falha na alteração do Registro";
    }
}
?>


<html>
    <head>
        <title>Alunos</title>