« http://api.njuko.net/api-registrations/registrations »,
//CURLOPT_URL => « http://api.njuko.net/api-client »,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => «  »,
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => « POST »,
        CURLOPT_POSTFIELDS => « {\n    \ »itemsPerPage\ »:5000\n} »,
        CURLOPT_HTTPHEADER => array(
          « accept: application/json »,
          « cache-control: no-cache »,
          « content-type: application/json »,
          // Edition > Paramètres avancés une fois connecté sur njuko
          « edition: 9363 »,
          « authorization: 24f06cb847a3652098e2d14cb745bb93 »,
        ),
      ));
      $response = json_decode(curl_exec($curl), true);
      $err = curl_error($curl);
//print_r($response);
      curl_close($curl);
//echo var_dump($response);
     //  calcul du nombre d’équipes
$data=$response[‘results’];
$tab=array(); // tab : tableau des noms d’équipe
$tabent=array(); //tabent : tableau du challenge entreprise
foreach($data as $v) {
  if (array_key_exists($v[‘team_id’],$tab) &&  strcmp ( $tab[$v[‘team_id’]] , «  » )==0) {
    $tab[$v[‘team_id’]]=$v[‘team_name’];
  }
  if (!array_key_exists($v[‘team_id’],$tab) && $v[‘team_id’]!= » ») {
    $tab[$v[‘team_id’]]=$v[‘team_name’];
  }
  // tabnb : tableau de la taille des équipes
  if (array_key_exists($v[‘team_id’], $tabnb)) {
    if ($v[‘isRegistered’]==1) {
      $tabnb[$v[‘team_id’]]++;
      //echo $v[‘gender’];
      if (strcmp($v[‘gender’], »male »)==0) {
        $tabtp[$v[‘team_id’]]+=10;
      } else {
        $tabtp[$v[‘team_id’]]+=1;
      }
    }
  } else {
    if ($v[‘isRegistered’]==1) {
      $tabnb[$v[‘team_id’]]=1;
      if (strcmp($v[‘gender’], »male »)==0) {
        $tabtp[$v[‘team_id’]]=10;
      } else {
        $tabtp[$v[‘team_id’]]=1;
      }
    }
  }
if (!isset($tabent[$v[‘team_id’]])) {
    foreach( $v[‘answers’] as $cle => $element) {
      if (isset($element[‘value’][0]) && strcmp($element[‘value’][0], « Non je ne fais pas partis du Challenge Entreprise »)==0) {
        $tabent[$v[‘team_id’]]=0;
      }
      else if (isset($element[‘value’][0]) && strcmp($element[‘value’][0], « Oui je fais partis du Challenge Entreprise »)==0) {
        $tabent[$v[‘team_id’]]=1;
      }
    }
  }
}
$cpt=0;
foreach($tabnb as $cle => $element){
  if ($element<6) {
    $cpt++;
  }
}
      echo "« .(sizeof($tab)-$cpt).’ équipes complètes
‘;
      echo $cpt. » équipes incomplètes
« ;
      echo $response[totalHits]. » inscrits
« ;
    // print_r($data);
?>
Liste des équipes incomplètes
| Nom d’équipe | Nb coureurs | |
| « .$tab[$cle]. » | « .$element. » | « ; if ($tabent[$cle]==1) {echo « Entreprise »;} echo «  | 
Liste des équipes
« ;
//print_r($tabnb);
?>
| Nom d’équipe | Composition | Nb coureurs | |
| « ; if (!isset($tabent[$cle])) $i++; if ($element<6) echo "« ; $equipe=$tab[$cle]; echo $equipe; if ($element<6) echo "« ; echo «  | 
« ; if ($element<6) { echo " Incomplète « ; if ($tabent[$cle]==1) $e++; else $ne++; } // Equipes complètes  | 
« ; if ($element<6) echo "« ; echo $element; if ($element<6) echo "« ; echo «  | 
« ; if ($tabent[$cle]==1) {echo « Entreprise »;} if (!isset($tabent[$cle])) {echo « ? »; } echo «  | 
