forked from howardpchen/capricorn
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbrowse.php
More file actions
211 lines (173 loc) · 6.7 KB
/
browse.php
File metadata and controls
211 lines (173 loc) · 6.7 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php
/*
Capricorn - Open-source analytics tool for radiology residents.
Copyright (C) 2014 (Howard) Po-Hao Chen
This file is part of Capricorn.
Capricorn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
include_once "capricornLib.php";
?>
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="<?php echo $URL_root; ?>css/jquery-ui.css" />
<link href="<?php echo $URL_root; ?>css/chardinjs.css" rel="stylesheet">
<script src="<?php echo $URL_root; ?>js/jquery-1.9.1.js"></script>
<script src="<?php echo $URL_root; ?>js/jquery-ui.js"></script>
<script src="<?php echo $URL_root; ?>js/highcharts.js"></script>
<script src="<?php echo $URL_root; ?>js/collapseTable.js"></script>
<script type='text/javascript' src="<?php echo $URL_root; ?>js/chardinjs.min.js"></script>
<script>
<!--
$(function() {
$( "#from" ).datepicker({
changeMonth: true,
numberOfMonths: 1,
onClose: function( selectedDate ) {
$( "#to" ).datepicker( "option", "minDate", selectedDate);
}
});
$("#from").datepicker('setDate', new Date("<?php echo $sd?>"));
$( "#to" ).datepicker({
changeMonth: true,
numberOfMonths: 1,
onClose: function( selectedDate ) {
$( "#from" ).datepicker( "option", "maxDate", selectedDate );
}
});
$("#to").datepicker('setDate', new Date("<?php echo $ed?>"));
});
function clickInterval(a) {
/* if (a < -90) {
document.getElementById('mod').value = document.getElementById('mod').value==''?'CR':document.getElementById('mod').value;
}
*/
$("#from").datepicker('setDate',a);
$("#to").datepicker('setDate',new Date());
$("#range").submit();
}
//-->
</script>
<?php include "header.php"; ?>
<Title>Browse - <?php echo getLoginUserFullName();?> - Capricorn</title>
<p>
<table border=0 width=100%><tr>
<td valign=top width=250 style="padding:15px">
<!-- Display Rotations Here -->
<?php
function displayRotationButton($rot, $startDate, $endDate) {
global $schemaColor;
$startDate = toJSDate($startDate);
$endDate = toJSDate($endDate);
echo
<form id="rotationRange">
<input type="hidden" size=10 name="from" value="$startDate"/>
<input type="hidden" size=10 name="to" value="$endDate"/>
<input type="hidden" name="rota" value="$rot"/>
<input type="submit" id="sub" title="$startDate to $endDate" value="$rot" style="line-height:1em; border:none;margin-bottom: 0;margin-top: 0;background:none"/>
</form>
END;
}
$rotations = getRotationsByTrainee($_SESSION['traineeid']);
$current = array();
$prev = array();
$future = array();
$calls = array();
foreach ($rotations as $r) {
$today = date_create('NOW');
$startD = date_create($r['RotationStartDate']);
$endD = date_create($r['RotationEndDate']);
$endD->add(new DateInterval("P1D"));
if (isCallRotation($r['Rotation'])) $calls[] = $r;
else if ($today > $endD) $prev[] = $r;
else if ($today < $startD) $future[] = $r;
else $current[] = $r;
}
?>
<div data-intro="Click on a rotation to display its data." data-position="bottom">
<?php
tableStartSection("Current Rotation", 0);
foreach ($current as $r) {
$r['RotationStartDate'] = str_replace("-", "/", $r['RotationStartDate']);
$r['RotationEndDate'] = str_replace("-", "/", $r['RotationEndDate']);
displayRotationButton($r['Rotation'], $r['RotationStartDate'], $r['RotationEndDate']);
}
tableEndSection();
?>
</div>
<?php
tableStartSection("Previous 2013-2014", 0);
foreach ($prev as $r) {
$r['RotationStartDate'] = str_replace("-", "/", $r['RotationStartDate']);
$r['RotationEndDate'] = str_replace("-", "/", $r['RotationEndDate']);
displayRotationButton($r['Rotation'], $r['RotationStartDate'], $r['RotationEndDate']);
}
tableEndSection();
tableStartSection("Future", 0);
foreach ($future as $r) {
displayRotationButton($r['Rotation'], $r['RotationStartDate'], $r['RotationEndDate']);
}
tableEndSection();
?>
<td valign=top>
<?php
if (isset($_GET['rota'])) {
$r = $_GET['rota'];
echo "<table border=0 width=100%><tr><td bgcolor=$schemaColor[0]><center><font size=+1 color=white>$r</font></center></tr></table><br>";
}
?>
<div class='control' data-intro="Control Panel to select date range and display style." data-position="right">
<form id="range">
<label for="from" >From</label>
<input style="border:solid 1px;background:none" type="text" size=10 id="from" name="from" />
<label for="to">to</label>
<input style="border:solid 1px;background:none" type="text" size=10 id="to" name="to"/>
<label><input type="checkbox" title="Total studies interpreted versus daily counts." onClick="$('#range').submit();" id="cumulative" name="cumulative" value="Y" <?php echo $cumulative?"checked":""?>>Cumulative</label>
<input type="submit" id="sub" value="Go" /><br>
<label>Modality:
<select style="background:none" name='mod' id='mod'>
<option value=''> All </option>
<?php
$examType = getExamCodeData('Type', NULL, 'ORDER BY Type');
foreach ($examType as $type) {
$short = $type[0];
$long = codeToEnglish($short);
if (isset($excludeBrowse)) {
// Remove the exam types in the exclude list (under capricornConfig.php)
if (in_array($short, $excludeBrowse)) continue;
}
$selected = '';
if (isset($_GET['mod']) && $_GET['mod'] == $short) $selected = 'selected';
echo "<option value='" . $short . "' " . $selected . " >" . $long . "</option>\n";
}
?>
</select></label>
</form>
Past: [ <a href="#" onclick="clickInterval(-31)">1 month</a> |
<a href="#" onclick="clickInterval(-183)">6 months</a> |
<a href="#" onclick="clickInterval(-365)" title="May take up to 1 minute to process. Speed things up by selecting a specific modality.">1 year</a> |
<a href="#" onclick="clickInterval(-1431)" title="May take up to 5 minutes to process. Speed things up by selecting a specific modality.">4 years</a> ]
</div>
<p>
<?php
if (isset($_GET['mod']) && $_GET['mod'] != '') {
include "disp_single_modality.php";
} else {
include "disp_by_modality.php";
}
?>
</tr></table>
<P><A HREF="logout.php">Log Out</A></P>
<?php
include "footer.php";
ob_end_flush();
?>