NxTIC/view/charts.php

67 lines
1.6 KiB
PHP
Raw Normal View History

<?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('chart/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('chart/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='phone' class='charts'>
<!-- SECTION 1 - SOCIOGRAMME SPATIAL -->
<section>
<center><h6>SOCIOGRAMME SPATIAL</h6></center>
<div id='sociogram' style='border-radius:3px;border: 1px solid #ddd;margin: 2em;width:30em;height: 30em;'></div>
</section>
<!-- SECTION 1 BIS - SOCIOGRAMME SPATIAL -->
<section>
<center><h6>SOCIOGRAMME EGOCENTRE</h6></center>
<div id='graph-container' style='border-radius:3px;border: 1px solid #ddd;margin: 2em;width:30em;height: 30em;'></div>
</section>
<!-- SECTION 2 - SOCIOGRAMME EGOCENTRE -->
<section>
<center><h6>SOCIOGRAMME EGOCENTRE</h6></center>
<?php echo $render; ?>
</section>
</section>