Your Shopping Cart Contents
To change the quantity for the items in this page type in the desired quantity in the prompt and press Update. For more details on any item click on the name link.
To continue shopping choose from the drop down menu at the top of the page.
BOTTOMCART2
&printbottom;
}
# ----------------------------
sub stp
# ----------------------------
{
$shipping = sprintf("%.2f", $input{'shipping'});
if ($input{'stt'} eq "checkout_4")
{
open(ORDERNUM,"<$order_number_path") || print "55";
while ()
{
@order_number = split(/\*/, $_);
$order_number = $order_number[0];
}
close ORDERNUM;
}
if ($input{'pgn'} eq "email.html")
{
open(FRIENDMESS2,"<$mess_friend_default") || print "55";
while ()
{
$friend_mess_default .= "$_";
}
close FRIENDMESS2;
}
if ($input{pgn} eq "email.html")
{
if ($input{ss} ne "")
{
$back_link = "/$CGIPROGRAM?stt=stp&pgn=$input{ss}&id=$id";
}
else
{
$back_link = "/$CGIPROGRAM?stt=search&scat=$input{scat}&display=$input{display}&type=SUB&id=$id";
}
}
$ship = sprintf("%.2f", ($ship_base + $ship_incr));
$ship_incr = sprintf("%.2f", $ship_incr);
$ship_secday = sprintf("%.2f", $ship_base + $ship_secday);
$ship_stand = sprintf("%.2f", $ship_stand);
$ship_prio = sprintf("%.2f", $ship_prio);
$int_ship_base = sprintf("%.2f", $int_ship_base);
$int_ship_incr = sprintf("%.2f", $int_ship_incr);
$int_ship_prio = sprintf("%.2f", $int_ship_prio);
open(PAGE,"<$SYSTEMROOT$input{'pgn'}") || print "77";
$x = 0;
while ()
{
$temp = $_ ;
$temp =~ s/xidx/$id/g;
$temp =~ s/xshippingx/$shipping/g;
$temp =~ s/xint_shippingx/$int_shipping/g;
$temp =~ s/xscatx/$input{scat}/g;
$temp =~ s/xdisplayx/$input{display}/g;
$temp =~ s/xbacklinkx/$back_link/g;
$temp =~ s/xdollarx/$dollar/g;
$temp =~ s/xssx/$input{ss}/g;
$record[$x] = $temp;
$x++;
}
close PAGE;
print "@record";
}
# ----------------------------
sub check_input1
# ----------------------------
{
$m = 0;
if(($input{'shipping'} =~ "can") and ($input{'state'} ne "Select Your State"))
{
$error_message[$m] = "If this is a USA order please select a USA shipping option. If this is a Canada order please DO NOT SELECT a USA state.";
$canintbug = "Y";
$m++;
}
if(($input{'shipping'} =~ "int") and ($input{'state'} ne "Select Your State"))
{
$error_message[$m] = "If this is a USA order please select a USA shipping option. If this is an International order please DO NOT SELECT a USA state.";
$canintbug = "Y";
$m++;
}
if($input{'shipping'} eq "")
{
$error_message[$m] = "You must select a shipping option.";
$m++;
}
if($input{'name'} eq "")
{
$error_message[$m] = "You must enter a name.";
$m++;
}
if(($input{'email'} eq "") or ($input{'email'} !~ /\@/) or ($input{'email'} !~ /\./))
{
$error_message[$m] = "You must enter a valid e-mail address.";
$m++;
}
if($input{'phone'} eq "")
{
$error_message[$m] = "You must enter a telephone number.";
$m++;
}
if ($input{'address'} eq "")
{
$error_message[$m] = "You must enter a shipping address.";
$m++;
}
if ($input{'city'} eq "")
{
$error_message[$m] = "You must enter a city for the shipping address.";
$m++;
}
if(($input{'state'} eq "Select Your State") and ($input{'int_state'} eq "") and ($input{'country'} eq ""))
{
$error_message[$m] = "You must enter a state and/or country for your order.";
$m++;
}
if(($input{'state'} ne "Select Your State") and ($input{'zip'} eq ""))
{
$error_message[$m] = "You must enter a ZIP CODE for your shipping address.";
$m++;
}
if(($input{'int_state'} ne "") and ($input{'country'} eq ""))
{
$error_message[$m] = "You must enter a country for your order.";
$m++;
}
if ($m > 0)
{
&checkout_1($m, @error_message);
exit;
}
}
# ----------------------------
sub check_input2
# ----------------------------
{
$m = 0;
$cc=$input{ccard};
$date_split[0] = "$input{ccexpiry_month}";
$date_split[1] = "$input{ccexpiry_year}";
if ($input{'SAME_ADDRESS'} eq "YES")
{
$b_address = "$input{'address'}";
$b_address_2 = "$input{'address_2'}";
$b_city = "$input{'city'}";
$b_state = "$input{'state'}";
$b_int_state = "$input{'int_state'}";
$b_zip = "$input{'zip'}";
$b_country = "$input{'country'}";
}
else
{
$b_address = "$input{'b_address'}";
$b_address_2 = "$input{'b_address_2'}";
$b_city = "$input{'b_city'}";
$b_state = "$input{'b_state'}";
$b_int_state = "$input{'b_int_state'}";
$b_zip = "$input{'b_zip'}";
$b_country = "$input{'b_country'}";
}
if ($input{'cctype'} eq "Select Card Type")
{
$error_message[$m] = "You must select a credit card type.";
$m++;
}
if (length($cc)<2)
{
$error_message[$m] = "You must enter a credit card number.";
$m++;
}
if ($input{'ccname'} eq "")
{
$error_message[$m] = "You must enter the name on the credit card.";
$m++;
}
if ( $input{'ccexpiry_month'} eq "Month")
{
$error_message[$m] = "You must select a credit card expiry month.";
$m++;
}
if ( $input{'ccexpiry_year'} eq "Year")
{
$error_message[$m] = "You must select a credit card expiry year.";
$m++;
}
if(($input{'int_state'} ne "") and ($input{'country'} eq ""))
{
$error_message[$m] = "You must enter a country for your order.";
$m++;
}
if ($b_address eq "")
{
$error_message[$m] = "You must enter a billing address.";
$m++;
}
if ($b_city eq "")
{
$error_message[$m] = "You must enter a city for the billing address.";
$m++;
}
if (($b_state ne "Select Your State") and ($b_zip eq ""))
{
$error_message[$m] = "You must enter a ZIP CODE for your billing address.";
$m++;
}
if (($b_state ne "Select Your State") and ($b_country eq ""))
{
$error_message[$m] = "You must enter a Country for your billing address.";
$m++;
}
if ($ccc eq "1")
{
if (length($cc)<2)
{
# $error_message[$m] = "Credit Card field must be filled out.
";
# $m++;
}
else
{
$error = 0;
$cc =~ s/\D//g;
$length = length($cc);
if (($length < 13) || ($length > 16))
{
$error = 1;
}
$first = substr($cc, 0, 1);
$card_type = "none";
if ($first == 5)
{
$card_type = "MasterCard";
if ($length != 16)
{
$error = 1;
}
}
if ($first == 4)
{
$card_type = "Visa";
if (($length != 16) && ($length != 13))
{
$error = 1;
}
}
if ($first == 3)
{
$card_type = "American Express";
if ($length != 15)
{
$error = 1;
}
}
if ($first == 6)
{
$card_type = "Discover";
if ($length != 16)
{
$error = 1;
}
}
if ($card_type eq "none")
{
$error = 1;
}
if (!($error))
{
$z = 2;
$sum = 0;
for ($i = $length - 2; $i>=0; $i--)
{
$cdigit = substr($cc, $i, 1);
$prod = $z * $cdigit;
$ones= chop($prod);
$sum += $ones + $prod;
$z = $z % 2 + 1;
}
if (!(substr($cc, $length - 1, 1) == (10 - ($sum % 10)) % 10))
{
$error = 1;
}
}
if ($error == 1)
{
$error_message[$m] = "The Credit Card Number you entered: $input{ccard} is invalid.";
$m++;
}
}
@current_time = localtime(time());
$month = $current_time[4]+1;
$year = $current_time[5];
if ($year < 171)
{
if ($year < 50)
{
$year += 2000;
}
else
{
$year += 1900;
}
}
@date_split =($input{ccexpiry_month}, $input{ccexpiry_month});
if ($date_split[1] < 171)
{
if ($date_split[1] < 50)
{
$date_split[1] += 2000;
}
else
{
$date_split[1] += 1900;
}
}
# if (($input{ccexpiry_month} eq "Month") or ($input{ccexpiry_year} eq "Year"))
# {
# $error_message[$m] = "You must enter a valid expiration date for your credit card.";
# $m++;
# }
# elsif (length($date_split[1]) != 4)
# {
# $error_message[$m] = "The date $input{ccexpiry}, you entered for your credit card expiration date is invalid. It must be in the format: MM/YY.";
# $m++;
# }
# els
if (($year > $date_split[1])||(($year == $date_split[1])&&($month > $date_split[0])))
{
$error_message[$m] = "You must enter a valid expiration date for your credit card. Date entered has expired. \n";
$m++;
}
} ####------------ END IF CCC=1
if ($m > 0)
{
&checkout_2($m, @error_message);
exit;
}
}
# ----------------------------
sub finish_order
# ----------------------------
{
open(ORDERMESS,"<$mess_ord_top") || print "(7)";
while ()
{
$order_mess_top .= "$_";
}
close ORDERMESS;
$info_buffer .= "\n";
$info_buffer .= "SHIPPING INFORMATION\n";
$info_buffer .= "----------------------------------------\n";
$info_buffer .= "Name: $input{'name'}\n";
$info_buffer .= "E-mail: $input{'email'}\n";
$info_buffer .= "Phone: $input{'phone'}\n";
$info_buffer .= "Address: $input{'address'}\n";
if ($input{'address_2'} ne "")
{
$info_buffer .= " $input{'address_2'}\n";
}
$info_buffer .= "City: $input{'city'}\n";
$info_buffer .= "State: $input{'state'}\n";
if ($input{'int_state'} ne "")
{
$info_buffer .= "International State: $input{'int_state'}\n";
}
$info_buffer .= "Zip Code: $input{'zip'}\n";
$info_buffer .= "Country: $input{'country'}\n";
$info_buffer .= "Phone: $input{'phone'}\n\n";
if ($input{'instructions'} ne "")
{
$instructions = $input{instructions};
$instructions =~ s/\n/ /g;
$instructions =~ s/\r/ /g;
$instructions =~ s/ / /g;
$info_buffer .= "SPECIAL INSTRUCTIONS\n";
$info_buffer .= "----------------------------------------\n";
$info_buffer .= "$instructions\n\n";
}
#$info_buffer .= "Discount Code: $input{'discount_code'}\n";
$order_buffer .= "YOUR ORDER:\n";
$order_buffer .= "----------------------------------------\n";
$ccexp = "$input{'ccexpiry_month'}" . "/" . "$input{'ccexpiry_year'}";
$ORDER_LINE .= "$order_number" . "::" . "$input{'name'}" . "::" . "$input{'email'}" . "::" . "$input{'phone'}" . "::" . "$input{'address'}" . "::";
$ORDER_LINE .= "$input{'address_2'}" . "::" . "$input{'city'}" . "::" . "$input{'state'}" . "::" . "$input{'int_state'}" . "::" . "$input{'zip'}" . "::" . "$input{'country'}" . "::";
$ORDER_LINE .= "$input{'b_address'}" . "::" . "$input{'b_address_2'}" . "::" . "$input{'b_city'}" . "::";
$ORDER_LINE .= "$input{'b_state'}" . "::" . "$input{'b_int_state'}" . "::" . "$input{'b_zip'}" . "::" . "$input{'b_country'}" . "::";
$ORDER_LINE .= "$input{'cctype'}" . "::" . "$input{'ccard'}" . "::" . "$ccexp" . "::" . "$input{'ccname'}" . "::" . "$input{'find_engine'}" . "::" . "$input{'find_other'}" . "::";
####--------------RETIEVE CART INFO ($qty, $sku, $name, $author, $price)
$k = 0;
open (SHOP, "<$SCART_SECURE");
while ()
{
chop;
($qty[$k], $sku[$k], $name[$k], $author[$k], $price[$k]) = split(/\|/, $_);
$disp_price[$k] = sprintf("%.2f", $price[$k]);
$extended[$k] = ($qty[$k] * $price[$k]);
$disp_extended[$k] = sprintf("%.2f", $extended[$k]);
$order_buffer .= "$name[$k]\n";
#$order_buffer .= "$sku[$k] ....... $name[$k]\n";
$order_buffer .= "$author[$k]\n";
$order_buffer .= "$qty[$k] " . "x" . " $dollar$disp_price[$k] " . "=" . " $dollar$disp_extended[$k]\n\n";
if ($k == 0)
{
$ORDER_LINE .= "$qty[$k]" . "|" . "$sku[$k]" . "|" . "$name[$k]" . "|" . "$disp_price[$k]" . "|" . "$disp_extended[$k]";
}
else
{
$ORDER_LINE .= "+" . "$qty[$k]" . "|" . "$sku[$k]" . "|" . "$name[$k]" . "|" . "$disp_price[$k]" . "|" . "$disp_extended[$k]";
}
$subtotal += $extended[$k];
$k++;
}
close SHOP;
$ORDER_LINE .= "::" . "$subtotal";
$disp_subtotal= sprintf("%.2f", $subtotal);
$disp_subtotal1= sprintf("%.2f", $subtotal);
$order_buffer .= "------------------------\n";
$order_buffer .= "Subtotal ....... $dollar$disp_subtotal\n";
#print "$input{'state'}"; exit;
#($DISC_CODE_ENABLER, $DISC_CODE, $DISC_RATE, $DISC_NAME, $ICON_ON, $SALE_ON, $FREESHIP, $DISC_THRESH) = @PROMO;
@codes = split(/\+/, $DISC_CODE);
if ($DISC_CODE_ENABLER eq "Y2")
{
foreach $m (0 .. $#codes)
{
if ($codes[$m] eq "$input{'discount_code'}")
{
$display_disc= sprintf("%.2f", ($subtotal * $DISC_RATE) / 100);
$subtotal = ($subtotal - $display_disc);
$display_subtotal= sprintf("%.2f", ($subtotal));
$order_buffer .= "$DISC_NAME ....... -$dollar$display_disc\n";
$order_buffer .= "Subtotal ....... $dollar$display_subtotal\n";
}
}
}
elsif (($DISC_CODE_ENABLER eq "Y1") and ($subtotal >= $DISC_THRESH))
{
$display_disc= sprintf("%.2f", ($subtotal * $DISC_RATE) / 100);
$subtotal = ($subtotal - $display_disc);
$display_subtotal= sprintf("%.2f", ($subtotal));
$order_buffer .= "Discount ....... $dollar$display_disc\n";
$order_buffer .= "Subtotal ....... $dollar$display_subtotal\n";
}
$ORDER_LINE .= "::" . "$DISC_RATE" . "::" . "$display_disc" . "::" . "$subtotal";
if ($input{'state'} eq "$taxable_state")
{
$tax = (($subtotal * $state_tax_rate) / 100);
$disp_tax = sprintf("%.2f", $tax);
$order_buffer .= "$taxable_state Tax ......... $dollar$disp_tax\n";
}
$ORDER_LINE .= "::" . "$disp_tax";
($method, $shipping) = split(/\+/, $input{'shipping'});
if (($FREESHIP eq "Y") and ($method eq "a"))
{
$shipping = 0;
}
$display_shipping= sprintf("%.2f", $shipping);
#($display_method,) = split(/\++/, $SHOPTION{$method});
$display_method = "$SHOPTION{$method}";
$order_buffer .= "Shipping ....... $dollar$display_shipping\n";
$order_buffer .= "$display_method \n";
$ORDER_LINE .= "::" . "$display_shipping" . "::" . "$display_method";
$total = ($subtotal + $tax + $shipping);
$disp_total = sprintf("%.2f", $total);
#print "$total $disp_total"; exit;
$order_buffer .= "------------------------\n";
$order_buffer .= "Total .......... $dollar$disp_total \n \n";
$ORDER_LINE .= "::" . "$disp_total";
#$ORDER_LINE .= "::" . "$input{'discount_code'}";
#####---------------WRITE ORDER
&write_order;
#####---------------BEGIN KEDISI MAILING STUFF
#$admin = 'fo@amcreative.com';
$mail="$mailprogram $admin";
open(MAIL, "| $mail") || &sys_error("Can't open pipe to sendmail.");
$header_buffer = '';
print MAIL "To: $admin\r\n";
print MAIL "From: $admin\r\n";
#print MAIL "Reply-To: \"$admin\" <$admin>\n" ;
#print MAIL "X-Mailer: Curtis Evarts\r\n";
#print MAIL "Mime-Version: 1.0\r\n";
#print MAIL "Content-Type: text/plain\r\n";
#$header_buffer .= "Subject: Website order placed. Order# CS$order_number\r\n\r\n";
print MAIL "Subject: Website order placed.\n\n" ;
#print MAIL "$header_buffer";
print MAIL "Order awaiting retrieval at http://www.chinese-furniture.com/ccor/\r\n";
print MAIL "$order_mess_top";
print MAIL "$info_buffer";
print MAIL "$order_buffer";
#print MAIL "$order_mess_bot";
print MAIL "\r\n$input{'find_engine'}";
print MAIL "\n$input{'find_other'}";
close (MAIL) || &sys_error("Error closing pipe to sendmail - 1.");
#####---------------BEGIN PARAGONMAILING STUFF
#$paragon = 'fo@amcreative.com';
$mail="$mailprogram $paragon";
open(MAIL, "| $mail") || &sys_error("Can't open pipe to sendmail.");
#$header_buffer = '';
print MAIL "To: $paragon\r\n";
print MAIL "From: $admin\r\n";
#print MAIL "X-Mailer: Curtis Evarts\r\n";
#print MAIL "Mime-Version: 1.0\r\n";
#print MAIL "Content-Type: text/plain\r\n";
#$header_buffer .= "Subject: Website order placed. Order# CS$order_number\r\n\r\n";
print MAIL "Subject: Website order placed.\n\n";
#print MAIL "$header_buffer";
print MAIL "Order awaiting retrieval at http://www.chinese-furniture.com/ccor/\r\n";
print MAIL "$order_mess_top";
print MAIL "$info_buffer";
print MAIL "$order_buffer";
#print MAIL "$order_mess_bot";
print MAIL "\r\n$input{'find_engine'}";
print MAIL "\n$input{'find_other'}";
close (MAIL) || &sys_error("Error closing pipe to sendmail - 2.");
#####---------------BEGIN CUSTOMER STUFF
$mail="$mailprogram $input{email}";
open(MAIL, "| $mail") || &sys_error("Can't open pipe to sendmail.");
#$header_buffer = '';
print MAIL "To: $input{email}\r\n";
print MAIL "From: $admin\r\n";
#$header_buffer .= "X-Mailer: Classical Chinese Furniture\r\n";
#$headerbuffer .= _"Mime-Version: 1.0\r\n";
#$header_buffer .= "Content-Type: text/plain; charset=$char_set\r\n";
#$header_buffer .= "Subject: Your Classical Chinese Furniture Order# CS$order_number\r\n\r\n";
print MAIL "Subject: Your Classical Chinese Furniture Order\n\n";
#print MAIL "$header_buffer";
print MAIL "$order_mess_top";
print MAIL "$info_buffer";
print MAIL "$order_buffer";
print MAIL "$order_mess_bot";
close (MAIL) || &sys_error("Error closing pipe to sendmail.");
######------------------EMPTY CART
unlink ("$SCART_SECURE");
######------------------THANK YOU VERY MUCH IT WAS A PLEASURE
open(PAGE,")
{
$temp = $_ ;
$temp =~ s/xidx/$id/g;
# $temp =~ s/xordx/$order_number/g;
$record[$x] = $temp;
$x++;
}
close PAGE;
print "@record";
$order_number++;
exit;
######------------------WRITE ORDER LINE TO FILE
open(ORDERLINE,">>$ORDERLINEPATH") || print " (77)";
print ORDERLINE "$ORDER_LINE\n";
close ORDERLINE;
&clear;
#exit;
}
# ----------------------------
sub clear
# ----------------------------
{
$cur_time = time();
if (!(opendir(LISTDIR, "$SHOPPERS_SECURE")))
{
&htmlcontext;
print("Error: unable to open directory: $SHOPPERS_SECURE");
exit;
}
while ($filename = readdir(LISTDIR))
{
if (($filename ne ".") or ($filename ne ".."))
{
@total = split (/\-/, $filename);
$seconds = $total[0];
$killit = ($cur_time - $time_range);
if ($killit > $seconds)
{
# print "HERE ";
unlink("$SHOPPERS_SECURE$filename");
}
}
}
closedir(LISTDIR);
#print "Current time: $cur_time ";
#print "Range: $time_range ";
#print "Seconds: $seconds ";
}
# ----------------------------
sub write_order
# ----------------------------
{
$EMAIL = "Email Address:";
format WORDER =
************************** NEW ORDER **************************
ORDER DATE: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`date`
Name: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'name'}
Email Address: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'email'}
Telephone: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'phone'}
SHIPPING INFORMATION
Address: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'address'}
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'address_2'}
City: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'city'}
State: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'state'}
International State: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'int_state'}
Zip: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'zip'}
Country: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'country'}
BILLING INFORMATION
Address: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'b_address'}
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'b_address_2'}
City: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'b_city'}
State: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'b_state'}
International State: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'b_int_state'}
Zip: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'b_zip'}
Country: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'b_country'}
Card Type: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'cctype'}
Card Number: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'ccard'}
Expiration Date: @<<<<<<<<<
$ccexp
Name on Card: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$input{'ccname'}
.
format SKU =
ORDER INFORMATION
--------------------------------------------------------------
.
format ORDLINE =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$name[$x]
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$author[$x]
@<<< x @@>>>>>> = @@>>>>>>>
$qty[$x] $dollar$disp_price[$x] $dollar$disp_extended[$x]
.
$nothing = " ";
$space = "---------";
$Total = "Total";
$Tax = "Tax";
$Shipping = "Shipping";
$Subtotal = "Subtotal";
$Discount = "$DISC_NAME" . " -";
format ORDTOTAL =
@>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> @>>>>>>>>
$nothing $space
@>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> @@>>>>>>>
$Subtotal $dollar$disp_subtotal1
@>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> @@>>>>>>>
$Tax $dollar$disp_tax
@>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> @@>>>>>>>
$display_method $dollar$display_shipping
@>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> @>>>>>>>>
$nothing $space
@>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> @@>>>>>>>
$Total $dollar$disp_total
.
open(FEEDPAGE,"<$FEEDPAGEFILE") || print "88";
while ()
{
$feedpage = $_;
}
close FEEDPAGE;
open(WORDER,">>$ORDERS") || print "BUG 99: $ORDERS";
if ($feedpage ne "0")
{
print WORDER "\f";
}
write WORDER;
if ($input{'instructions'} ne "")
{
$sinfo.= "Special Instructions:\n";
(@instr)=split(/\++/,$input{'instructions'});
foreach $a(0 .. $#instr)
{
$sinfo.= "$instr[$a]";
}
print WORDER "$sinfo";
print WORDER "\n";
}
close WORDER;
open(SKU,">>$ORDERS") || print "10";
write SKU;
close SKU;
open(ORDLINE,">>$ORDERS");
foreach $x (0 .. ($k - 1))
{
#print "$k";
write ORDLINE;
}
close ORDLINE;
open(ORDTOTAL,">>$ORDERS") || print "11";
write ORDTOTAL;
close ORDTOTAL;
if ($feedpage eq "0")
{
open(FEEDPAGE,">$FEEDPAGEFILE");
print FEEDPAGE "1";
close FEEDPAGE;
}
}
# ----------------------------
sub email_check
# ----------------------------
{
($email_address) = @_;
#print "BUG $email_address"; exit;
if (($email_address !~ "\@") or ($email_address !~ "\."))
{
# print "BUG2 $email_address"; exit;
&sys_error("The e-mail address you've entered is invalid.");
# &printbottom;
exit;
}
}
# ----------------------------
sub update
# ----------------------------
{
($message) = @_;
$mail="$mailprogram $admin";
open(MAIL, "| $mail") || &sys_error("Can't open pipe to sendmail.");
$header_buffer = '';
$header_buffer .= "To: $admin\r\n";
$header_buffer .= "X-Mailer: Classical Chinese Furniture\r\n";
$header_buffer .= "Mime-Version: 1.0\r\n";
$header_buffer .= "Content-Type: text/plain\r\n";
$header_buffer .= "From: $admin\r\n";
$header_buffer .= "Subject: CCF Site Update\r\n\r\n";
print MAIL "$header_buffer";
print MAIL "$message\n\n";
close (MAIL) || &sys_error("Error closing pipe to sendmail.");
}
# ----------------------------
sub contact
# ----------------------------
{
$message = $input{message};
$message =~ s/\n/ /g;
$message =~ s/\r/ /g;
$message =~ s/ / /g;
$mail="$mailprogram $admin";
open(MAIL, "| $mail") || &sys_error("Can't open pipe to sendmail.");
$header_buffer = '';
$header_buffer .= "To: $admin\r\n";
$header_buffer .= "X-Mailer: Classical Chinese Furniture\r\n";
$header_buffer .= "Mime-Version: 1.0\r\n";
$header_buffer .= "Content-Type: text/plain\r\n";
$header_buffer .= "From: $input{email}\r\n";
$header_buffer .= "Subject: CCF Site Contact\r\n\r\n";
print MAIL "$header_buffer";
print MAIL "Name: $input{name}\n";
print MAIL "Address: $input{address}\n";
print MAIL "City: $input{city}\n";
print MAIL "State: $input{state}\n";
print MAIL "Zip: $input{zip}\n";
print MAIL "Country: $input{country}\n";
print MAIL "E-mail: $input{email}\n\n";
print MAIL "Message:\n";
print MAIL "$message \n";
close (MAIL) || &sys_error("Error closing pipe to sendmail.");
#print "$mail $input{City}"; exit;
}
# ----------------------------
sub noitemsfound
# ----------------------------
{
print <