[if-mm !tables] [seti ui_error]Not authorized for table [cgi mv_data_table][/seti] [bounce page="__UI_BASE__/error"] [/if-mm] [if-mm !advanced report] [seti ui_error]Not authorized for reporting functions.[/seti] [bounce page="__UI_BASE__/error"] [/if-mm] [seti page_title][cgi report_title][/seti] [set icon_name]admin/icon_stats.gif[/set] [set ui_class]Design[/set] [set help_name]report[/set] @_UI_STD_HEAD_@ [seti name=tables][list-databases][/seti] [perl table="[scratch tables]"] $vals = {}; my (@wanted) = qw/ current_column num_columns search_name search_table search_type search_template unique_only allow_regex matchlimit /; my $saved = $Values->{saved_search} || {}; for (@wanted) { delete $Values->{$_}; $saved->{$_} = $CGI->{$_} if defined $CGI->{$_}; $Values->{$_} = $saved->{$_} if defined $saved->{$_}; } #Log("wizard_results saved search_table=$saved->{search_table} num_columns=$saved->{num_columns} current=$saved->{current_column}"); my $current_table = $saved->{search_table}; for(keys %saved) { push @del, $_ unless length($saved{$_}); } for(@del) { delete $saved{$_}; } unless ($current_table) { $Scratch->{search_string} = ""; $Scratch->{search_page} = "NO CURRENT TABLE"; return; } my @look = ( qw/ search_field search_spec search_op case_sensitive begin_string substring numeric / ); my @looktoo = ( qw/ sort_order sort_option return / ); my %xlt = ( qw/ search_spec se search_field sf search_op op case_sensitive cs begin_string bs substring su return rf sort_order tf sort_option to / ); my %found; for( keys %{$saved}) { next unless /^([A-Za-z_]+)(\d+)$/; my $item = $1; my $idx = $2; $found{$item} = 1 if length $saved->{"$item$idx"}; $vals->{$item} = [] unless defined $vals->{$item}; $vals->{$item}[$idx] = $saved->{"$item$idx"}; } for( keys %{$CGI}) { next unless /^([A-Za-z_]+)(\d+)$/; my $item = $1; my $idx = $2; next unless defined $xlt{$item}; $found{$item} = 1 if length $CGI->{"$item$idx"}; $vals->{$item} = [] unless defined $vals->{$item}; $vals->{$item}[$idx] = $CGI->{"$item$idx"}; } return "No tables/columns selected" unless defined $saved->{search_table}; foreach my $one (0 .. ($saved->{num_columns} - 1) ) { if($saved->{"search_field$one"} and $saved->{"search_spec$one"}) { for (@look) { push @string, qq!$xlt{$_}=$saved->{"$_$one"}! if $found{$_}; next unless $_ eq 'search_op'; push @string, ( $saved->{"search_op$one"} =~ /[=<>]/ ? 'nu=1' : 'nu=0'); } push @string, ""; } } if(! scalar @string) { push @string, "ra=yes"; } else { if($saved->{search_field0} eq '*') { for(@string) { s/^sf=\*// and last; } } else { unshift @string, '', "co=1", ''; } } foreach my $one (0 .. 2) { for (qw/ return /) { next unless $saved->{"$_$one"}; push @string, qq!$xlt{$_}=$saved->{"$_$one"}!; } } unshift @string, "ac=0" if $saved->{allow_regex}; unshift @string, "sp=$saved->{search_template}" if $saved->{search_template}; unshift @string, "st=$saved->{search_type}" if $saved->{search_type}; unshift @string, '', "fi=$current_table"; if ($saved->{matchlimit}) { push @string, "ml=$saved->{matchlimit}"; } if($vals->{sort_order}) { for(my $i = 0; $i < scalar @{$vals->{sort_order}}; $i++) { my $f = $vals->{sort_order}[$i]; last unless $f; push @string, "tf=$f"; push @string, "to=" . $vals->{sort_option}[$i]; } } my $sstring = join "\n\t\t", @string; for( '|', '"', "'") { next if index($sstring, $_) != -1; $qchar = $_; last; } $page = '[' . "area\thref=scan\n"; $page .= "\tsearch=$qchar\n\t\t"; $page .= join "\n\t\t", @string; $page .= "\n\t$qchar\n]"; $Scratch->{search_page} = $page; $Scratch->{rows} = scalar(@string) + 5; return; [/perl] [if cgi ui_target] [tag op=header interpolate=1] Window-Target: [cgi ui_target] Location: [return-to url] [/tag] [elsif !cgi generate_page] [tag op=header] Window-Target: test [/tag] [bounce href='[scratch name=search_page interpolate=1]'] [/elsif] [/if] Test
Test [if !cgi ui_target] [set search_page][/set] [/if] [set search_string][/set] @_UI_STD_FOOTER_@