Example #1
0
/**
* Gives an array with worker stats:
* $stats['totalhours']
* $stats['monthhours'
* $stats['yearhours']
* $stats['termhours']
* $stats['totalearnings'] 
* $stats['monthearnings']
* $stats['yearearnings']
* $stats['termearnings']
* @return an array with useful values
*/
function get_worker_stats($userid, $courseid)
{
    global $DB;
    $stats['totalhours'] = get_total_hours($userid, $courseid);
    $stats['monthhours'] = get_hours_this_month($userid, $courseid);
    $stats['yearhours'] = get_hours_this_year($userid, $courseid);
    $stats['termhours'] = get_hours_this_term($userid, $courseid);
    $stats['totalearnings'] = get_total_earnings($userid, $courseid);
    $stats['monthearnings'] = get_earnings_this_month($userid, $courseid);
    $stats['yearearnings'] = get_earnings_this_year($userid, $courseid);
    $stats['termearnings'] = get_earnings_this_term($userid, $courseid);
    return $stats;
}
        $ac = null;
        foreach ($active_cases as $key => $value) {
            $ac .= "<a href='index.php?i=Cases.php#cases/{$key}' target='_new'>{$value}</a>" . ", ";
        }
        echo rtrim($ac, ', ');
    } else {
        echo "This user is not currently assigned to any open cases.";
    }
    ?>

	</div>

	<p><label>Total Hours</label>

		<?php 
    $t = get_total_hours($dbh, $username);
    echo implode(' ', $t);
    ?>
	<p>

	<?php 
    if ($_SESSION['permissions']['supervises'] == '1') {
        ?>

	<p><label>Evaluations</label>

		<div class="eval_display">
			<?php 
        echo nl2br(htmlentities($evals));
        ?>
		</div>