2 function CONTENIDO_usuario_editar($usuario) {
3 global $database, $session;
4 if(!$session->isAdmin()){
5 echo "<h1>Acceso denegado</h1>";
8 if ( !$usuario ) { $usuario = $session->codigo
; }
9 //Verificamos que el usuario que quiere editar exista...
10 if(!$database->codigoTaken($usuario)) {
11 echo "<h1>El usuario '$usuario' no existe</h1>";
15 /* Si esta en proceso de edición */
16 if(isset($_SESSION['useredit'])){
17 unset($_SESSION['useredit']);
19 echo "<h2>¡Cuenta de cliente editada exitosamente!</h2><hr />";
20 echo "<h3>La cuenta de ".$_SESSION['user_edic'] ." ha sido exitosamente actualizada.</h3>";
23 $_SESSION['user_edic'] = $usuario;
24 $req_user_info = $database->getUserInfo($_SESSION['user_edic']);
26 <h1
>Editar cuenta del Cliente
: <?
echo $_SESSION['user_edic']; ?
></h1
>
27 <form action
="include/x.php" method
="POST">
28 <table border
="0" cellspacing
="0">
31 <td
><input type
="password" name
="newpass" maxlength
="30" style
="width: 98%;" value
=""></td
>
35 <td
>Código fiscal
:</td
>
36 <td
><input type
="text" name
="codigo" maxlength
="100" style
="width: 98%;" value
="<? echo $req_user_info['codigo']; ?>"></td
>
40 <td
>Nombre de cliente
:</td
>
41 <td
><input type
="text" name
="nombre" maxlength
="100" style
="width: 98%;" value
="<? echo $req_user_info['nombre']; ?>"></td
>
46 <td
><input type
="text" name
="email" maxlength
="50" style
="width: 98%;" value
="<? echo $req_user_info['email']; ?>"></td
>
50 <td
>Razón social
:</td
>
51 <td
><input type
="text" name
="razon" maxlength
="100" style
="width: 98%;" value
="<? echo $req_user_info['razon']; ?>"></td
>
56 <td
><input type
="text" name
="telefono1" maxlength
="100" style
="width: 98%;" value
="<? echo $req_user_info['telefono1']; ?>"></td
>
61 <td
><input type
="text" name
="telefono2" maxlength
="100" style
="width: 98%;" value
="<? echo $req_user_info['telefono2']; ?>"></td
>
66 <td
><input type
="text" name
="telefono3" maxlength
="100" style
="width: 98%;" value
="<? echo $req_user_info['telefono3']; ?>"></td
>
70 <td
>Notas u otras observaciones
:</td
>
71 <td
><textarea name
="notas" rows
="5" cols
="10" style
="width: 98%;" ><?
echo $req_user_info['notas']; ?
></textarea
></td
>
76 <td
><input type
="submit" value
="Editar cuenta"></td
>
79 <input type
="hidden" name
="subedit" value
="1">
80 <input type
="hidden" name
="username" value
="<?echo $_SESSION['user_edic']; ?>">