= 0) {
return $tense = "now";
} elseif ($difference > 0) {
$tense = "ago";
} else {
$tense = "later";
}
for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {
$difference /= $lengths[$j];
}
$difference = round($difference);
$period = $periods[$j] . ($difference >1 ? "s" :'');
return "{$difference} {$period} {$tense}";
}
if (getSubsystemByID($subsystemID) === null) header("Location: /?error=Invalid subsystem ID") and die();
$subsystemData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystemID.json"), true);
$title = $subsystemData["name"] . " ยท " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php';
?>