diff options
author | Mark Wells <mark@freeside.biz> | 2014-09-05 14:59:38 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2014-09-05 14:59:38 -0700 |
commit | 76a65fb930294e3773ed87f39f0972220854fe42 (patch) | |
tree | 0e48cf518abeee81326ff1a55cb05936f2bebd7d /httemplate/graph | |
parent | 529413f23d545179ff07ac393713a225a78014c2 (diff) |
clean up last commit
Diffstat (limited to 'httemplate/graph')
-rw-r--r-- | httemplate/graph/signupdate.cgi | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/httemplate/graph/signupdate.cgi b/httemplate/graph/signupdate.cgi index 23e459664..5b7075868 100644 --- a/httemplate/graph/signupdate.cgi +++ b/httemplate/graph/signupdate.cgi @@ -32,23 +32,22 @@ my @count = (0) x 24; my %where; $where{'agentnum'} = $agentnum if $agentnum; $where{'usernum'} = $usernum if $usernum; - -my $sdate = DateTime->new( - year => $cgi->param('start_year'), - month => $cgi->param('start_month'), -)->epoch(); - -my $edate = DateTime->new( - year => $cgi->param('end_year'), - month => ($cgi->param('end_month') % 12 + 1) # first day of the next month -)->epoch(); - -my $where .= " AND signupdate >= $sdate ". - " AND signupdate <= $edate "; +my $sdate = $cgi->param('start_year'). + '-'. + $cgi->param('start_month'). + '-01'; +my $edate = ($cgi->param('end_year') + + ($cgi->param('end_month')==12)). + '-'. + ($cgi->param('end_month') % 12 + 1). + '-01'; # first day of the next month + +my $sql = "AND signupdate >= ".str2time($sdate). + " AND signupdate < ".str2time($edate); foreach my $cust (qsearch({ table => 'cust_main', hashref => \%where, - extra_sql => $where } )) { + extra_sql => $sql } )) { next if !$cust->signupdate; my $hour = time2str('%H',$cust->signupdate); $count[$hour]++; |