<?php

require_once '../api/requireConnected.php';
header('Content-Type: application/json');
require_once '../php/sql.php';
require_once '../api/lag.php';
require_once '../lib/general.php';
require_once '../lib/teamRanking.php';
require_once '../lib/userRanking.php';
$matchInfo = getUserRanking([15]);
echo json_encode($matchInfo);
Example #2
0
        $matchIds[] = $row['id'];
    }
}
if ($_GET['type'] == 'demiSaison') {
    $demiSaison = $currentRound > 19 ? 2 : 1;
    $saison = $currentSaison;
    if (isset($_GET['option'])) {
        $explode = explode('_', $_GET['option']);
        $saison = $explode[0];
        $demiSaison = $explode[1];
    }
    $result = runQuery('SELECT id 
      FROM result 
      WHERE saison = "' . $saison . '" 
      AND round' . ($demiSaison == "2" ? ">" : "<=") . '19');
    foreach ($result as $row) {
        $matchIds[] = $row['id'];
    }
}
if ($_GET['type'] == 'general') {
    $result = runQuery('SELECT id FROM result');
    foreach ($result as $row) {
        $matchIds[] = $row['id'];
    }
}
if (count($matchIds) > 0) {
    $ranking = getUserRanking($matchIds);
} else {
    $ranking = array('ranking' => array());
}
echo json_encode($ranking);