3 * FusionForge reporting system
5 * Copyright 2003-2004, Tim Perdue/GForge, LLC
6 * Copyright 2009, Roland Mas
8 * This file is part of FusionForge.
10 * FusionForge is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published
12 * by the Free Software Foundation; either version 2 of the License,
13 * or (at your option) any later version.
15 * FusionForge is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with FusionForge; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
26 require_once $gfcommon.'reporting/Report.class.php';
28 class ReportUserAdded extends Report {
30 function ReportUserAdded($span,$start=0,$end=0) {
34 $start=mktime(0,0,0,date('m'),1,date('Y'));;
42 if (!$span || $span == REPORT_TYPE_MONTHLY) {
43 $res = db_query_params ('SELECT * FROM rep_users_added_monthly WHERE month BETWEEN $1 AND $2 ORDER BY month ASC',
46 } elseif ($span == REPORT_TYPE_WEEKLY) {
47 $res = db_query_params ('SELECT * FROM rep_users_added_weekly WHERE week BETWEEN $1 AND $2 ORDER BY week ASC',
50 } elseif ($span == REPORT_TYPE_DAILY) {
51 $res = db_query_params ('SELECT * FROM rep_users_added_daily WHERE day BETWEEN $1 AND $2 ORDER BY day ASC',
56 $this->start_date=$start;
59 if (!$res || db_error()) {
60 $this->setError('ReportUserAdded:: '.db_error());
63 $this->setSpan($span);
64 $this->setDates($res,0);
65 $this->setData($res,1);
73 // c-file-style: "bsd"