Added Page statistics

This commit is contained in:
Dmitriy Simushev 2011-11-14 18:41:31 +00:00
parent 82d4e79dc9
commit 863de0057c
4 changed files with 39 additions and 1 deletions

View File

@ -402,6 +402,9 @@ report.byoperator.2=Chat Threads
report.byoperator.3=Messages
report.byoperator.4=Average message length (in chars)
report.byoperator.title=Threads by operator
report.bypage.1=Page
report.bypage.2=Chat threads
report.bypage.title=Chat threads by page
report.no_items=Not enough data
report.total=Total:
resetpwd.changed.title=Your password has been changed!

View File

@ -400,6 +400,9 @@ report.byoperator.2=
report.byoperator.3=Сообщений
report.byoperator.4=Средняя длина сообщения (в символах)
report.byoperator.title=Статистика по операторам
report.bypage.1=Страница
report.bypage.2=Диалогов
report.bypage.title=Статистика по страницам
report.no_items=Мало данных
report.total=Итого:
restore.back_to_login=Вернуться на главную

View File

@ -80,6 +80,8 @@ $page['reportByAgent'] = select_multi_assoc("select vclocalename as name, COUNT(
"from ${mysqlprefix}chatmessage, ${mysqlprefix}chatoperator " .
"where agentId = operatorid AND unix_timestamp(dtmcreated) >= $start AND unix_timestamp(dtmcreated) < $end group by operatorid", $link);
$page['reportByPage'] = select_multi_assoc("SELECT COUNT(threadid) as chattimes, referer FROM ${mysqlprefix}chatthread WHERE unix_timestamp(dtmcreated) >= $start AND unix_timestamp(dtmcreated) < $end GROUP BY referer", $link);
$page['showresults'] = count($errors) == 0;
close_connection($link);

View File

@ -126,7 +126,7 @@ require_once('inc_errors.php');
<?php echo getlocal("report.byoperator.4") ?>
</th></tr>
</thead>
<tbody>
<tbody>
<?php if( $page['reportByAgent'] ) { ?>
<?php foreach( $page['reportByAgent'] as $row ) { ?>
<tr>
@ -146,6 +146,36 @@ require_once('inc_errors.php');
</tbody>
</table>
<br/>
<br/>
<div class="tabletitle"><?php echo getlocal("report.bypage.title") ?></div>
<table class="statistics">
<thead>
<tr><th>
<?php echo getlocal("report.bypage.1") ?>
</th><th>
<?php echo getlocal("report.bypage.2") ?>
</th></tr>
</thead>
<tbody>
<?php if( $page['reportByPage'] ) { ?>
<?php foreach( $page['reportByPage'] as $row ) { ?>
<tr>
<td><a href="<?php echo htmlspecialchars($row['referer']) ?>"><?php echo htmlspecialchars($row['referer']) ?></a></td>
<td><?php echo $row['chattimes'] ?></td>
</tr>
<?php } ?>
<?php } else { ?>
<tr>
<td colspan="2">
<?php echo getlocal("report.no_items") ?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php } ?>
<?php