54 lines
1.2 KiB
PHP
54 lines
1.2 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<?php include_once "../../base/meta.php" ?>
|
|
|
|
<link href="index.css" rel="stylesheet" />
|
|
|
|
<title>Test</title>
|
|
</head>
|
|
|
|
<body>
|
|
<?php
|
|
include_once "../base/settings.php";
|
|
include_once "../base/headers.php";
|
|
Headers::html();
|
|
include_once "../base/database.php";
|
|
|
|
$db = DB::openConnection();
|
|
|
|
$query = "SELECT * FROM users ORDER BY ID";
|
|
|
|
$stmt = $db->prepare($query);
|
|
$stmt->execute();
|
|
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
DB::closeConnection($db);
|
|
?>
|
|
<div class="col">
|
|
<div class="list">
|
|
<?php
|
|
foreach ($result as $item) {
|
|
?>
|
|
<div class="item">
|
|
<span class="marker"><?= $item["ID"] ?></span>
|
|
<span class="content"><?= $item["Name"] ?></span>
|
|
<form action="action.php" method="post">
|
|
<input type="hidden" name="ID" value="<?= $item["ID"] ?>" />
|
|
<button name="act" value="rem">Remove</button>
|
|
</form>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<form action="action.php" method="post" class="add">
|
|
<label>Name:</label>
|
|
<input name="name" placeholder="Name" required />
|
|
<button name="act" value="add">Add</button>
|
|
</form>
|
|
</div>
|
|
</body>
|
|
|
|
</html>
|