Implement user searching

This commit is contained in:
2020-06-17 05:34:36 +02:00
parent e77f29b393
commit 67417b0bfc
5 changed files with 53 additions and 7 deletions

View File

@@ -9,6 +9,9 @@
<link rel="stylesheet" href="../static/style.css" type="text/css" media="screen" />
</head>
<body>
<div style="text-align: right; margin-top: 20px;">
<a href="forms/user_create_form.html" class="create_btn" >Crear</a>
</div>
<table>
<thead>
<tr>
@@ -23,7 +26,13 @@
include 'database.php';
$pdo = connectDatabase();
$list = listUsers($pdo);
if (isset($_GET["search"])) {
$list = findUser($pdo, $_GET["search"]);
} else {
$list = listUsers($pdo);
}
foreach($list as $row) :
if(!$row[5]):
?>
@@ -43,8 +52,15 @@
<?php endforeach ?>
<?php closeDatabase($pdo); ?>
</table>
<div style="text-align: right;">
<a href="forms/user_create_form.html" class="create_btn" >Crear</a>
<div>
<form method="post" action="user_management.php">
<div class="search-group">
<input type="text" name="search_box" value="">
</div>
<div class="input-group">
<button class="btn" type="submit" name="search" >Buscar</button>
</div>
</form>
</div>
</body>
</html>