From 99e2edb45abd9987c6526ba9be3ac301e03af713 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 20 Apr 2025 17:47:30 +0500 Subject: feat: alerts --- public/static/img/icons/no.png | Bin 0 -> 587 bytes public/static/img/icons/yes.png | Bin 0 -> 781 bytes public/static/style.css | 6 ++++++ src/alert.php | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 public/static/img/icons/no.png create mode 100644 public/static/img/icons/yes.png create mode 100644 src/alert.php diff --git a/public/static/img/icons/no.png b/public/static/img/icons/no.png new file mode 100644 index 0000000..c149c2b Binary files /dev/null and b/public/static/img/icons/no.png differ diff --git a/public/static/img/icons/yes.png b/public/static/img/icons/yes.png new file mode 100644 index 0000000..89c8129 Binary files /dev/null and b/public/static/img/icons/yes.png differ diff --git a/public/static/style.css b/public/static/style.css index 1687616..933e46e 100644 --- a/public/static/style.css +++ b/public/static/style.css @@ -237,6 +237,7 @@ button.purple:hover, } .row { + display: flex; flex-direction: row; align-items: center; } @@ -324,6 +325,11 @@ a.box:hover { margin: 32px 0; } +.alert.red { + background: #e27777; + border-color: #9f5050; +} + /** ------------- ACCOUNTS diff --git a/src/alert.php b/src/alert.php new file mode 100644 index 0000000..eb67f77 --- /dev/null +++ b/src/alert.php @@ -0,0 +1,33 @@ + $status, + "message" => $error, + "data" => null + ]); + } else { + header("Location: $path?error_status=$status&error_reason=$error"); + } +} + +function display_alert() +{ + if (!isset($_GET["error_status"], $_GET["error_reason"])) { + return; + } + + $status = $_GET["error_status"]; + $reason = str_safe($_GET["error_reason"], 50); + $ok = substr($status, 0, 1) == '2'; + + echo '' ?> +
+ +

+
+