Parsage du journal d'appel op
This commit is contained in:
parent
0b06a50d8c
commit
cad72e9f28
38
automate.php
38
automate.php
|
@ -40,6 +40,9 @@
|
|||
// On formatte le numero
|
||||
if( preg_match("/^(?:\+33|33|0)(.+)/", $num, $m) )
|
||||
$num = '0'.$m[1];
|
||||
// Si pas un numero, on sort de la boucle
|
||||
else
|
||||
continue;
|
||||
|
||||
|
||||
/* (1) Si le type est MMS ou SMS */
|
||||
|
@ -77,8 +80,25 @@
|
|||
|
||||
/* [4] On trie par nombre de contacts
|
||||
=========================================================*/
|
||||
// rsort($msms);
|
||||
// rsort($call);
|
||||
$tmp = $msms;
|
||||
/* (2) Tri des appels */
|
||||
$maxMSMS = array();
|
||||
for( $i = 0 ; $i < 10 ; $i++ ){
|
||||
$maxval = max($tmp);
|
||||
$maxkey = array_search($maxval, $tmp);
|
||||
array_push( $maxMSMS, array($maxkey, $maxval) );
|
||||
unset($tmp[$maxkey]);
|
||||
}
|
||||
|
||||
$tmp = $call;
|
||||
/* (2) Tri des appels */
|
||||
$maxCalls = array();
|
||||
for( $i = 0 ; $i < 10 ; $i++ ){
|
||||
$maxval = max($tmp);
|
||||
$maxkey = array_search($maxval, $tmp);
|
||||
array_push( $maxCalls, array($maxkey, $maxval) );
|
||||
unset($tmp[$maxkey]);
|
||||
}
|
||||
|
||||
/* [5] On debug les donnees recues
|
||||
=========================================================*/
|
||||
|
@ -86,16 +106,16 @@
|
|||
echo "- ".count($msms)." par SMS/MMS<br>";
|
||||
echo "- ".count($call)." par telephone<br><br>";
|
||||
|
||||
echo 'Soit par ordre d\'affinites : <br>';
|
||||
echo "TOP 10 DES APPELS<br>";
|
||||
echo "=================<br>";
|
||||
$count = 0;
|
||||
foreach($call as $k=>$v){
|
||||
var_dump( $k );
|
||||
foreach($maxCalls as $v)
|
||||
var_dump( $v[0] ." (".$names[$v[0]].") \t\t\t". $v[1] ." appels");
|
||||
|
||||
echo "TOP 10 DES MMS/SMS<br>";
|
||||
echo "==================<br>";
|
||||
foreach($maxMSMS as $v)
|
||||
var_dump( $v[0] ." (".$names[$v[0]].") \t\t\t". $v[1] ." appels");
|
||||
|
||||
var_dump( $names[$k] ." => ". $v ." appels");
|
||||
$count++;
|
||||
}
|
||||
// var_dump( $call );
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue