From: Leandro Lucarella Date: Thu, 5 May 2005 05:52:25 +0000 (+0000) Subject: Se agrega pantalla para agregar créditos a usuarios. X-Git-Tag: svn_import~65 X-Git-Url: https://git.llucax.com/z.facultad/75.43/tp1.git/commitdiff_plain/d3b7db85c60d658e7e7b00bb48d8d7a5f9ce833b?ds=sidebyside Se agrega pantalla para agregar créditos a usuarios. --- diff --git a/src/admin.creditos.php b/src/admin.creditos.php new file mode 100644 index 0000000..6b7fb75 --- /dev/null +++ b/src/admin.creditos.php @@ -0,0 +1,53 @@ +esAdmin()) { + error('Acceso denegado!'); + marco_pie('Leandro Lucarella', 'llucare@fi.uba.ar'); + exit; +} + +// Si llenó el formulario +if (isset($_POST['admin_cred']) and isset($_POST['admin_cred_user']) + and isset($_POST['admin_cred_pass'])) +{ + if (check_numero($_POST['admin_cred']) + and check_asociado($_POST['admin_cred_user']) + and check_password($_SESSION['user']->getId(), + $_POST['admin_cred_pass'])) + { + $u = new Usuario($_POST['admin_cred_user']); + $u->addCreditos($_POST['admin_cred']); + ok('Se agregaron '.$_POST['admin_cred'].' créditos al usuario ' + .$u->getNombre().' '.$u->getApellido()); + admin_form_creditos(Usuario::getAll(), $u->getId(),$_POST['admin_cred']); + } + else + { + admin_form_creditos(Usuario::getAll(), $_POST['admin_cred_user'], + $_POST['admin_cred']); + } +} +else // Si no llenó el formulario +{ + admin_form_creditos(Usuario::getAll()); +} + +marco_pie('Leandro Lucarella', 'llucare@fi.uba.ar'); + +?> \ No newline at end of file