Will things ever be the same again?
[freeside.git] / httemplate / misc / upload-batch.cgi
1 %
2 %
3 %  my $fh = $cgi->upload('batch_results');
4 %  my $filename = $cgi->param('batch_results');
5 %  $filename =~ /^(.*[\/\\])?([^\/\\]+)$/
6 %    or die "unparsable filename: $filename\n";
7 %  my $paybatch = $2;
8 %
9 %  my $error = defined($fh)
10 %    ? FS::cust_pay_batch::import_results( {
11 %        'filehandle' => $fh,
12 %        'format'     => $cgi->param('format'),
13 %        'paybatch'   => $paybatch,
14 %      } )
15 %    : 'No file';
16 %
17 %  if ( $error ) {
18 %    
19
20     <!-- mason kludge -->
21 %
22 %    eidiot($error);
23 %#    $cgi->param('error', $error);
24 %#    print $cgi->redirect( "${p}cust_main-import.cgi
25 %  } else {
26 %    
27
28     <!-- mason kludge -->
29     <% include("/elements/header.html",'Batch results upload successful') %> 
30 %
31 %  }
32 %
33
34