Example #1
0
$title_arr[] = _('Category');
$title_arr[] = _('User');
$title_arr[] = ' ';
$report = new Report();
if ($report->isError()) {
    exit_error('Error', $report->getErrorMessage());
}
echo $HTML->listTableTop($title_arr);
echo '<form action="/reporting/timeadd.php" method="post" />
	<input type="hidden" name="project_task_id" value="' . $project_task_id . '">
	<input type="hidden" name="submit" value="1" />
	<tr ' . $HTML->boxGetAltRowStyle(@$xi++) . '>
		<td style="text-align:center">' . report_weeks_box($report, 'week') . '</td>
		<td style="text-align:center">' . report_day_adjust_box($report, 'days_adjust') . '</td>
		<td style="text-align:center"><input type="text" name="hours" value="" size="3" maxlength="3" /></td>
		<td style="text-align:center">' . report_time_category_box('time_code', false) . '</td>
		<td>&nbsp;</td>
		<td style="text-align:center"><input type="submit" name="add" value="' . _('Add') . '" /><input type="submit" name="cancel" value="' . _('Cancel') . '" /></td>
	</tr></form>';
//setenv("TZ=" . $user_timezone); //restore the user�s timezone
//
//	Display Time Recorded for this task
//
$sql = "SELECT users.realname, rep_time_tracking.report_date, rep_time_tracking.hours, rep_time_category.category_name\n\tFROM users,rep_time_tracking,rep_time_category\n\tWHERE \n\tusers.user_id=rep_time_tracking.user_id\n\tAND rep_time_tracking.time_code=rep_time_category.time_code\n\tAND rep_time_tracking.project_task_id='{$project_task_id}'";
$res = db_query($sql);
$total_hours = 0;
for ($i = 0; $i < db_numrows($res); $i++) {
    echo '
	<tr ' . $HTML->boxGetAltRowStyle($xi++) . '>
	<td>&nbsp;</td>
	<td>' . date(_('Y-m-d H:i'), db_result($res, $i, 'report_date')) . '</td>
Example #2
0
				<td align="middle"><!-- <input type="text" name="hours" value="' . $r['hours'] . '" size="3" maxlength="3" /> -->' . $r['hours'] . '</td>
				<td align="middle"><!-- ' . report_time_category_box('time_code', $r['time_code']) . ' -->' . $r['category_name'] . '</td>
				<td align="middle"><!-- <input type="submit" name="update" value="Update" /> -->
				<input type="submit" name="delete" value="' . _('Delete') . '" /></td>
			</tr></form>';
        $total_hours += $r['hours'];
    }
    if ($group_project_id) {
        $respt = db_query("SELECT project_task_id,summary FROM project_task WHERE group_project_id='{$group_project_id}'");
        echo '<form action="' . getStringFromServer('PHP_SELF') . '?week=' . $week . '" method="post" />
			<input type="hidden" name="submit" value="1" />
			<tr ' . $HTML->boxGetAltRowStyle($xi++) . '>
				<td align="middle">' . html_build_select_box($respt, 'project_task_id', false, false) . '</td>
				<td align="middle"><input type="text" name="report_date" value="' . date('Y-m-d', $week) . '" size="10" maxlength="10" /></td>
				<td align="middle"><input type="text" name="hours" value="" size="3" maxlength="3" /></td>
				<td align="middle">' . report_time_category_box('time_code', false) . '</td>
				<td align="middle"><input type="submit" name="add" value="' . _('Add') . '" /><input type="submit" name="cancel" value="' . _('Cancel') . '" /></td>
			</tr></form>';
    }
    echo '<tr ' . $HTML->boxGetAltRowStyle($xi++) . '><td colspan="2"><strong>' . _('Total Hours') . ':</strong></td><td><strong>' . $total_hours . '</strong></td><td colspan="2"></td></tr>';
    echo $HTML->listTableBottom();
}
if (!$group_project_id) {
    ?>
<p>
<h3><?php 
    echo _('Add Entry');
    ?>
</h3>
<p><?php 
    echo _('Choose a Project/Subproject in the Task Manager. You will then have to choose a Task and category to record your time in.');