3 * FusionForge reporting system
5 * Copyright 2003-2004, Tim Perdue/GForge, LLC
7 * This file is part of FusionForge.
9 * FusionForge is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published
11 * by the Free Software Foundation; either version 2 of the License,
12 * or (at your option) any later version.
14 * FusionForge is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with FusionForge; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 require_once $gfcommon.'reporting/Report.class.php';
27 class ReportGroupCum extends Report {
29 function ReportGroupCum($span,$start=0,$end=0) {
33 $start=mktime(0,0,0,date('m'),1,date('Y'));;
41 if (!$span || $span == REPORT_TYPE_MONTHLY) {
43 $res=db_query("SELECT * FROM rep_groups_cum_monthly
44 WHERE month BETWEEN '$start' AND '$end' ORDER BY month");
46 } elseif ($span == REPORT_TYPE_WEEKLY) {
48 $res=db_query("SELECT * FROM rep_groups_cum_weekly
49 WHERE week BETWEEN '$start' AND '$end' ORDER BY week");
51 } elseif ($span == REPORT_TYPE_DAILY) {
53 $res=db_query("SELECT * FROM rep_groups_cum_daily
54 WHERE day BETWEEN '$start' AND '$end' ORDER BY day ASC");
58 $this->start_date=$start;
61 if (!$res || db_error()) {
62 $this->setError('ReportGroupAdded:: '.db_error());
65 $this->setSpan($span);
66 $this->setDates($res,0);
67 $this->setData($res,1);
75 // c-file-style: "bsd"