- $style = $class_counter==0 ? '' : $style = "style='display:none'";
- $acc = access_string($key);
- $st_classes .= "<a href='javascript:showClass($class_counter)'$acc[1]>$acc[0]</a> <br>";
- $st_reports .= "<table id='TAB_" . $class_counter++ ."' $style cellpadding=0 cellspacing=0 border=0 width='100%'><tr><td><b>" . _("Reports For Class: ") . " $key</b></td></tr>";
- foreach($value as $report)
- { $acc = access_string($report->name);
- $st_reports .= "<tr><td><a href='javascript:showReport($rep_counter)'$acc[1]>$acc[0]</a></td></tr>";
-
- $action = $path_to_root.'/reporting/prn_redirect.php';
-
- $st_params .= "<div id='REP_" . $rep_counter++ . "' style='display:none'>";
- $st_params .= "<table border=0><tr><td>\n"
- . "<form method='POST' action='$action'>\n"
- . $report->getDisplay()
- . "\n</form>\n"
- . "</td></tr></table></div>";
-
+ $style = $class_id==$_REQUEST['Class'] ? '' : "style='display:none'";
+// $cname = access_string($key, true);
+// $style = $_REQUEST['Class']==$cname ? '' : "style='display:none'";
+ $acc = access_string($name);
+ $st_classes .= "<a href='"
+ .$_SERVER['PHP_SELF']."?Class=$class_id'"
+ ." class='menu_option' id='".default_focus()."'"
+ ." onclick='return showClass(\"$class_id\");'$acc[1]>$acc[0]</a> <br>";
+ $st_reports .= "<table class='repclass' id='TAB_" . $class_id ."' $style cellpadding=0 cellspacing=0 border=0 width='100%'><tr><td><b>" . _("Reports For Class: ") . " $name</b></td></tr>\n";
+ foreach($this->ar_reports[$class_id] as $rep_id => $report)
+ {
+ $acc = access_string($report->name);
+ $st_reports .= "<tr><td><a class='printlink' href='"
+ .$_SERVER['PHP_SELF']."?Class=$class_id&rep_id=$report->id'"
+ ." id='".default_focus()."'"
+ ."$acc[1]>$acc[0]</a><tr><td>\n";
+ if (isset($_REQUEST['rep_id']) && $_REQUEST['rep_id']==$report->id) {
+
+ $action = $path_to_root.'/reporting/prn_redirect.php';
+
+ $st_params = "<table><tr><td>\n"
+ . "<form method='POST' action='$action' target='_blank'>\n";
+ $st_params .= submit('Rep'.$report->id,
+ _("Display: ") . access_string($report->name, true),
+ false, '', $pdf_debug ? false : 'default') . hidden('REP_ID', $report->id, false).'<br><br>';
+ $st_params .= $this->getOptions($report->get_controls());
+ $st_params .= "\n</form></td></tr></table>\n";
+ set_focus('Rep'.$report->id);
+ $Ajax->addUpdate(true, 'rep_form', $st_params);
+ }