// RÉCUPÉRATION DES INSTANCES
$instances = $this->Instance->find('all');
- // RECUPERATION DE L'HISTORIQUE DE CHAQUE INSTANCE
+ // RECUPERATION DES INFOS DE CHAQUE INSTANCE
$historiques = array();
$totalAlertes = array();
+ $clients = array();
foreach($instances as $instance) {
+ // RECUPERATION DE L'HISTORIQUE
$historique = $historiquesController->Historique->findById($instance['Instance']['historique']);
if ($historique) {
// RÉCUPÉRATION DES ALERTES DE L'HISTORIQUE
// AJOUT DANS LA LISTE DES HISTORIQUES
$historiques[$instance['Instance']['id']] = $historique;
}
+ // RECUPERATION DU NOM DU CLIENT
+ $reference = str_replace("/", "\\/", $instance['Instance']['reference']);
+ $url = 'http://allo_serveur/?action=get_client&reference='.$reference;
+ $options = array("http" => array("method" => "GET"));
+ $context = stream_context_create($options);
+ $client = file_get_contents($url, false, $context);
+ if ($client) {
+ $clients[$instance['Instance']['id']] = $client;
+ }
}
// ENVOI DES DONNÉES À LA VUE
'historiques' => $historiques,
'_serialize' => array('historiques')
));
+ $this->set(array(
+ 'clients' => $clients,
+ '_serialize' => array('clients')
+ ));
$this->set(array(
'totalAlertes' => $totalAlertes,
'_serialize' => array('totalAlertes')