20,10 → 20,14 |
$cdr_detail = array(); |
$db->query_params('SELECT * FROM cdr WHERE acctid=$1', array($_GET['detail'])); |
$detail = $db->fetch_row(); |
|
for ($i=0;$i<$db->num_fields();$i++) { |
$col = $db->get_field_name($i); |
$cdr_detail['CDR_'.strtoupper($col)] = $detail[$col]; |
} |
$cdr_detail['CDR_DURATION_F'] = Duration($detail['duration']); |
$cdr_detail['CDR_BILLSEC_F'] = Duration($detail['billsec']); |
|
$display->add_variables($cdr_detail); |
$display->add_template('cdr_detail'); |
} |
88,16 → 92,13 |
} |
} |
|
$list_query = "SELECT acctid,calldate,clid,src,dst,duration,billsec,disposition from cdr where 1=1" |
$list_query = "SELECT acctid,calldate,src,dst,billsec,disposition" |
. " from cdr where dstchannel != ''" |
. $query . " ORDER BY calldate desc" . $query_limit; |
$result = $db->query_params($list_query, $params); |
|
$calls_number = $db->num_rows(); |
$header = array(); |
for ($hdr=0;$hdr<$db->num_fields();$hdr++) { |
array_push($header, $db->get_field_name($hdr)); |
} |
$cdr = new Table($header); |
$cdr = new Table(array('ID', 'Call Date', 'Source', 'Destination', 'Duration', 'Disposition')); |
$cdr->set_table_class('stat cdr list'); |
|
while ($line = $db->fetch_row()) { |
104,12 → 105,10 |
$cdr->newrow(); |
$cdr->addcell($line['acctid']); |
$cdr->addcell($line['calldate']); |
$cdr->addcell($line['clid']); |
$cdr->addcell($line['src']); |
$cdr->addcell($line['dst']); |
$cdr->addcell(Duration($line['duration'])); |
$cdr->addcell(Duration($line['billsec'])); |
$cdr->addcell($line['disposition']); |
$cdr->addcell($line['disposition'] == 'ANSWERED' ? Duration($line['billsec']) : ''); |
$cdr->addcell(strtolower($line['disposition'])); |
$cdr->addcell(array('class' => 'link', 'html' => |
display_link($PHP_SELF.'?m=cdr&detail='.$line['acctid'], 'Details'))); |
} |
116,7 → 115,7 |
$display->add_text($cdr->build()); |
|
// summary |
$sum_query = "SELECT sum(duration) as dur, sum(billsec) as bill from cdr where 1=1" . $query; |
$sum_query = "SELECT sum(duration) as dur, sum(billsec) as bill from cdr where dstchannel != ''" . $query; |
$result = $db->query_params($sum_query, $params); |
$line = $db->fetch_row(); |
$cdr = new Table(); |