-
Notifications
You must be signed in to change notification settings - Fork 2
/
dashboard.php
67 lines (58 loc) · 2.27 KB
/
dashboard.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
67
<?php
require_once APP_PATH_DOCROOT . 'ProjectGeneral/header.php';
session_start();
// support 'show_future_seqs' checkbox
if (!isset($_SESSION['show_future_seqs'])) {
$_SESSION['show_future_seqs'] = false;
}
if ($_GET['show_future_seqs'] === 'true') {
$_SESSION['show_future_seqs'] = true;
$module->llog('show_future_seqs setting to true');
}
if ($_GET['show_future_seqs'] === 'false') {
$_SESSION['show_future_seqs'] = false;
$module->llog('show_future_seqs setting to false');
}
## Need to call this once because 'blue' on $module->interviewStatusIconURLs below
# isn't set until the function is called
$module->getInterviewStatusIconURLs('blue');
?>
<link rel="stylesheet" type="text/css" href="<?php echo $module->getUrl('css/dashboard.css'); ?>">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf8">
CATMH = {
dashboard_ajax_url: <?php echo '"' . $module->getUrl("ajax/dashboard_ajax.php") . '"'; ?>,
icon_urls: <?php echo json_encode((object) $module->interviewStatusIconURLs); ?>,
acknowledge_ajax_url: <?php echo '"' . $module->getUrl("ajax/acknowledge_ajax.php") . '"'; ?>
}
</script>
<script type="text/javascript" charset="utf8" src="<?php echo $module->getUrl('js/dashboard.js'); ?>"></script>
<?php
if (empty($module->getProjectSetting('enrollment_field'))) {
echo '
<div class="alert alert-warning w-50" role="alert">
<h5>The CAT-MH module does not have an Enrollment Field configured!</h5>
<p>No participant interview data will be tabulated until an Enrollment Field has been chosen via the External Modules page\'s Configure modal.</p>
</div>';
}
?>
<input type='checkbox' id='show_future_seqs'<?php if ($_SESSION['show_future_seqs']) {echo ' checked';} ?>>
<label for='show_future_seqs'> Show Future Sequences</label><br>
<table id="records" class="display compact nowrap">
<thead>
<tr>
<?php
$cols = $module->dashboardColumns;
foreach($cols as $i => $name) {
echo "<th>$name</th>\n";
}
?>
</tr>
</thead>
<tbody>
</tbody>
</table>
<?php
require_once APP_PATH_DOCROOT . 'ProjectGeneral/footer.php';
?>