5 * Copyright 2004 (c) GForge LLC
8 * @author Tim Perdue tim@gforge.org
11 * This file is part of GForge.
13 * GForge is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * GForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with GForge; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 require_once('../env.inc.php');
29 require_once('pre.php');
30 require_once('common/reporting/report_utils.php');
31 require_once('common/reporting/Report.class');
33 session_require( array('group'=>$sys_stats_group) );
37 if ($report->isError()) {
38 exit_error($report->getErrorMessage());
41 $typ = getStringFromRequest('typ');
42 $start = getStringFromRequest('start');
43 $end = getStringFromRequest('end');
46 $z =& $report->getMonthStartArr();
47 $start = $z[count($z)-1];
50 echo report_header(_('Site-Wide Time Tracking'));
53 <h3><?php echo _('Site-Wide Time Tracking'); ?></h3>
55 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="get">
56 <input type="hidden" name="typ" value="<?php echo $typ; ?>">
58 <td><strong><?php echo _('Start'); ?>:</strong><br /><?php echo report_months_box($report, 'start', $start); ?></td>
59 <td><strong><?php echo _('End'); ?>:</strong><br /><?php echo report_months_box($report, 'end', $end); ?></td>
60 <td><input type="submit" name="submit" value="<?php echo _('Refresh'); ?>"></td>
68 $start=mktime(0,0,0,date('m'),1,date('Y'));;
76 $res=db_query("SELECT week,sum(hours)
77 FROM rep_time_tracking
79 BETWEEN '$start' AND '$end' GROUP BY week");
81 $report->setDates($res,0);
82 $report->setData($res,1);
83 $data=$report->getData();
84 $labels=$report->getDates();
85 echo $HTML->listTableTop (array(_('Week'),
88 for ($i=0; $i<count($labels); $i++) {
90 echo '<tr '. $HTML->boxGetAltRowStyle($i) .'>'.
91 '<td>'. $labels[$i] .'</td><td>'. $data[$i] .'</td></tr>';
95 echo $HTML->listTableBottom ();
98 <img src="sitetimebar_graph.php?<?php echo "start=$start&end=$end"; ?>" width="640" height="480">
102 echo report_footer();