mirror of
https://github.com/sigmasternchen/mobmash.click
synced 2025-03-15 08:09:02 +00:00
35 lines
No EOL
897 B
PHP
35 lines
No EOL
897 B
PHP
<?php
|
|
|
|
require_once __DIR__ . '/../../core.php';
|
|
require_once __DIR__ . '/../../lib/rating.php';
|
|
|
|
$validOrderColumns = [
|
|
"position",
|
|
"name",
|
|
"rating",
|
|
"matches",
|
|
"wins",
|
|
"losses"
|
|
];
|
|
|
|
$orderColumn = $_GET["order"];
|
|
if (!in_array($orderColumn, $validOrderColumns)) {
|
|
$orderColumn = "position";
|
|
}
|
|
|
|
$orderDirection = $_GET["direction"] == "desc" ? "desc" : "asc";
|
|
|
|
$mobs = getMobsWithMetaData($orderColumn, $orderDirection);
|
|
$trends = getRatingTrends();
|
|
|
|
if (isset($_GET["ajax"])) {
|
|
require __DIR__ . '/../../view/fragments/mobList.php';
|
|
} else {
|
|
$title = "MobMash - Results";
|
|
$description = "Which Minecraft mob is the best? Let's take a look at how people votes. These are the results.";
|
|
$content = function () use ($mobs, $trends) {
|
|
require __DIR__ . '/../../view/pages/results.php';
|
|
};
|
|
|
|
require_once __DIR__ . '/../../view/layout.php';
|
|
} |