2 function CONTENIDO_usuario_editar() {
3 global $database, $session, $form;
4 if(!$session->isAdmin()){
5 echo "<h3>Acceso denegado</h3>";
8 /* Si esta en proceso de edición */
9 if(isset($_SESSION['useredit'])){
10 unset($_SESSION['useredit']);
12 echo "<h2>¡Cuenta de usuario editada exitosamente!</h2><hr />";
13 echo "<h3>La cuenta de ".$_SESSION['user_edic'] ." ha sido exitosamente actualizada.</h3>";
16 $_SESSION['user_edic'] = $_GET['usr'];
17 $req_user_info = $database->getUserInfo($_SESSION['user_edic']);
19 <h2
>Editar cuenta del Instructor
: <?
echo $_SESSION['user_edic']; ?
></h2
>
20 <form action
="include/process.php" method
="POST">
21 <table border
="0" cellspacing
="0">
24 <td
><input type
="password" name
="newpass" maxlength
="30" value
=""></td
>
29 <td
><input type
="text" name
="email" maxlength
="50" value
="<? echo $req_user_info['email']; ?>"></td
>
34 <td
><input type
="text" name
="nombre" maxlength
="100" value
="<? echo $req_user_info['nombre']; ?>"></td
>
39 <td
><input type
="text" name
="encargado" maxlength
="100" value
="<? echo $req_user_info['encargado']; ?>"></td
>
44 <td
><input type
="text" name
="catedratico" maxlength
="100" value
="<? echo $req_user_info['catedratico']; ?>"></td
>
51 <option value
="0" <?
if ($req_user_info['tipo'] == 0) {echo 'selected="selected"';}; ?
>>Asistente de Catedrático
52 <option value
="1" <?
if ($req_user_info['tipo'] == 1) {echo 'selected="selected"';}; ?
>>Asistente de Taller
53 <option value
="2" <?
if ($req_user_info['tipo'] == 2) {echo 'selected="selected"';}; ?
>>Encargado de Taller
54 <option value
="3" <?
if ($req_user_info['tipo'] == 3) {echo 'selected="selected"';}; ?
>>Instructor de Materia
60 <td
>Departamento
:</td
>
62 <select name
="departamento">
63 <option value
="0" <?
if ($req_user_info['departamento'] == 0) {echo 'selected="selected"';}; ?
>>Dpto
. Electrónica
64 <option value
="1" <?
if ($req_user_info['departamento'] == 1) {echo 'selected="selected"';}; ?
>>Dpto
. Informática
71 <td
><input type
="submit" value
="Editar cuenta"></td
>
74 <input type
="hidden" name
="subedit" value
="1">
75 <input type
="hidden" name
="username" value
="<?echo $_SESSION['user_edic']; ?>">