move header() to include(/elements/header.html) so it can be changed in one place...
[freeside.git] / httemplate / misc / process / cust_main-import.cgi
1 <%
2
3   my $fh = $cgi->upload('csvfile');
4   #warn $cgi;
5   #warn $fh;
6
7   my $error = defined($fh)
8     ? FS::cust_main::batch_import( {
9         filehandle => $fh,
10         agentnum   => scalar($cgi->param('agentnum')),
11         refnum     => scalar($cgi->param('refnum')),
12         pkgpart    => scalar($cgi->param('pkgpart')),
13         'fields'    => [qw( cust_pkg.setup dayphone first last address1 address2
14                            city state zip comments                          )],
15       } )
16     : 'No file';
17
18   if ( $error ) {
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     <!-- mason kludge -->
28     <%= include("/elements/header.html",'Import sucessful') %> <%
29   }
30 %>