зеркало из https://github.com/mozilla/pjs.git
Nothing says I love you like more stats. And you'd rather have chocolate? Adding breakdown by product, and by os, both very interesting.
This commit is contained in:
Родитель
aa813e02bc
Коммит
56a3428935
|
@ -66,14 +66,32 @@ $content->assign('users_quant', $uniqueusers);
|
|||
$avgRepPerUsr = $reports/$uniqueusers;
|
||||
$content->assign('avgRepPerUsr', $avgRepPerUsr);
|
||||
|
||||
// Top Users (by reports)
|
||||
// XXX TODO
|
||||
|
||||
// Total Reports per product
|
||||
// XXX TODO
|
||||
$product_q =& $db->Execute("SELECT DISTINCT (report.report_product),
|
||||
COUNT( report.report_product ) AS total
|
||||
FROM report
|
||||
GROUP BY report.report_product
|
||||
ORDER BY total DESC");
|
||||
|
||||
while(!$product_q->EOF){
|
||||
$product[] = $product_q->fields;
|
||||
$product_q->MoveNext();
|
||||
}
|
||||
$content->assign('product', $product);
|
||||
|
||||
// Total Reports per platform
|
||||
// XXX TODO
|
||||
$platform_q =& $db->Execute("SELECT DISTINCT (report.report_platform),
|
||||
COUNT( report.report_platform ) AS total
|
||||
FROM report
|
||||
GROUP BY report.report_platform
|
||||
ORDER BY total DESC");
|
||||
|
||||
while(!$platform_q->EOF){
|
||||
$platform[] = $platform_q->fields;
|
||||
$platform_q->MoveNext();
|
||||
}
|
||||
$content->assign('platform', $platform);
|
||||
|
||||
|
||||
// Total Hosts
|
||||
$uniquehosts_q =& $db->Execute("SELECT COUNT(*)
|
||||
|
@ -97,10 +115,6 @@ $last7days_q =& $db->Execute("SELECT COUNT(*)
|
|||
$last7days = $last7days_q->fields['COUNT(*)'];
|
||||
$content->assign('last7days', $last7days);
|
||||
|
||||
// Reports by month
|
||||
// XXX TODO
|
||||
|
||||
|
||||
// disconnect database
|
||||
$db->Close();
|
||||
|
||||
|
|
|
@ -24,5 +24,32 @@
|
|||
<div class="title">Reports (7d):</div>
|
||||
<div class="data">{$last7days}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title">By Platform:</div>
|
||||
<div class="data">
|
||||
<table>
|
||||
{section name=sys loop=$platform}
|
||||
<tr>
|
||||
<td>{$platform[sys].report_platform}</td>
|
||||
<td>{$platform[sys].total}</td>
|
||||
</tr>
|
||||
{/section}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="title">By Product:</div>
|
||||
<div class="data">
|
||||
<table>
|
||||
{section name=prod loop=$product}
|
||||
<tr>
|
||||
<td>{$product[prod].report_product}</td>
|
||||
<td>{$product[prod].total}</td>
|
||||
</tr>
|
||||
{/section}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br />
|
Загрузка…
Ссылка в новой задаче