This commit is contained in:
Daniel Cortés
2019-12-13 13:53:12 -03:00
parent f480b2942f
commit fdada2adcc
14 changed files with 220 additions and 132 deletions

View File

@@ -0,0 +1,28 @@
<?php
require_once('../models/alumno.php');
require_once('../rut_validacion.php');
$id = $_POST['id'];
$rut = $_POST['rut'];
$nombre = $_POST['nombre'];
if(!validar_rut($rut))
{
header("location: /alumnos/modificar.php?id=$id");
exit();
}
$alumno = new Alumno();
$alumno->set_id($id);
$alumno->set_rut($rut);
$alumno->set_nombre($nombre);
if($alumno->update())
{
header("location: /alumnos/index.php");
}
else
{
header("location: /alumnos/modificar.php?id=$id");
}
?>