blob: fd513bcad93576a9d679d9173963075d442a0f57 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
<script>
function priceSorter(a, b) {
if( a ) {
a = parseFloat( a.replace(/[^\d.]/g,'') );
}
if( b ) {
b = parseFloat( b.replace(/[^\d.]/g,'') );
}
if (a > b) return 1;
if (a < b) return -1;
return 0;
}
</script>
<div class="floaticon">{bithelp}</div>
<div class="display statistics">
<header class="page-header">
<div class="pull-right">{minifind period_format="`$smarty.request.period_format`" timeframe="`$smarty.request.timeframe`"}</div>
<h1><a class="btn btn-xs btn-default" href="{$smarty.const.STATS_PKG_URL}users.php">{booticon iname="icon-arrow-left"}</a> {tr}User Registration Statistics{/tr} {$smarty.request.timeframe|escape}</h1>
</header>
<div class="body">
<table class="table data">
{assign var=refCount value=0}
{foreach from=$referers key=host item=reg}
{assign var=hostKey value=$host|strip:'.':''}
{assign var=regCount value=$reg|@count}
{assign var=totalReg value=$totalReg+$regCount}
{assign var=hostHash value=$host|md5}
<tr>
<th>{booticon iname='icon-search' class="btn btn-default btn-sm" onclick="BitBase.toggleElementDisplay('`$hostHash`','table-row-group');"}</th>
<th style="position:relative"><div style="position:absolute;z-index:-1;width:{math equation="round( ( r / m ) * 100 )" r=$reg|@count m=$maxRegistrations}%; background:#CAF3FF;padding:0 0 0 5px;"> </div>{$host|escape}</th>
<th class="text-right"><div class="floaticon"> [{math equation="round((x / y) * 100)" x=$reg|@count y=$totalRegistrations}% ] <a href="{$smarty.server.SCRIPT_NAME}?period={$smarty.request.period}&find={$host|escape}">{booticon iname='icon-clock'}</a></div></th>
{if $aggregateStats.$host}
<th class="text-right">{$reg|@count} {booticon iname="icon-user"}</th>
<th class="text-right">{$aggregateStats.$host.orders|default:"0"} {booticon iname="icon-shopping-cart"}</th>
<th class="text-right">{$gCommerceCurrencies->format($aggregateStats.$host.revenue|default:"0.00")}</th>
{/if}
</tr>
<tbody id="{$hostHash}" style="display:none">
<tr><td colspan="6">
<div class="panel-group" id="accordion-{$hostHash}" role="tablist" aria-multiselectable="true">
{foreach from=$aggregateStats.$host.values item=paramValues key=paramKey}
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="accordion-{$paramKey}">
<div class="pull-right">{$paramValues.registrations} {booticon iname="icon-user"} {$paramValues.orders} {booticon iname="icon-shopping-cart"} {$gCommerceCurrencies->format($paramValues.revenue)}</div>
<h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion-{$hostHash}" href="#collapse-{$hostHash}-{$paramKey}" aria-expanded="false" aria-controls="collapse-{$hostHash}-{$paramKey}">{$paramKey}</a>
</h4>
</div>
{if $paramValues.values}
<div id="collapse-{$hostHash}-{$paramKey}" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
<div class="panel-group" id="accordion-{$hostHash}-{$paramKey}" role="tablist" aria-multiselectable="true">
<table data-toggle="table">
<thead>
<tr>
<th>{$paramKey}</th>
<th class="text-center" data-field="registrations" data-sortable="true">{booticon iname="icon-user"}</th>
<th class="text-center" data-field="order_count" data-sortable="true">{booticon iname="icon-shopping-cart"}</th>
<th class="text-center" data-field="revenue" data-sortable="true" data-sorter="priceSorter">Revenue</th>
</tr>
</thead>
<tbody>
{foreach from=$paramValues.values item=valueHash key=valueKey name=paramval}
<tr>
<td><a href="#" onclick="BitBase.toggleElementDisplay('order-list-{$hostHash}-{$paramKey}-{$valueKey}','block');return false;">{$valueKey|default:"unknown"}</a>
<ol class="data" id="order-list-{$hostHash}-{$paramKey}-{$valueKey}" style="display:none">
{foreach from=$valueHash.users item=userHash}
<li class="item width100p" style="border-bottom:1px solid #cccccc;">
<div class="inline-block width10p date">{$userHash.registration_date|bit_date_format}</div>
<div class="inline-block width65p">{if $userHash.referer_url}<a href="{$userHash.referer_url|escape}">{$userHash.referer_url|stats_referer_display_short}</a><br/>{/if}{BitUser::getDisplayLinkFromHash($userHash,1)} - {$userHash.email}</div>
<div class="inline-block text-right width10p">{if $userHash.revenue.total_orders}<a target="_new" href="{$smarty.const.BITCOMMERCE_PKG_URL}admin/list_orders.php?user_id={$userHash.user_id}">{$userHash.revenue.total_orders} {tr}orders{/tr}</a>{/if}</div>
<div class="inline-block text-right width10p">{if $userHash.revenue.total_revenue}{$gCommerceCurrencies->format($userHash.revenue.total_revenue)}{/if}</div>
</li>
{/foreach}
</ol>
</td>
<td class="text-right">{if $valueHash.users}{$valueHash.users|count}{/if}</td>
<td class="text-right">{if $valueHash.orders}{$valueHash.orders}{/if}</td>
<td class="text-right">{if $valueHash.revenue}{$gCommerceCurrencies->format($valueHash.revenue)}{/if}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
{/if}
</div>
{/foreach}
{assign var=paramKey value="Everything"}
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="accordion-{$paramKey}">
{if $aggregateStats.$host}
<div class="pull-right">
{$reg|@count} {booticon iname="icon-user"} {$aggregateStats.$host.orders|default:"0"} {booticon iname="icon-shopping-cart"} {$gCommerceCurrencies->format($aggregateStats.$host.revenue|default:"0.00")}
</div>
{/if}
<h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion-{$hostHash}" href="#collapse-{$hostHash}-{$paramKey}" aria-expanded="false" aria-controls="collapse-{$hostHash}-{$paramKey}">{$paramKey}</a>
</h4>
</div>
{if $reg}
<div id="collapse-{$hostHash}-{$paramKey}" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
<div class="panel-group" id="accordion-{$hostHash}-{$paramKey}" role="tablist" aria-multiselectable="true">
<table data-toggle="table">
<thead>
<tr>
<th></th>
<th data-field="name" data-sortable="true">User</th>
<th class="text-center" data-field="order_count" data-sortable="true">{booticon iname="icon-shopping-cart"}</th>
<th class="text-center" data-field="revenue" data-sortable="true" data-sorter="priceSorter">Revenue</th>
</tr>
</thead>
<tbody>
{foreach from=$reg key=userId item=user}
<tr class="{cycle values='odd,even'}">
<td class="date">{$user.registration_date|bit_date_format}</td>
<td><strong style="font-size:larger">{displayname hash=$user}</strong>{if $user.referer_url}<br/><a href="{$user.referer_url|escape}">{$user.referer_url|stats_referer_display_short}</a>{/if}</td>
<td class="text-right">{if $user.revenue.total_orders}{$user.revenue.total_orders}{/if}</td>
<td class="text-right">{if $user.revenue.total_revenue}{$gCommerceCurrencies->format($user.revenue.total_revenue)}{/if}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
{/if}
</div>
</div>
</td></tr>
</tbody>
{foreachelse}
<tr class="norecords"><td colspan="3">{tr}No records found{/tr}</td></tr>
{/foreach}
<tr>
<th style="width:5%;">{$totalReg}</th>
<th>{tr}Total Registrations{/tr}</th>
</tr>
</table>
</div> <!-- end .body -->
{include file="bitpackage:kernel/pagination.tpl"}
</div> <!-- end .statistics -->
|