summaryrefslogtreecommitdiff
path: root/fs_selfservice/FS-SelfService/cgi/cust_bill-logo.cgi
blob: 253f853f87b45a78ce5d0902d372b2af937ae39d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl -T
#!/usr/bin/perl -Tw

use strict;
use CGI;
use FS::SelfService qw( invoice_logo );

my $cgi = new CGI;

my %hash = ();
if ( $cgi->param('invnum') ) {
  $hash{$_} = scalar($cgi->param($_)) foreach qw( invnum template );
} else {
  my($query) = $cgi->keywords;
  $query =~ /^([^\.\/]*)$/ or '' =~ /^()$/;
  $hash{'template'} = $1;
}

my $hashref = invoice_logo(%hash);

print $cgi->header( '-type'    => $hashref->{'content_type'},
                    '-expires' => 'now',
                  ).
      $hashref->{'logo'};