Move user creation from to a separate file
This commit is contained in:
68
src/user.php
68
src/user.php
@@ -9,13 +9,6 @@
|
||||
<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]-->
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -26,54 +19,29 @@
|
||||
<th colspan="2">Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
<?php
|
||||
include 'database.php';
|
||||
|
||||
$pdo = connectDatabase("practica", "practica", "practica");
|
||||
$list = listUsers($pdo);
|
||||
foreach($list as $row) :
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $row[0]; ?></td>
|
||||
<td><?php echo $row[1]; ?></td>
|
||||
<td><?php echo $row[2]; ?></td>
|
||||
<td><?php echo $row[3]; ?></td>
|
||||
<td>
|
||||
<a href="index.php?edit=" class="edit_btn" >Editar</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="server.php?del=" class="del_btn">Borrar</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $row[0]; ?></td>
|
||||
<td><?php echo $row[1]; ?></td>
|
||||
<td><?php echo $row[2]; ?></td>
|
||||
<td><?php echo $row[3]; ?></td>
|
||||
<td>
|
||||
<a href="html/user_create_form.html?edit=" class="edit_btn">Editar</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="html/user_create_form.html?delete=" class="del_btn">Borrar</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
<form method="post" action="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>
|
||||
<div style="text-align: right;">
|
||||
<a href="html/user_create_form.html" class="create_btn" >Crear</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user