add some reporting features
[freeside.git] / httemplate / search / report_credit.cgi
1 <%
2 #!/usr/bin/perl -Tw
3 #
4 # $Id: report_credit.cgi,v 1.1 2002-02-22 23:18:33 jeff Exp $
5 #
6 # Usage: post form to:
7 #        http://server.name/path/svc_domain.cgi
8 #
9 # ivan@voicenet.com 96-mar-5
10 #
11 # need to look at table in results to make it more readable
12 #
13 # ivan@voicenet.com
14 #
15 # rewrite ivan@sisd.com 98-mar-15
16 #
17 # Changes to allow page to work at a relative position in server
18 #       bmccane@maxbaud.net     98-apr-3
19 #
20 # $Log: report_credit.cgi,v $
21 # Revision 1.1  2002-02-22 23:18:33  jeff
22 # add some reporting features
23 #
24 # Revision 1.2  2002/02/19 14:24:53  jeff
25 # might be functional now
26 #
27 # Revision 1.1  2002/02/05 15:22:00  jeff
28 # preserving state prior to 1.4.0pre7 upgrade
29 #
30 # Revision 1.2  2000/09/20 19:25:19  jeff
31 # local modifications
32 #
33 # Revision 1.1.1.1  2000/09/18 06:26:58  jeff
34 # Import of Freeside 1.2.3
35 #
36 # Revision 1.10  1999/07/20 06:03:36  ivan
37 # s/CGI::Request/CGI/; (how'd i miss that before?)
38 #
39 # Revision 1.9  1999/04/09 04:22:34  ivan
40 # also table()
41 #
42 # Revision 1.8  1999/04/09 03:52:55  ivan
43 # explicit & for table/itable/ntable
44 #
45 # Revision 1.7  1999/02/28 00:03:56  ivan
46 # removed misleading comments
47 #
48 # Revision 1.6  1999/02/09 09:22:58  ivan
49 # visual and bugfixes
50 #
51 # Revision 1.5  1999/01/19 05:14:16  ivan
52 # for mod_perl: no more top-level my() variables; use vars instead
53 # also the last s/create/new/;
54 #
55 # Revision 1.4  1999/01/18 09:41:40  ivan
56 # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
57 # (good idea anyway)
58 #
59 # Revision 1.3  1998/12/17 09:41:11  ivan
60 # s/CGI::(Base|Request)/CGI.pm/;
61 #
62
63 use strict;
64 use vars qw( $conf $cgi $beginning $ending );
65 use CGI;
66 use CGI::Carp qw(fatalsToBrowser);
67 use FS::UID qw(cgisuidsetup);
68 use FS::CGI qw(popurl idiot header table);
69 use FS::Record qw(qsearch qsearchs);
70 use FS::Conf;
71
72 $cgi = new CGI;
73 &cgisuidsetup($cgi);
74
75 $conf = new FS::Conf;
76
77 $cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/;
78 $beginning = $1;
79
80 $cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/;
81 $ending = $1;
82
83   print $cgi->header( '-expires' => '-2m' ),
84         header('In House Credit Report Results');
85
86   open (REPORT, "/usr/bin/freeside-credit-report -v -s $beginning -d $ending freeside |");
87
88   print '<PRE>';
89   while(<REPORT>) {
90     print $_;
91   }
92   print '</PRE>';
93
94   print '</BODY></HTML>';
95
96 %>
97