29 lines
480 B
PHP
29 lines
480 B
PHP
<?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");
|
|
}
|
|
?>
|