3 * FusionForge reporting system
5 * Copyright 2003-2004, Tim Perdue/GForge, LLC
6 * Copyright 2009, Roland Mas
8 * This file is part of FusionForge. FusionForge is free software;
9 * you can redistribute it and/or modify it under the terms of the
10 * GNU General Public License as published by the Free Software
11 * Foundation; either version 2 of the Licence, or (at your option)
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 require_once $gfcommon.'reporting/Report.class.php';
26 class ReportUserCum extends Report {
28 function __construct($span,$start=0,$end=0) {
29 parent::__construct();
32 $start=mktime(0,0,0,date('m'),1,date('Y'));;
40 if (!$span || $span == REPORT_TYPE_MONTHLY) {
41 $res = db_query_params ('SELECT * FROM rep_users_cum_monthly WHERE month BETWEEN $1 AND $2 ORDER BY month ASC',
44 } elseif ($span == REPORT_TYPE_WEEKLY) {
45 $res = db_query_params ('SELECT * FROM rep_users_cum_weekly WHERE week BETWEEN $1 AND $2 ORDER BY week ASC',
48 } elseif ($span == REPORT_TYPE_DAILY) {
49 $res = db_query_params ('SELECT * FROM rep_users_cum_daily WHERE day BETWEEN $1 AND $2 ORDER BY day ASC',
54 $this->start_date=$start;
57 if (!$res || db_error()) {
58 $this->setError('ReportUserAdded: '.db_error());
61 $this->setSpan($span);
62 $this->setDates($res,0);
63 $this->setData($res,1);
71 // c-file-style: "bsd"