Line 214... |
Line 214... |
214 |
$additionalLimitations is a partial where clause. When passed in, it will replace the special parameter <additionalLimitations>.
|
214 |
$additionalLimitations is a partial where clause. When passed in, it will replace the special parameter <additionalLimitations>.
|
215 |
if it is not passed in, <additionalLimitations> will be removed
|
215 |
if it is not passed in, <additionalLimitations> will be removed
|
216 |
$makeTitle, if set to false, will simply return the data in a table. If true, will return the title and the data
|
216 |
$makeTitle, if set to false, will simply return the data in a table. If true, will return the title and the data
|
217 |
The return value is the title in an H1, the conditions in H2's, and the results in a table
|
217 |
The return value is the title in an H1, the conditions in H2's, and the results in a table
|
218 |
*/
|
218 |
*/
|
219 |
function run( $parameters = '', $additionalLimitations = '', $makeTitle = true ) {
|
219 |
function run( $parameters = '', $additionalLimitations = '', $makeTitle = true, $titleTags = array('startTag' => '<h4>', 'endTag' => '</h4>', 'conditionStart' => '<h2>', 'conditionEnd' => '</h2>' ) ) {
|
220 |
$conditions = array();
|
220 |
$conditions = array();
|
221 |
foreach ( $this->parameters as $parameter ) {
|
221 |
foreach ( $this->parameters as $parameter ) {
|
222 |
if ( $parameters[$parameter->name()] ) { // in the array passed in
|
222 |
if ( $parameters[$parameter->name()] ) { // in the array passed in
|
223 |
$parameter->value( $parameters[$parameter->name()] );
|
223 |
$parameter->value( $parameters[$parameter->name()] );
|
224 |
} elseif ($_POST['report_param_' . $parameter->name()]) { // in $_POST
|
224 |
} elseif ($_POST['report_param_' . $parameter->name()]) { // in $_POST
|
Line 244... |
Line 244... |
244 |
$this->query = preg_replace( '/<additionalLimitations>/', ' and ' . $additionalLimitations, $this->query );
|
244 |
$this->query = preg_replace( '/<additionalLimitations>/', ' and ' . $additionalLimitations, $this->query );
|
245 |
} else {
|
245 |
} else {
|
246 |
$this->query = preg_replace( '/<additionalLimitations>/', '', $this->query );
|
246 |
$this->query = preg_replace( '/<additionalLimitations>/', '', $this->query );
|
247 |
}
|
247 |
}
|
248 |
// print "<pre>$this->query</pre>";
|
248 |
// print "<pre>$this->query</pre>";
|
- |
|
249 |
$return = queryToTable($this->query);
|
- |
|
250 |
if ( $return && $makeTitle ) {
|
- |
|
251 |
$return = $titleTags['startTag'] . $this->title . $titleTags['endTag'] .
|
- |
|
252 |
$titleTags['conditionStart'] .
|
249 |
return ( $makeTitle ? '<h1>' . $this->title . '</h1>' . '<h2>' . implode('</h2><h2>', $conditions) . '</h2>' : '' ) . queryToTable($this->query);
|
253 |
implode($titleTags['conditionEnd'] . $titleTags['conditionStart'], $conditions) .
|
- |
|
254 |
$titleTags['conditionEnd'] .
|
- |
|
255 |
$return;
|
- |
|
256 |
}
|
- |
|
257 |
return $return;
|
250 |
}
|
258 |
}
|
251 |
|
259 |
|
252 |
/*
|
260 |
/*
|
253 |
Creates a table with the necessary INPUT or SELECT fields to get the parameter values from the user
|
261 |
Creates a table with the necessary INPUT or SELECT fields to get the parameter values from the user
|
254 |
returns a table suitable for inserting into a FORM
|
262 |
returns a table suitable for inserting into a FORM
|
Line 268... |
Line 276... |
268 |
return parameterInputScreen();
|
276 |
return parameterInputScreen();
|
269 |
}
|
277 |
}
|
270 |
|
278 |
|
271 |
} // class Report
|
279 |
} // class Report
|
272 |
|
280 |
|
273 |
?>
|
- |
|
274 |
|
281 |
?>
|
- |
|
282 |
|