#!/usr/local/bin/perl ####################### # # printorders.pl #------------------------------------------------------------------# # A partial front end to Perlshop that will print a listing of # customer numbers, which can be clicked on to print the customer # file. # # Written by Kevin H. Weiss, Ph.D. # Last modified on 10/15/1998 # kevin@childbirth.org # http://www.childbirth.org #------------------------------------------------------------------# # You will need to create a password file, such as "htaccess" that # contains username:password pairs. # Webstorage customers, go to http://www.webstorage.com/utils/htpasswd.html # to create username:password pairs. #------------------------------------------------------------------# # Set the following variables: $htaccess_file="$ENV{'DOCUMENT_ROOT'}/cgi-bin/CEP/htpasswd"; #location of password file $customer = "$ENV{'DOCUMENT_ROOT'}/cgi-bin/Mystore/customers"; #the directory where the orders reside $program_location = "http://www.childbirth.org/cgi-bin/CEP/printorders.pl"; $secure_program = "https://secure.nameservers.com/~childbir/cgi-bin/CEP/printorders.pl"; #################### &ReadParse(*formdata); ### Subroutine ReadParse is part of cgi-lib.pl library, Copyright 1993 Steven E. Brenner (see full text below) $customer_file_name="$ENV{'DOCUMENT_ROOT'}/cgi-bin/Mystore/customers/$formdata{'CUSTOMER'}"; #$order_file_name="$ENV{'DOCUMENT_ROOT'}/cgi-bin/Mystore/orders/$formdata{'ORDER'}"; ##################################### # Print HTML MIME headers and a title print "Content-type: text/html\n\n"; print "
\n";
print("Customer ID: $customer_info[0]
");
# print("Remote Address: $customer_info[1]
");
print ("Date: $customer_info[2]
");
print ("Time: $customer_info[3]
");
print ("$customer_info[4] $customer_info[5] $customer_info[6]
"); #Title First Last
print ("$customer_info[7]
") if ($customer_info[7] ne ""); #Company
print ("$customer_info[8]
"); #Street1
print ("$customer_info[9]
") if ($customer_info[9] ne ""); #Street 2
print ("$customer_info[10], "); #CITY
print ("$customer_info[11] "); #STATE
print ("$customer_info[12]
"); #ZIP CODE
print ("$customer_info[13]
") if ($customer_info[13] ne "US"); #COUNTRY
print ("E-Mail: $customer_info[14]
");
print ("Daytime Phone: $customer_info[15]");
print ("x$customer_info[16]") if ($customer_info[16] ne ""); #EXTENSION
print "
";
print ("Nighttime Phone: $customer_info[17]");
print ("x$customer_info[18]") if ($customer_info[18] ne ""); #EXTENSION
print "
";
print ("Fax: $customer_info[19]
") if ($customer_info[19] ne "");
print ("$customer_info[22] "); #CARD TYPE
print ("$customer_info[23] "); #CARD NO.
print ("Exp. $customer_info[24]/$customer_info[25]
"); #EXPIRATION MONTH/YEAR
print ("\n");
# skipped fields 26, 27, 28
# which are Suggestions, where did you find out about our site?, and FirstVirtual PIN
printf(" Sub Total: %6.2f
", $customer_info[29]); #sub total
if ($customer_info[30] != 0) {
printf(" Tax: %6.2f
", $customer_info[30]); #tax
}
printf(" Shipping: %6.2f
", $customer_info[31]); #shipping
if ($customer_info[33] != 0) {
printf(" Discount: %6.2f
", -$customer_info[33]); #total discount
}
if ($customer_info[34] != 0) {
printf("COD Charge: %6.2f
", $customer_info[34]); #COD charge
}
if ($customer_info[35] != 0) {
printf(" Handling: %6.2f
", $customer_info[35]); #handling
}
printf("-----------------
");
printf(" Total: %6.2f
", $customer_info[32]); #grand total
print "
";
close customer_file;
}
else
{
#------------------------------------------------------------------#
# User logged in. Now print up form to enter an invoice number.
### maximum number of orders to be seen as new at one time
$max=100;
&scan_dir;
### pretty it up a bit.
print "$err_msg