#!/usr/bin/perl -wT
print "Content-type: text/html\n\n";
use strict;
use warnings;
use CGI;
use File::Copy;
use File::Temp;
use Fcntl qw(:flock);
use CGI::Carp qw ( fatalsToBrowser );
sub encrypt;
$CGI::DISABLE_UPLOADS = 1;
$ENV{'PATH'} = '/bin:/usr/bin';
print"\n";
print "
";
print "Hello $custNAME, Congratulations. Seller has finally accepted your bid of \$ $oldBIDactual for: $unit[5]$asdcust . . . .Price(includes S\&H) - \$ $itemPRICE . . . . . . . Zip code - $unit[10] . . . . . $unit[9] "; print "However, seller's acceptance of this offer came after the 24 hour time limit established by GScat policy. Therefore, your acceptance of your own bid is now optional. What do you want to do now? Best Regards, The GScat intermediary \n"; #print "P.S. -- This message is intended for GScat members that are vividly aware of this transaction in progress. If you don't recognize this transaction or are confused by it for any reason, please do not respond to this message but instead go to the www.GScat.com website, log in and review this transaction under the Local Bidding header. \n"; #print "NOTICE -- GScat will NEVER ask you for any information in an email except a radio button choice and a price. \n"; print " |
";
print "Hello $custNAME, Seller has made a counter offer of \$ $oldBIDactual for: $unit[5]$asdcust . . . .Price(includes S\&H) - \$ $itemPRICE . . . . . . . Zip code - $unit[10] . . . . . $unit[9] You must reply within 24 hours of the posting of this bid or the seller will have the option of ending bidding with you. What do you want to do next: "; print " Best Regards and have a great day, The GScat intermediary "; #print "P.S. -- This message is intended for GScat members that are vividly aware of this transaction in progress. If you don't recognize this transaction or are confused by it for any reason, please do not respond to this message but instead go to the www.GScat.com website, log in and review this transaction under the Local Bidding header. \n"; #print "NOTICE -- GScat will NEVER ask you for any information in an email except a radio button choice and a price. \n"; print " |
";
print "To: $custEMAIL "; print "From: intermediary\@GScat.com "; print "Subject: GScat: End of bidding at your request. "; print "Hello $custNAME, As per your request, you have ended bidding with the seller for: $unit[5]$asdcust . . . .Price(\+S\&H) - \$ $itemPRICE . . . . . . . Zip code - $unit[10] . . . . . $unit[9] Since you the bidder ended the bidding, if you choose, you may still bid on this item again. Best Regards, The GScat intermediary (email receipt to follow.) "; print " |
Hello $sellerNAME, Hello $sellerNAME,
$custUSERNAME has chosen to stop bidding for $itemCODE$asd. The item is now available to other customers for selection and bidding. Since $custUSERNAME stopped the bidding, he/she may choose to bid on this item again.
Best Regards,
The GScat intermediary
\n";
close MAIL;
#-------------------------------------------------
exit;
#No lost item here since Bidder closed the bidding.
}
#------------------------------
#Reject bids below minimum price.
if($BIDactual < $itemMINIMUM && $lowbidexception == 0){
#$repsrecord
my $clink = 0;
my $zzz = 0;
my $reps = 0;
my $found = 0;
my $tmp = File::Temp->new();
my $tempfile = $tmp->filename;
open (SEM,$repsrecordLOCK);
flock (SEM, LOCK_EX);
open (TEMP, ">>$tempfile");
open (REPS,$repsrecord);
while ($line = Low Bid.
";
if ($local == 0){
print "Home Page --- ";
print "Login
";
}else{
print "Return to bidding --- ";
print "Return to User's Page --- ";
print "Logout
";
}
print "
";
if ($local == 0){
print "Home Page --- ";
print "Login";
print "
Hello $custNAME,
Your bid of \$ $BIDactual for:
";
print $unit[5],$asdcust;
print "
. . . .Price(includes S\&H) - \$ ", $itemPRICE, " . . . . . . . Zip code - ", $unit[10],"
";
print " . . . . . ",$unit[9],"
";
print "is less than the minimum established by the seller.
Please feel free to try a higher bid. You may make a total of three low bids on this item.
";
#print <
";
print " Instead, I bid: \$";
print "
";
print " Stop bidding.
";
if ($local == 0){
print "
";
}
print "
";
#ENDHTML
print "
";
}else{
print "Return to bidding --- ";
print "Return to User's Page --- ";
print "Logout
";
}
print "
";
#\\\\\\\\\\\\\\\\\\\\\\\\\\\
exit;
}else{
#//////////////////////////
print "End of Bidding.
";
if ($local == 0){
print "Home Page --- ";
print "Login
";
}else{
print "Return to bidding --- ";
print "Return to User's Page --- ";
print "Logout
";
}
print "
";
if ($local == 0){
print "Home Page --- ";
print "Login";
print "To: $custEMAIL
";
print "From: intermediary\@GScat.com
";
print "Subject: GScat: End of bidding due to three low bids.
";
print "Hello $custNAME,
Three of your bids for:
$unit[5]$asdcust
. . . .Price(\+S\&H) - \$ $itemPRICE . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]
have been lower than the seller's minimum.
Please feel free to bid on other items. You cannot bid on this item again.
Best Regards,
The GScat intermediary
(email receipt to follow.)
";
print "
";
}else{
print "Return to bidding --- ";
print "Return to User's Page --- ";
print "Logout
";
}
print "
";
#\\\\\\\\\\\\\\\\\\\\\\\\\\\
print "
";
#-------End bidding due to Three low bids from bidder---receipt-----------
open (MAIL, "|$sendmail");
print MAIL "To: " . $custEMAIL . "\n";
print MAIL "Reply-to: " . $gscati . "\n";
print MAIL "From: " . $gscati . "\n";
print MAIL "Subject: GScat RECEIPT: End of bidding due to three low bids.\n";
print MAIL "Content-type: text/html\n\n";
print MAIL "Hello $custNAME,
Three of your bids for:
$unit[5]$asdcust
. . . .Price(\+S\&H) - \$ $itemPRICE . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]
have been lower than the seller's minimum.
Please feel free to bid on another item. You cannot bid on this item again.
Best Regards,
The GScat intermediary
\n";
close MAIL;
#----------------------------------------------------
#print "
";
#----------End bidding due to three low bids from bidder------------Email to seller------------
open (MAIL, "|$sendmail");
print MAIL "To: " . $sellerEMAIL . "\n";
print MAIL "Reply-to: " . $gscati . "\n";
print MAIL "From: " . $gscati . "\n";
print MAIL "Subject: GScat: Three low bids for $itemCODE$asd.\n";
print MAIL "Content-type: text/html\n\n";
print MAIL "
After making at least one bid above your selected minimum, $custUSERNAME has now made three bids below your selected minimum bid for $itemCODE$asd. This item is now available to other customers for selection and bidding. $custUSERNAME cannot bid on this item again.
Best Regards,
The GScat intermediary
\n";
close MAIL;
#-------------------------------------------------
#Un Hold the item after failed bidding.
$z = 0;
my $tmp = File::Temp->new();
my $tempfile = $tmp->filename;
open (SEM, ">$itemfileLOCK");
flock (SEM, LOCK_EX);
open (ITEM, $itemfile);
open (TEMP, ">>$tempfile");
while ($line =
#Return to user's page.
#Logout
#ENDHTML
exit;
}
}
#NO HOLD ITEM NEEDED HERE.
#$pass = "n=" . $bidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=" . $reps . "&z=0&x=0";
$pass = "n=" . $bidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=0&z=0&x=0" . "&d=" . $random;
$pass1 = "n=" . $bidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=1&z=0&x=0" . "&d=" . $random;
#print "
FIRST ", $pass;
#print "
reps here -- ", $reps;
$doublecheck = $bidID . "*" . $custID. "*" . $custUSERNAME . "*" . $seller . "*" . $sellerNAME . "*" . $itemNUM . "*" . $itemCODE . "*". $itemQUANT . "*&" . $BIDactual . "*" . localtime . "*" . $reps . "*" . $random . "*";
#$doublecheck = $bidID . "*" . $custID. "*" . $custNAME . "*" . $seller . "*" . $sellerNAME . "*" . $itemNUM . "*" . $itemCODE . "*". $BIDactual . "*" . localtime . "*";
if ($BIDactual >= $oldBIDactual){ #make this latest price.
#Sale made. Send final email to buyer(bidder) needed also as receipt.
if ($late eq "0"){
#///////////////////////////////
print "Successful Bid and Purchase.
";
if ($local == 0){
print "Home Page --- ";
print "Login
";
}else{
print "Return to bidding --- ";
print "Return to User's Page --- ";
print "Logout
";
}
print "
";
if ($local == 0){
print "Home Page --- ";
print "Login";
print "To: $custEMAIL
";
print "From: intermediary\@GScat
";
print "Subject: GScat: Successful purchase for: \$ $oldBIDactual.
";
print "Hello $custNAME,
Thank you for purchasing:
$unit[5]$asdsold
. . . .Price(\+S\&H) - \$ $itemPRICE . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]
Because you accepted the counter bid of \$ $oldBIDactual, your bidding is complete. The seller has been notified of your purchase and has been provided with the contact/shipping information on record from your GScat registration. If you provided no address/shipping information, you will have to contact the seller to make special arrangements.
The seller's email address is: $sellerEMAIL.
You may use this address to complete the transaction. Please remember to post your opinion of this transaction when it is complete.
Best Regards and have a great day,
The GScat intermediary
(email receipt to follow.)
";
print "
";
}else{
print "Return to bidding --- ";
print "Return to User's Page --- ";
print "Logout
";
}
print "
";
#\\\\\\\\\\\\\\\\\\\\\\\\\\\
print "
";
#---------Receipt email to bidder----------
open (MAIL, "|$sendmail");
print MAIL "To: " . $custEMAIL . "\n";
print MAIL "Reply-to: " . $gscati . "\n";
print MAIL "From: " . $gscati . "\n";
print MAIL "Subject: GScat RECEIPT: Successful purchase for: \$ $oldBIDactual.\n";
print MAIL "Content-type: text/html\n\n";
print MAIL "Hello $custNAME,
Thank you for purchasing:
$unit[5]$asdsold
. . . .Price(\+S\&H) - \$ ", $itemPRICE, " . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]
Because you accepted the counter bid of \$ $oldBIDactual (you may have bid more), your bidding is complete. The seller has been notified of your purchase and has been provided with the contact/shipping information on record from your GScat registration. If you provided no address/shipping information, you will have to contact the seller to make special arrangements.
The seller's email address is: $sellerEMAIL.
You may use this address to complete the transaction. Please remember to post your opinion of this transaction when it is complete.
Best Regards and have a great day,
The GScat intermediary
\n";
close MAIL;
#----------------------------------
#print "
";
#----------Final email to seller------------
open (MAIL, "|$sendmail");
print MAIL "To: " . $sellerEMAIL . "\n";
print MAIL "Reply-to: " . $gscati . "\n";
print MAIL "From: " . $gscati . "\n";
print MAIL "Subject: GScat: $itemCODE$asd sold for \$ $oldBIDactual.\n";
print MAIL "Content-type: text/html\n\n";
print MAIL "Hello $sellerNAME,
Congratulations. $custUSERNAME purchased $itemCODE$asd on GScat for \$ $oldBIDactual, your most recent counterbid.
Contact/shipping information for $custUSERNAME is:
$custNAME
$custADDRESS1, $custADDRESS2
$custCITY, $custSTATE $custZIP
$custNATION
$custEMAIL
GScat provided the buyer with your email address only so that they can contact you and complete the transaction. Please contact the buyer if other arrangements are required. Please remember to post your opinion of this transaction when it is complete.
Best Regards and have a great day,
The GScat intermediary
\n";
close MAIL;
#--------------------------------------
#$custUSERNAME
}else{
#Include final emails for late acceptance by seller.
#///////////////////////////////
print "Successful Bid and Sale.
";
if ($local == 0){
print "Home Page --- ";
print "Login
";
}else{
print "Return to bidding --- ";
print "Return to User's Page --- ";
print "Logout
";
}
print "
";
if ($local == 0){
print "Home Page --- ";
print "Login";
print "To: $custEMAIL
";
print "From: intermediary\@GScat.com
";
print "Subject: GScat: Successful purchase for: \$ $oldBIDactual.
";
print "Hello $custNAME,
Thank you for purchasing:
$unit[5],$asdsold
. . . .Price(\+S\&H) - \$ $itemPRICE . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]
Because you corroborated your counter bid of \$ $oldBIDactual, your bidding is complete. The seller has been notified of your purchase and has been provided with the contact/shipping information on record from your GScat registration. If you provided no address/shipping information, you will have to contact the seller to make special arrangements.
The seller's email address is: $sellerEMAIL.
You may use this address to complete the transaction. Please remember to post your opinion of this transaction when it is complete.
Best Regards and have a great day,
The GScat intermediary
(email receipt to follow.)
";
print "
";
}else{
print "Return to bidding --- ";
print "Return to User's Page --- ";
print "Logout
";
}
print "
";
#\\\\\\\\\\\\\\\\\\\\\\\\\\\
print "
";
#---------Receipt email to bidder----------
open (MAIL, "|$sendmail");
print MAIL "To: " . $custEMAIL . "\n";
print MAIL "Reply-to: " . $gscati . "\n";
print MAIL "From: " . $gscati . "\n";
print MAIL "Subject: GScat RECEIPT: Successful purchase for: \$ $oldBIDactual.\n";
print MAIL "Content-type: text/html\n\n";
print MAIL "Hello $custNAME,
Thank you for purchasing:
$unit[5]$asdcust
. . . .Price(\+S\&H) - \$ ", $itemPRICE, " . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]
Because you corroborated your counter bid of \$ $oldBIDactual your bidding is complete. The seller has been notified of your purchase and has been provided with the contact/shipping information on record from your GScat registration. If you provided no address/shipping information, you will have to contact the seller to make special arrangements.
The seller's email address is: $sellerEMAIL.
You may use this address to complete the transaction. Please remember to post your opinion of this transaction when it is complete.
Best Regards and have a great day,
The GScat intermediary
\n";
close MAIL;
#----------------------------------
#print "
";
#----------Final email to seller------------
open (MAIL, "|$sendmail");
print MAIL "To: " . $sellerEMAIL . "\n";
print MAIL "Reply-to: " . $gscati . "\n";
print MAIL "From: " . $gscati . "\n";
print MAIL "Subject: GScat: $itemCODE$asd sold for: \$ $oldBIDactual.\n";
print MAIL "Content-type: text/html\n\n";
print MAIL "Hello $sellerNAME,
Due to corroboration by $custUSERNAME, he/she purchased $itemCODE$asd on GScat for \$ $oldBIDactual, $custUSERNAME's most recent counterbid that you accepted late.
Contact/shipping information for $custUSERNAME is:
$custNAME
$custADDRESS1, $custADDRESS2
$custCITY, $custSTATE $custZIP
$custNATION
$custEMAIL
GScat provided $custUSERNAME with your email address only so that he/she can complete the transaction. Please contact the buyer if other arrangements are required. Please remember to post your opinion of this transaction when it is complete.
Best Regards and have a great day,
The GScat intermediary
\n";
close MAIL;
#--------------------------------------
}
#Sale made. Remove item from item log. With HOLD label. Remove photo.
$z = 0;
my $tmp = File::Temp->new();
my $tempfile = $tmp->filename;
open (SEM, ">$itemfileLOCK");
flock (SEM, LOCK_EX);
open (TEMP,">>$tempfile");
open (ITEMS,$itemfile);
while ($line = Continued Bidding.
";
if ($local == 0){
print "Home Page --- ";
print "Login
";
}else{
print "Return to bidding --- ";
print "Return to User's Page --- ";
print "Logout
";
}
print "
";
if ($local == 0){
print "Home Page --- ";
print "Login";
print "To: $custEMAIL
";
print "From: intermediary\@GScat.com
";
print "Subject: GScat: Counter bid received.
";
print "Hello $custNAME,
Thank you for bidding \$ $BIDactual for:
$unit[5]$asdcust
. . . .Price(includes S\&H) - \$ $unit[7] . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]
An email message has been sent to the seller of this item. GScat will contact you when the seller decides whether to accept your bid, reject your bidding or make a counter offer. The seller is given at least 24 hours from the time you posted your bid to decide but the item is not available to anyone else in that time period. If no response is received from the seller after 24 hours, your acceptance of your own bid becomes optional.
Best Regards and have a great day,
The GScat intermediary.
(email receipt to follow.)
";
print "
";
}else{
print "Return to bidding --- ";
print "Return to User's Page --- ";
print "Logout
";
}
print "
";
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
print "
";
#WORKS (changed with \n)
#---------------Email receipt to bidder-------------
open (MAIL, "|$sendmail");
print MAIL "To: " . $custEMAIL . "\n";
print MAIL "Reply-to: " . $gscati . "\n";
print MAIL "From: " . $gscati . "\n";
print MAIL "Subject: GScat RECEIPT: Counter bid received.\n";
print MAIL "Content-type: text/html\n\n";
print MAIL "Hello $custNAME,
Thank you for bidding \$ $BIDactual for:
$unit[5]$asdcust
. . . .Price(includes S\&H) - \$ $unit[7] . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]
An email message has been sent to the seller of this item. GScat will contact you when the seller decides whether to accept your bid, reject your bidding or make a counter offer. The seller is given at least 24 hours from the time you posted your bid to decide but the item is not available to anyone else in that time period. If no response is received from the seller after 24 hours, your acceptance of your own bid becomes optional.
Best Regards and have a great day,
The GScat intermediary.
\n";
close MAIL;
#-----------------------
#print "
";
#Broken now. (changed with \n)
#--------------------Email message to seller---------
open (MAIL, "|$sendmail");
print MAIL "To: " . $sellerEMAIL . "\n";
print MAIL "Reply-to: " . $gscati . "\n";
print MAIL "From: " . $gscati . "\n";
print MAIL "Subject: GScat: Counter bid for $itemCODE$asd.\n";
print MAIL "Content-type: text/html\n\n";
print MAIL "Hello $sellerNAME,
You have received a counter bid for $itemCODE$asd of \$ $BIDactual from $custUSERNAME. You asked for \$ $itemPRICE and a minimum bid of \$ $itemMINIMUM. You must respond within 24 hours from the time the bidder posted his/her bid or the bidder need not honor his/her own bid.
";
print MAIL "You may log on to the GScat.com Marketplace to respond to this bid (select the 'Local Bidding' link on the User's Page) or click below for GScat.com Express Bidding.
Best Regards and have a great day,
The GScat intermediary
\n";
#print MAIL "P.S. -- This message is intended for GScat members that are vividly aware of this transaction in progress. If you don't recognize this transaction or are confused by it for any reason, please do not respond to this message but instead go to the www.GScat.com website, log in and review this transaction under the Local Bidding header.
";
#print MAIL "NOTICE -- GScat will NEVER ask you for any information in an email except a radio button choice and price.
\n";
close MAIL;
#-------------------------------------------------
}
exit;
sub encrypt(){
#my $RegisterKEY = "78704035285550587773797924280260057777174581965208962778627919390535356193758845";
my $RegisterKEY = "31888979673984578252060512781162624156486021981835483654499149458158022304464579";
my $LRkey=length($RegisterKEY);
my $Lreg = length($CustName);
my $ii=0;
my $jj=0;
my $letter="";
my $number=0;
my $ascsum=0;
my $ascvalue;
my $KEY = "";
my $divisor1;
my $divisor2;
for ($jj=1;$jj<=$Lreg;$jj++){
$ii = $jj;
$divisor1 = int($ii/2);
$divisor2 = $ii/2;
if ($ii <= $LRkey - 7){
$letter = substr($CustName, $ii-1, 1); #40
$number = substr($RegisterKEY, $ii + 5, 1);
$ascvalue = ord($letter);
if ($ascvalue <= 80){
if ($divisor1 == $divisor2){
$ascsum = $ascvalue + $number;
}else{
$ascsum = $ascvalue + (2 * $number);
}
}elsif ($ascvalue > 80){
if ($divisor1 == $divisor2){
$ascsum = $ascvalue - $number;
}else{
$ascsum = $ascvalue - (2 * $number);
}
}
if ($ascsum == 92){ #backslash
$ascsum = $ascsum - (2 * $number);
}
if ($ascsum == 42){ #ampersand
$ascsum = $ascsum + (4 * $number);
}
if ($ascsum == 124){ #vertical line.
$ascsum = 75;
}
$KEY = $KEY . chr($ascsum);
}else{
goto tututu;
}
}
#print "$KEY
";
tututu: #continue.
return $KEY;
}
__END__
print MAIL "Click here for website bidding.
";