added show/ik3qar command
[spider.git] / cmd / show / dxqsl.pl
1 #
2 # Display QSL information from the local database
3 #
4 # Copyright (c) 2003 Dirk Koopman G1TLH
5 #
6 #
7 #
8
9 my ($self, $line) = @_;
10 my @call = split /\s+/, uc $line;
11 my @out;
12
13 #$DB::single=1;
14
15 return (1, $self->msg('db3', 'QSL')) unless $QSL::dbm;
16
17 push @out, $self->msg('qsl1');
18 foreach my $call (@call) {
19         my $q = QSL::get($call);
20         if ($q) {
21                 my $c = $call;
22                 for (sort {$b->[2] <=> $a->[2]} @{$q->[1]}) {
23                         push @out, sprintf "%-14s %-10s %4d  %s   %s", $c, $_->[0], $_->[1], cldatetime($_->[2]), $_->[3];
24                         $c = "";
25                 }
26         } else {
27                 push @out, $self->msg('db2', $call, 'QSL');
28         }
29 }
30
31 return (1, @out);