01bf5d25f42e93cd253f27eb3f533c4a32739025
[freeside.git] / httemplate / misc / download-batch.cgi
1 <% $pay_batch->export_batch($format) %>
2
3 <%init>
4
5 #http_header('Content-Type' => 'text/comma-separated-values' ); #IE chokes
6 http_header('Content-Type' => 'text/plain' ); # not necessarily correct...
7
8 my $batchnum;
9 if ( $cgi->param('batchnum') =~ /^(\d+)$/ ) {
10   $batchnum = $1;
11 } else {
12   die "No batch number (bad URL) \n";
13 }
14
15 my $format;
16 if ( $cgi->param('format') =~ /^([\w\- ]+)$/ ) {
17   $format = $1;
18 }
19
20 my $pay_batch = qsearchs('pay_batch', { batchnum => $batchnum } );
21 die "Batch not found: '$batchnum'" if !$pay_batch;
22
23 </%init>