Update (dirty) index.php

This commit is contained in:
xdrm-brackets 2017-09-12 18:16:02 +02:00
parent 6736e79b33
commit 47118442e5
1 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,27 @@
<?php require_once '../autoloader.php';
use \service\Config;
/* [1] Fetch configuration
=========================================================*/
/* (1) Get config */
try{
$config = Config::load("http://sciences.univ-pau.fr/edt/_ressource.js", "http://sciences.univ-pau.fr/edt/_periode.js");
/* (2) Error management */
}catch(\Exception $e){
die("An error occured. Please contact the developers.\n");
}
/* (3) Get the diplome list */
$diplomes = $config->getDiplomes();
/* [2] Display the links
=========================================================*/
foreach($diplomes as $id=>$name){
echo "<a href='/ics/$id'>$name</a><br>";
}