(86400 * ($day - 1));
}));
uksort($filtered, function ($a, $b) {
return strtotime($b["timestamp"]) - strtotime($a["timestamp"]);
});
return $filtered;
}
function getSwitchBefore(string $id) {
global $switches;
$currentPassed = false;
$before = null;
foreach ($switches as $switch) {
if ($currentPassed) {
$before = $switch;
break;
} else {
if ($switch["id"] === $id) {
$currentPassed = true;
}
}
}
return $before;
}
function isNotToday(int $timestamp, int $offset) {
if (date('Y-m-d', $timestamp) !== date('Y-m-d', time() - (86400 * $offset))) {
return true;
} else {
return false;
}
}
$switches1 = getSwitchesForDay(0);
$switches2 = getSwitchesForDay(1);
$switches3 = getSwitchesForDay(2);
$switches4 = getSwitchesForDay(3);
$switches5 = getSwitchesForDay(4);
$switches6 = getSwitchesForDay(5);
$switches7 = getSwitchesForDay(6);
$switches8 = getSwitchesForDay(7);
$switches9 = getSwitchesForDay(8);
$switches10 = getSwitchesForDay(9);
?>
Front history in the = $systemCommonName ?>
Today
$i["members"][0],
"date" => strtotime($i["timestamp"])
];
}, $switches1);
$fronters[] = [
"member" => $switches2[0] ? $switches2[0]["members"][0] : ($switches3[0] ? $switches3[0]["members"][0] : ($switches4[0] ? $switches4[0]["members"][0] : ($switches5[0] ? $switches5[0]["members"][0] : ($switches6[0] ? $switches6[0]["members"][0] : ($switches7[0] ? $switches7[0]["members"][0] : ($switches8[0] ? $switches8[0]["members"][0] : ($switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0]))))))),
"date" => strtotime($switches2[0] ? $switches2[0]["timestamp"] : ($switches3[0] ? $switches3[0]["timestamp"] : ($switches4[0] ? $switches4[0]["timestamp"] : ($switches5[0] ? $switches5[0]["timestamp"] : ($switches6[0] ? $switches6[0]["timestamp"] : ($switches7[0] ? $switches7[0]["timestamp"] : ($switches8[0] ? $switches8[0]["timestamp"] : ($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))))))))
];
$fronters = array_unique($fronters, SORT_REGULAR);
foreach ($fronters as $fronter): $member = getMember($fronter["member"]);
?>
Yesterday
$i["members"][0],
"date" => strtotime($i["timestamp"])
];
}, $switches2);
$fronters[] = [
"member" => $switches3[0] ? $switches3[0]["members"][0] : ($switches4[0] ? $switches4[0]["members"][0] : ($switches5[0] ? $switches5[0]["members"][0] : ($switches6[0] ? $switches6[0]["members"][0] : ($switches7[0] ? $switches7[0]["members"][0] : ($switches8[0] ? $switches8[0]["members"][0] : ($switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0])))))),
"date" => strtotime($switches3[0] ? $switches3[0]["timestamp"] : ($switches4[0] ? $switches4[0]["timestamp"] : ($switches5[0] ? $switches5[0]["timestamp"] : ($switches6[0] ? $switches6[0]["timestamp"] : ($switches7[0] ? $switches7[0]["timestamp"] : ($switches8[0] ? $switches8[0]["timestamp"] : ($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])))))))
];
$fronters = array_unique($fronters, SORT_REGULAR);
foreach ($fronters as $fronter): $member = getMember($fronter["member"]);
?>
= date('D j M', time() - (86400 * 2)) ?>
$i["members"][0],
"date" => strtotime($i["timestamp"])
];
}, $switches3);
$fronters[] = [
"member" => $switches4[0] ? $switches4[0]["members"][0] : ($switches5[0] ? $switches5[0]["members"][0] : ($switches6[0] ? $switches6[0]["members"][0] : ($switches7[0] ? $switches7[0]["members"][0] : ($switches8[0] ? $switches8[0]["members"][0] : ($switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0]))))),
"date" => strtotime($switches4[0] ? $switches4[0]["timestamp"] : ($switches5[0] ? $switches5[0]["timestamp"] : ($switches6[0] ? $switches6[0]["timestamp"] : ($switches7[0] ? $switches7[0]["timestamp"] : ($switches8[0] ? $switches8[0]["timestamp"] : ($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))))))
];
$fronters = array_unique($fronters, SORT_REGULAR);
foreach ($fronters as $fronter): $member = getMember($fronter["member"]);
?>
= date('D j M', time() - (86400 * 3)) ?>
$i["members"][0],
"date" => strtotime($i["timestamp"])
];
}, $switches4);
$fronters[] = [
"member" => $switches5[0] ? $switches5[0]["members"][0] : ($switches6[0] ? $switches6[0]["members"][0] : ($switches7[0] ? $switches7[0]["members"][0] : ($switches8[0] ? $switches8[0]["members"][0] : ($switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0])))),
"date" => strtotime($switches5[0] ? $switches5[0]["timestamp"] : ($switches6[0] ? $switches6[0]["timestamp"] : ($switches7[0] ? $switches7[0]["timestamp"] : ($switches8[0] ? $switches8[0]["timestamp"] : ($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])))))
];
$fronters = array_unique($fronters, SORT_REGULAR);
foreach ($fronters as $fronter): $member = getMember($fronter["member"]);
?>
= date('D j M', time() - (86400 * 4)) ?>
$i["members"][0],
"date" => strtotime($i["timestamp"])
];
}, $switches5);
$fronters[] = [
"member" => $switches6[0] ? $switches6[0]["members"][0] : ($switches7[0] ? $switches7[0]["members"][0] : ($switches8[0] ? $switches8[0]["members"][0] : ($switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0]))),
"date" => strtotime($switches6[0] ? $switches6[0]["timestamp"] : ($switches7[0] ? $switches7[0]["timestamp"] : ($switches8[0] ? $switches8[0]["timestamp"] : ($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))))
];
$fronters = array_unique($fronters, SORT_REGULAR);
foreach ($fronters as $fronter): $member = getMember($fronter["member"]);
?>
= date('D j M', time() - (86400 * 5)) ?>
$i["members"][0],
"date" => strtotime($i["timestamp"])
];
}, $switches6);
$fronters[] = [
"member" => $switches7[0] ? $switches7[0]["members"][0] : ($switches8[0] ? $switches8[0]["members"][0] : ($switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0])),
"date" => strtotime($switches7[0] ? $switches7[0]["timestamp"] : ($switches8[0] ? $switches8[0]["timestamp"] : ($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])))
];
$fronters = array_unique($fronters, SORT_REGULAR);
foreach ($fronters as $fronter): $member = getMember($fronter["member"]);
?>
= date('D j M', time() - (86400 * 6)) ?>
$i["members"][0],
"date" => strtotime($i["timestamp"])
];
}, $switches7);
$fronters[] = [
"member" => $switches8[0] ? $switches8[0]["members"][0] : ($switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0]),
"date" => strtotime($switches8[0] ? $switches8[0]["timestamp"] : ($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))
];
$fronters = array_unique($fronters, SORT_REGULAR);
foreach ($fronters as $fronter): $member = getMember($fronter["member"]);
?>
= date('D j M', time() - (86400 * 7)) ?>
$i["members"][0],
"date" => strtotime($i["timestamp"])
];
}, $switches8);
$fronters[] = [
"member" => $switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0],
"date" => strtotime($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])
];
$fronters = array_unique($fronters, SORT_REGULAR);
foreach ($fronters as $fronter): $member = getMember($fronter["member"]);
?>
= date('D j M', time() - (86400 * 8)) ?>
$i["members"][0],
"date" => strtotime($i["timestamp"])
];
}, $switches9);
$fronters[] = [
"member" => $switches10[0] ? $switches10[0]["members"][0] : getSwitchBefore($switches9[count($switches9) - 1]["id"])["members"][0],
"date" => strtotime($switches10[0] ? $switches10[0]["timestamp"] : getSwitchBefore($switches9[count($switches9) - 1]["id"])["timestamp"])
];
$fronters = array_unique($fronters, SORT_REGULAR);
foreach ($fronters as $fronter): $member = getMember($fronter["member"]);
?>
= date('D j M', time() - (86400 * 9)) ?>
$i["members"][0],
"date" => strtotime($i["timestamp"])
];
}, $switches10);
$fronters = array_unique($fronters, SORT_REGULAR);
foreach ($fronters as $fronter): $member = getMember($fronter["member"]);
?>