Added view times in by page statistics

This commit is contained in:
Dmitriy Simushev 2011-11-24 16:25:43 +00:00
parent 567f61d7ca
commit 7569720a52
4 changed files with 12 additions and 5 deletions

View File

@ -405,7 +405,8 @@ 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.2=View times
report.bypage.3=Chat threads
report.bypage.title=Chat threads by page
report.no_items=Not enough data
report.total=Total:

View File

@ -403,7 +403,8 @@ report.byoperator.3=
report.byoperator.4=Средняя длина сообщения (в символах)
report.byoperator.title=Статистика по операторам
report.bypage.1=Страница
report.bypage.2=Диалогов
report.bypage.2=Просмотров
report.bypage.3=Диалогов
report.bypage.title=Статистика по страницам
report.no_items=Мало данных
report.total=Итого:

View File

@ -82,7 +82,9 @@ $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['reportByPage'] = select_multi_assoc("SELECT COUNT(p.pageid) as visittimes, p.address, COUNT(t.threadid) as chattimes " .
"FROM ${mysqlprefix}visitedpage p LEFT OUTER JOIN ${mysqlprefix}chatthread t ON (p.address = t.referer AND DATE(p.visittime) = DATE(t.dtmcreated)) " .
"WHERE unix_timestamp(p.visittime) >= $start AND unix_timestamp(p.visittime) < $end GROUP BY p.address", $link);
$page['showresults'] = count($errors) == 0;

View File

@ -164,19 +164,22 @@ require_once('inc_errors.php');
<?php echo getlocal("report.bypage.1") ?>
</th><th>
<?php echo getlocal("report.bypage.2") ?>
</th><th>
<?php echo getlocal("report.bypage.3") ?>
</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><a href="<?php echo htmlspecialchars($row['address']) ?>"><?php echo htmlspecialchars($row['address']) ?></a></td>
<td><?php echo $row['visittimes'] ?></td>
<td><?php echo $row['chattimes'] ?></td>
</tr>
<?php } ?>
<?php } else { ?>
<tr>
<td colspan="2">
<td colspan="3">
<?php echo getlocal("report.no_items") ?>
</td>
</tr>