line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::OptimalQuery::XML; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
546
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
5
|
1
|
|
|
1
|
|
3
|
no warnings qw( uninitialized ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
6
|
1
|
|
|
1
|
|
3
|
use base 'CGI::OptimalQuery::Base'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
52
|
|
7
|
1
|
|
|
1
|
|
3
|
use CGI(); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
171
|
|
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}->(CGI::header(-type => 'text/xml', -attachment => "$title.xml"). |
18
|
|
|
|
|
|
|
"\n\n"); |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
my @userselcols = @{ $o->get_usersel_cols }; |
|
0
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
my $buf; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# print data |
25
|
0
|
|
|
|
|
|
while (my $rec = $o->fetch()) { |
26
|
0
|
|
|
|
|
|
$buf .= "\n"; |
27
|
0
|
|
|
|
|
|
foreach my $col (@userselcols) { |
28
|
0
|
|
|
|
|
|
$buf .= " <$col>".$o->escape_html($o->get_val($col))."$col>\n"; |
29
|
|
|
|
|
|
|
} |
30
|
0
|
|
|
|
|
|
$buf .= "\n"; |
31
|
|
|
|
|
|
|
} |
32
|
0
|
|
|
|
|
|
$buf .= ""; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
$$o{output_handler}->($buf); |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
$o->finish(); |
37
|
0
|
|
|
|
|
|
return undef; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |