forked from science-ation/science-ation
- Add an option to view reports from previous years
This commit is contained in:
parent
40067ed0c4
commit
186c0525b7
@ -349,10 +349,11 @@ foreach($stock as $n=>$v) {
|
||||
|
||||
|
||||
|
||||
function report_gen_by_id($report_id, $format=NULL)
|
||||
function report_gen_by_id($report_id, $year, $format=NULL)
|
||||
{
|
||||
global $options;
|
||||
$report = report_load($report_id);
|
||||
$report['year'] = $year;
|
||||
if($format != NULL) {
|
||||
$keys = array_keys($options['type']['values']);
|
||||
if(in_array($format, $keys)) {
|
||||
|
@ -44,6 +44,7 @@
|
||||
echo "<select name=\"type\"><option value=\"\">Default Format</option>";
|
||||
echo "<option value=\"pdf\">PDF</option>";
|
||||
echo "<option value=\"csv\">CSV</option></select>";
|
||||
echo "<input type=\"text\" value=\"{$config['FAIRYEAR']}\" size=\"5\" name=\"year\" />";
|
||||
echo "<input type=\"submit\" value=\"Generate Report\"></form>";
|
||||
echo "<br />";
|
||||
echo "<hr />";
|
||||
|
@ -30,9 +30,11 @@
|
||||
|
||||
$id = intval($_GET['id']);
|
||||
$format = stripslashes($_GET['type']);
|
||||
$year = intval($_GET['year']);
|
||||
if($year < 1000) $year = $config['FAIRYEAR'];
|
||||
|
||||
if($format == '') $format = NULL;
|
||||
|
||||
report_gen_by_id($id, $format);
|
||||
report_gen_by_id($id, $year, $format);
|
||||
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user