Admin Dashboard - Add Year to Top "Compare" Statistics 2.2.3

I believe there is/was a little confusion as to what statistics the Admin Dashboard Order Statistics thread was referring to so I have created this thread to show how to add the Year to the top statistic which compares order totals from the previous day, week, month and now year.



In /skins/basic/admin/views/index/index.tpl replace:

	<div class="statistics-body"><br />
		<a href="{"orders.manage?time_from=`$date.today`&time_to=`$date.TIME`&period=C"|fn_url}" class="section"><span class="price">{include file="common_templates/price.tpl" value=$orders_stats.daily_orders.totals.total_paid} </span><u>{$lang.today}</u> <span class="block">{$lang.prev} {include file="common_templates/price.tpl" value=$orders_stats.daily_orders.prev_totals.total_paid} <span class="percent-{if $orders_stats.daily_orders.totals.profit >= 0}up{else}down{/if}">{if $orders_stats.daily_orders.totals.profit}({if $orders_stats.daily_orders.totals.profit >= 0}+{/if}{$orders_stats.daily_orders.totals.profit}%){/if}</span></span></a><br />
		<br />
		<a href="{"orders.manage?time_from=`$date.week`&time_to=`$date.TIME`&period=C"|fn_url}" class="section"><span class="price">{include file="common_templates/price.tpl" value=$orders_stats.weekly_orders.totals.total_paid} </span><u>{$lang.week}</u> <span class="block">{$lang.prev} {include file="common_templates/price.tpl" value=$orders_stats.weekly_orders.prev_totals.total_paid} <span class="percent-{if $orders_stats.weekly_orders.totals.profit >= 0}up{else}down{/if}">{if $orders_stats.weekly_orders.totals.profit}({if $orders_stats.weekly_orders.totals.profit >= 0}+{/if}{$orders_stats.weekly_orders.totals.profit}%){/if}</span></span></a><br />
		<br />
		<a href="{"orders.manage?time_from=`$date.month`&time_to=`$date.TIME`&period=C"|fn_url}" class="section last"><span class="price">{include file="common_templates/price.tpl" value=$orders_stats.monthly_orders.totals.total_paid} </span><u>{$lang.month}</u> <span class="block">{$lang.prev} {include file="common_templates/price.tpl" value=$orders_stats.monthly_orders.prev_totals.total_paid} <span class="percent-{if $orders_stats.monthly_orders.totals.profit >= 0}up{else}down{/if}">{if $orders_stats.monthly_orders.totals.profit}({if $orders_stats.monthly_orders.totals.profit >= 0}+{/if}{$orders_stats.monthly_orders.totals.profit}%){/if}</span></span></a><br />
	</div>
```<br />
<br />
with:<br />
```php
	<div class="statistics-body"><br />
		<a href="{"orders.manage?time_from=`$date.today`&time_to=`$date.TIME`&period=C"|fn_url}" class="section"><span class="price">{include file="common_templates/price.tpl" value=$orders_stats.daily_orders.totals.total_paid} </span><u>{$lang.today}</u> <span class="block">{$lang.prev} {include file="common_templates/price.tpl" value=$orders_stats.daily_orders.prev_totals.total_paid} <span class="percent-{if $orders_stats.daily_orders.totals.profit >= 0}up{else}down{/if}">{if $orders_stats.daily_orders.totals.profit}({if $orders_stats.daily_orders.totals.profit >= 0}+{/if}{$orders_stats.daily_orders.totals.profit}%){/if}</span></span></a><br />
		<br />
		<a href="{"orders.manage?time_from=`$date.week`&time_to=`$date.TIME`&period=C"|fn_url}" class="section"><span class="price">{include file="common_templates/price.tpl" value=$orders_stats.weekly_orders.totals.total_paid} </span><u>{$lang.week}</u> <span class="block">{$lang.prev} {include file="common_templates/price.tpl" value=$orders_stats.weekly_orders.prev_totals.total_paid} <span class="percent-{if $orders_stats.weekly_orders.totals.profit >= 0}up{else}down{/if}">{if $orders_stats.weekly_orders.totals.profit}({if $orders_stats.weekly_orders.totals.profit >= 0}+{/if}{$orders_stats.weekly_orders.totals.profit}%){/if}</span></span></a><br />
		<br />
		<a href="{"orders.manage?time_from=`$date.month`&time_to=`$date.TIME`&period=C"|fn_url}" class="section"><span class="price">{include file="common_templates/price.tpl" value=$orders_stats.monthly_orders.totals.total_paid} </span><u>{$lang.month}</u> <span class="block">{$lang.prev} {include file="common_templates/price.tpl" value=$orders_stats.monthly_orders.prev_totals.total_paid} <span class="percent-{if $orders_stats.monthly_orders.totals.profit >= 0}up{else}down{/if}">{if $orders_stats.monthly_orders.totals.profit}({if $orders_stats.monthly_orders.totals.profit >= 0}+{/if}{$orders_stats.monthly_orders.totals.profit}%){/if}</span></span></a><br />
		<br />
		<a href="{"orders.manage?time_from=`$date.year`&time_to=`$date.TIME`&period=C"|fn_url}" class="section last"><span class="price">{include file="common_templates/price.tpl" value=$orders_stats.yearly_orders.totals.total_paid} </span><u>{$lang.year}</u> <span class="block">{$lang.prev} {include file="common_templates/price.tpl" value=$orders_stats.yearly_orders.prev_totals.total_paid} <span class="percent-{if $orders_stats.yearly_orders.totals.profit >= 0}up{else}down{/if}">{if $orders_stats.yearly_orders.totals.profit}({if $orders_stats.yearly_orders.totals.profit >= 0}+{/if}{$orders_stats.yearly_orders.totals.profit}%){/if}</span></span></a><br />
	</div>
```<br />
<br />
You will also need to edit  [i][b]/skins/basic/admin/styles.css [/b][/i]and change the width from 31 to 23 so the data will fit properly:<br />
```php
.statistics-box.overall .statistics-body .section {<br />
	display: inline-block;<br />
	width: 23%;<br />
	margin: 0 6px;<br />
	white-space: normal;<br />
	border-right: 1px dotted #ccc;<br />
	text-decoration: none;<br />
}
```<br />
<br />
[attachment=4634:Administration panel_1319362178622.png]<p><a href="127.0.0.1/uploads/monthly_10_2011/post-9394-0-10558300-1319362299.png">Administration panel_1319362178622.png</a></p>

After applying this to my live store, the yearly data is not being pulled. Now the discussion can continue to figure out how to pull the data. I am not interested enough in this so I will more than likely not be participating.