<?php header("Content-Type: application/json"); require_once __DIR__ . '/../vendor/autoload.php'; require __DIR__ . '/common.php'; /*$sort_params = array('startTime', 'endTime'); $sort_param = !empty($_GET['sort']) && in_array($_GET['sort'], $sort_params) ? $_GET['sort'] : 'startTime';*/ $selected = get_clanwars(!empty($_GET['count']) ? $_GET['count'] : null, !empty($_GET['completed']), !empty($_GET['clan']) ? $_GET['clan'] : null); echo json_encode($selected);
<?php header("Content-Type: application/json"); require_once __DIR__ . '/../vendor/autoload.php'; require __DIR__ . '/common.php'; $clan_id = $_GET['id']; $clan = find_clan($clan_id); $clan->wars = get_clanwars(15, null, $clan_id); $clan->stats = get_clanstats(0, $clan_id)->now; echo json_encode($clan);
<?php header("Content-Type: application/json"); require_once __DIR__ . '/../vendor/autoload.php'; require __DIR__ . '/common.php'; $selected = get_clanwars(null, null, null, $_GET['id']); echo json_encode($selected[$_GET['id']]);