mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
The goal is to increase confidence in fusionpbx, one step is to run by default with error_reporting (E_ALL ^ E_NOTICE);
So, please find in this set numerous small changes which eliminate numerous php warning messages. Also, a small bug fix in an sql statistics routine, naming a count(*) field as count, so displaying correct detail. If any of the proposed changes are omitted, the relevant page will experience php warnings. There are no doubt fusionpbx pages I've yet to visit that still generate warnings, this set is nearly certainly not comprehensive.
This commit is contained in:
@@ -326,8 +326,8 @@ else {
|
||||
$stats[$i]['volume'] = get_call_volume_between($stats[$i]['start_epoch'], $stats[$i]['stop_epoch'], $sql_where);
|
||||
$stats[$i]['seconds'] = get_call_seconds_between($stats[$i]['start_epoch'], $stats[$i]['stop_epoch'], '');
|
||||
$stats[$i]['minutes'] = $stats[$i]['seconds'] / 60;
|
||||
$stats[$i]['avg_sec'] = $stats[$i]['seconds'] / $stats[$i]['volume'];
|
||||
$stats[$i]['avg_min'] = ($stats[$i]['volume'] - $stats[$i]['missed']) / 60;
|
||||
$stats[$i]['avg_sec'] = ($stats[$i]['volume']==0) ? 0 : $stats[$i]['seconds'] / $stats[$i]['volume'];
|
||||
$stats[$i]['avg_min'] = (($stats[$i]['volume']==0) ? 0 : $stats[$i]['volume'] - $stats[$i]['missed']) / 60;
|
||||
|
||||
//answer / seizure ratio
|
||||
if ($_GET['showall'] && permission_exists('xml_cdr_all')) {
|
||||
@@ -338,10 +338,10 @@ else {
|
||||
$where .= " billsec = '0' and ";
|
||||
$where .= " direction = 'inbound' and ";
|
||||
$stats[$i]['missed'] = get_call_volume_between($stats[$i]['start_epoch'], $stats[$i]['stop_epoch'], $where);
|
||||
$stats[$i]['asr'] = (($stats[$i]['volume'] - $stats[$i]['missed']) / ($stats[$i]['volume']) * 100);
|
||||
$stats[$i]['asr'] = ($stats[$i]['volume']==0) ? 0 : (($stats[$i]['volume'] - $stats[$i]['missed']) / ($stats[$i]['volume']) * 100);
|
||||
|
||||
//average length of call
|
||||
$stats[$i]['aloc'] = $stats[$i]['minutes'] / ($stats[$i]['volume'] - $stats[$i]['missed']);
|
||||
$stats[$i]['aloc'] = ($stats[$i]['volume']==0) ? 0 : $stats[$i]['minutes'] / ($stats[$i]['volume'] - $stats[$i]['missed']);
|
||||
}
|
||||
|
||||
//call info for a day
|
||||
@@ -356,7 +356,7 @@ else {
|
||||
$stats[$i]['volume'] = get_call_volume_between($stats[$i]['start_epoch'], $stats[$i]['stop_epoch'], $sql_where);
|
||||
$stats[$i]['seconds'] = get_call_seconds_between($stats[$i]['start_epoch'], $stats[$i]['stop_epoch'], '');
|
||||
$stats[$i]['minutes'] = $stats[$i]['seconds'] / 60;
|
||||
$stats[$i]['avg_sec'] = $stats[$i]['seconds'] / $stats[$i]['volume'];
|
||||
$stats[$i]['avg_sec'] = ($stats[$i]['volume']==0) ? 0 : $stats[$i]['seconds'] / $stats[$i]['volume'];
|
||||
$stats[$i]['avg_min'] = ($stats[$i]['volume'] - $stats[$i]['missed']) / (60*24);
|
||||
if ($_GET['showall'] && permission_exists('xml_cdr_all')) {
|
||||
$where = "where ";
|
||||
@@ -366,8 +366,8 @@ else {
|
||||
$where .= " billsec = '0' and ";
|
||||
$where .= " direction = 'inbound' and ";
|
||||
$stats[$i]['missed'] = get_call_volume_between($stats[$i]['start_epoch'], $stats[$i]['stop_epoch'], $where);
|
||||
$stats[$i]['asr'] = (($stats[$i]['volume'] - $stats[$i]['missed']) / ($stats[$i]['volume']) * 100);
|
||||
$stats[$i]['aloc'] = $stats[$i]['minutes'] / ($stats[$i]['volume'] - $stats[$i]['missed']);
|
||||
$stats[$i]['asr'] = ($stats[$i]['volume']==0) ? 0 :(($stats[$i]['volume'] - $stats[$i]['missed']) / ($stats[$i]['volume']) * 100);
|
||||
$stats[$i]['aloc'] = ($stats[$i]['volume']==0) ? 0 :$stats[$i]['minutes'] / ($stats[$i]['volume'] - $stats[$i]['missed']);
|
||||
$i++;
|
||||
|
||||
//call info for a week
|
||||
@@ -381,8 +381,8 @@ else {
|
||||
$stats[$i]['volume'] = get_call_volume_between($stats[$i]['start_epoch'], $stats[$i]['stop_epoch'], $sql_where);
|
||||
$stats[$i]['seconds'] = get_call_seconds_between($stats[$i]['start_epoch'], $stats[$i]['stop_epoch'], '');
|
||||
$stats[$i]['minutes'] = $stats[$i]['seconds'] / 60;
|
||||
$stats[$i]['avg_sec'] = $stats[$i]['seconds'] / $stats[$i]['volume'];
|
||||
$stats[$i]['avg_min'] = ($stats[$i]['volume'] - $stats[$i]['missed']) / (60*24*7);
|
||||
$stats[$i]['avg_sec'] = ($stats[$i]['volume']==0) ? 0 :$stats[$i]['seconds'] / $stats[$i]['volume'];
|
||||
$stats[$i]['avg_min'] = ($stats[$i]['volume']==0) ? 0 :($stats[$i]['volume'] - $stats[$i]['missed']) / (60*24*7);
|
||||
if ($_GET['showall'] && permission_exists('xml_cdr_all')) {
|
||||
$where = "where ";
|
||||
} else {
|
||||
@@ -391,8 +391,8 @@ else {
|
||||
$where .= " billsec = '0' and ";
|
||||
$where .= " direction = 'inbound' and ";
|
||||
$stats[$i]['missed'] = get_call_volume_between($stats[$i]['start_epoch'], $stats[$i]['stop_epoch'], $where);
|
||||
$stats[$i]['asr'] = (($stats[$i]['volume'] - $stats[$i]['missed']) / ($stats[$i]['volume']) * 100);
|
||||
$stats[$i]['aloc'] = $stats[$i]['minutes'] / ($stats[$i]['volume'] - $stats[$i]['missed']);
|
||||
$stats[$i]['asr'] = ($stats[$i]['volume']==0) ? 0 :(($stats[$i]['volume'] - $stats[$i]['missed']) / ($stats[$i]['volume']) * 100);
|
||||
$stats[$i]['aloc'] = ($stats[$i]['volume']==0) ? 0 :$stats[$i]['minutes'] / ($stats[$i]['volume'] - $stats[$i]['missed']);
|
||||
$i++;
|
||||
|
||||
//call info for a month
|
||||
@@ -406,7 +406,7 @@ else {
|
||||
$stats[$i]['volume'] = get_call_volume_between($stats[$i]['start_epoch'], $stats[$i]['stop_epoch'], $sql_where);
|
||||
$stats[$i]['seconds'] = get_call_seconds_between($stats[$i]['start_epoch'], $stats[$i]['stop_epoch'], '');
|
||||
$stats[$i]['minutes'] = $stats[$i]['seconds'] / 60;
|
||||
$stats[$i]['avg_sec'] = $stats[$i]['seconds'] / $stats[$i]['volume'];
|
||||
$stats[$i]['avg_sec'] = ($stats[$i]['volume']==0) ? 0 :$stats[$i]['seconds'] / $stats[$i]['volume'];
|
||||
$stats[$i]['avg_min'] = ($stats[$i]['volume'] - $stats[$i]['missed']) / (60*24*30);
|
||||
if ($_GET['showall'] && permission_exists('xml_cdr_all')) {
|
||||
$where = "where ";
|
||||
@@ -416,8 +416,8 @@ else {
|
||||
$where .= " billsec = '0' and ";
|
||||
$where .= " direction = 'inbound' and ";
|
||||
$stats[$i]['missed'] = get_call_volume_between($stats[$i]['start_epoch'], $stats[$i]['stop_epoch'], $where);
|
||||
$stats[$i]['asr'] = (($stats[$i]['volume'] - $stats[$i]['missed']) / ($stats[$i]['volume']) * 100);
|
||||
$stats[$i]['aloc'] = $stats[$i]['minutes'] / ($stats[$i]['volume'] - $stats[$i]['missed']);
|
||||
$stats[$i]['asr'] = ($stats[$i]['volume']==0) ? 0 :(($stats[$i]['volume'] - $stats[$i]['missed']) / ($stats[$i]['volume']) * 100);
|
||||
$stats[$i]['aloc'] =($stats[$i]['volume']==0) ? 0 : $stats[$i]['minutes'] / ($stats[$i]['volume'] - $stats[$i]['missed']);
|
||||
$i++;
|
||||
|
||||
//show the graph
|
||||
|
||||
Reference in New Issue
Block a user