From 83354b2b88218090988dd6e526b0a2505b57e0f1 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Thu, 6 Apr 2023 22:18:28 +0200 Subject: Updated 5 files and added 1110 files (automated) --- pages/contacts.inc | 269 ++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/schedules.inc | 10 +- 2 files changed, 274 insertions(+), 5 deletions(-) create mode 100644 pages/contacts.inc (limited to 'pages') diff --git a/pages/contacts.inc b/pages/contacts.inc new file mode 100644 index 0000000..73232aa --- /dev/null +++ b/pages/contacts.inc @@ -0,0 +1,269 @@ + $value) { + if (trim($value) === "") $_POST[$key] = null; + if (isset($_POST[$key])) $_POST[$key] = str_replace(">", ">", str_replace("<", "<", str_replace("&", "&", substr($_POST[$key], 0, $key === "description" ? 400 : 100)))); + } + + foreach ($methods as $name => $method) { + if (isset($_POST[$name]) && isset($method["adapter"])) { + $_POST[$name] = exec("cd \"$_SERVER[DOCUMENT_ROOT]/includes/external/addressbook\" && node \"$_SERVER[DOCUMENT_ROOT]/includes/external/addressbook/$method[adapter]\" \"$_POST[$name]\""); + } + } + + $contacts[$id] = $_POST; + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/addressbook/contacts.json", json_encode($contacts)); + createJob("UpdateContactMethods", [ + "contact" => $id + ]); + + header("Location: /-/contacts"); + die(); +} else if (isset($_GET["delete"])) { + if (isset($contacts[$_GET["delete"]])) { + unset($contacts[$_GET["delete"]]); + } + + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/addressbook/contacts.json", json_encode($contacts)); + + header("Location: /-/contacts"); + die(); +} + +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $Parsedown; + +$cache = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/addressbook/saved.json"), true); + +?> + + + +
+
+
+

+ + Create +

+ + $contact): ?> +
+
+
+ + + + + + - + + + +
+
text($contact["description"]) ?>
+
+
+ + $method): if (isset($contact[$name]) && isset($cache[$name][$contact[$name]])): $data = $cache[$name][$contact[$name]]["data"]; ?> +
+ +
+ +
+ +
+
+
+ +
+ + E, D + +
+
+ +
+
+ + + + + + + + + + diff --git a/pages/schedules.inc b/pages/schedules.inc index bff1822..fae5984 100644 --- a/pages/schedules.inc +++ b/pages/schedules.inc @@ -160,7 +160,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/composer/ical/ical.php"; let time1 = (new Intl.DateTimeFormat('en-US', { timeZone: 'Europe/Paris', hour: 'numeric', - minute: 'numeric', + minute: '2-digit', hour12: true })).format(new Date()); @@ -170,7 +170,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/composer/ical/ical.php"; let time2 = (new Intl.DateTimeFormat('en-US', { timeZone: 'Europe/London', hour: 'numeric', - minute: 'numeric', + minute: '2-digit', hour12: true })).format(new Date()); @@ -180,7 +180,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/composer/ical/ical.php"; let time3 = (new Intl.DateTimeFormat('en-US', { timeZone: 'America/Chicago', hour: 'numeric', - minute: 'numeric', + minute: '2-digit', hour12: true })).format(new Date()); @@ -190,13 +190,13 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/composer/ical/ical.php"; document.getElementById("live-time-other1").innerText = (new Intl.DateTimeFormat('en-US', { timeZone: 'America/Anchorage', hour: 'numeric', - minute: 'numeric', + minute: '2-digit', hour12: true })).format(new Date()); document.getElementById("live-time-other2").innerText = (new Intl.DateTimeFormat('en-US', { timeZone: 'America/Vancouver', hour: 'numeric', - minute: 'numeric', + minute: '2-digit', hour12: true })).format(new Date()); } -- cgit