CDR Stats: Added missing 'and' in SQL queries.

This commit is contained in:
Nate Jones 2015-04-05 02:26:31 +00:00
parent 92eed032c2
commit 63aba24bc7
1 changed files with 17 additions and 15 deletions

View File

@ -81,7 +81,8 @@ else {
if (strlen($where) == 0) {
if ($_GET['showall'] && permission_exists('xml_cdr_all')) {
$where = "where ";
} else {
}
else {
$where = "where domain_uuid = '".$_SESSION['domain_uuid']."' and ";
}
}
@ -109,7 +110,8 @@ else {
if (strlen($where) == 0) {
if ($_GET['showall'] && permission_exists('xml_cdr_all')) {
$where = "where ";
} else {
}
else {
$where = "where domain_uuid = '".$_SESSION['domain_uuid']."' and ";
}
}
@ -163,8 +165,8 @@ else {
} else {
$where = "where domain_uuid = '".$_SESSION['domain_uuid']."' and ";
}
$where .= "billsec = '0' ";
$where .= "and direction = 'inbound' ";
$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);
@ -191,8 +193,8 @@ else {
} else {
$where = "where domain_uuid = '".$_SESSION['domain_uuid']."' and ";
}
$where .= "billsec = '0' ";
$where .= "and direction = 'inbound' ";
$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']);
@ -216,8 +218,8 @@ else {
} else {
$where = "where domain_uuid = '".$_SESSION['domain_uuid']."' and ";
}
$where .= "billsec = '0' ";
$where .= "and direction = 'inbound' ";
$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']);
@ -241,8 +243,8 @@ else {
} else {
$where = "where domain_uuid = '".$_SESSION['domain_uuid']."' and ";
}
$where .= " billsec = '0' ";
$where .= "and direction = 'inbound' ";
$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']);