-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.php
238 lines (190 loc) · 8.18 KB
/
index.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
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<?php
/*
* *************************************************************************************************************************
* * CORAL Usage Statistics Reporting Module v. 1.0
* *
* * Copyright (c) 2010 University of Notre Dame
* *
* * This file is part of CORAL.
* *
* * CORAL 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.
* *
* * CORAL 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 CORAL. If not, see <http://www.gnu.org/licenses/>.
* *
* *************************************************************************************************************************
*/
session_start();
require 'minify.php';
ob_start('minify_output');
include_once 'directory.php';
// print header
$pageTitle = 'Home';
include 'templates/header.php';
?>
<center>
<form name="reportlist" method="post" onsubmit=" return daterange_onsubmit()" action="report.php">
<table class='noborder' cellpadding="0" cellspacing="0" style="width: 699px; text-align: left;">
<tr>
<td class="noborder"
style="background-image: url('images/reportstitle.gif'); background-repeat: no-repeat; text-align: right;">
<span style="border: none; outline: none; -moz-outline-style: none; float: left;">
<img src='images/transparent.gif' style='width: 450px; height: 100px; border: none' alt=''/></span>
<div style='margin-right: 5px; margin-top: 35px; text-align: right;'>
<span style='float: right; font-size: 110%; color: #526972'> </span>
</div>
</td>
</tr>
<tr>
<td class="fullborder"><br /> <br />
<div id='div_report'>
<label for="reportID">Select Report</label> <select name='reportID' id='reportID' class='opt'>
<option value=''></option>
<?php
// get all reports for output in drop down
$db = new DBService();
foreach ( $db->query("SELECT reportID, reportName FROM Report ORDER BY 2, 1")->fetchRows(MYSQLI_ASSOC) as $report ) {
echo "<option value='" . $report['reportID'] . "' ";
if (isset($_REQUEST['reportID']) && $report['reportID'] === $_REQUEST['reportID']) {
echo 'selected="selected"';
}
echo ">{$report['reportName']}</option>";
}
unset($db);
?>
</select>
<<<<<<< HEAD
</div>
<div id='div_parm'>
<?php
if (isset($_GET['reportID'])){
$report = new Report($_GET['reportID']);
// get parameters
$parmValue = array();
foreach ( $report->getParameters() as $parm ){
echo "<div id='div_parm_" . $parm->ID . "'><br><label for='prm_", $parm->ID . "'>" . $parm->displayPrompt, "</label>";
if ($parm->typeCode === "dd"){
echo "<select name='prm_" . $parm->ID . "' id='prm_" . $parm->ID . "' class='opt' ";
if ($parm->isParent()){
echo "onchange='javascript:updateChildren(" . $parm->ID . ");')";
}
echo ">";
if ($parm->requiredInd != '1'){
echo "<option value=''>All</option>";
}
$rownumber = 1;
foreach ( $parm->getSelectValues($_GET['prm_' . $parm->parentReportParameterID]) as $value ){
if (($rownumber === 1) && ($parm->requiredInd == '1')){
$parmValue[$parm->ID] = $value[0];
}
echo "<option value='" . $value['cde'] . "'";
if ($_GET['prm_' . $parm->ID] == $value['cde']){
echo "selected";
}
echo '>' . $value['val'] . "</option>";
++$rownumber;
}
echo "</select>";
}else if ($parm->typeCode === "ms"){
$parms = array();
$passedParm = $_GET['prm_' . $parm->ID];
echo "<span style='margin-left:-90px'><div id='div_show_" . $parm->ID . "' style='";
if ($passedParm){
$passedParm = str_replace(" ", "", str_replace("'", "", $passedParm));
$parms = explode(",", $passedParm);
echo "display:none;";
}
echo "float:left;margin-bottom: 5px'><a href=\"javascript:toggleLayer('div_", $parm->ID, "','block');toggleLayer('div_show_", $parm->ID, "','none');\">-Click to choose ", $parm->displayPrompt, "-</a></div><div id='div_", $parm->ID, "' style='";
if (!$passedParm){
echo "display:none;";
}
echo "float:left;margin-bottom: 5px;'><table class='noborder'><tr><td class='noborder'><select name='prm_left_", $parm->ID, "' id='prm_left_", $parm->ID, "' class='opt' size='10' multiple='multiple' style='width:175px'>";
if ($parm->requiredInd != '1'){
echo "<option value='' selected>All</option>";
}
$rightParms = '';
foreach ( $parm->getSelectValues($_GET['prm_' . $parm->parentReportParameterID]) as $value ){
$cde = strtr(str_replace("'", "\\'", $value['cde']), ',', "\\");
// also perform check to add to the right hand side
$displayThis = 1;
if ($passedParm){
foreach ( $parms as $parmVal ){
if ($parmVal == $cde){
$rightParms .= "<option value='" . $cde . "'>" . $value['val'] . "</option>\n";
$displayThis = 0;
}
}
}
if ($displayThis == '1'){
echo "<option value='" . $cde . "'>" . $value['val'] . "</option>\n";
}
}
echo "</select></td>",
// echo javascript left/right buttons
"<td align='center' valign='middle' style='border:0px;'><input type='button' value='-->' style='width:35px' onclick='moveOptions(this.form.prm_left_", $parm->ID, ", this.form.prm_right_", $parm->ID, ");placeInHidden(\",\",\"prm_right_", $parm->ID, "\", \"prm_", $parm->ID, "\");' /><br><input type='button' value='<--' style='width:35px' onclick='moveOptions(this.form.prm_right_", $parm->ID, ", this.form.prm_left_", $parm->ID, ");placeInHidden(\",\",\"prm_right_", $parm->ID, "\", \"prm_", $parm->ID, "\");' /></td><td style='border:0px;'><select name='prm_right_", $parm->ID, "' id='prm_right_", $parm->ID, "' class='opt' size='10' multiple='multiple' style='width:175px'>", ($rightParms ? $rightParms : ''), "</select></td></tr><tr><td style='border:0px;' colspan='3' align='left'><input type='hidden' name='prm_", $parm->ID, "' id='prm_", $parm->ID, "' value=\"", $passedParm, "\"><a href=\"javascript:toggleLayer('div_", $parm->ID, "','none');toggleLayer('div_show_", $parm->ID, "','block');\">-Hide ", $parm->displayPrompt, "-</a></td></tr></table></div></span>";
}else if ($parm->typeCode === "chk"){
echo "<input type='checkbox' name='prm_", $parm->ID, "' class='opt' style='text-align:left;width:13px;' ", (($_GET['prm_' . $parm->ID] === 'on' || $_GET['prm_' . $parm->ID] === 'Y') ? 'checked' : ''), ">";
}else{
echo "<input type='text' name='prm_", $parm->ID, "' value='' class='opt'>", (($parm->formatCode === 'date') ? '<font size="-2">ex: MM/DD/YYYY</font>' : '');
}
echo "</div>";
}
}else{
echo "<br />";
}
?>
</div> <input type='hidden' name='rprt_output' value='web'> <br /> <br />
<input type="submit" value="Submit" name="submitbutton"
id="submitbutton"> <input type="button" value="Reset"
name="resetbutton" id="resetbutton"
onclick="javascript:clearParms();"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</form>
<br /> <br />
=======
</div>
>>>>>>> 7e8451eda445c57bc7c99c019af067bfd6550582
<div id='div_parm'>
<?php
if (isset($_GET['reportID'])) {
$reportID = $_GET['reportID'];
} else if (isset($_SESSION['reportID'])) {
$reportID = $_SESSION['reportID'];
unset($_SESSION['reportID']);
}
if (isset($reportID)) {
$report = ReportFactory::makeReport($reportID);
Parameter::$ajax_parmValues = array();
foreach ( $report->getParameters() as $parm ) {
$parm->form();
}
Parameter::$ajax_parmValues = null;
} else {
echo "<br />";
}
?>
</div>
<input type='hidden' name='rprt_output' value='web'/>
<br /><br />
<input type="submit" value="Submit" name="submitbutton" id="submitbutton"/>
<input type="button" value="Reset" name="resetbutton" id="resetbutton" onclick="javascript:clearParms();"/>
</td>
</tr>
</table>
</form>
</center>
<br />
<br />
<br />
<script type="text/javascript" src="js/index.js"></script>
<?php
// print footer
include 'templates/footer.php';
ob_end_flush();
?>