summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GPL339
-rw-r--r--INSTALL1
-rwxr-xr-xetc/acp_logfile-parse197
-rwxr-xr-xetc/example-direct-cardin67
-rwxr-xr-xhtdocs/edit/cust_credit.cgi97
-rwxr-xr-xhtdocs/edit/cust_pay.cgi76
-rwxr-xr-xhtdocs/images/sisd.jpgbin0 -> 22122 bytes
-rwxr-xr-xhtdocs/search/cust_bill.html21
-rwxr-xr-xhtdocs/search/cust_main-payinfo.html21
-rwxr-xr-xhtdocs/search/cust_main.html36
-rwxr-xr-xhtdocs/search/svc_acct.html21
-rwxr-xr-xhtdocs/search/svc_acct_sm.html23
-rwxr-xr-xhtdocs/search/svc_domain.html22
-rw-r--r--site_perl/table_template-svc.pm107
-rw-r--r--site_perl/table_template-unique.pm66
-rw-r--r--site_perl/table_template.pm66
16 files changed, 1160 insertions, 0 deletions
diff --git a/GPL b/GPL
new file mode 100644
index 000000000..e77696ae8
--- /dev/null
+++ b/GPL
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 000000000..ff2e43f4e
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1 @@
+See htdocs/docs/index.html
diff --git a/etc/acp_logfile-parse b/etc/acp_logfile-parse
new file mode 100755
index 000000000..5e258991b
--- /dev/null
+++ b/etc/acp_logfile-parse
@@ -0,0 +1,197 @@
+#!/usr/bin/perl
+
+###
+# WHO WROTE THIS???
+###
+
+#require "perldb.pl";
+
+# Compute SLIP/PPP log times
+# Arguments -a Process entire file with totals
+# -t Process only totals
+# -f File to be processed if not current
+# -d processing start date (default is entire file)
+# -l to return all totals for dayuse
+# -w name of tmp work file for dayuse
+# user names
+
+require "time.pl";
+
+$space=' ';
+
+unless (@ARGV[0]) {
+ print "Missing Arguments\n";
+ print "-a - entire file\n";
+ print "-t - totals only\n";
+ print "-f - file name to be processed\n";
+ print "-d - processing start date (yymmdd)\n";
+ print "-l - return totals for dayuse\n";
+ print "-w - tmp work file for dayuse\n";
+ exit;
+} # end if test for missing arguments
+
+$infile = "/usr/annex/acp_logfile";
+$tmpfile = "/tmp/ppp";
+$n = $#ARGV;
+$start_yymmdd = "";
+for ($i = 0; $i <= $n; $i++) {
+ if ($ARGV[$i] eq "-a") {
+ $allflag = "true";
+ }
+ elsif ($ARGV[$i] eq "-t") {
+ $totalflag = "true";
+ }
+ elsif ($ARGV[$i] eq "-f") {
+ $i++;
+ $infile = $ARGV[$i];
+ }
+ elsif ($ARGV[$i] eq "-d") {
+ $i++;
+ $start_yymmdd = $ARGV[$i];
+ } #end start yymmdd
+ elsif ($ARGV[$i] eq "-l") {
+ $logflag = "true";
+ $totalflag = "true";
+ } # end log
+ elsif ($ARGV[$i] eq "-w") {
+ $i++;
+ $tmpfile = $ARGV[$i];
+ } # end tmp file
+ else {
+ ($arg_user,$arg_yymmdd) = split (/:/, $ARGV[$i]);
+ $ip_user_date {$arg_user} = $ARGV[$i];
+ $userflag = "true";
+ } # end else
+ } # end for 1 = 1 to n
+
+open (IN,$infile)
+ || die "Can't open acp_logfile";
+
+NEXTUSER: while (<IN>) {
+ chop;
+ ($add,$ether,$port,$date,$time,$type,$action,$user) = split(/:/);
+
+ if ($logflag) {
+ $start_yymmdd = '';
+ if ($ip_user_date{$user}) {
+ ($ip_user, $start_yymmdd) =
+ split (/:/, $ip_user_date{$user});
+ } # end get date
+ } # end log flag
+ if ($start_yymmdd) {
+ if ($date < $start_yymmdd) {
+ next NEXTUSER;
+ } #end date compare
+ } #end if date
+ if ($userflag){
+ if (!$ip_user_date{$user}) {
+ next NEXTUSER;
+ } # end user test
+ } # end by user or all
+ if (($totalflag) ||
+ ($allflag) ||
+ ($ip_user_date{$user})) {
+ if (($type eq 'ppp') || ($type eq 'slip')) {
+
+ if ($action eq 'login') {
+ $login{$user} = "$time:$date";
+
+ }
+ elsif ($action eq 'logout') {
+ if (!$login{$user}) {
+ $login{$user} = "010101:$date";
+ } #end pad user if carry over
+ ($stime,$sdate) = split(':',$login{$user});
+ $start = &annex2sec($stime);
+ $end = &annex2sec($time);
+
+ #If we went through midnight, add a day;
+ if ($end < $start) {$end += 86400;}
+ $timeon = $end - $start;
+
+ $elapsed{$user} += $timeon;
+
+ if (!$totalflag) {
+ print (&fmt_user($user),
+ ' ', &fmt_date($sdate), ' In: ',
+ &fmt_time($stime),' Out: ',
+ &fmt_time($time),
+ ' Elapsed: ', &fmt_sec($timeon), "\n");
+ } # end total test
+ } #end elsif action
+ } # type = ppp of slip
+ } # check arguments
+}
+close IN;
+
+if ($logflag) {
+ open (TMPPPP, ">$tmpfile")
+ || die "Can't open ppp tmp file";
+ foreach $user ( sort((keys(%elapsed))) ) {
+ $log_time = &fmt_sec($elapsed{$user});
+ $tmp = join (':',
+ $user,
+ $log_time);
+ print (TMPPPP "$tmp\n");
+ }
+ close (TMPPPP);
+}
+ else {
+ print "\n\nTotal Time On For Period:\n";
+ print "-------------------------\n";
+
+ foreach $user ( sort((keys(%elapsed))) ) {
+ print (&fmt_user($user), " ",&fmt_sec($elapsed{$user}), "\n");
+ }
+ }
+exit(0);
+
+#-------------------------------------------------------
+#--------------- Subroutines Start Here ----------------
+#-------------------------------------------------------
+
+sub annex2sec {
+ local($time) = @_;
+ return( &time2sec( &break_annex($time) ) );
+}
+
+sub fmt_date {
+ local($date) = @_;
+
+ return( substr($date,2,2).'/'.substr($date,4,2).'/'.substr($date,0,2) );
+}
+
+sub fmt_time {
+ local($time) = @_;
+ local($s,$m,$h) = &break_annex($time);
+ return ("$h:$m:$s");
+}
+
+
+sub break_annex {
+ local($time) = @_;
+ local($h,$m,$s);
+
+ $h=substr($time,0,2);
+ $m=substr($time,2,2);
+ $s=substr($time,4,2);
+
+ return ($s,$m,$h);
+}
+
+sub fmt_sec {
+ local(@t) = &sec2time(@_);
+ @t[2] += (@t[3]*24);
+
+ foreach $a (@t) {
+ if ($a < 10) {$a = "0$a";}
+ }
+
+ return ("@t[2]:@t[1]:@t[0]");
+}
+
+sub fmt_user {
+ local($user) = @_;
+ return( $user.substr($space,0,8 - length($user) ).' ' );
+}
+
diff --git a/etc/example-direct-cardin b/etc/example-direct-cardin
new file mode 100755
index 000000000..1a4097221
--- /dev/null
+++ b/etc/example-direct-cardin
@@ -0,0 +1,67 @@
+#!/usr/local/bin/perl
+
+###
+# THIS IS FROM CYBERCASH (is there a newer version?)
+###
+
+$paymentserverhost = 'localhost';
+$paymentserverport = 8000;
+$paymentserversecret = 'two-turntables';
+use CCLib qw(sendmserver);
+
+# first lets fake up some data
+# use time of day and pid to give me my pretend
+# order number
+# you obviously need to get real data from somewhere...
+
+$oid = "test$$"; #fake order number.
+$amount = 'usd 42.42';
+$ramount = 'usd 24.24';
+$pan = '4111111111111111';
+$name = 'John Q. Doe';
+$addr = '17 Richard Rd.';
+$city = 'Ivyland';
+$state = 'PA';
+$zip = '18974';
+$country = 'USA';
+$exp = '7/97';
+
+
+%result = &sendmserver('mauthcapture',
+ 'Order-ID', $oid,
+ 'Amount', $amount,
+ 'Card-Number', $pan,
+ 'Card-Name', $name,
+ 'Card-Address', $addr,
+ 'Card-City', $city,
+ 'Card-State', $state,
+ 'Card-Zip', $zip,
+ 'Card-Country', $country,
+ 'Card-Exp', $exp);
+
+#
+# just dump results to stdout.
+# you should process them...
+# to allow results to affect operation of your fulfillment...
+#
+foreach (keys(%result)) {
+ print " $_ ==> $result{$_}\n";
+}
+
+print "\n";
+
+exit;
+
+$trans=$result{'MTransactionNumber'};
+$code=$result{'MRetrievalCode'};
+
+%result = &sendmserver('return',
+ 'Order-ID', $oid,
+ 'Return-Amount',$ramount,
+ 'Amount',$amount,
+ );
+
+foreach (keys(%result)) {
+ print " $_ ==> $result{$_}\n";
+}
+
diff --git a/htdocs/edit/cust_credit.cgi b/htdocs/edit/cust_credit.cgi
new file mode 100755
index 000000000..75ef21208
--- /dev/null
+++ b/htdocs/edit/cust_credit.cgi
@@ -0,0 +1,97 @@
+#!/usr/bin/perl -Tw
+#
+# cust_credit.cgi: Add a credit (output form)
+#
+# Usage: cust_credit.cgi custnum [ -paybatch ]
+# http://server.name/path/cust_credit?custnum [ -paybatch ]
+#
+# Note: Should be run setuid root as user nobody.
+#
+# some hooks in here for modifications as well as additions, but needs (lots) more work.
+# also see process/cust_credit.cgi, the script that processes the form.
+#
+# ivan@voicenet.com 96-dec-05
+#
+# paybatch field, differentiates between credits & credits+refunds by commandline
+# ivan@voicenet.com 96-dec-08
+#
+# added (but commented out) sprintf("%.2f" in amount field. Hmm.
+# ivan@voicenet.com 97-jan-3
+#
+# paybatch stuff thrown out - has checkbox now instead.
+# (well, sort of. still passed around for backward compatability and possible editing hook)
+# ivan@voicenet.com 97-apr-21
+#
+# rewrite ivan@sisd.com 98-mar-16
+
+use strict;
+use Date::Format;
+use CGI::Base qw(:DEFAULT :CGI); #CGI module
+use FS::UID qw(cgisuidsetup getotaker);
+
+my($cgi) = new CGI::Base;
+$cgi->get;
+cgisuidsetup($cgi);
+
+#untaint custnum
+$QUERY_STRING =~ /^(\d+)$/;
+my($custnum)=$1;
+
+#untaint otaker
+my($otaker)=getotaker;
+
+SendHeaders(); # one guess.
+print <<END;
+<HTML>
+ <HEAD>
+ <TITLE>Post Credit</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>Post Credit</H1>
+ </CENTER>
+ <FORM ACTION="process/cust_credit.cgi" METHOD=POST>
+ <HR><PRE>
+END
+
+#crednum
+my($crednum)="";
+print qq!Credit #<B>!, $crednum ? $crednum : " <I>(NEW)</I>", qq!</B><INPUT TYPE="hidden" NAME="crednum" VALUE="$crednum">!;
+
+#custnum
+print qq!\nCustomer #<B>$custnum</B><INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!;
+
+#paybatch
+print qq!<INPUT TYPE="hidden" NAME="paybatch" VALUE="">!;
+
+#date
+my($date)=time;
+print qq!\nDate: <B>!, time2str("%D",$date), qq!</B><INPUT TYPE="hidden" NAME="_date" VALUE="$date">!;
+
+#amount
+my($amount)='';
+print qq!\nAmount \$<INPUT TYPE="text" NAME="amount" VALUE="$amount" SIZE=8 MAXLENGTH=8>!;
+
+#refund?
+#print qq! <INPUT TYPE="checkbox" NAME="refund" VALUE="yes">Also post refund!;
+
+#otaker (hidden)
+print qq!<INPUT TYPE="hidden" NAME="otaker" VALUE="$otaker">!;
+
+#reason
+my($reason)='';
+print qq!\nReason <INPUT TYPE="text" NAME="reason" VALUE="$reason" SIZE=72>!;
+
+print <<END;
+</PRE>
+<BR>
+<CENTER><INPUT TYPE="submit" VALUE="Post"></CENTER>
+END
+
+print <<END;
+
+ </FORM>
+ </BODY>
+</HTML>
+END
+
diff --git a/htdocs/edit/cust_pay.cgi b/htdocs/edit/cust_pay.cgi
new file mode 100755
index 000000000..a6cb204d1
--- /dev/null
+++ b/htdocs/edit/cust_pay.cgi
@@ -0,0 +1,76 @@
+#!/usr/bin/perl -Tw
+#
+# cust_pay.cgi: Add a payment (output form)
+#
+# Usage: cust_pay.cgi invnum
+# http://server.name/path/cust_pay.cgi?invnum
+#
+# Note: Should be run setuid as user nobody.
+#
+# some hooks for modifications as well as additions, but needs work.
+#
+# ivan@voicenet.com 96-dec-11
+#
+# rewrite ivan@sisd.com 98-mar-16
+
+use strict;
+use Date::Format;
+use CGI::Base qw(:DEFAULT :CGI);
+use FS::UID qw(cgisuidsetup);
+
+my($cgi) = new CGI::Base;
+$cgi->get;
+cgisuidsetup($cgi);
+
+#untaint invnum
+$QUERY_STRING =~ /^(\d+)$/;
+my($invnum)=$1;
+
+SendHeaders(); # one guess.
+print <<END;
+<HTML>
+ <HEAD>
+ <TITLE>Enter payment</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>Enter payment</H1>
+ </CENTER>
+ <FORM ACTION="process/cust_pay.cgi" METHOD=POST>
+ <HR><PRE>
+END
+
+#invnum
+print qq!Invoice #<B>$invnum</B><INPUT TYPE="hidden" NAME="invnum" VALUE="$invnum">!;
+
+#date
+my($date)=time;
+print qq!<BR>Date: <B>!, time2str("%D",$date), qq!</B><INPUT TYPE="hidden" NAME="_date" VALUE="$date">!;
+
+#paid
+print qq!<BR>Amount \$<INPUT TYPE="text" NAME="paid" VALUE="" SIZE=8 MAXLENGTH=8>!;
+
+#payby
+my($payby)="BILL";
+print qq!<BR>Payby: <B>$payby</B><INPUT TYPE="hidden" NAME="payby" VALUE="$payby">!;
+
+#payinfo (check # now as payby="BILL" hardcoded.. what to do later?)
+my($payinfo)="";
+print qq!<BR>Check #<INPUT TYPE="text" NAME="payinfo" VALUE="$payinfo">!;
+
+#paybatch
+print qq!<INPUT TYPE="hidden" NAME="paybatch" VALUE="">!;
+
+print <<END;
+</PRE>
+<BR>
+<CENTER><INPUT TYPE="submit" VALUE="Post"></CENTER>
+END
+
+print <<END;
+
+ </FORM>
+ </BODY>
+</HTML>
+END
+
diff --git a/htdocs/images/sisd.jpg b/htdocs/images/sisd.jpg
new file mode 100755
index 000000000..908a5eaff
--- /dev/null
+++ b/htdocs/images/sisd.jpg
Binary files differ
diff --git a/htdocs/search/cust_bill.html b/htdocs/search/cust_bill.html
new file mode 100755
index 000000000..4adb40e4a
--- /dev/null
+++ b/htdocs/search/cust_bill.html
@@ -0,0 +1,21 @@
+<HTML>
+ <HEAD>
+ <TITLE>Invoice Search</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>Invoice Search</H1>
+ </CENTER>
+ <HR>
+ <FORM ACTION="cust_bill.cgi" METHOD="post">
+ Search for <B>invoice #</B>:
+ <INPUT TYPE="text" NAME="invnum">
+
+ <P><INPUT TYPE="submit" VALUE="Search">
+
+ </FORM>
+
+ <HR>
+ </BODY>
+</HTML>
+
diff --git a/htdocs/search/cust_main-payinfo.html b/htdocs/search/cust_main-payinfo.html
new file mode 100755
index 000000000..92341ad13
--- /dev/null
+++ b/htdocs/search/cust_main-payinfo.html
@@ -0,0 +1,21 @@
+<HTML>
+ <HEAD>
+ <TITLE>Customer Search</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>Customer Search</H1>
+ </CENTER>
+ <HR>
+ <FORM ACTION="cust_main.cgi" METHOD="post">
+ Search for <B>Credit card #</B>:
+ <INPUT TYPE="hidden" NAME="card_on" VALUE="TRUE">
+ <INPUT TYPE="text" NAME="card">
+
+ <P><INPUT TYPE="submit" VALUE="Search">
+
+ </FORM>
+ <HR>
+ </BODY>
+</HTML>
+
diff --git a/htdocs/search/cust_main.html b/htdocs/search/cust_main.html
new file mode 100755
index 000000000..656943f9c
--- /dev/null
+++ b/htdocs/search/cust_main.html
@@ -0,0 +1,36 @@
+<HTML>
+ <HEAD>
+ <TITLE>Customer Search</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>Customer Search</H1>
+ </CENTER>
+ <HR>
+ <FORM ACTION="cust_main.cgi" METHOD="post">
+ <INPUT TYPE="checkbox" NAME="last_on"> Search for <B>last name</B>:
+ <INPUT TYPE="text" NAME="last_text">
+ using search method(s): <SELECT NAME="last_type" MULTIPLE>
+ <OPTION SELECTED>Fuzzy
+ <OPTION>Exact
+ </SELECT>
+
+ <P><INPUT TYPE="checkbox" NAME="company_on"> Search for <B>company</B>:
+ <INPUT TYPE="text" NAME="company_text">
+ using search methods(s): <SELECT NAME="company_type" MULTIPLE>
+ <OPTION SELECTED>Fuzzy
+ <OPTION>Exact
+ </SELECT>
+
+ <P><INPUT TYPE="submit" VALUE="Search"> Note: Fuzzy searching can take a while. Please be patient.
+
+ </FORM>
+
+ <HR>Explanation of search methods:
+ <UL>
+ <LI><B>Fuzzy</B> - Searches for matches that are close to your text.
+ <LI><B>Exact</B> - Finds exact matches only, but much faster than the other search methods.
+ </UL>
+ </BODY>
+</HTML>
+
diff --git a/htdocs/search/svc_acct.html b/htdocs/search/svc_acct.html
new file mode 100755
index 000000000..91291be99
--- /dev/null
+++ b/htdocs/search/svc_acct.html
@@ -0,0 +1,21 @@
+<HTML>
+ <HEAD>
+ <TITLE>Account Search</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>Account Search</H1>
+ </CENTER>
+ <HR>
+ <FORM ACTION="svc_acct.cgi" METHOD="post">
+ Search for <B>username</B>:
+ <INPUT TYPE="text" NAME="username">
+
+ <P><INPUT TYPE="submit" VALUE="Search">
+
+ </FORM>
+
+ <HR>
+ </BODY>
+</HTML>
+
diff --git a/htdocs/search/svc_acct_sm.html b/htdocs/search/svc_acct_sm.html
new file mode 100755
index 000000000..0719856db
--- /dev/null
+++ b/htdocs/search/svc_acct_sm.html
@@ -0,0 +1,23 @@
+<HTML>
+ <HEAD>
+ <TITLE>Mail Alias Search</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>Mail Alias Search</H1>
+ </CENTER>
+ <HR>
+ <FORM ACTION="svc_acct_sm.cgi" METHOD="post">
+ Search for <B>mail alias</B>:
+ <INPUT TYPE="text" NAME="domuser"><FONT SIZE=-1>(opt.)</FONT> @
+ <INPUT TYPE="text" NAME="domain"><FONT SIZE=-1>(req.)</FONT>
+
+ <P><INPUT TYPE="submit" VALUE="Search">
+
+ </FORM>
+
+ <HR>
+
+ </BODY>
+</HTML>
+
diff --git a/htdocs/search/svc_domain.html b/htdocs/search/svc_domain.html
new file mode 100755
index 000000000..533743ba2
--- /dev/null
+++ b/htdocs/search/svc_domain.html
@@ -0,0 +1,22 @@
+<HTML>
+ <HEAD>
+ <TITLE>Domain Search</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>Domain Search</H1>
+ </CENTER>
+ <HR>
+ <FORM ACTION="svc_domain.cgi" METHOD="post">
+ Search for <B>domain</B>:
+ <INPUT TYPE="text" NAME="domain">
+
+ <P><INPUT TYPE="submit" VALUE="Search">
+
+ </FORM>
+
+ <HR>
+
+ </BODY>
+</HTML>
+
diff --git a/site_perl/table_template-svc.pm b/site_perl/table_template-svc.pm
new file mode 100644
index 000000000..a8cbaed5e
--- /dev/null
+++ b/site_perl/table_template-svc.pm
@@ -0,0 +1,107 @@
+#!/usr/local/bin/perl -Tw
+#
+# ivan@voicenet.com 97-jul-21
+
+package FS::svc_table;
+
+use strict;
+use Exporter;
+use FS::Record qw(fields qsearchs);
+
+@FS::svc_table::ISA = qw(FS::Record Exporter);
+
+# Usage: $record = create FS::svc_table ( \%hash );
+# $record = create FS::svc_table ( { field=>value, ... } );
+sub create {
+ my($proto,$hashref)=@_;
+
+ my($field);
+ foreach $field (fields('svc_table')) {
+ $hashref->{$field}='' unless defined $hashref->{$field};
+ }
+
+ $proto->new('svc_table',$hashref);
+
+}
+
+# Usage: $error = $record -> insert;
+sub insert {
+ my($self)=@_;
+ my($error);
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+
+ $error=$self->check;
+ return $error if $error;
+
+ $error = $self->add;
+ return $error if $error;
+
+ ''; #no error
+}
+
+# Usage: $error = $record -> delete;
+sub delete {
+ my($self)=@_;
+ my($error);
+
+ $error = $self->del;
+ return $error if $error;
+
+}
+
+# Usage: $error = $newrecord -> replace($oldrecord)
+sub replace {
+ my($new,$old)=@_;
+ my($error);
+
+ return "(Old) Not a svc_table record!" unless $old->table eq "svc_table";
+ return "Can't change svcnum!"
+ unless $old->getfield('svcnum') eq $new->getfield('svcnum');
+
+ $error=$new->check;
+ return $error if $error;
+
+ $error = $new->rep($old);
+ return $error if $error;
+
+ ''; #no error
+}
+
+# Usage: $error = $record -> suspend;
+sub suspend {
+ ''; #no error (stub)
+}
+
+# Usage: $error = $record -> unsuspend;
+sub unsuspend {
+ ''; #no error (stub)
+}
+
+# Usage: $error = $record -> cancel;
+sub cancel {
+ ''; #no error (stub)
+}
+
+# Usage: $error = $record -> check;
+sub check {
+ my($self)=@_;
+ return "Not a svc_table record!" unless $self->table eq "svc_table";
+ my($recref) = $self->hashref;
+
+ $recref->{svcnum} =~ /^(\d+)$/ or return "Illegal svcnum";
+ $recref->{svcnum} = $1;
+ return "Unknown svcnum" unless
+ qsearchs('cust_svc',{'svcnum'=> $recref->{svcnum} } );
+
+ #DATA CHECKS GO HERE!
+
+ ''; #no error
+}
+
+1;
+
diff --git a/site_perl/table_template-unique.pm b/site_perl/table_template-unique.pm
new file mode 100644
index 000000000..32b7e6911
--- /dev/null
+++ b/site_perl/table_template-unique.pm
@@ -0,0 +1,66 @@
+#!/usr/local/bin/perl -Tw
+#
+# ivan@voicenet.com 97-jul-1
+#
+# added hfields
+# ivan@sisd.com 97-nov-13
+
+package FS::table_name;
+
+use strict;
+use Exporter;
+#use FS::UID qw(getotaker);
+use FS::Record qw(fields hfields qsearch qsearchs);
+
+@FS::table_name::ISA = qw(FS::Record Exporter);
+@FS::table_name::EXPORT_OK = qw(hfields);
+
+# Usage: $record = create FS::table_name ( \%hash );
+# $record = create FS::table_name ( { field=>value, ... } );
+sub create {
+ my($proto,$hashref)=@_;
+
+ my($field);
+ foreach $field (fields('table_name')) {
+ $hashref->{$field}='' unless defined $hashref->{$field};
+ }
+
+ $proto->new('table_name',$hashref);
+}
+
+# Usage: $error = $record -> insert;
+sub insert {
+ my($self)=@_;
+
+ $self->check or
+ $self->add;
+}
+
+# Usage: $error = $record -> delete;
+sub delete {
+ my($self)=@_;
+
+ $self->del;
+}
+
+# Usage: $error = $newrecord -> replace($oldrecord)
+sub replace {
+ my($new,$old)=@_;
+ return "(Old) Not a table_name record!" unless $old->table eq "table_name";
+ return "Can't change keyfield!"
+ unless $old->getfield('keyfield') eq $new->getfield('keyfield');
+ $new->check or
+ $new->rep($old);
+}
+
+# Usage: $error = $record -> check;
+sub check {
+ my($self)=@_;
+ return "Not a table_name record!" unless $self->table eq "table_name";
+ my($recref) = $self->hashref;
+
+ ''; #no error
+}
+
+1;
+
diff --git a/site_perl/table_template.pm b/site_perl/table_template.pm
new file mode 100644
index 000000000..cef2d92e8
--- /dev/null
+++ b/site_perl/table_template.pm
@@ -0,0 +1,66 @@
+#!/usr/local/bin/perl -Tw
+#
+# ivan@voicenet.com 97-jul-1
+#
+# added hfields
+# ivan@sisd.com 97-nov-13
+
+package FS::table_name;
+
+use strict;
+use Exporter;
+#use FS::UID qw(getotaker);
+use FS::Record qw(hfields qsearch qsearchs);
+
+@FS::table_name::ISA = qw(FS::Record Exporter);
+@FS::table_name::EXPORT_OK = qw(hfields);
+
+# Usage: $record = create FS::table_name ( \%hash );
+# $record = create FS::table_name ( { field=>value, ... } );
+sub create {
+ my($proto,$hashref)=@_;
+
+ my($field);
+ foreach $field (fields('table_name')) {
+ $hashref->{$field}='' unless defined $hashref->{$field};
+ }
+
+ $proto->new('table_name',$hashref);
+
+}
+
+# Usage: $error = $record -> insert;
+sub insert {
+ my($self)=@_;
+
+ $self->check or
+ $self->add;
+}
+
+# Usage: $error = $record -> delete;
+sub delete {
+ my($self)=@_;
+
+ $self->del;
+}
+
+# Usage: $error = $newrecord -> replace($oldrecord)
+sub replace {
+ my($new,$old)=@_;
+ return "(Old) Not a table_name record!" unless $old->table eq "table_name";
+
+ $new->check or
+ $new->rep($old);
+}
+
+# Usage: $error = $record -> check;
+sub check {
+ my($self)=@_;
+ return "Not a table_name record!" unless $self->table eq "table_name";
+ my($recref) = $self->hashref;
+
+ ''; #no error
+}
+
+1;
+