initial commit

This commit is contained in:
Daniel Cortés
2019-12-12 16:05:20 -03:00
commit f480b2942f
13 changed files with 444 additions and 0 deletions

21
alumnos/register_post.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
require_once('../models/alumno.php');
require_once('../rut_validacion.php');
$rut = $_POST['rut'];
if(!validar_rut($rut)){
echo "ERROR";
header("location: /alumnos/registrar.php");
var_dump("OH NO");
exit();
}
$alumno = new Alumno();
$alumno->set_rut($_POST['rut']);
$alumno->set_nombre($_POST['nombre']);
if($alumno->save())
{
header("location: /alumnos/index.php");
}
?>