69 lines
1.8 KiB
PHP
Executable File
69 lines
1.8 KiB
PHP
Executable File
<?php define('__ROOT__', dirname(__FILE__) );
|
|
require_once __ROOT__.'/manager/autoloader.php';
|
|
|
|
use \manager\ModuleRequest;
|
|
use \manager\ResourceDispatcher;
|
|
use \manager\ManagerError;
|
|
use \manager\Repo;
|
|
|
|
use \manager\module\callLog;
|
|
|
|
debug();
|
|
|
|
|
|
|
|
|
|
|
|
/* 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('callLog/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
|
|
=========================================================*/
|
|
$obj = $answer->get('object');
|
|
|
|
/* [5] On debug les donnees recues
|
|
=========================================================*/
|
|
var_dump( "Il y a ".count($obj['contact'])." personnes :" );
|
|
var_dump( "- ".count($obj['SMS'])." par SMS/MMS" );
|
|
var_dump( "- ".count($obj['CALL'])." par telephone" );
|
|
echo "<br>";
|
|
echo "TOP 10 DES APPELS<br>";
|
|
echo "=================<br>";
|
|
foreach($obj['CALL'] as $v)
|
|
var_dump( $v[0] ." (".$obj['contact'][$v[0]].") \t\t\t". $v[1] ." appels");
|
|
|
|
echo "TOP 10 DES MMS/SMS<br>";
|
|
echo "==================<br>";
|
|
foreach($obj['SMS'] as $v)
|
|
var_dump( $v[0] ." (".$obj['contact'][$v[0]].") \t\t\t". $v[1] ." appels");
|
|
|
|
|
|
var_dump("\n\n\nOBJET COMPLET");
|
|
var_dump( $obj );
|
|
}
|
|
|
|
parseCallLog();
|
|
|
|
?>
|