line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::OptimalQuery::XML; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
726
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
5
|
1
|
|
|
1
|
|
6
|
no warnings qw( uninitialized ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
6
|
1
|
|
|
1
|
|
4
|
use base 'CGI::OptimalQuery::Base'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
73
|
|
7
|
1
|
|
|
1
|
|
5
|
use CGI(); |
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
190
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub output { |
10
|
0
|
|
|
0
|
0
|
|
my $o = shift; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
my $title = $o->{schema}->{title}; |
13
|
0
|
|
|
|
|
|
$title =~ s/\W//g; |
14
|
0
|
|
|
|
|
|
my @t = localtime; |
15
|
0
|
|
|
|
|
|
$title .= '_'.($t[5] + 1900).($t[4] + 1).$t[3].$t[2].$t[1]; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
$$o{output_handler}->($$o{httpHeader}->(-type => 'text/xml', -attachment => "$title.xml"). |
18
|
|
|
|
|
|
|
"\n\n"); |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
my @userselcols = @{ $o->get_usersel_cols }; |
|
0
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# print data |
23
|
0
|
|
|
|
|
|
while (my $rec = $o->fetch()) { |
24
|
0
|
|
|
|
|
|
my $buf = "\n"; |
25
|
0
|
|
|
|
|
|
foreach my $col (@userselcols) { |
26
|
0
|
|
|
|
|
|
$buf .= " <$col>".$o->escape_html($o->get_val($col))."$col>\n"; |
27
|
|
|
|
|
|
|
} |
28
|
0
|
|
|
|
|
|
$buf .= "\n"; |
29
|
0
|
|
|
|
|
|
$$o{output_handler}->($buf); |
30
|
|
|
|
|
|
|
} |
31
|
0
|
|
|
|
|
|
$$o{output_handler}->(""); |
32
|
0
|
|
|
|
|
|
$o->finish(); |
33
|
0
|
|
|
|
|
|
return undef; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |