diff options
author | RaindropsSys <contact@minteck.org> | 2023-03-27 22:22:53 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-03-27 22:22:53 +0200 |
commit | e98e95d89939cdc1252d02df04ae8d91c6aa8c92 (patch) | |
tree | a5d5535f8058f1a7b45a31a1caf36ab7e24ff19d /includes/util/functions.inc | |
parent | 6ab243c12f2514cd0f40e80504223664755a6da4 (diff) | |
download | pluralconnect-e98e95d89939cdc1252d02df04ae8d91c6aa8c92.tar.gz pluralconnect-e98e95d89939cdc1252d02df04ae8d91c6aa8c92.tar.bz2 pluralconnect-e98e95d89939cdc1252d02df04ae8d91c6aa8c92.zip |
Updated 9 files, added 9 files, deleted 3 files and renamed includes/refresh/logo.inc (automated)
Diffstat (limited to 'includes/util/functions.inc')
-rw-r--r-- | includes/util/functions.inc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/includes/util/functions.inc b/includes/util/functions.inc index 1bfd341..5b5b6b5 100644 --- a/includes/util/functions.inc +++ b/includes/util/functions.inc @@ -4,6 +4,19 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/score.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/bitset.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/homepage.inc"; +if (!function_exists("createJob")) { + function createJob($title, $options) { + $jobs = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/jobs.json"), true); + $jobs[] = [ + "name" => $title, + "options" => $options, + "date" => date('c') + ]; + + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/jobs.json", json_encode($jobs)); + } +} + if (!function_exists("peh_error")) { function peh_error($message, $code = 500): void { header("Location: /?em=" . urlencode(base64_encode($message)) . "&ec=" . $code); |