Updates the store administration home page, and added the commission rate to the affiliate sign up email.

git-svn-id: http://svn.cleancode.org/svn/pickles@111 4d10bc64-7434-11dc-a737-d2d0f8310089
This commit is contained in:
Josh Sherman 2009-03-25 01:26:15 +00:00
parent fab27b3332
commit 48a98802f3
3 changed files with 72 additions and 1 deletions

View file

@ -134,6 +134,10 @@ Your custom URL:
---------------------
{$this->config->store->url}/referral/" . md5($affiliate_id) . "
Your commission rate:
---------------------
{$_REQUEST['commission_rate']}%
------------------
Thank you for your interest in the {$this->config->store->title} Affiliate Program.

View file

@ -4,6 +4,19 @@ class store_admin_home extends store_admin {
public function __default() {
$sql = '
SELECT
(SELECT COUNT(id) FROM orders WHERE DATE_FORMAT(time_placed, "%Y%m%d") = DATE_FORMAT(CURDATE(), "%Y%m%d")) AS orders_today,
(SELECT COUNT(id) FROM orders WHERE DATE_FORMAT(time_placed, "%Y%m") = DATE_FORMAT(CURDATE(), "%Y%m")) AS orders_mtd,
(SELECT COUNT(id) FROM orders WHERE DATE_FORMAT(time_placed, "%Y") = DATE_FORMAT(CURDATE(), "%Y")) AS orders_ytd,
(SELECT SUM(total_amount) - SUM(shipping_amount) FROM orders WHERE DATE_FORMAT(time_placed, "%Y%m%d") = DATE_FORMAT(CURDATE(), "%Y%m%d")) AS sales_today,
(SELECT SUM(total_amount) - SUM(shipping_amount) FROM orders WHERE DATE_FORMAT(time_placed, "%Y%m") = DATE_FORMAT(CURDATE(), "%Y%m")) AS sales_mtd,
(SELECT SUM(total_amount) - SUM(shipping_amount) FROM orders WHERE DATE_FORMAT(time_placed, "%Y") = DATE_FORMAT(CURDATE(), "%Y")) AS sales_ytd,
(SELECT COUNT(id) FROM customers) AS total_customers;
';
$this->setPublic('statistics', $this->db->getRow($sql));
}
}

View file

@ -1 +1,55 @@
This will eventually look like a better version of the DigiCrap Admin.
{literal}
<style>
fieldset {
width: 200px;
border: 1px solid black;
padding: 10px;
background-color: #E9BFFF;
;
}
fieldset legend {
font-weight: bold;
font-size: 14pt;
}
fieldset dl dt {
float: left;
clear: left;
width: 60px;
text-align: right;
padding-right: 10px;
}
fieldset dl dd {
float: left;
}
</style>
{/literal}
<div style="float: left">The best is yet to come... under construction.</div>
<fieldset class="float-right">
<legend>Statistics</legend>
<b>Sales:</b>
<dl>
<dt>Today:</dt>
<dd>${$module.statistics.sales_today|number_format:2}</dd>
<dt>Y-T-D:</dt>
<dd>${$module.statistics.sales_ytd|number_format:2}</dd>
<dt>M-T-D:</dt>
<dd>${$module.statistics.sales_mtd|number_format:2}</dd>
</dl>
<br clear="both" /><br />
<b>Orders:</b>
<dl>
<dt>Today:</dt>
<dd>{$module.statistics.orders_today}</dd>
<dt>Y-T-D:</dt>
<dd>{$module.statistics.orders_ytd}</dd>
<dt>M-T-D:</dt>
<dd>{$module.statistics.orders_mtd}</dd>
</dl>
<br clear="both" /><br />
<b>Customers:</b>
<dl>
<dt>Total:</dt>
<dd>{$module.statistics.total_customers}</dd>
</dl>
</fieldset>
<br clear="both" />