NxTIC/view/charts.php

45 lines
1014 B
PHP
Executable File

<?php define('__ROOT__', dirname(dirname(__FILE__)) );
require_once __ROOT__.'/manager/autoloader.php';
use \manager\ModuleRequest;
use \manager\ManagerError;
use \manager\ResourceDispatcher;
/* [1] Gestion du cercle des relations
=======================================*/
/* (1) On recupere les donnees */
$getData = new ModuleRequest('charts/network_data');
$answer = $getData->dispatch();
// Si pas d'erreur
if( $answer->error != ManagerError::Success )
var_dump( ManagerError::explicit($answer->error) );
// On enregistre les donnees
$data = $answer->get('data');
/* (2) On recupere le rendu */
$getRender = new ModuleRequest('charts/network_render', array('dataset' => $data));
$answer = $getRender->dispatch();
// Si pas d'erreur
if( $answer->error != ManagerError::Success )
var_dump( ManagerError::explicit($answer->error) );
// On enregistre les donnees
$render = $answer->get('render');
?>
<section data-sublink='network'>
<h6>CERCLE DES RELATIONS</h6>
<?= $render; ?>
</section>