diff options
author | Minteck <contact@minteck.org> | 2022-06-17 15:23:02 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-06-17 15:23:02 +0200 |
commit | d67f6a0547700aded74e2429c4f13d6a9dbf29ce (patch) | |
tree | 6b4a533fe5057b55c9cf79d25041607132170105 /Application/TransactionsList/index.php | |
parent | 01a7ea3c92861529e22f8df52d6005cafcedc334 (diff) | |
download | bits-server-d67f6a0547700aded74e2429c4f13d6a9dbf29ce.tar.gz bits-server-d67f6a0547700aded74e2429c4f13d6a9dbf29ce.tar.bz2 bits-server-d67f6a0547700aded74e2429c4f13d6a9dbf29ce.zip |
Fix major bug
Diffstat (limited to 'Application/TransactionsList/index.php')
-rw-r--r-- | Application/TransactionsList/index.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Application/TransactionsList/index.php b/Application/TransactionsList/index.php index 185e94b..4bb56e0 100644 --- a/Application/TransactionsList/index.php +++ b/Application/TransactionsList/index.php @@ -33,10 +33,14 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/Private/SessionManager.php"; header("Content-Type: application/json"); $users = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Users.json"), true); -$list = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Transactions.json"), true); +$list = array_reverse(array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Transactions"), function ($i) { + return !str_starts_with($i, ".") && str_ends_with($i, ".json"); +})); $plist = []; -foreach ($list as $item) { +foreach ($list as $id) { + $item = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Transactions/" . $id), true); + $item["author"] = [ "id" => $item["author"], "name" => $users[$item["author"]] ?? $item["author"], |