5 * Copyright 2004 (c) GForge LLC
7 * @author Tim Perdue tim@gforge.org
10 * This file is part of GForge.
12 * GForge is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * GForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with GForge; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 require_once('../env.inc.php');
28 require_once $gfwww.'include/pre.php';
29 require_once $gfcommon.'reporting/report_utils.php';
30 require_once $gfcommon.'reporting/Report.class.php';
32 session_require( array('group'=>forge_get_config('stats_group')) );
35 if ($report->isError()) {
36 exit_error($report->getErrorMessage());
39 $typ = getStringFromRequest('typ');
40 $start = getIntFromRequest('start');
41 $end = getIntFromRequest('end');
44 $z =& $report->getMonthStartArr();
45 $start = $z[count($z)-1];
48 echo report_header(_('Site-Wide Time Tracking'));
51 <h2><?php echo _('Site-Wide Time Tracking'); ?></h2>
52 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="get">
53 <input type="hidden" name="typ" value="<?php echo $typ; ?>" />
55 <td><strong><?php echo _('Start'); ?>:</strong><br /><?php echo report_months_box($report, 'start', $start); ?></td>
56 <td><strong><?php echo _('End'); ?>:</strong><br /><?php echo report_months_box($report, 'end', $end); ?></td>
57 <td><input type="submit" name="submit" value="<?php echo _('Refresh'); ?>" /></td>
65 $start=mktime(0,0,0,date('m'),1,date('Y'));;
73 $res=db_query_params ('SELECT week,sum(hours)
74 FROM rep_time_tracking
76 BETWEEN $1 AND $2 GROUP BY week',
80 $report->setDates($res,0);
81 $report->setData($res,1);
82 $data=$report->getData();
83 $labels=$report->getDates();
84 echo $HTML->listTableTop (array(_('Week'),
87 for ($i=0; $i<count($labels); $i++) {
89 echo '<tr '. $HTML->boxGetAltRowStyle($i) .'>'.
90 '<td>'. $labels[$i] .'</td><td>'. $data[$i] .'</td></tr>';
94 echo $HTML->listTableBottom ();
98 <img src="sitetimebar_graph.php?<?php echo "start=$start&end=$end"; ?>" width="640" height="480" alt="" />
103 echo report_footer();
107 // c-file-style: "bsd"