Reindent user/index.php and include search
This commit is contained in:
parent
c4e7d15c37
commit
0b2ef1a4f8
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
include("../db_connect.php");
|
||||
|
||||
include("../db_connect.php");
|
||||
|
||||
if (isset($_GET['username'])) {
|
||||
if (isset($_GET['username'])) {
|
||||
$query = pg_prepare($dbconn, "userid_by_username", 'SELECT id FROM users WHERE username = $1');
|
||||
$result = pg_execute($dbconn, "userid_by_username", array($_GET['username']));
|
||||
$row = pg_fetch_row($result);
|
||||
|
@ -13,8 +12,7 @@ if (isset($_GET['username'])) {
|
|||
} else {
|
||||
header("Location: /user/index.php?id=-1");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
@ -31,7 +29,6 @@ if (isset($_GET['username'])) {
|
|||
?>
|
||||
|
||||
<div class="container box">
|
||||
|
||||
<div class="notification is-primary">
|
||||
<h1 class="title">Search and edit users</h1>
|
||||
</div>
|
||||
|
@ -50,7 +47,11 @@ if (isset($_GET['username'])) {
|
|||
</form>
|
||||
</div>
|
||||
|
||||
<table class="table is-fullwidth">
|
||||
<div class="notiifcation is-info is-light mt-2">
|
||||
<input class="input" type="text" id="searchInput" placeholder="Search user">
|
||||
</div>
|
||||
|
||||
<table class="table is-fullwidth" id="userTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Username</th>
|
||||
|
@ -77,7 +78,13 @@ if (isset($_GET['username'])) {
|
|||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
// The site functions entirely without JavaScript, but it's nice to have search without reloading the page
|
||||
?>
|
||||
<script src="/js/fuse.js"></script>
|
||||
<script src="/js/searchUserTable.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue