Exemplo n.º 1
0
<?php

include_once "phplib/base.php";
if (isset($_GET['week'])) {
    if (is_numeric($_GET['week'])) {
        $_POST['date'] = date("r", $_GET['week']);
    } else {
        die("Wat?");
    }
}
$time_requested = getOrSetRequestedDate();
$my_username = getUsername();
$start_end = getWeekRange($time_requested);
$start_ts = $start_end[0];
$end_ts = $start_end[1];
$oncall_period = getOnCallWeekRange($time_requested);
$oncall_start = $oncall_period[0];
$oncall_end = $oncall_period[1];
$protocol = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' || $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://";
$permalink = "{$protocol}{$_SERVER['SERVER_NAME']}/meeting.php?week={$start_ts}";
$page_title = getTeamName() . " Weekly Updates - Meeting View";
include_once 'phplib/header.php';
include_once 'phplib/nav.php';
$root_url = getTeamUrl();
?>

<script>
function setDateToLastWeek() {
    $.post("meeting.php", { date: '<?php 
echo date("r", strtotime("1 week ago"));
?>
Exemplo n.º 2
0
<?php

// Handle a time period requested other than now
$time_requested = isset($_GET['date']) ? $_GET['date'] : "now";
include_once 'phplib/base.php';
$my_username = getUsername();
$start_end = getOnCallWeekRange($time_requested);
$start_ts = $start_end[0];
$end_ts = $start_end[1];
// Get the alerts with timezone data so it matches the users expectations
$oncall_start_end = getOnCallWeekRangeWithTZ($time_requested);
$oncall_start_ts = $oncall_start_end[0];
$oncall_end_ts = $oncall_start_end[1];
?>


<form action="<?php 
echo $ROOT_URL;
?>
/add_oncall_weekly.php" method="POST" class="form-horizontal">
    <h3>Alerts recieved this week (<?php 
echo date("l jS F Y", $start_ts) . " - " . date("l jS F Y", $end_ts);
?>
)</h3>
    <table class="table table-striped table-bordered table-hover">
    <thead>
        <tr>
        <th>Date/Time</th><th>Host</th><th>Service</th><th>Output</th><th>State</th>
        </tr>
    </thead>
    <tbody>