83 lines
2.0 KiB
PHP
Executable File
83 lines
2.0 KiB
PHP
Executable File
<?php define('__ROOT__', dirname(__FILE__) );
|
|
require_once __ROOT__.'/manager/autoloader.php';
|
|
|
|
use \manager\ModuleRequest;
|
|
use \manager\ResourceDispatcher;
|
|
use \manager\sessionManager;
|
|
use \manager\ManagerError;
|
|
use \manager\Repo;
|
|
|
|
use \api\client;
|
|
|
|
|
|
|
|
|
|
/* PARSAGE DE JOURNAUX D'APPEL
|
|
*
|
|
*
|
|
*/
|
|
function parseCallLog(){
|
|
|
|
/* [1] On recupere le journal d'appel
|
|
=========================================================*/
|
|
$file_content = file_get_contents('calllog.xml');
|
|
|
|
/* [2] On cree la requete
|
|
=========================================================*/
|
|
$request = new ModuleRequest('call_log/unserialize', array($file_content));
|
|
$answer = $request->dispatch(); // on l'execute
|
|
|
|
/* [3] Si erreur
|
|
=========================================================*/
|
|
if( $answer->error != ManagerError::Success ){
|
|
// on l'explicite
|
|
var_dump( ManagerError::explicit($answer->error) );
|
|
// on quitte
|
|
return;
|
|
}
|
|
|
|
|
|
/* [4] Sinon on recupere le resultat
|
|
=========================================================*/
|
|
$sms = $answer->get('sms');
|
|
$call = $answer->get('call');
|
|
$contact = $answer->get('contact');
|
|
|
|
/* [5] On debug les donnees recues
|
|
=========================================================*/
|
|
var_dump( "Il y a ".count($contact)." personnes :" );
|
|
var_dump( "- ".count($sms)." par SMS/MMS" );
|
|
var_dump( "- ".count($call)." par telephone" );
|
|
echo "<br>";
|
|
echo "TOP 10 DES APPELS<br>";
|
|
echo "=================<br>";
|
|
foreach($call as $v)
|
|
var_dump( $v[0] ." (".$contact[$v[0]].") \t\t\t". $v[1] ." appels");
|
|
|
|
echo "TOP 10 DES MMS/SMS<br>";
|
|
echo "==================<br>";
|
|
foreach($sms as $v)
|
|
var_dump( $v[0] ." (".$contact[$v[0]].") \t\t\t". $v[1] ." appels");
|
|
|
|
|
|
var_dump("\n\n\nOBJET COMPLET");
|
|
var_dump( $sms );
|
|
var_dump( $call );
|
|
var_dump( $contact );
|
|
}
|
|
|
|
parseCallLog();
|
|
|
|
debug();
|
|
|
|
|
|
|
|
// $api = new client();
|
|
|
|
// $response = $api->send('generate-network-chart-data', array(
|
|
// '@token'=> '48e701d4e72e4e35bc37c9a800b49d5400734d7b'
|
|
// ));
|
|
|
|
// var_dump($response);
|
|
|
|
?>
|