From ae766d28c07628e71629a72452261898ea72057a Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 21 Dec 2022 18:09:20 +0100 Subject: Update - This is an automated commit --- pages/metadata.inc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'pages/metadata.inc') diff --git a/pages/metadata.inc b/pages/metadata.inc index ecb8aba..ffe2397 100644 --- a/pages/metadata.inc +++ b/pages/metadata.inc @@ -54,7 +54,7 @@ if ($member === null) { if (isset($_GET["submit"])) { if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json")) { - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), true)); + $metadata = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), true); } else { die(); } @@ -108,10 +108,26 @@ if ($member === null) { $toUpdate["birth"]["date"] = substr($_GET["birth"],5); } + if (isset($_GET["membc"])) { + $toUpdate["code"] = $_GET['membc']; + } + foreach ($toUpdate as $item => $value) { $metadata[$item] = $value; } + $metadata = [ + "bitset" => $metadata["bitset"] ?? 0, + "regression" => $metadata["regression"] ?? null, + "median" => $metadata["median"] ?? null, + "marefriends" => $metadata["marefriends"] ?? [], + "sisters" => $metadata["sisters"] ?? [], + "caretakers" => $metadata["caretakers"] ?? [], + "heat" => $metadata["heat"] ?? null, + "birth" => $metadata["birth"] ?? ["age" => 0, "date" => "01-01", "year" => null], + "code" => $metadata["code"] ?? null, + ]; + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json", json_encode($metadata)); header("Location: /" . $_GET['_']); -- cgit