X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_referral.cgi;h=1a57a5b24685075ea997f357c83dc19a8a7debb5;hp=084c21bd09a4e3c4d88577756ab64c6cb6fde538;hb=368bc5c098a47c32db7c575f912683ebe8662f59;hpb=952ce66262265a57634240373c18ddb6d8dd57bd
diff --git a/httemplate/browse/part_referral.cgi b/httemplate/browse/part_referral.cgi
index 084c21bd0..1a57a5b24 100755
--- a/httemplate/browse/part_referral.cgi
+++ b/httemplate/browse/part_referral.cgi
@@ -8,31 +8,56 @@ Where a customer heard about your service. Tracked for informational purposes.
Add a new advertising source
+<%
+ my $today = timelocal(0, 0, 0, (localtime(time))[3..5] );
+ my %past;
+ tie %past, 'Tie::IxHash',
+ 'Today' => 0,
+ 'Past week' => 518400, # 60sec * 60min * 24hrs * 6days
+ 'Past 30 days' => 2505600, # 60sec * 60min * 24hrs * 29days
+ 'Past 60 days' => 5097600, # 60sec * 60min * 24hrs * 29days
+ 'Past 90 days' => 7689600, # 60sec * 60min * 24hrs * 29days
+ 'Past 6 months' => 15724800, # 60sec * 60min * 24hrs * 182days
+ 'Past year' => 31486000, # 60sec * 60min * 24hrs * 364days
+ 'Total' => $today,
+ ;
+
+ my $sth = dbh->prepare("SELECT COUNT(*) FROM h_cust_main
+ WHERE refnum = ?
+ AND history_date > ? ")
+ or die dbh->errstr;
+%>
+
<%= table() %>