Initial setup, not working yet

This commit is contained in:
2026-06-12 15:08:50 +03:00
parent 2aba4b03a4
commit a467754d6c
37 changed files with 1211 additions and 4 deletions

59
frontend/items.php Normal file
View File

@@ -0,0 +1,59 @@
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
require_once "api/client.php";
$token = $_COOKIE["token"] ?? null;
if (!$token) {
header("Location: login.php");
exit;
}
$items = api_request(
"GET",
"/item",
null,
$token
);
?>
<!DOCTYPE html>
<html>
<head>
<title>Items</title>
<link rel="stylesheet" href="assets/style.css">
</head>
<body>
<div class="container">
<h1>Items</h1>
<table border="1" cellpadding="8">
<tr>
<th>ID</th>
<th>Name</th>
<th>Unit Type</th>
</tr>
<?php foreach ($items as $item): ?>
<tr>
<td><?= htmlspecialchars($item["id"]) ?></td>
<td><?= htmlspecialchars($item["name"]) ?></td>
<td><?= htmlspecialchars($item["unitType"]) ?></td>
</tr>
<?php endforeach; ?>
</table>
</div>
</body>
</html>