Add user creation functionality
This commit is contained in:
parent
26cdb78296
commit
bb1b2f077b
|
@ -0,0 +1,52 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html class="no-js" lang="es">
|
||||||
|
<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="apple-touch-icon" href="/apple-touch-icon.png">
|
||||||
|
<!-- Place favicon.ico in the root directory -->
|
||||||
|
<link rel="stylesheet" href="static/style.css" type="text/css" media="screen" />
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!--[if lt IE 8]>
|
||||||
|
<p class="browserupgrade">
|
||||||
|
You are using an <strong>outdated</strong> browser. Please
|
||||||
|
<a href="http://browsehappy.com/">upgrade your browser</a> to improve
|
||||||
|
your experience.
|
||||||
|
</p>
|
||||||
|
<![endif]-->
|
||||||
|
<form method="post" action="../src/user_management.php">
|
||||||
|
<div class="input-group">
|
||||||
|
<label>Nombre</label>
|
||||||
|
<input type="text" name="nombre" value="">
|
||||||
|
</div>
|
||||||
|
<div class="input-group">
|
||||||
|
<label>usuario</label>
|
||||||
|
<input type="text" name="usuario" value="">
|
||||||
|
</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="">
|
||||||
|
</div>
|
||||||
|
<div class="input-group">
|
||||||
|
<button class="btn" type="submit" name="submit" >Guardar</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?php
|
||||||
|
include'database.php';
|
||||||
|
if (isset($_POST['submit'])) {
|
||||||
|
$data = $_POST;
|
||||||
|
$pdo = connectDatabase("practica", "practica", "practica");
|
||||||
|
createUser($pdo, $data);
|
||||||
|
closeDatabase($pdo);
|
||||||
|
}
|
Loading…
Reference in New Issue