2017-09-12 16:32:01 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace router\controller;
|
|
|
|
use \service\Config;
|
|
|
|
|
|
|
|
|
|
|
|
class page{
|
|
|
|
|
|
|
|
|
|
|
|
private $pagename;
|
|
|
|
|
|
|
|
/* PRE-CALL
|
|
|
|
*
|
|
|
|
* @url<String> Calling URI
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public function __construct($url){
|
|
|
|
$this->pagename = $url['page'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* CALL
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public function home(){
|
|
|
|
|
|
|
|
|
|
|
|
/* [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){
|
2017-09-12 16:38:46 +00:00
|
|
|
|
|
|
|
|
2017-09-12 17:19:03 +00:00
|
|
|
echo "<span>$name</span>";
|
|
|
|
|
|
|
|
$link = $_SERVER['HTTP_HOST']."/ics/$id.ics";
|
|
|
|
// if( file_exists(__ROOT__."/tmp/$id.ics") )
|
|
|
|
|
|
|
|
echo " -> <a>$link</a><br>";
|
2017-09-12 16:32:01 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* POST-CALL
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public function __destruct(){
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|