Esempio n. 1
0
<?php 
if (!($profile = checkForUserProfile($my_username))) {
    echo insertNotify("info", "Welcome to your profile page! Please <a href='{$ROOT_URL}/edit_profile.php'>edit your profile</a>");
    $profile = null;
} else {
    $sleeptracking_settings = json_decode($profile['sleeptracking_settings'], 1);
}
// Welcome the user either with their full name, or their username.
if ($profile['full_name'] != "") {
    list($name, $rest) = explode(" ", $profile['full_name'], 2);
} else {
    $name = $my_username;
}
echo "<h1>Hello {$name} <small>viewing your profile</small></h1>";
// Count the number of weekly updates for the summary
if (!($updates = getGenericWeeklyReportsForUser($my_username))) {
    $num_weekly = "no";
} else {
    $num_weekly = count($updates);
}
// Get the oncall ranges for this user for their stats, and for the summary.
if (!($oncall_ranges = getAvailableOnCallRangesForUser($my_username))) {
    $oncall = false;
} else {
    $oncall = true;
    $num_oncall = count($oncall_ranges);
    $sleep_status_agg = array();
    $tag_agg_norm = array();
    $mtts_total = 0;
    $top_wakeup_cause = array();
    $tag_graph_data[] = array("Week", "Action Taken", "No Action Taken");
Esempio n. 2
0
include_once "phplib/base.php";
$user_requested = isset($_POST['username']) ? $_POST['username'] : getUsername();
$page_title = getTeamName() . " Weekly Updates - Updates for {$user_requested}";
include_once 'phplib/header.php';
include_once 'phplib/nav.php';
?>

<div class="container">
<h1>All Weekly Updates <small>for user <?php 
echo $user_requested;
?>
</small></h1>
<div class="row">
    <div class="span9">
    <?php 
$updates = getGenericWeeklyReportsForUser($user_requested);
if (!$updates) {
    echo insertNotify("error", "This user doesn't appear to have any weekly updates!");
} else {
    foreach ($updates as $update) {
        $pretty_time = getPrettyTime($update['timestamp']);
        $ending_date = date("l jS F Y", $update['range_end']);
        echo "<h3>Week ending {$ending_date} <small>written {$pretty_time}</small></h3>";
        echo "<div class='well well-small'><p>{$update['report']}</p></div>";
    }
}
?>
    </div>

    <div class="span3">
    <h4>Choose person</h3>