7,7 → 7,7 |
{ |
global $db, $g_display; |
|
$query = "select count(acctid), sum(billsec) from cdr where" . BaseQuery() |
$query = "select count(acctid), sum(billsec) from cdr where" . CdrBaseQueryWhere() |
. ($interval ? " and date_trunc('" . $interval . "', calldate)" |
. ($diff ? " + interval '$diff $interval'" : "") . " = date_trunc('" |
. $interval . "', current_date)" : ""); |
19,7 → 19,7 |
|
# active calls |
$db->query("select count(acctid), sum(extract(epoch from date_trunc('second',current_timestamp-linkdate)))" |
. " from activecalls where" . BaseQuery() . " and duration is null"); |
. " from activecalls where" . CdrBaseQueryWhere() . " and duration is null"); |
$db->fetch_row_idx(); |
$g_display->add_variables(array('CS_ACTIVE' => $db->get_field(0), |
'CS_ACTIVE_DUR' => FormatDuration($db->get_field(1)))); |