<?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 old news
    $news = find_all_old_news(1); 


    exit(json_encode($news));


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

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

    //All club news
    $news = find_all_club_news($clubId, 1); 

    exit(json_encode($news));

  }
