<?php header("Access-Control-Allow-Origin: *");
  header("Access-Control-Allow-Headers: *");  

  header('Content-Type: application/json');

  include '../db/connectMe.php';   
  include '../function/function.php';  

  if (!isset($_GET["c"]) ) {

    //All results
    $results = find_all_results(1); 

    exit(json_encode($results));

  }else if (isset($_GET["c"]) ) {

    @$clubId = mysql_prep($_GET['c']);  

    //All club results
    $results = find_all_club_results($clubId, 1); 

    exit(json_encode($results));

  }

