Implement update and delete user
This commit is contained in:
45
src/forms/user_edit_form.php
Normal file
45
src/forms/user_edit_form.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>Gestión de usuarios</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../static/style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
include '../database.php';
|
||||
|
||||
$pdo = connectDatabase("practica", "practica", "practica");
|
||||
$data = findUser($pdo, $_GET["edit"]);
|
||||
?> <form method="post" action="../user_management.php">
|
||||
<div class="input-group">
|
||||
<label>Nombre</label>
|
||||
<input type="text" name="nombre" value="<?php echo $data[1]; ?>">
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<label>usuario</label>
|
||||
<input type="text" name="usuario" value="<?php echo $data[2]; ?>">
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<label>contraseña</label>
|
||||
<input type="password" name="contraseña" value="">
|
||||
</div>
|
||||
<div class="select-input">
|
||||
<label>rol</label>
|
||||
<select id="rol" name="rol">
|
||||
<option value="1">administrativo</option>
|
||||
<option value="2">médico</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<label>correo</label>
|
||||
<input type="text" name="correo" value="<?php echo $data[6]; ?>">
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<button class="btn" type="submit" name="edit" >Editar</button>
|
||||
</div>
|
||||
<input type="hidden" name="id" value="<?php echo $_GET["edit"]; ?>">
|
||||
</form>
|
||||
<?php closeDatabase($pdo); ?>
|
||||
</body>
|
||||
Reference in New Issue
Block a user