This repository has been archived by the owner on Apr 4, 2022. It is now read-only.
forked from etsy/opsweekly
-
Notifications
You must be signed in to change notification settings - Fork 1
/
report.php
66 lines (54 loc) · 1.88 KB
/
report.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
include_once("phplib/base.php");
$time_requested = getOrSetRequestedDate();
$start_end = getWeekRange($time_requested);
$start_ts = $start_end[0];
$end_ts = $start_end[1];
$page_title = getTeamName() . " Weekly Updates - Reports";
include_once('phplib/header.php');
include_once('phplib/nav.php');
?>
<style>
.icon-time {
-moz-transform:scale(1.2,1.2); /* Firefox */
-webkit-transform:scale(1.2,1.2); /* Safari and Chrome */
}
</style>
<div class="container">
<h1>On Call Reporting</h1>
<?php
if (getTeamConfig('oncall')) {
?>
<ul id="myTab" class="nav nav-tabs">
<li class="active"><a href="#week" report="week" data-toggle="tab">Week</a></li>
<li><a href="#year" report="year" data-toggle="tab">Year</a></li>
</ul>
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="week"><div id="week-report-container"></div></div>
<div class="tab-pane fade" id="year"><div id="year-report-container"></div></div>
</div>
<script>
$('#week-report-container').html('<h2>Generating...</h2>');
var want_report = "week";
$.post("./generate_report.php", { type: want_report, date: '<?php echo $time_requested ?>' }).done(function(data) {
$('#' + want_report + '-report-container').html(data);
});
</script>
<script>
$('a[data-toggle="tab"]').on('show', function (e) {
$('#week-report-container').html('<h2>Generating...</h2>');
$('#year-report-container').html('<h2>Generating...</h2>');
var want_report = $(e.target).attr('report');
$.post("./generate_report.php", { type: want_report, date: '<?php echo $time_requested ?>' }).done(function(data) {
$('#' + want_report + '-report-container').html(data);
});
})
</script>
<?php } else {
echo "<p class='lead'>This feature is disabled because you have disabled 'on call' support. Please enable it and try again. </p>";
}
?>
</div>
<?php include_once('phplib/footer.php'); ?>
</body>
</html>