zi
This commit is contained in:
28
alumnos/modificar_post.php
Normal file
28
alumnos/modificar_post.php
Normal 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");
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user