Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
Shopping Cart Software Forum for Ecommerce Templates
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?



Find us on Facebook

Follow us on Twitter

View our YouTube channel


 All Forums
 Technical
 Tips and Tricks - HALL OF FAME
 Admin home stats - Sort by amt + Sales percentages
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic  

dbdave
ECT Moderator

USA
7798 Posts

Posted - 01/31/2019 :  17:22:54  Show Profile
===EDIT - ASP version in this post - PHP version below in another post===

I was poking around working on some stuff Evil and looking in the (.asp version) incadmin.asp file and noticed the sql query for the top 10 sellers on the home page.
For a long time, I have wanted to show that based on amount instead of quantity.
The thing is, we have some products that are literally a few cents each. Customers order thousands.
These are always near the top of our stats summary on the home page, but not really relevant for us.

This will get overwritten by updaters, but it's an easy change when you update.

This is in the vsadmin/inc/incadmin.asp file. find the line below
sSQL="SELECT "&IIfVs(mysqlserver<>TRUE,"TOP 10 ")&"cartProdName, SUM(cartQuantity) AS numbought, SUM(cartProdPrice*cartQuantity) AS totalvalue FROM cart INNER JOIN orders ON cart.cartOrderID=orders.ordID WHERE cartDateAdded>=" & vsusdate(dbdate)&" AND cartCompleted=1 AND ordStatus>=3 GROUP BY cartProdName ORDER BY SUM(cartQuantity) DESC, SUM(cartProdPrice*cartQuantity) DESC"&IIfVs(mysqlserver=TRUE," LIMIT 0,10")


change that to this instead (area in red is where the change was made)
sSQL="SELECT "&IIfVs(mysqlserver<>TRUE,"TOP 10 ")&"cartProdName, SUM(cartQuantity) AS numbought, SUM(cartProdPrice*cartQuantity) AS totalvalue FROM cart INNER JOIN orders ON cart.cartOrderID=orders.ordID WHERE cartDateAdded>=" & vsusdate(dbdate)&" AND cartCompleted=1 AND ordStatus>=3 GROUP BY cartProdName ORDER BY SUM(cartProdPrice*cartQuantity) DESC, SUM(cartQuantity) DESC"&IIfVs(mysqlserver=TRUE," LIMIT 0,10")


If there is interest, I will post this up for .php - EDIT - php version below.

Enjoy,
David

Edited by - dbdave on 02/13/2019 22:21:12

midvalleydrifter001
Advanced Member

USA
496 Posts

Posted - 02/10/2019 :  10:33:58  Show Profile
I would be interested in the PHP version

Thanks

Patrick
Go to Top of Page

dbdave
ECT Moderator

USA
7798 Posts

Posted - 02/11/2019 :  18:18:55  Show Profile
Hi Patrick, it's actually a simple edit there as well. I have tested this to work for the .php version.

In your admin (vsadmin or secondary folder is used) it's the incadmin.php file you want (in the inc folder) and the line you want is a very similar select statement to the .asp version.

find the line below
$sSQL="SELECT cartProdName, SUM(cartQuantity) AS numbought, SUM(cartProdPrice*cartQuantity) AS totalvalue FROM cart INNER JOIN orders ON cart.cartOrderID=orders.ordID WHERE cartDateAdded>='".$dbdate."' AND cartCompleted=1 AND ordStatus>=3 GROUP BY cartProdName ORDER BY numbought DESC, totalvalue DESC LIMIT 0,10";


change that to this instead (area in red is where the change was made)
$sSQL="SELECT cartProdName, SUM(cartQuantity) AS numbought, SUM(cartProdPrice*cartQuantity) AS totalvalue FROM cart INNER JOIN orders ON cart.cartOrderID=orders.ordID WHERE cartDateAdded>='".$dbdate."' AND cartCompleted=1 AND ordStatus>=3 GROUP BY cartProdName ORDER BY totalvalue DESC, numbought DESC LIMIT 0,10";


Basically we are just reversing the totalvalue and numbought in both versions. Wink

Let me know how you like it.
I might work up some additional features. I think it would be nice to hover over the total for the year and get a percentage increase (or decrease) amount,
much like you can hover over the number of orders there to get an average per order total. The same with month over month. To me, I want to see the percentage. It's nice to see the actual numbers,
but a percentage gain or loss is a better way to track progress.

Edited by - dbdave on 02/11/2019 18:20:09
Go to Top of Page

midvalleydrifter001
Advanced Member

USA
496 Posts

Posted - 02/11/2019 :  19:46:54  Show Profile
I like it and yes the percentage feature would be very helpful.

Thanks

Patrick
Go to Top of Page

dbdave
ECT Moderator

USA
7798 Posts

Posted - 02/11/2019 :  22:06:22  Show Profile
This new additional feature is now working for .php and .asp
This feature will show you your percentage increase in sales on your admin home page stats summary.
Keep in mind that if you do not have sales for one of the time periods then you will just see a message that not enough data exists to make a calculation. (found this and fixed after "divide by zero" error occured Blackeye )

The modification is in the same file - vsadmin/inc/incadmin/asp/.php (or yoursecretfolder/inc/incadmin/asp/.php if using a secondary admin)

Here is what you will see. This is a title tag that you can hover over the time period and get the info. Much like the existing title tag for the avearge $ per sale you get when you hover over the number of orders there.

IMAGE


We have been using this for over a week on my busy live ect website and I absolutely love it.
Perhaps ect will consider making it a native feature Wink

Keep in mind this is a mod and will need to be redone when updating your site. Althought I think this is a file that not too often changed, so use a file comparison program when updating to check for changes and easily merge these changes to the new updates.

Always make a backup copy of files before modifying them.

:::PHP VERSION:::

STEP ONE
Around line 225 or so, look for the following block of code

$sincedate = date('l jS F', strtotime('-30 days'));
$sinceweekdate = date('l jS F', strtotime('-7 days'));
$dbdate = date('Y-m-d H:i:s', strtotime('-30 days'));
$dbweekdate = date('Y-m-d H:i:s', strtotime('-7 days'));
$thismonth=date('M');
$lastmonth = date('M', strtotime('first day of last month'));
$lastyear = date('M Y', strtotime('-1 year'));
$lastlastyear = date('M y', strtotime('-2 year'));
// echo $sincedate.' '.$dbdate;
?>
and add a new chunk of code there so it looks like the following - (new code shown in red)

$sincedate = date('l jS F', strtotime('-30 days'));
$sinceweekdate = date('l jS F', strtotime('-7 days'));
$dbdate = date('Y-m-d H:i:s', strtotime('-30 days'));
$dbweekdate = date('Y-m-d H:i:s', strtotime('-7 days'));
$thismonth=date('M');
$lastmonth = date('M', strtotime('first day of last month'));
$lastyear = date('M Y', strtotime('-1 year'));
$lastlastyear = date('M y', strtotime('-2 year'));
// echo $sincedate.' '.$dbdate;
if ($thismonthtotal[0] > 0 and $thismonthtotal[1] > 0) {
if ($thismonthtotal[0] > $thismonthtotal[1]) { $currmonthpct = 'Increase of '. (round($thismonthtotal[0]/$thismonthtotal[1]*100-100,2)).'%';
}else{ $currmonthpct = 'Decrease of '. (round(100-$thismonthtotal[0]/$thismonthtotal[1]*100,2)) .'%';
} }else{ $currmonthpct = 'Not enough Data to make calculation'; }
if ($lastmonthtotal[0] > 0 and $lastmonthtotal[1] > 0) {
if ($lastmonthtotal[0] > $lastmonthtotal[1]) { $lastmonthpct = 'Increase of '. (round($lastmonthtotal[0]/$lastmonthtotal[1]*100-100,2)).'%';
}else{ $lastmonthpct = 'Decrease of '. (round(100-$lastmonthtotal[0]/$lastmonthtotal[1]*100,2)) .'%';
} }else{ $lastmonthpct = 'Not enough Data to make calculation'; }
if ($yeartotal[0] > 0 and $yeartotal[1] > 0) {
if ($yeartotal[0] > $yeartotal[1]) { $thisyrpct = 'Increase of '. (round($yeartotal[0]/$yeartotal[1]*100-100,2)).'%';
}else{ $thisyrpct = 'Decrease of '. (round(100-$yeartotal[0]/$yeartotal[1]*100,2)) .'%';
} }else{ $thisyrpct = 'Not enough Data to make calculation'; }
if ($last12total[0] > 0 and $last12total[1] > 0) {
if ($last12total[0] > $last12total[1]) { $lastyrpct = 'Increase of '. (round($last12total[0]/$last12total[1]*100-100,2)).'%';
}else{ $lastyrpct = 'Decrease of '. (round(100-$last12total[0]/$last12total[1]*100,2)) .'%';
} }else{ $lastyrpct = 'Not enough Data to make calculation'; }

?>


STEP TWO Find / Replace 4 lines as shown below
FIND REPLACE 1 OF 4
Find this line
<td style="text-align:right;vertical-align:middle" rowspan="2"><?php print $thismonth?></td>

replace with this
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="<?php print $thismonth?> vs <?php print $thismonth?> of last year - <?php print $currmonthpct?>"><?php print $thismonth?></div></td>

FIND REPLACE 2 OF 4
Find this line
<td style="text-align:right;vertical-align:middle" rowspan="2"><?php print $lastmonth?></td>

replace with this
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="<?php print $lastmonth?> vs <?php print $lastmonth?> of last year - <?php print $lastmonthpct?>"><?php print $lastmonth?></div></td>

FIND REPLACE 3 OF 4
Find this line
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="January 1 - Now"><?php print "Jan 1 "?></div></td>

replace with this
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="January 1 to today - <?php print $thisyrpct?>"><?php print "Jan 1 "?></div></td>

FIND REPLACE 4 OF 4
Find this line
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="Last 12 Months"><?php print '12 Mo.'?></div></td>

replace with this
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="Last 12 Months - <?php print $lastyrpct?>"><?php print '12 Mo.'?></div></td>


That's it - Upload the file and give it a test drive.

:::ASP VERSION:::

STEP ONE
Around line 230 or so, look for the following block of code

lmdate=date()-day(date())
sincedate = date()-30
' sinceweekdate = date('l jS F', strtotime('-7 days'));
dbdate = date()-30
dbweekdate = date()-7
thismonth=monthname(month(date()),TRUE)
lastmonth=monthname(month(lmdate),TRUE)
lastyear=monthname(month(lmdate),TRUE)&" "&(year(date())-1)
%>
and add a new chunk of code there so it looks like the following - (new code shown in red)

lmdate=date()-day(date())
sincedate = date()-30
' sinceweekdate = date('l jS F', strtotime('-7 days'));
dbdate = date()-30
dbweekdate = date()-7
thismonth=monthname(month(date()),TRUE)
lastmonth=monthname(month(lmdate),TRUE)
lastyear=monthname(month(lmdate),TRUE)&" "&(year(date())-1)
dim currmonthpct, lastmonthpct, lastyrpct, thisyrpct
if thismonthtotal(0) > 0 and thismonthtotal(1) > 0 then
if thismonthtotal(0) > thismonthtotal(1) then
currmonthpct = "Increase of "& (Round(thismonthtotal(0)/thismonthtotal(1)*100-100,2))&"%"
else
currmonthpct = "Decrease of "& (Round(100-thismonthtotal(0)/thismonthtotal(1)*100,2)) &"%"
end if
else
currmonthpct = "Not enough Data to make calculation"
end if
if lastmonthtotal(0) > 0 and lastmonthtotal(1) > 0 then
if lastmonthtotal(0) > lastmonthtotal(1) then
lastmonthpct = "increase of "& (Round(lastmonthtotal(0)/lastmonthtotal(1)*100-100,2))&"%"
else
lastmonthpct = "decrease of "& (Round(100-lastmonthtotal(0)/lastmonthtotal(1)*100,2)) &"%"
end if
else
lastmonthpct = "Not enough Data to make calculation"
end if
if yeartotal(0) > 0 and yeartotal(1) > 0 then
if yeartotal(0) > yeartotal(1) then
thisyrpct = "increase of "& (Round(yeartotal(0)/yeartotal(1)*100-100,2))&"%"
else
thisyrpct = "decrease of "& (Round(100-yeartotal(0)/yeartotal(1)*100,2)) &"%"
end if
else
thisyrpct = "Not enough Data to make calculation"
end if
if last12total(0) > 0 and last12total(1) > 0 then
if last12total(0) > last12total(1) then
lastyrpct = "increase of "& (Round(last12total(0)/last12total(1)*100-100,2))&"%"
else
lastyrpct = "decrease of "& (Round(100-last12total(0)/last12total(1)*100,2)) &"%"
end if
else
lastyrpct = "Not enough Data to make calculation"
end if

%>


STEP TWO Find / Replace 4 lines as shown below
FIND REPLACE 1 OF 4
Find this line
<td style="text-align:right;vertical-align:middle" rowspan="2"><%=thismonth%></td>

replace with this
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="<%=thismonth%> vs <%=thismonth%> of last year - <%=currmonthpct%>"><%=thismonth%></div></td>

FIND REPLACE 2 OF 4
Find this line
	<td style="text-align:right;vertical-align:middle" rowspan="2"><%=lastmonth%></td>

replace with this
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="<%=lastmonth%> vs <%=lastmonth%> of last year - <%=lastmonthpct%>"><%=lastmonth%></div></td>

FIND REPLACE 3 OF 4
Find this line
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="January 1 - Now"><%="Jan 1 "%></div></td>

replace with this
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="January 1 through today - <%=thisyrpct%>"><%="Jan 1 "%></div></td>

FIND REPLACE 4 OF 4
Find this line
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="Last 12 Months"><%="12 Mo."%></div></td>

replace with this
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="Last 12 Months - <%=lastyrpct%>"><%="12 Mo."%></div></td>


That's it - Upload the file and give it a test drive.

Edited by - dbdave on 02/14/2019 18:11:14
Go to Top of Page

midvalleydrifter001
Advanced Member

USA
496 Posts

Posted - 02/14/2019 :  16:48:54  Show Profile
Works great.

How would I break down the percentage (+/-) to the hundredth rather that rounding as you have it now?

Patrick
Go to Top of Page

dbdave
ECT Moderator

USA
7798 Posts

Posted - 02/14/2019 :  17:14:37  Show Profile
That's awesome Patrick. I think it's quite powerful to see these numbers at a quick glance.
I will look at the rounding. I think with .php the default is two places unless specified otherwise.
I think it's an easy change, but I just finished polishing touches on the .asp version so I am going to post that up, and then I will take a look at the rounding.
Go to Top of Page

dbdave
ECT Moderator

USA
7798 Posts

Posted - 02/14/2019 :  18:14:32  Show Profile
Hi Patrick, in looking at the rounding, I discovered n error in the way the calculations were being made, so I revised the code above, and you should fix yours.

The "2" there in red is the decimal places. Change those to "3" (8 instances there) and that will do it.
credit this page for the rounding info - right from the source Wink http://php.net/manual/en/function.round.php


if ($thismonthtotal[0] > 0 and $thismonthtotal[1] > 0) {
if ($thismonthtotal[0] > $thismonthtotal[1]) { $currmonthpct = 'Increase of '. (round($thismonthtotal[0]/$thismonthtotal[1]*100-100,2)).'%';
}else{ $currmonthpct = 'Decrease of '. (round(100-$thismonthtotal[0]/$thismonthtotal[1]*100,2)) .'%';
} }else{ $currmonthpct = 'Not enough Data to make calculation'; }
if ($lastmonthtotal[0] > 0 and $lastmonthtotal[1] > 0) {
if ($lastmonthtotal[0] > $lastmonthtotal[1]) { $lastmonthpct = 'Increase of '. (round($lastmonthtotal[0]/$lastmonthtotal[1]*100-100,2)).'%';
}else{ $lastmonthpct = 'Decrease of '. (round(100-$lastmonthtotal[0]/$lastmonthtotal[1]*100,2)) .'%';
} }else{ $lastmonthpct = 'Not enough Data to make calculation'; }
if ($yeartotal[0] > 0 and $yeartotal[1] > 0) {
if ($yeartotal[0] > $yeartotal[1]) { $thisyrpct = 'Increase of '. (round($yeartotal[0]/$yeartotal[1]*100-100,2)).'%';
}else{ $thisyrpct = 'Decrease of '. (round(100-$yeartotal[0]/$yeartotal[1]*100,2)) .'%';
} }else{ $thisyrpct = 'Not enough Data to make calculation'; }
if ($last12total[0] > 0 and $last12total[1] > 0) {
if ($last12total[0] > $last12total[1]) { $lastyrpct = 'Increase of '. (round($last12total[0]/$last12total[1]*100-100,2)).'%';
}else{ $lastyrpct = 'Decrease of '. (round(100-$last12total[0]/$last12total[1]*100,2)) .'%';
} }else{ $lastyrpct = 'Not enough Data to make calculation'; }

Edited by - dbdave on 02/14/2019 18:20:45
Go to Top of Page

midvalleydrifter001
Advanced Member

USA
496 Posts

Posted - 02/14/2019 :  18:38:47  Show Profile
PERFECT !!

Nice job. I really like it.

Thanks for taking the time to do this.

Patrick
Go to Top of Page

dbdave
ECT Moderator

USA
7798 Posts

Posted - 02/14/2019 :  20:49:52  Show Profile
No worries Patrick. As my business has grown, I find myself needing more and more analytical data at my fingertips.
I know some folks here are not fond of godaddy, but Bob Parsons had come out with a poster some years back. 16 Rules for sucess in business.
I have it hanging in my office.
One of these rules is Measure everything. - Anything measured will grow.

I recently developed a way to track our errors and we have these large 40" screens in the warehouse with our orders and it scrolls as new orders come in and old orders ship.
At the top, we have a message area. I used these javascript gauges (one for each month) http://justgage.com/ to adjust as new errors come in.
We created an incentive for our employees where I set aside a set amount each month and at the end of the year, any funds left over, rolls into any bonus money we hand out.
The errors go against those funds and the gauges adjust automatically.
One thing this did for me was a mental benefit.
I no longer get (as) frustrated with the errors and I take it less personal. It's now as if it's costing the staff instead of me.
Again, a mind game, but in the end, less stress for me as the owner of the company.


I guess my point is, if you have a store generating daily sales, it's important to understand this type of data and monitor it for improvement.
The better you understand your weak points, the bigger chance you have of fixing them.

Of course sharing these tips serves several purposes for me. I am learning all I can about code and the more projects I take on, the better my skills get.
Secondly, I can't begin to measure the amount of knowledge I have gained on this forum, so sharing here is a way for me to give back too. Cool

Edited by - dbdave on 02/14/2019 20:53:21
Go to Top of Page

midvalleydrifter001
Advanced Member

USA
496 Posts

Posted - 02/15/2019 :  12:31:37  Show Profile
I totally agree with metrics. Very important data to utilize.

Thanks for sharing your knowledge.

I too have learned so much from this forum and value everything and everybody who provides advice.

I looked at the justgage.com website and their js files.

Can their info be linked to ECT or is that a manual thing to input?

Not quite sure how to implement that on my site.

Edited by - midvalleydrifter001 on 02/15/2019 12:36:17
Go to Top of Page

dbdave
ECT Moderator

USA
7798 Posts

Posted - 02/15/2019 :  15:13:24  Show Profile
Hi Patrick,
Depending on where you want to use the gauge, there may be a variable available to give you the data you want for the gauge,
making it dynamic.

Give me an idea of where you want to use it and for what data, and I will see if I can help.
We will probably want to take it to email if it's something I can help with.
Go to Top of Page

PieMan
Advanced Member

United Kingdom
249 Posts

Posted - 03/18/2019 :  05:02:37  Show Profile
Hi Dave,

the percentage increase/decrease is a nice simple mod that gives extra info, thank you.

Maybe it's something that Vince and Andy can incorporate in an updater in the future.

Regards

Mike

Using ECT since 2003.
Go to Top of Page

John M
Advanced Member

317 Posts

Posted - 04/18/2019 :  10:03:22  Show Profile
Very cool... I made some changes for a cleaner look with coloured arrows showing all the time.



if ($thismonthtotal[0] > 0 and $thismonthtotal[1] > 0) {
if ($thismonthtotal[0] > $thismonthtotal[1]) { $currmonthpct = '#8593; ' . (round($thismonthtotal[0]/$thismonthtotal[1]*100-100,0)).'%'; $color="green";
}else{ $currmonthpct = '#8595; ' . (round(100-$thismonthtotal[0]/$thismonthtotal[1]*100,0)) .'%'; $color="red";
} }else{ $currmonthpct = '#8594; '; $color="orange";}
if ($lastmonthtotal[0] > 0 and $lastmonthtotal[1] > 0) {
if ($lastmonthtotal[0] > $lastmonthtotal[1]) { $lastmonthpct = '#8593; '. (round($lastmonthtotal[0]/$lastmonthtotal[1]*100-100,0)).'%'; $color="green";
}else{ $lastmonthpct = '#8595; '. (round(100-$lastmonthtotal[0]/$lastmonthtotal[1]*100,0)) .'%'; $color="red";
} }else{ $lastmonthpct = '#8594; '; $color="orange";}
if ($yeartotal[0] > 0 and $yeartotal[1] > 0) {
if ($yeartotal[0] > $yeartotal[1]) { $thisyrpct = '#8593; '. (round($yeartotal[0]/$yeartotal[1]*100-100,0)).'%'; $color="green";
}else{ $thisyrpct = '#8595; '. (round(100-$yeartotal[0]/$yeartotal[1]*100,0)) .'%'; $color="red";
} }else{ $thisyrpct = '#8594; '; $color="orange";}
if ($last12total[0] > 0 and $last12total[1] > 0) {
if ($last12total[0] > $last12total[1]) { $lastyrpct = '#8593; '. (round($last12total[0]/$last12total[1]*100-100,0)).'%'; $color="green";
}else{ $lastyrpct = '#8595; '. (round(100-$last12total[0]/$last12total[1]*100,0)) .'%'; $color="red";
} }else{ $lastyrpct = '#8594; '; $color="orange";}
// echo $sincedate.' '.$dbdate;
?>


<div class="one_third">
<h3 class="round_top">Order Stats<br><span style="font-weight:normal;font-size:10px">This month, last month, last year</span></h3>
<table class="quickstats">
<tr><th> </th><th> </th><th style="text-align:right;">No</th><th style="text-align:right;">Value</th></tr>
<tr>
<td style="text-align:right;vertical-align:middle;" rowspan="2"><div title="<?php print $currmonthpct?>"><?php print $thismonth?></div></td>
<td style="text-align:right;font-size:0.9em;"><span style="color:<?php print $color ?>"><?php print $currmonthpct?></span> This Year</td>
<td style="text-align:right;font-size:0.9em" title="<?php print FormatEuroCurrency($thismonthorders[0]==0?0:$thismonthtotal[0]/$thismonthorders[0]);?>"><?php print $thismonthorders[0] . '</td><td style="text-align:right;font-size:0.9em">' . FormatEuroCurrency($thismonthtotal[0]);?></td>
</tr>
<tr>
<td style="text-align:right;font-size:0.9em;color:#FF6060">Last Year</td>
<td style="text-align:right;font-size:0.9em;color:#FF6060" title="<?php print FormatEuroCurrency($thismonthorders[1]==0?0:$thismonthtotal[1]/$thismonthorders[1]);?>"><?php print $thismonthorders[1] . '</td><td style="text-align:right;font-size:0.9em;color:#FF6060">' . FormatEuroCurrency($thismonthtotal[1]);?></td>
</tr>
<tr>
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="<?php print $lastmonthpct?>"><?php print $lastmonth?></div></td>
<td style="text-align:right;font-size:0.9em"><span style="color:<?php print $color ?>"><?php print $lastmonthpct?></span> This Year</td>
<td style="text-align:right;font-size:0.9em" title="<?php print FormatEuroCurrency($lastmonthorders[0]==0?0:$lastmonthtotal[0]/$lastmonthorders[0]);?>"><?php print $lastmonthorders[0] . '</td><td style="text-align:right;font-size:0.9em">' . FormatEuroCurrency($lastmonthtotal[0]);?></td>
</tr>
<tr>
<td style="text-align:right;font-size:0.9em;color:#FF6060">Last Year</td>
<td style="text-align:right;font-size:0.9em;color:#FF6060" title="<?php print FormatEuroCurrency($lastmonthorders[1]==0?0:$lastmonthtotal[1]/$lastmonthorders[1]);?>"><?php print $lastmonthorders[1] . '</td><td style="text-align:right;font-size:0.9em;color:#FF6060">' . FormatEuroCurrency($lastmonthtotal[1]);?></td>
</tr>
<tr>
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="<?php print $thisyrpct?>"><?php print "Jan 1 "?></div></td>
<td style="text-align:right;font-size:0.9em"><span style="color:<?php print $color ?>"><?php print $thisyrpct?></span> This Year</td>
<td style="text-align:right;font-size:0.9em" title="<?php print FormatEuroCurrency($yearorders[0]==0?0:$yeartotal[0]/$yearorders[0]);?>"><?php print $yearorders[0] . '</td><td style="text-align:right;font-size:0.9em">' . FormatEuroCurrency($yeartotal[0]);?></td>
</tr>
<tr>
<td style="text-align:right;font-size:0.9em;color:#FF6060">Last Year</td>
<td style="text-align:right;font-size:0.9em;color:#FF6060" title="<?php print FormatEuroCurrency($yearorders[1]==0?0:$yeartotal[1]/$yearorders[1]);?>"><?php print $yearorders[1] . '</td><td style="text-align:right;font-size:0.9em;color:#FF6060">' . FormatEuroCurrency($yeartotal[1]);?></td>
</tr>
<tr>
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="Last 12 Months - <?php print $lastyrpct?>"><?php print '12 Mo.'?></div></td>
<td style="text-align:right;font-size:0.9em"><span style="color:<?php print $color ?>"><?php print $lastyrpct?></span> This Year</td>
<td style="text-align:right;font-size:0.9em" title="<?php print FormatEuroCurrency($last12[0]==0?0:$last12total[0]/$last12[0]);?>"><?php print $last12[0] . '</td><td style="text-align:right;font-size:0.9em">' . FormatEuroCurrency($last12total[0]);?></td>
</tr>
<tr>
<td style="text-align:right;font-size:0.9em;color:#FF6060">Last Year</td>
<td style="text-align:right;font-size:0.9em;color:#FF6060" title="<?php print FormatEuroCurrency($last12[1]==0?0:$last12total[1]/$last12[1]);?>"><?php print $last12[1] . '</td><td style="text-align:right;font-size:0.9em;color:#FF6060">' . FormatEuroCurrency($last12total[1]);?></td>
</tr>
<tr>
<td style="text-align:right;white-space:nowrap"><div title="All Time Sales"><?php print 'All Time'?></div></td>
<td style="font-size:0.9em"> </td>
<td style="text-align:right;font-size:0.9em" title="<?php print FormatEuroCurrency($alltime==0?0:$alltimetotal/$alltime);?>"><?php print $alltime . '</td><td style="text-align:right;font-size:0.9em">' . FormatCurrencyZeroDP($alltimetotal);?></td>
</tr>
</table>
</div>

Go to Top of Page

midvalleydrifter001
Advanced Member

USA
496 Posts

Posted - 05/15/2019 :  19:00:04  Show Profile
Hi John,

I have your mod applied but the GREEN increase and % is in RED.

Only the RED shows for both Decreases and Increases.

Any idea why this is happening?

Patrick
Go to Top of Page

John M
Advanced Member

317 Posts

Posted - 05/19/2019 :  21:30:36  Show Profile
The colours should hopefully work now plus added more stats for today, 7days, 15days and 30days and if you also want to show their last year stats then add this to your includes file $lastyearstats=2;

John

Everything in red from LINE 162 to LINE 599 (your lines might be different)
// this month, last month and this month last year order totals

if(@$dumpadminstats) print "Section 1 : " . (microtime_float()-$time_start)."<br />";
$thismonthorders=$thismonthtotal=$lastmonthorders=$lastmonthtotal=$yearorders=$yeartotal=[];

if(@$homeordersstatus!='') $ordersstatus='ordStatus IN ('.$homeordersstatus.')'; else $ordersstatus='ordStatus>=3';
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND YEAR(ordDate) = YEAR(CURRENT_DATE ) AND MONTH(ordDate) = MONTH(CURRENT_DATE)";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$thismonthorders[0]=$rs['totalorders'];$thismonthtotal[0]=$rs['totalvalue'];}
}

if(@$dumpadminstats) print "Section 2 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND YEAR(ordDate) = YEAR(CURRENT_DATE - INTERVAL 12 MONTH) AND MONTH(ordDate) = MONTH(CURRENT_DATE - INTERVAL 12 MONTH)";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$thismonthorders[1]=$rs['totalorders'];$thismonthtotal[1]=$rs['totalvalue'];}
}

if(@$dumpadminstats) print "Section 2 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND ordDate >= (CURRENT_DATE - INTERVAL 30 DAY)";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$last30[0]=$rs['totalorders'];$last30total[0]=$rs['totalvalue'];}
}

if(@$dumpadminstats) print "Section 2 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND ordDate >= (CURRENT_DATE - interval 1 year) - interval 30 day AND ordDate <= CURRENT_DATE - interval 1 year;";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$last30[1]=$rs['totalorders'];$last30total[1]=$rs['totalvalue'];}
}

if(@$dumpadminstats) print "Section 2 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND ordDate >= (CURRENT_DATE - INTERVAL 15 DAY)";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$last15[0]=$rs['totalorders'];$last15total[0]=$rs['totalvalue'];}
}

if(@$dumpadminstats) print "Section 2 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND ordDate >= (CURRENT_DATE - interval 1 year) - interval 15 day AND ordDate <= CURRENT_DATE - interval 1 year;";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$last15[1]=$rs['totalorders'];$last15total[1]=$rs['totalvalue'];}
}

if(@$dumpadminstats) print "Section 2 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND ordDate >= (CURRENT_DATE - INTERVAL 7 DAY)";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$last7[0]=$rs['totalorders'];$last7total[0]=$rs['totalvalue'];}
}

if(@$dumpadminstats) print "Section 2 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND ordDate >= (CURRENT_DATE - interval 1 year) - interval 7 day AND ordDate <= CURRENT_DATE - interval 1 year;";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$last7[1]=$rs['totalorders'];$last7total[1]=$rs['totalvalue'];}
}

if(@$dumpadminstats) print "Section 2 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND ordDate >= (CURRENT_DATE);";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$todayorders[0]=$rs['totalorders'];$todaytotal[0]=$rs['totalvalue'];}
}

if(@$dumpadminstats) print "Section 2 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND ordDate >= (CURRENT_DATE - interval 1 year) AND ordDate <= (CURRENT_DATE + 1) - interval 1 year";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$todayorders[1]=$rs['totalorders'];$todaytotal[1]=$rs['totalvalue'];}
}

if(@$dumpadminstats) print "Section 3 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND YEAR(ordDate) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH) AND MONTH(ordDate) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH)";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$lastmonthorders[0]=$rs['totalorders'];$lastmonthtotal[0]=$rs['totalvalue'];}
}

if(@$dumpadminstats) print "Section 4 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND YEAR(ordDate) = YEAR(CURRENT_DATE - INTERVAL 13 MONTH) AND MONTH(ordDate) = MONTH(CURRENT_DATE - INTERVAL 13 MONTH)";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$lastmonthorders[1]=$rs['totalorders'];$lastmonthtotal[1]=$rs['totalvalue'];}
}
if(@$dumpadminstats) print "Section 5 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND ordDate BETWEEN '" . date("Y-01-01") . "' AND '" . date("Y-m-d",strtotime("+1 day")) . "'";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$yearorders[0]=$rs['totalorders'];$yeartotal[0]=$rs['totalvalue'];}
}
if(@$dumpadminstats) print "Section 6 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND ordDate BETWEEN '" . date("Y-01-01",strtotime("-1 year")) . "' AND '" . date("Y-m-d",strtotime("-1 year")) . "'";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$yearorders[1]=$rs['totalorders'];$yeartotal[1]=$rs['totalvalue'];}
}

if(@$dumpadminstats) print "Section 7 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND ordDate BETWEEN '" . date("Y-m-d",strtotime("-1 year")) . "' AND '" . date("Y-m-d",strtotime("+1 day")) . "'";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$last12[0]=$rs['totalorders'];$last12total[0]=$rs['totalvalue'];}
}

if(@$dumpadminstats) print "Section 8 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus." AND ordDate BETWEEN '" . date("Y-m-d",strtotime("-2 year")) . "' AND '" . date("Y-m-d",strtotime("-1 year")) . "'";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$last12[1]=$rs['totalorders'];$last12total[1]=$rs['totalvalue'];}
}
if(@$dumpadminstats) print "Section 9 : " . (microtime_float()-$time_start)."<br />";
$sSQL = " SELECT COUNT(*) AS totalorders, SUM(ordTotal-ordDiscount) AS totalvalue FROM orders WHERE ".$ordersstatus."";
$result=ect_query($sSQL) or ect_error();
if($rs=ect_fetch_assoc($result)){
if(!is_null($rs['totalorders'])){$alltime=$rs['totalorders'];$alltimetotal=$rs['totalvalue'];}
}
if(@$dumpadminstats) print "Section 10 : " . (microtime_float()-$time_start)."<br />";
// END this month, last month and this month last year order totals

$sincedate = date('l jS F', strtotime('-30 days'));
$sinceweekdate = date('l jS F', strtotime('-7 days'));
$dbdate = date('Y-m-d H:i:s', strtotime('-30 days'));
$dbweekdate = date('Y-m-d H:i:s', strtotime('-7 days'));
$thismonth=date('M');
$last30days='30 Days';
$last15days='15 Days';
$last7days='7 Days';
$today='Today';
$lastmonth = date('M', strtotime('first day of last month'));
$lastyear = date('M Y', strtotime('-1 year'));
$lastlastyear = date('M y', strtotime('-2 year'));

function updatethismonth()
{
global $thismonthtotal,$thismonthorders,$currmonthpct,$currmonthorderspct,$color;
$color='';

if ($thismonthtotal[0] > 0 and $thismonthtotal[1] > 0)
{
if ($thismonthtotal[0] > $thismonthtotal[1])
{
$currmonthpct = '#8593; ' . (round($thismonthtotal[0]/$thismonthtotal[1]*100-100,0)).'%'; $color="green";
$currmonthorderspct = '#8593; ' . (round($thismonthorders[0]/$thismonthorders[1]*100-100,0)).'%'; $color="green";
}
else
{
$currmonthpct = '#8595; ' . (round(100-$thismonthtotal[0]/$thismonthtotal[1]*100,0)) .'%'; $color="red";
}
}
else
{
$currmonthpct = '#8594; '; $color="orange";
}
}
function updatelastmonth()
{
global $lastmonthtotal,$lastmonthorders,$lastmonthpct,$lastmonthorderspct,$color;
$color='';

if ($lastmonthtotal[0] > 0 and $lastmonthtotal[1] > 0)
{
if ($lastmonthtotal[0] > $lastmonthtotal[1])
{
$lastmonthpct = '#8593; '. (round($lastmonthtotal[0]/$lastmonthtotal[1]*100-100,0)).'%'; $color="green";
$lastmonthorderspct = '#8593; '. (round($lastmonthorders[0]/$lastmonthorders[1]*100-100,0)).'%'; $color="green";
}
else
{
$lastmonthpct = '#8595; '. (round(100-$lastmonthtotal[0]/$lastmonthtotal[1]*100,0)) .'%'; $color="red";
}
}
else
{
$lastmonthpct = '#8594; '; $color="orange";
}
}
function updatethisyear(){
global $yeartotal,$yearorders,$thisyrpct,$thisyrorderpct,$color;
$color='';

if ($yeartotal[0] > 0 and $yeartotal[1] > 0)
{
if ($yeartotal[0] > $yeartotal[1])
{
$thisyrpct = '#8593; '. (round($yeartotal[0]/$yeartotal[1]*100-100,0)).'%'; $color="green";
$thisyrorderpct = '#8593; '. (round($yearorders[0]/$yearorders[1]*100-100,0)).'%'; $color="green";
}
else
{
$thisyrpct = '#8595; '. (round(100-$yeartotal[0]/$yeartotal[1]*100,0)) .'%'; $color="red";
}
}
else
{
$thisyrpct = '#8594; '; $color="orange";
}
}
function updatelast12()
{
global $last12total,$last12,$lastyrpct,$lastyrorderpct,$color;
$color='';

if ($last12total[0] > 0 and $last12total[1] > 0)
{
if ($last12total[0] > $last12total[1])
{
$lastyrpct = '#8593; '. (round($last12total[0]/$last12total[1]*100-100,0)).'%'; $color="green";
$lastyrorderpct = '#8593; '. (round($last12[0]/$last12[1]*100-100,0)).'%'; $color="green";
}
else
{
$lastyrpct = '#8595; '. (round(100-$last12total[0]/$last12total[1]*100,0)) .'%'; $color="red";
}
}
else
{
$lastyrpct = '#8594; '; $color="orange";
}
}
function updatelast30()
{
global $last30total,$last30,$last30pct,$last30orderpct,$color;
$color='';

if ($last30total[0] > 0 and $last30total[1] > 0)
{
if ($last30total[0] > $last30total[1])
{
$last30pct = '#8593; '. (round($last30total[0]/$last30total[1]*100-100,0)).'%'; $color="green";
$last30orderpct = '#8593; '. (round($last30[0]/$last30[1]*100-100,0)).'%'; $color="green";
}
else
{
$last30pct = '#8595; '. (round(100-$last30total[0]/$last30total[1]*100,0)) .'%'; $color="red";
}
}
else
{
$last30pct = '#8594; '; $color="orange";
}
}
function updatelast15(){
global $last15total,$last15,$last15pct,$last15orderpct,$color;
$color='';

if ($last15total[0] > 0 and $last15total[1] > 0)
{
if ($last15total[0] > $last15total[1])
{
$last15pct = '#8593; '. (round($last15total[0]/$last15total[1]*100-100,0)).'%'; $color="green";
$last15orderpct = '#8593; '. (round($last15[0]/$last15[1]*100-100,0)).'%'; $color="green";
}
else
{
$last15pct = '#8595; '. (round(100-$last15total[0]/$last15total[1]*100,0)) .'%'; $color="red";
}
}
else
{
$last15pct = '#8594; '; $color="orange";
}
}
function updatelast7(){
global $last7total,$last7,$last7pct,$last7orderpct,$color;
$color='';

if ($last7total[0] > 0 and $last7total[1] > 0)
{
if ($last7total[0] > $last7total[1])
{
$last7pct = '#8593; '. (round($last7total[0]/$last7total[1]*100-100,0)).'%'; $color="green";
$last7orderpct = '#8593; '. (round($last7[0]/$last7[1]*100-100,0)).'%'; $color="green";
}
else
{
$last7pct = '#8595; '. (round(100-$last7total[0]/$last7total[1]*100,0)) .'%'; $color="red";
}
}
else
{
$last7pct = '#8594; '; $color="orange";
}
}
function updatetoday(){
global $todaytotal,$todayorders,$todaypct,$todayorderpct,$color;
$color='';

if ($todaytotal[0] > 0 and $todaytotal[1] > 0)
{
if ($todaytotal[0] > $todaytotal[1])
{
$todaypct = '#8593; '. (round($todaytotal[0]/$todaytotal[1]*100-100,0)).'%'; $color="green";
$todayorderpct = '#8593; '. (round($todayorders[0]/$todayorders[1]*100-100,0)).'%'; $color="green";
}
else
{
$todaypct = '#8595; '. (round(100-$todaytotal[0]/$todaytotal[1]*100,0)) .'%'; $color="red";
}
}
else
{
$todaypct = '#8594; '; $color="orange";
}
}

// echo $sincedate.' '.$dbdate;
?>


<div class="one_third">
<h3 class="round_top">Order Stats<br><span style="font-weight:normal;font-size:10px">This month, last month, last year</span></h3>
<table class="quickstats">
<tr><th> </th><th> </th><th style="text-align:right;">No</th><th style="text-align:right;">Value</th></tr>

<?php updatetoday(); ?>

<tr>
<td style="text-align:right;vertical-align:middle;" rowspan="<?php (print $lastyearstats);?>"><div title="<?php print $todaypct?>"><?php print $today ?></div></td>
<td style="text-align:right;font-size:0.9em;"> This Year</td>
<td style="text-align:right;font-size:0.9em" title="<?php print FormatEuroCurrency($todayorders[0]==0?0:$todaytotal[0]/$todayorders[0]);?>"><span style="color:<?php print $color ?>"><?php print $todayorderpct ?></span>    <?php print $todayorders[0] . '</td><td style="text-align:right;font-size:0.9em"><span style="color:' . $color . '">' . $todaypct . '</span>   ' . FormatEuroCurrency($todaytotal[0]);?></td>
</tr>


<?php if ($lastyearstats==2)
{
print '<tr> <td style="text-align:right;font-size:0.9em;color:#FF6060">Last Year</td> <td style="text-align:right;font-size:0.9em;color:#FF6060" title="' . FormatEuroCurrency($todayorders[1]==0?0:$todaytotal[1]/$todayorders[1]) . '">' . $todayorders[1] . '</td><td style="text-align:right;font-size:0.9em;color:#FF6060">' . FormatEuroCurrency($todaytotal[1]) . '</td></tr>';

}
?>


<?php updatelast7() ?>

<tr>
<td style="text-align:right;vertical-align:middle;" rowspan="<?php (print $lastyearstats);?>"><div title="<?php print $last7pct?>"><?php print $last7days ?></div></td>
<td style="text-align:right;font-size:0.9em;"> This Year</td>
<td style="text-align:right;font-size:0.9em" title="<?php print FormatEuroCurrency($last7[0]==0?0:$last7total[0]/$last7[0]);?>"><span style="color:<?php print $color ?>"><?php print $last7orderpct ?></span>    <?php print $last7[0] . '</td><td style="text-align:right;font-size:0.9em"><span style="color:' . $color . '">' . $last7pct . '</span>   ' . FormatEuroCurrency($last7total[0]);?></td>
</tr>


<?php if ($lastyearstats==2)
{
print '<tr> <td style="text-align:right;font-size:0.9em;color:#FF6060">Last Year</td> <td style="text-align:right;font-size:0.9em;color:#FF6060" title="' . FormatEuroCurrency($last7[1]==0?0:$last7total[1]/$last7[1]) . '">' . $last7[1] . '</td><td style="text-align:right;font-size:0.9em;color:#FF6060">' . FormatEuroCurrency($last7total[1]) . '</td></tr>';

}
?>

<?php updatelast15() ?>

<tr>
<td style="text-align:right;vertical-align:middle;" rowspan="<?php (print $lastyearstats);?>"><div title="<?php print $last15pct?>"><?php print $last15days ?></div></td>
<td style="text-align:right;font-size:0.9em;"> This Year</td>
<td style="text-align:right;font-size:0.9em" title="<?php print FormatEuroCurrency($last15[0]==0?0:$last15total[0]/$last15[0]);?>"><span style="color:<?php print $color ?>"><?php print $last15orderpct ?></span>    <?php print $last15[0] . '</td><td style="text-align:right;font-size:0.9em"><span style="color:' . $color . '">' . $last15pct . '</span>   ' . FormatEuroCurrency($last15total[0]);?></td>
</tr>


<?php if ($lastyearstats==2)
{
print '<tr> <td style="text-align:right;font-size:0.9em;color:#FF6060">Last Year</td> <td style="text-align:right;font-size:0.9em;color:#FF6060" title="' . FormatEuroCurrency($last15[1]==0?0:$last15total[1]/$last15[1]) . '">' . $last15[1] . '</td><td style="text-align:right;font-size:0.9em;color:#FF6060">' . FormatEuroCurrency($last15total[1]) . '</td></tr>';

}
?>

<?php updatelast30() ?>

<tr>
<td style="text-align:right;vertical-align:middle;" rowspan="<?php (print $lastyearstats);?>"><div title="<?php print $last30pct?>"><?php print $last30days ?></div></td>
<td style="text-align:right;font-size:0.9em;"> This Year</td>
<td style="text-align:right;font-size:0.9em" title="<?php print FormatEuroCurrency($last30[0]==0?0:$last30total[0]/$last30[0]);?>"><span style="color:<?php print $color ?>"><?php print $last30orderpct ?></span>    <?php print $last30[0] . '</td><td style="text-align:right;font-size:0.9em"><span style="color:' . $color . '">' . $last30pct . '</span>   ' . FormatEuroCurrency($last30total[0]);?></td>
</tr>

<?php if ($lastyearstats==2)
{
print '<tr> <td style="text-align:right;font-size:0.9em;color:#FF6060">Last Year</td> <td style="text-align:right;font-size:0.9em;color:#FF6060" title="' . FormatEuroCurrency($last30[1]==0?0:$last30total[1]/$last30[1]) . '">' . $last30[1] . '</td><td style="text-align:right;font-size:0.9em;color:#FF6060">' . FormatEuroCurrency($last30total[1]) . '</td></tr>';

}
?>

<?php updatethismonth() ?>

<tr>
<td style="text-align:right;vertical-align:middle;" rowspan="2"><div title="<?php print $currmonthpct?>"><?php print $thismonth?></div></td>
<td style="text-align:right;font-size:0.9em;"> This Year</td>
<td style="text-align:right;font-size:0.9em" title="<?php print FormatEuroCurrency($thismonthorders[0]==0?0:$thismonthtotal[0]/$thismonthorders[0]);?>"><span style="color:<?php print $color ?>"><?php print $currmonthorderspct ?></span>    <?php print $thismonthorders[0] . '</td><td style="text-align:right;font-size:0.9em"><span style="color:' . $color . '">' . $currmonthpct . '</span>   ' . FormatEuroCurrency($thismonthtotal[0]);?></td>
</tr>
<tr>
<td style="text-align:right;font-size:0.9em;color:#FF6060">Last Year</td>
<td style="text-align:right;font-size:0.9em;color:#FF6060" title="<?php print FormatEuroCurrency($thismonthorders[1]==0?0:$thismonthtotal[1]/$thismonthorders[1]);?>"><?php print $thismonthorders[1] . '</td><td style="text-align:right;font-size:0.9em;color:#FF6060">' . FormatEuroCurrency($thismonthtotal[1]);?> </td>
</tr>

<?php updatelastmonth() ?>

<tr>
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="<?php print $lastmonthpct?>"><?php print $lastmonth?></div></td>
<td style="text-align:right;font-size:0.9em"> This Year</td>
<td style="text-align:right;font-size:0.9em" title="<?php print FormatEuroCurrency($lastmonthorders[0]==0?0:$lastmonthtotal[0]/$lastmonthorders[0]);?>"><span style="color:<?php print $color ?>"><?php print $lastmonthorderspct ?></span>   <?php print $lastmonthorders[0] . '</td><td style="text-align:right;font-size:0.9em"><span style="color:' . $color . '">' . $lastmonthpct . '</span>   ' . FormatEuroCurrency($lastmonthtotal[0]);?></td>
</tr>
<tr>
<td style="text-align:right;font-size:0.9em;color:#FF6060">Last Year</td>
<td style="text-align:right;font-size:0.9em;color:#FF6060" title="<?php print FormatEuroCurrency($lastmonthorders[1]==0?0:$lastmonthtotal[1]/$lastmonthorders[1]);?>"><?php print $lastmonthorders[1] . '</td><td style="text-align:right;font-size:0.9em;color:#FF6060">' . FormatEuroCurrency($lastmonthtotal[1]);?></td>
</tr>

<?php updatethisyear() ?>

<tr>
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="<?php print $thisyrpct?>"><?php print "Jan 1 "?></div></td>
<td style="text-align:right;font-size:0.9em"> This Year</td>
<td style="text-align:right;font-size:0.9em" title="<?php print FormatEuroCurrency($yearorders[0]==0?0:$yeartotal[0]/$yearorders[0]);?>"><span style="color:<?php print $color ?>"><?php print $thisyrorderpct ?></span>   <?php print $yearorders[0] . '</td><td style="text-align:right;font-size:0.9em"><span style="color:' . $color . '">' . $thisyrpct . '</span>   ' . FormatEuroCurrency($yeartotal[0]);?></td>
</tr>
<tr>
<td style="text-align:right;font-size:0.9em;color:#FF6060">Last Year</td>
<td style="text-align:right;font-size:0.9em;color:#FF6060" title="<?php print FormatEuroCurrency($yearorders[1]==0?0:$yeartotal[1]/$yearorders[1]);?>"><?php print $yearorders[1] . '</td><td style="text-align:right;font-size:0.9em;color:#FF6060">' . FormatEuroCurrency($yeartotal[1]);?></td>
</tr>

<?php updatelast12() ?>

<tr>
<td style="text-align:right;vertical-align:middle" rowspan="2"><div title="Last 12 Months - <?php print $lastyrpct?>"><?php print '12 Mo.'?></div></td>
<td style="text-align:right;font-size:0.9em"> This Year</td>
<td style="text-align:right;font-size:0.9em" title="<?php print FormatEuroCurrency($last12[0]==0?0:$last12total[0]/$last12[0]);?>"><span style="color:<?php print $color ?>"><?php print $lastyrorderpct ?></span>   <?php print $last12[0] . '</td><td style="text-align:right;font-size:0.9em"><span style="color:' . $color . '">' . $lastyrpct . '</span>   ' . FormatEuroCurrency($last12total[0]);?></td>
</tr>
<tr>
<td style="text-align:right;font-size:0.9em;color:#FF6060">Last Year</td>
<td style="text-align:right;font-size:0.9em;color:#FF6060" title="<?php print FormatEuroCurrency($last12[1]==0?0:$last12total[1]/$last12[1]);?>"><?php print $last12[1] . '</td><td style="text-align:right;font-size:0.9em;color:#FF6060">' . FormatEuroCurrency($last12total[1]);?></td>
</tr>

<tr>
<td style="text-align:right;white-space:nowrap"><div title="All Time Sales"><?php print 'All Time'?></div></td>
<td style="font-size:0.9em"> </td>
<td style="text-align:right;font-size:0.9em" title="<?php print FormatEuroCurrency($alltime==0?0:$alltimetotal/$alltime);?>"><?php print $alltime . '</td><td style="text-align:right;font-size:0.9em">' . FormatCurrencyZeroDP($alltimetotal);?></td>
</tr>
</table>
</div>


LINE 599
<div class="one_third">
<h3 class="round_top">Top Sellers: Last 30 days
Go to Top of Page
   Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2018 ecommercetemplates.com Go To Top Of Page
This page was generated in 0.06 seconds. Snitz Forums 2000