<?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 fixtures
    $fixtures = find_all_fixtures(1); 


    exit(json_encode($fixtures));


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

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

    //All fixtures
    $fixtures = find_all_club_fixtures($clubId, 1); 


    exit(json_encode($fixtures));

  }
