diff options
Diffstat (limited to 'pages')
-rw-r--r-- | pages/metadata.inc | 18 |
1 files changed, 17 insertions, 1 deletions
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['_']); |