summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/partials.php11
-rw-r--r--lib/utils.php11
2 files changed, 22 insertions, 0 deletions
diff --git a/lib/partials.php b/lib/partials.php
new file mode 100644
index 0000000..e11e194
--- /dev/null
+++ b/lib/partials.php
@@ -0,0 +1,11 @@
+<?php
+function html_navbar()
+{
+ echo '' ?>
+ <header>
+ <a href="/">
+ <img src="/static/brand/big.webp" alt="ilt.su">
+ </a>
+ </header>
+ <?php ;
+} \ No newline at end of file
diff --git a/lib/utils.php b/lib/utils.php
new file mode 100644
index 0000000..b81ddda
--- /dev/null
+++ b/lib/utils.php
@@ -0,0 +1,11 @@
+<?php
+function json_response(int $code, string|null $message, mixed $data)
+{
+ header('Content-Type: application/json');
+ http_response_code($code);
+ return json_encode([
+ 'status_code' => $code,
+ 'message' => $message,
+ 'data' => $data
+ ], JSON_UNESCAPED_SLASHES);
+} \ No newline at end of file