-
+
+
+
-
-
-
Alumnos
-
-
-
- | # |
- Rut |
- Nombre |
- Controles |
-
-
-
-
+
+
+
- | get_id() ?> |
- get_rut() ?> |
- get_nombre() ?> |
-
- Link
- Link
- |
+ # |
+ Rut |
+ Nombre |
+ |
-
-
-
+
+
+
+
+ | get_id() ?> |
+ get_rut() ?> |
+ get_nombre() ?> |
+
+
+ |
+
+
+
+
+
-
-
-
+
diff --git a/alumnos/modificar.php b/alumnos/modificar.php
index e69de29..4f21d37 100644
--- a/alumnos/modificar.php
+++ b/alumnos/modificar.php
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/alumnos/modificar_post.php b/alumnos/modificar_post.php
new file mode 100644
index 0000000..9a35b48
--- /dev/null
+++ b/alumnos/modificar_post.php
@@ -0,0 +1,28 @@
+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");
+}
+?>
diff --git a/alumnos/register_post.php b/alumnos/register_post.php
index a7d36ad..416f1d0 100644
--- a/alumnos/register_post.php
+++ b/alumnos/register_post.php
@@ -3,10 +3,10 @@ require_once('../models/alumno.php');
require_once('../rut_validacion.php');
$rut = $_POST['rut'];
+$nombre = $_POST['nombre'];
+
if(!validar_rut($rut)){
- echo "ERROR";
header("location: /alumnos/registrar.php");
- var_dump("OH NO");
exit();
}
@@ -14,8 +14,5 @@ $alumno = new Alumno();
$alumno->set_rut($_POST['rut']);
$alumno->set_nombre($_POST['nombre']);
-if($alumno->save())
-{
- header("location: /alumnos/index.php");
-}
+if($alumno->save()) header("location: /alumnos/index.php");
?>
diff --git a/alumnos/registrar.php b/alumnos/registrar.php
index 30a6c2b..f24f304 100644
--- a/alumnos/registrar.php
+++ b/alumnos/registrar.php
@@ -1,39 +1,13 @@
+
+
-
Restaurant
-
-
-
-
+
-
-