#!/usr/bin/perl require "newauctionvars.pl"; require 'subber.lib'; require 'sea.lib'; require 'air.lib'; require 'condition.lib'; require 'auction_html.lib'; $basepath = '/u1/www/transportuniverse/auctiontrain/'; #use SelfLoader; #%%%%%%%%%%%%%%%%%%%%%%%% $regpath = '/u1/www/transportuniverse/auction/'; #%%%%%%%%%%%%%%%%%%%%%%%% #-Image Upload-----------------------------------------# use File::Copy; # needed for upload add-on $allowupload = 1; # 0 for no 1 for yes $uploadcharge = '0'; # ie -1.00 or set to zero '0' for no charge (for AccountFirst) $imageuploaddir = '/u1/www/transportuniverse/www/super/uploadedpictures'; $imageuploadurl = "http://www.transportuniverse.com/super/picturebin"; #--Image Upload END------------------------------------# $mailserver = "206.152.180.10"; ############################################## # The input query string is in the form # auction.cgi?[category]&[number]&[r|n|u|c|v] open THEBIDS, "$basepath/no_bids.txt"; ($no_bids) = ; close THEBIDS; open THEVIEWED, "$basepath/no_viewed.txt"; ($no_viewed) = ; close THEVIEWED; open THEPOST, "$basepath/no_post.txt"; ($no_post) = ; close THEPOST; open THEREGS, "$basepath/no_regs.txt"; ($no_regs) = ; close THEREGS; &header; ###Print The Page Header print "
LIVE AUCTIONS


\n"; ############################################## &get_form_data; # parse arguments from post @ARGV = split(/\\*\&/, $ENV{'QUERY_STRING'}); $ARGV[0] =~ s/\W//g; #$ARGV[1] =~ s/\D//g; if ($form{'action'} eq 'bid') { &procbid; } elsif ($form{'action'} eq 'new') { &procnew; } ################################## next lines are elsif ($form{'action'} eq 'viewhich') { &viewhich; } elsif ($form{'action'} eq 'addreport') { &addreport; } elsif ($form{'action'} eq 'processreport') { &processreport; } elsif ($form{'action'} eq 'addland') { &addland; } elsif ($form{'action'} eq 'addsea') { &addsea; } elsif ($form{'action'} eq 'addair') { &addair; } elsif ($form{'action'} eq 'addcondition') { &addcondition; } elsif ($form{'action'} eq 'accepted') { &accepted; } ################################## #--Image Upload----------------------------------------# # elsif ($ARGV[2] eq 'n') { &newitem; } elsif ($ARGV[2] eq 'n') { &uploadform; } elsif ($form{'picture'}) { &newitem; } elsif ($form{'pictureurl'}) { &newitem; } elsif (lc($ARGV[0]) eq 'uploaddone') { &newitem; } #--Image Upload END------------------------------------# elsif ($ARGV[2] eq 'a') { &dispcat; } #elsif ($ARGV[2] eq 'x') { &autoclose; } elsif ($ARGV[2] eq 'l') { &listall; } elsif ($ARGV[2] eq 'q') { &qonvert; } ################################## elsif ($form{'action'} eq 'selled') { &sellerchange; } elsif ($form{'action'} eq 'se') {&selleredit; } elsif ($form{'action'} eq 'selldel') { &selldel1; } ################################## elsif (($regdir ne "") && ($ARGV[0] eq $regdir)) { &dispcat; } # be sure nobody is trying to hack the user dir elsif (!(($ARGV[0]) && (-d "$basepath$ARGV[0]"))) { &dispcat; } ###elsif ($ARGV[1] eq 'subcat') { &dispsubcat; } elsif ($ARGV[2] eq 'r') { &remitem; } elsif ($ARGV[2] eq 'e') { &editem; } elsif (!(($ARGV[1]) && (-f "$basepath$ARGV[0]/$ARGV[1].dat"))) { &displist; } else { &dispitem; } ############################################## &footer; ### Print The Page Footer ############################################## # Sub: Display List Of Categories # HTML can be enhanced to replace the current static pages sub dispcat { print "

Live Auction Categories

\n"; print ""; foreach $key (sort keys %category) { opendir THEDIR, "$basepath$key" || die "Unable to open directory: $!"; @allfiles = grep -T, map "$basepath$key/$_", readdir THEDIR; closedir THEDIR; $numfiles = @allfiles; umask(000); # UNIX file permission junk mkdir("$basepath$key", 0777) unless (-d "$basepath$key"); print ""; } print "
CategoryItems
$category{$key}$numfiles
\n"; } ############################################## ############################################## # Sub: Display List Of Items sub displist { print "$category{$ARGV[0]}\n"; print "\n"; print "\n"; opendir THEDIR, "$basepath$ARGV[0]" || die "Unable to open directory: $!"; @allfiles = readdir THEDIR; closedir THEDIR; ##################################### # foreach $file (sort { int($b) <=> int($a) } @allfiles) { ### the old line ### my $pagelength = 25; $ENV{QUERY_STRING}=~/\&page=(\d*)/; $form{page} = int $1; $ENV{QUERY_STRING}=~/\&+pb=(\d*)/; $form{pb} = int $1; $ENV{QUERY_STRING} = join("&", @ARGV[0..6]); my $pagebreak = $form{pb} || $pagelength; my ($icount, $pcount) = (0,0); foreach $file (sort { int($b) <=> int($a) } @allfiles) { next if $file=~/^\.{1,2}$/; if(++$icount > $pagebreak){$icount=1; $pcount++} next if $pcount != $form{page}; ##################################### ########################## ADDON: Select alternating row color. if ($i % 2 == 1) { $colortablebody = $odd_row_color; } else { $colortablebody = $even_row_color; } $i++; $ii++; ########################### END: Select alternating row color. if (-T "$basepath$ARGV[0]/$file") { open THEFILE, "$basepath$ARGV[0]/$file"; ($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids) = ; close THEFILE; chomp($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids); @lastbid = split(/\[\]/,$bids[$#bids]); $file =~ s/\.dat//; @closetime = localtime($file); $closetime[4]++; $thm = $item . "thm\.jpg"; $piciconpath = ""; if (-e "/u1/www/transportuniverse/www/thm/$thm") { $piciconpath = ""; } $reporticonpath = ""; $camera=""; $camera =$piciconpath if (($pic eq "Y") || ($image ne "")); $report =$reporticonpath if ($report eq "Y"); $link = "$make $model"; print "\n"; } } print "
VEHICLEYEARLOCATIONPRICE
$camera$report$link
$title
$year$state$country\$$price

\n"; #-------------------------------------------------------------------# # Previous Link if($form{page} > 0){print " Previous Page "} else{print " Previous Page "} print "["; # Numbers: for(0..$form{page}-1){print " @{[$_+1]} "} # Current page number: print " ", int($form{page})+1, " "; # Numbers again: for($form{page}+1..$pcount){print " @{[$_+1]} "} # All-Link, comment out if not used: if($pcount>0){print " All "} print "]"; # Next Link if($form{page} < $pcount){print " Next Page "} else{print " Next Page "} #------------------------------------------------------------------# } ############################################## # Sub: Display Item sub dispitem { open THEFILE, "$basepath$ARGV[0]/$ARGV[1].dat"; ($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids) = ; close THEFILE; chomp($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids); @firstbid = split(/\[\]/,$bids[0]); @lastbid = split(/\[\]/,$bids[$#bids]); $nowtime = localtime(time); $closetime = localtime($ARGV[1]); $image = "" if ($image); $image2 = "" if ($image2); $image3 = "" if ($image3); $image4 = "" if ($image4); $reservemet = ""; $reservemet = "(reserve price not yet met)" if ($lastbid[2] < $reserve); $reservemet = "(reserve price met)" if (($lastbid[2] >= $reserve) && ($reserve > 0)); $desired_file = $ARGV[1] . "r" . ".txt"; print "
$title
Item Number\: $ARGV[1]
Category:$category{$ARGV[0]}
Location: $city  $state  $country
Auction Closes: $closetime
PRICE: \$$lastbid[2] $reservemet

"; if ($report eq "Y") { print "
"; } print "
Contact Information
$cont
Description
$desc

"; print "$image$image2$image3$image4
\n"; if ((time > $ARGV[1]) && (time > (60 * $aftermin + $thebid[3]))) { print "THIS AUCTION HAS ENDED BUT MAY BE
REPOSTED BY THE SELLER.
CLICK HERE{$ARGV[0]}
TO CHECK THE CATEGORY FOR THE RELIST OF THIS ITEM.
"; &autoclose; } else { &placebid; } } ############################################## # Sub: Place Bid on Item sub placebid { $lowbid = &parsebid($lastbid[2] + $inc); print <<"EOF";


The Current High Bid Is: \$$lastbid[2]
You Must Bid At Least: \$$lowbid
Buyers, Place Your Bid Here!
User Name:
Password:
The Amount You Wish To Bid On This Item:       \$

Please note that by placing a bid you are making a an offer to BUY this item. You have established a contract between yourself and the seller. This Auction has been started inorder to sell this item to the highest bid (where there is NO RESERVE or THE RESERVE HAS BEEN MET). Once you place a bid, you may not retract it. In some states, it is illegal to win an auction and not purchase or sell the item

Seller, Add Your Condition Report Here!

There is no extra charge to fill out a Report. Fill out as much or as little as you wish. Think of the report as a standard tool designed by experts to assist you.
It takes less time to fill out a complete report than it takes to compose a random, subjective, or vague description...The report effectively details the precise condition of your item or vehicle.
UserName:
Password:

Choose Vehicle Type\:
LAND     SEA     AIR     OTHER
 



Seller, Edit Your Ad With Ease Here!

The Seller of this item may add to the description by entering both UserName and Password below, and clicking on the EDIT YOUR AD button.  This is useful if you wish to add photos or update information about this listing.

UserName: Password:

 


EOF ######################### SHOW BID HISTORY #print "
Bid History
\n"; # print "Starting Bid: \$$firstbid[2]
"; # foreach $bid (@bids) { # @thebid = split(/\[\]/,$bid); # $bidtime = localtime($thebid[3]); # print "$thebid[0] \($bidtime\) - \$$thebid[2]
"; # } ########################## $nowbid = &parsebid($lastbid[2]); #&sendemail('postmaster@transportuniverse.com', 'AUCTION VIEWED standard', 'nobody', $mailserver, "Someone has viewed this auction listing\n\nItem Number\: $ARGV[1]\n$ARGV[0]\n$year, $make, $model\nCurrent Bid\: $nowbid\nMust Bid\: $lowbid\n\n$signature"); } ############################################## # Sub: time left # revised w/ proper english - smarter output sub timeleft { ($second, $minute, $hour, $dayofmonth, $month, $year, $weekday, $dayofyear, $iddst) = localtime($_[0]); ($csecond, $cminute, $chour, $cdayofmonth, $cmonth, $cyear, $cweekday, $cdayofyear, $ciddst) = localtime(time); ############## Fixed timeleft with date for a new year ################################ ## Turn of a non leap new year ## if ($dayofyear < 31) { if ($cmonth == 12) { if (($cyear ne 99) or ($cyear ne 03) or ($cyear ne 07) or ($cyear ne 11)) { $i = 365; $dayofyear = ($dayofyear + 365); } } } ### Y2K ### if (($cmonth == 11) and ($cyear == 99)) { $i = 365; $dayofyear = ($dayofyear + 365); } ## Leap Year ### if (($cmonth == 11) and ($cyear == 03) or ($cyear == 07) or ($cyear == 11)) { $i = 366; $dayofyear = ($dayofyear + 366); } if ($dayofyear > $i) { $dayofyear = $dayofyear - $i; } if ($dayofyear < $cdayofyear) { $dayofyear = $dayofyear + $i; } ####################################################################################### if ($second >= $csecond) { $rsecond = ($second - $csecond); } else { $rsecond = (($second + 60) - $csecond); $minute = ($minute - 1); } if ($minute >= $cminute) { $rminute = ($minute - $cminute); } else { $rminute = (($minute + 60) - $cminute); $hour = ($hour - 1); } if ($hour >= $chour) { $rhour = ($hour - $chour); } else { $rhour = (($hour + 24) - $chour); $dayofyear = ($dayofyear - 1); } if ($dayofyear == $cdayofyear) { if($rhour < 1) { if($rminute < 1) { if ($rminute = 0) { $timeremain = " auction closed"; } else { $timeremain = sprintf('%02d seconds', $rsecond); @s = split / /, $timeremain; if ($s[0] eq "01") {$s[1] = "second";} $timeremain = " " . "$s[0] $s[1]"; }} else { $timeremain = sprintf('%02d minutes %02d seconds', $rminute, $rsecond); @s = split / /, $timeremain; if ($s[0] eq "01") {$s[1] = "minute";} if ($s[2] eq "01") {$s[3] = "second";} $timeremain = " " . "$s[0] $s[1] $s[2] $s[3]"; }} else { $timeremain = sprintf('%02d hours %02d minutes', $rhour, $rminute); @s = split / /, $timeremain; if ($s[0] eq "01") {$s[1] = "hour";} if ($s[2] eq "01") {$s[3] = "minute";} $timeremain = " " . "$s[0] $s[1] $s[2] $s[3]"; }} else { $rday = ($dayofyear - $cdayofyear); if ($rday <= -1) { $timeremain = " auction closed"; } else { $timeremain = sprintf('%02d days %02d hours +', $rday, $rhour); @s = split / /, $timeremain; if ($s[0] eq "01") {$s[1] = "day";} if ($s[2] eq "01") {$s[3] = "hour";} if ($s[2] eq "00") {($s[3], $s[2], $s[4]) = (" 1 hour","\<","");} $timeremain = "$s[0] $s[1] $s[2] $s[3] $s[4]"; } } return "$timeremain"; } ############################################## # Sub: Process Bid sub procbid { if (($regdir ne "") && !($newbidflag)) { $form{'USERNAME'} =~ s/\W//g; $form{'USERNAME'} = lc($form{'USERNAME'}); $form{'USERNAME'} = ucfirst($form{'USERNAME'}); $form{'PAGENT'} =~ s/\W//g; $form{'PAGENT'} = lc($form{'PAGENT'}); $form{'PAGENT'} = ucfirst($form{'PAGENT'}); &oops('USERNAME') unless (open(REGFILE, "$regpath$regdir/$form{'USERNAME'}.dat")); ($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids) = ; close REGFILE; chomp($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids); &oops('PASSWORD') unless ((lc $password) eq (lc $form{'PASSWORD'})); } &oops('USERNAME') unless ($form{'USERNAME'}); &oops('EMAIL') unless ($form{'EMAIL'} =~ /.+\@.+/); &oops('BID') unless ($form{'BID'} =~ /^(\d+\.?\d*|\.\d+)$/); $form{'BID'} = &parsebid($form{'BID'}); &oops('ADDRESS1') unless ($form{'ADDRESS1'}); &oops('ADDRESS2') unless ($form{'ADDRESS2'}); &oops('ADDRESS3') unless ($form{'ADDRESS3'}); $timenum = time; $thetime = localtime(time); &oops('ITEM') unless (open ITEM, "$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat"); ($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids) = ; close ITEM; chomp($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids); @lastbid = split(/\[\]/,$bids[$#bids]); if ((((time <= $form{'ITEM'}) || (time <= (60 * $aftermin + $form{'ITEM'}))) && ($form{'BID'} >= $lastbid[2] + $inc)) || ($newbidflag == 1)) { &oops('ITEM') unless (open NEWITEM, ">>$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat"); &filelock if ($flock); print NEWITEM "\n$form{'USERNAME'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; if (($cat2 ne "") && ($cat2 ne $form{'CATEGORY'})) { open NEWITEM, ">>$basepath$cat2/$form{'ITEM'}.dat"; &filelock if ($flock); print NEWITEM "\n$form{'USERNAME'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; } if (($cat3 ne "") && ($cat3 ne $form{'CATEGORY'})) { open NEWITEM, ">>$basepath$cat3/$form{'ITEM'}.dat"; &filelock if ($flock); print NEWITEM "\n$form{'USERNAME'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; } if (($cat4 ne "") && ($cat4 ne $form{'CATEGORY'})) { open NEWITEM, ">>$basepath$cat4/$form{'ITEM'}.dat"; &filelock if ($flock); print NEWITEM "\n$form{'USERNAME'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; } print "
Thank you, $form{'USERNAME'}, your bid has been placed on Item Number $form{'ITEM'}, for the amount of \$$form{'BID'}.
.
You may want to print this notice as confirmation of your bid.

CLICK HERE
to return to the item


Or use the menu on the left to further navigate the sites\n"; if ($cat2 eq "") { $item2 eq ""; } else { $item2 = "$form{'ITEM'}"; } if ($cat3 eq "") { $item3 eq ""; } else { $item3 = "$form{'ITEM'}"; } if ($cat4 eq "") { $item4 eq ""; } else { $item4 = "$form{'ITEM'}"; } $flag=0; foreach $userbid(@userbids) { $flag=1 if ("$form{'CATEGORY'}$form{'ITEM'}" eq $userbid); } if ($flag==0 && $regdir ne "") { &oops('USERNAME') unless (open(REGFILE, ">>$regpath$regdir/$form{'USERNAME'}.dat")); print REGFILE "\n$form{'CATEGORY'}$form{'ITEM'}\[\]$cat2$item2\[\]$cat3$item3\[\]$cat4$item4"; close REGFILE; } #&sendemail($lastbid[1], 'TRANSPORT UNIVERSE A bid has been placed!', 'nobody', $mailserver, "A higher bid has been placed on $title\! If you are a bidder on this auction, you have been outbid. If you want to place a higher bid, please go to\:\n\n\thttp://$scripturl$ENV{'SCRIPT_NAME'}\?$form{'CATEGORY'}\&$form{'ITEM'}\n\nThe current high bid is \$$form{'BID'}.\n$signature\n") if (($newbidflag != 1) && $scripturl); #&sendemail('postmaster@transportuniverse.com', ' AUCTION BID ON', 'nobody', $mailserver, "A bid has been placed on the AUCTION site\nTITLE\: $form{'TITLE'}\n\nVISIT\: http://$scripturl$ENV{'SCRIPT_NAME'}?$form{'CATEGORY'}\&$form{'ITEM'}\n\nTHIS BID IS\: \$$form{'BID'}.\nBIDDER IS\: $lastbid[1]\n$signature\n"); } else { print "Either the auction is closed or your bid is too low.
Hit the back button and reload to get the latest auction statistics, then please try again!\n"; } } ############################################## # Sub: Process New Item Price sub thankyou { if (($regdir ne "") && !($newbidflag)) { $form{'USERNAME'} =~ s/\W//g; $form{'USERNAME'} = lc($form{'USERNAME'}); $form{'USERNAME'} = ucfirst($form{'USERNAME'}); $form{'PAGENT'} =~ s/\W//g; $form{'PAGENT'} = lc($form{'PAGENT'}); $form{'PAGENT'} = ucfirst($form{'PAGENT'}); &oops('USERNAME') unless (open(REGFILE, "$regpath$regdir/$form{'USERNAME'}.dat")); ($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids) = ; close REGFILE; chomp($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids); &oops('PASSWORD') unless ((lc $password) eq (lc $form{'PASSWORD'})); $filenumba = $form{'ITEM'}; $filenumba =~ s/\D//g; } &oops('USERNAME') unless ($form{'USERNAME'}); &oops('EMAIL') unless ($form{'EMAIL'} =~ /.+\@.+/); &oops('PRICE') unless ($form{'BID'} =~ /^(\d+\.?\d*|\.\d+)$/); $form{'BID'} = &parsebid($form{'BID'}); &oops('ADDRESS1') unless ($form{'ADDRESS1'}); &oops('ADDRESS2') unless ($form{'ADDRESS2'}); &oops('ADDRESS3') unless ($form{'ADDRESS3'}); $timenum = time; $thetime = localtime(time); &oops('ITEM') unless (open ITEM, "$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat"); ($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids) = ; close ITEM; chomp($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids); @lastbid = split(/\[\]/,$bids[$#bids]); if ((((time <= $form{'ITEM'}) || (time <= (60 * $aftermin + $lastbid[3]))) && ($form{'BID'} >= $lastbid[2] + $inc)) || ($newbidflag == 1)) { &oops('ITEM') unless (open NEWITEM, ">>$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat"); &filelock if ($flock); print NEWITEM "\n$form{'USERNAME'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; ############# WRITE LINE TO SEARCH DATABASE ############################ $url = "http://www.transportuniverse.com/cgi-transportuniverse/auction.cgi\?$form{'CATEGORY'}\&$form{'ITEM'}"; open DATFILE, ">>/u1/www/transportuniverse/db2/super.txt"; print DATFILE "\|$pic\| \|$year\|$make\|$model\|$vin\|$interior\|$exterior\|$mileage\|$price\|USD\|$zip\|$country\|$state\|$city\|$item\|0\|$url\|$title\|\n"; close DATFILE; ##################################################################### if ($form{'CATEGORY2'} ne "") { &oops('ITEM') unless (open NEWITEM, ">>$basepath$form{'CATEGORY2'}/$form{'ITEM'}.dat"); &filelock if ($flock); print NEWITEM "\n$form{'USERNAME'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; } if ($form{'CATEGORY3'} ne "") { &oops('ITEM') unless (open NEWITEM, ">>$basepath$form{'CATEGORY3'}/$form{'ITEM'}.dat"); &filelock if ($flock); print NEWITEM "\n$form{'USERNAME'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; } if ($form{'CATEGORY4'} ne "") { &oops('ITEM') unless (open NEWITEM, ">>$basepath$form{'CATEGORY4'}/$form{'ITEM'}.dat"); &filelock if ($flock); print NEWITEM "\n$form{'USERNAME'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; } print "
$form{'USERNAME'}, your Item Number is $form{'ITEM'}.
Your item has been listied in the following categories:
$category{$form{'CATEGORY'}}
$category{$form{'CATEGORY2'}}
$category{$form{'CATEGORY3'}}
$category{$form{'CATEGORY4'}}

You may wish to print this notice as confirmation of your Auction Listing.

CLICK HERE TO VIEW YOUR LISTING.


FROM THERE YOU SHOULD ADD A FREE COMPREHENSIVE CONDITION REPORT FOR YOUR LISTING


Attract serious interest from serious buyers by providing them with the essential details found in one our exclusive reports.
\n"; if ($form{'CATEGORY2'} eq "") { $item2 eq ""; } else { $item2 = "$form{'ITEM'}"; } if ($form{'CATEGORY3'} eq "") { $item3 eq ""; } else { $item3 = "$form{'ITEM'}"; } if ($form{'CATEGORY4'} eq "") { $item4 eq ""; } else { $item4 = "$form{'ITEM'}"; } $flag=0; foreach $userbid(@userbids) { $flag=1 if ("$form{'CATEGORY'}$form{'ITEM'}" eq $userbid); } if ($flag==0 && $regdir ne "") { &oops('USERNAME') unless (open(REGFILE, ">>$regpath$regdir/$form{'USERNAME'}.dat")); print REGFILE "\n$form{'CATEGORY'}$form{'ITEM'}\[\]$form{'CATEGORY2'}$item2\[\]$form{'CATEGORY3'}$item3\[\]$form{'CATEGORY4'}$item4"; close REGFILE; } $bob = 1; } else { print "Either the auction is closed or your bid is too low.
Hit the back button and reload to get the latest auction stats, then try again!\n"; } } ############################################## # Sub: Close Auction # Is now used from dispitem # ended items do not autorelist. sub closeit { if ($ARGV[0] ne $closedir) { # We'll use the @firstbid and @lastbid info defined in &dispitem if ($closedir) { umask(000); # UNIX file permission junk mkdir("$basepath$closedir", 0777) unless (-d "$basepath$closedir"); print "Please notify Transport Universe administration that this item cannot be copied to the closed directory even though it is closed.\n" unless &movefile("$basepath$ARGV[0]/$ARGV[1].dat", "$basepath$closedir/$ARGV[0]$ARGV[1].dat"); } else { print "Please notify the Transport Universe administration that this item cannot be removed even though it is closed.\n" unless unlink("$basepath$ARGV[0]/$ARGV[1].dat"); } if ($lastbid[2] >= $reserve) { &sendemail($lastbid[1], "Transport Universe Live Auction Close: $title", $firstbid[1], $mailserver, "Congratulations! You are the winner of Transport Universe Auction Item Number $ARGV[1].\nYour winning bid was \$$lastbid[2].\n\nPlease contact the seller to make arrangements for payment and shipping:\n\n$firstbid[4]\n$firstbid[5]\n$firstbid[6]\n$firstbid[1]\n$signature\n"); } else { #&sendemail($lastbid[1], "Transport Universe Auction Close: $title", $firstbid[1], $mailserver, "Notice\: You were the high bidder on auction number $ARGV[1].\nYour bid was \$$lastbid[2].\n\nUnfortunately, your bid did not meet the seller\'s reserve price...\n$signature\n"); } &sendemail($firstbid[1], "Transport Universe Auction Close: $title", $lastbid[1], $mailserver, "Auction Number $ARGV[1] Is Now Closed.\nThe high bid was \$$lastbid[2] (Your reserve was: \$$reserve)Please consider Relisting your item again.\n$signature\n"); } } ############################################## # Sub: Remove Item sub remitem { if ($ARGV[3] eq $adminpass) { if (unlink("$basepath$ARGV[0]/$ARGV[1].dat")) { print "File Successfully Removed!\n"; } else { print "File Could Not Be Removed!\n"; } } else { print "Sorry... Incorrect administrator password for delete!\n"; } } ############################## # Sub: Add New Item sub newitem { $inc = "1.00"; if ($form{'REPOST'}) { if (open (THEFILE, "$basepath$closedir/$form{'REPOST'}.dat")) { ($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids) = ; $title =~ s/\"//g; # quotes cause problems for a text input field close THEFILE; } } print <<"EOF";

SELL YOUR ITEM WITH LIVE AUCTIONS


CLICK HERE FOR FREE AND EASY REGISTRATION 
CLICK HERE TO SEE LIVE AUCTION LISTING FEES

Remember, all listings under \$5000 are free!
\n"; #--Image Upload----------------------------------------# if ($ARGV[0] eq 'uploaddone') { $form{'IMAGEUPLOAD'} = "YES"; if ($ARGV[2] ne '') { $form{'EXTENSION'} = $ARGV[2]; print ""; } $image = $ARGV[1]; print ""; } else { $form{'IMAGEUPLOAD'} = "NO"; print ""; $image = "NONE" if $form{'picture'}; $image = $form{'pictureurl'} if $form{'pictureurl'}; } print ""; #--Image Upload END------------------------------------# print <<"EOF";
Title: 
Place descriptive words in your title such as NEW, CUSTOM, RARE, TAKE OVER LEASE, etc.
When buyers use our comprehensive search, they often include such terms to find specific vehicles.
EXAMPLE: 2000 Dodge Viper NO MILEAGE?! Custom Show winner.
Make:  Model:
Year:  Price: \$
Bid Increment:  \$Reserve: \$
Mileage:  VIN# / Model# / Stock#: 
Exterior Color: Interior Color:  

Actual location of this item:

Town/City:
State/Province:
Country:
Zip Code:
Contact Information:


How will buyers contact you for purchase or information?
MULTIPLE CATEGORY LISTING
Choose up to four categories that represent this item
EOF print "\n"; } } print "<\/SELECT>    Optional
\n"; print "\n"; } } print "<\/SELECT>    Optional
Image: "; print " $image
Description:
Your UserName:
Your Password:
Agent ID Name:



Live Auction Fees

Selling Price

Fee

\$0.01               TO    \$5000

FREE!

\$5,000.01        TO    \$50,000

\$9.95

\$50,000.01      TO    \$100,000

\$19.95

\$100,000.01    TO    \$1,000,000

\$29.95

\$1,000,000.01          AND UP

\$49.95

CLICK HERE TO LIST YOUR ITEM NOW!
EOF } ############################################## # Sub: Preview sub preview { $nowtime = localtime(time); $closetime = localtime($form{'ITEM'}); #--Image Upload----------------------------------------# # $image = "" if ($form{'IMAGE'}); if ($form{'IMAGEUPLOAD'} eq 'NO') { $image = $form{'IMAGE'} if ($form{'IMAGE'}); $image = "" if ($form{'IMAGE'} eq 'http://'); $image = "" if ($form{'IMAGE'} eq 'NONE'); } if ($form{'IMAGEUPLOAD'} eq 'YES') { $image = ""; }; #--Image Upload END------------------------------------# $desc = "$form{'DESCRIPTION'}" if ($form{'DESCRIPTION'}); $cont = "$form{'CONTACT'}" if ($form{'CONTACT'}); print "

PREVIEW

\n"; print "
$form{'TITLE'}
Category1: $form{'CATEGORY'}
Category2: $form{'CATEGORY2'}
Category3: $form{'CATEGORY3'}
Category4: $form{'CATEGORY4'}
Location: $form{'CITY'}  $form{'STATE'}  $form{'COUNTRY'}
Auction Closes: $closetime
Or $aftermin minutes after last bid...
Starting Bid: \$$form{'BID'}


If this is satisfactory, Or click the BACK button on your browser to edit the item. Please fill in all fields. You may have to re-enter your password.
Thank You.



\n"; foreach $key (keys %form) { $form{$key} =~ s/\>/\[greaterthansign\]/gs; $form{$key} =~ s/\\n"; } print "
\n"; print "

$cont


Contact Information

$desc


Description

"; print "
$image
\n"; }############################################## # Sub: Process New Item sub procnew { if ($regdir ne "") { $form{'USERNAME'} =~ s/\W//g; $form{'USERNAME'} = lc($form{'USERNAME'}); $form{'USERNAME'} = ucfirst($form{'USERNAME'}); $form{'PAGENT'} =~ s/\W//g; $form{'PAGENT'} = lc($form{'PAGENT'}); $form{'PAGENT'} = ucfirst($form{'PAGENT'}); &oops('USERNAME') unless (open(REGFILE, "$regpath$regdir/$form{'USERNAME'}.dat")); ($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids) = ; close REGFILE; chomp($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids); &oops('PASSWORD') unless ((lc $password) eq (lc $form{'PASSWORD'})); } #--Image Upload----------------------------------------# $form{'IMAGE'} = "" if ($form{'IMAGE'} eq "NONE"); #--Image Upload END------------------------------------# $form{'DAYS'} = 90; &oops('MAKE') unless ($form{'MAKE'}); &oops('MODEL') unless ($form{'MODEL'}); # &oops('VIN') unless ($form{'VIN'}); &oops('YEAR') unless ($form{'YEAR'}); # &oops('ZIP CODE') unless ($form{'ZIP'}); &oops('CITY') unless ($form{'CITY'}); &oops('STATE') unless ($form{'STATE'}); &oops('COUNTRY') unless ($form{'COUNTRY'}); &oops('DESCRIPTION') unless ($form{'DESCRIPTION'}); &oops('CONTACT') unless ($form{'CONTACT'}); &oops('PRICE') unless ($form{'BID'} =~ /^(\d+\.?\d*|\.\d+)$/); $form{'ITEM'} = ($form{'DAYS'} * 86400 + time); $form{'ITEM'} = ($form{'DAYS'} * 86400 + time) until (!(-f "$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat")); if ($form{'FROMPREVIEW'}) { foreach $key (keys %form) { $form{$key} =~ s/\[greaterthansign\]/\>/gs; $form{$key} =~ s/\[lessthansign\]/\$basepath$form{'CATEGORY4'}/temp/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'ITEM'}\nT\.U\.\n$form{'TYPE'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}\n$form{'USERNAME'}\n$form{'YEAR'}\n$form{'MAKE'}\n$form{'MODEL'}\n$form{'VIN'}\n$form{'MILEAGE'}\n$form{'INTERIOR'}\n$form{'EXTERIOR'}\n$form{'BID'}\n$form{'CURRENCY'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'CITY'}\n$form{'STATE'}\n$form{'COUNTRY'}\n$form{'ZIP'}\n \n$picyes\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'TITLE'}\n$form{'CONTACT'}\n$form{'DESCRIPTION'}"; close NEWAUCTION; } if ($form{'CATEGORY3'} ne "") { mkdir("$basepath$form{'CATEGORY3'}/temp" , 0777); &oops('ITEM') unless (open(NEWAUCTION, ">$basepath$form{'CATEGORY3'}/temp/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'ITEM'}\nT\.U\.\n$form{'TYPE'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}\n$form{'USERNAME'}\n$form{'YEAR'}\n$form{'MAKE'}\n$form{'MODEL'}\n$form{'VIN'}\n$form{'MILEAGE'}\n$form{'INTERIOR'}\n$form{'EXTERIOR'}\n$form{'BID'}\n$form{'CURRENCY'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'CITY'}\n$form{'STATE'}\n$form{'COUNTRY'}\n$form{'ZIP'}\n \n$picyes\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'TITLE'}\n$form{'CONTACT'}\n$form{'DESCRIPTION'}"; close NEWAUCTION; } if ($form{'CATEGORY2'} ne "") { mkdir("$basepath$form{'CATEGORY2'}/temp" , 0777); &oops('ITEM') unless (open(NEWAUCTION, ">$basepath$form{'CATEGORY2'}/temp/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'ITEM'}\nT\.U\.\n$form{'TYPE'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}\n$form{'USERNAME'}\n$form{'YEAR'}\n$form{'MAKE'}\n$form{'MODEL'}\n$form{'VIN'}\n$form{'MILEAGE'}\n$form{'INTERIOR'}\n$form{'EXTERIOR'}\n$form{'BID'}\n$form{'CURRENCY'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'CITY'}\n$form{'STATE'}\n$form{'COUNTRY'}\n$form{'ZIP'}\n \n$picyes\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'TITLE'}\n$form{'CONTACT'}\n$form{'DESCRIPTION'}"; close NEWAUCTION;; } if ($form{'CATEGORY'} ne "") { mkdir("$basepath$form{'CATEGORY'}/temp" , 0777); &oops('ITEM') unless (open(NEWAUCTION, ">$basepath$form{'CATEGORY'}/temp/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'ITEM'}\nT\.U\.\n$form{'TYPE'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}\n$form{'USERNAME'}\n$form{'YEAR'}\n$form{'MAKE'}\n$form{'MODEL'}\n$form{'VIN'}\n$form{'MILEAGE'}\n$form{'INTERIOR'}\n$form{'EXTERIOR'}\n$form{'BID'}\n$form{'CURRENCY'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'CITY'}\n$form{'STATE'}\n$form{'COUNTRY'}\n$form{'ZIP'}\n \n$picyes\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'TITLE'}\n$form{'CONTACT'}\n$form{'DESCRIPTION'}"; close NEWAUCTION; } #&sendemail('postmaster@transportuniverse.com', ' Auction Ad Posted', 'nobody', $mailserver, "A listing has been placed in the TEMP bin on the AUCTION site.\n\nUSER NAME\: $form{'USERNAME'}\nTITLE\: $form{'TITLE'}\n\nVISIT\: http\:\/\/www.transportuniverse.com\/cgi-transportuniverse\/auction.cgi?$form{'CATEGORY'}\&$form{'ITEM'}\n\nPRICE is \$$form{'BID'}.\nThis listing has been placed in the following categories\:\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}\n\n$signature"); $newbidflag=1; $startprice = $form{'BID'}; if ($password eq "ismedit") { $startprice = 0; } if ($startprice > 5000) { &proccessor; } else { &oops('ITEM') unless (open(NEWAUCTION, ">$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'ITEM'}\nT\.U\.\n$form{'TYPE'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}\n$form{'USERNAME'}\n$form{'YEAR'}\n$form{'MAKE'}\n$form{'MODEL'}\n$form{'VIN'}\n$form{'MILEAGE'}\n$form{'INTERIOR'}\n$form{'EXTERIOR'}\n$form{'BID'}\n$form{'CURRENCY'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'CITY'}\n$form{'STATE'}\n$form{'COUNTRY'}\n$form{'ZIP'}\n \n$picyes\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'TITLE'}\n$form{'CONTACT'}\n$form{'DESCRIPTION'}"; close NEWAUCTION; &oops('ITEM') unless (open(NEWAUCTION, ">$basepath$form{'CATEGORY2'}/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'ITEM'}\nT\.U\.\n$form{'TYPE'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}\n$form{'USERNAME'}\n$form{'YEAR'}\n$form{'MAKE'}\n$form{'MODEL'}\n$form{'VIN'}\n$form{'MILEAGE'}\n$form{'INTERIOR'}\n$form{'EXTERIOR'}\n$form{'BID'}\n$form{'CURRENCY'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'CITY'}\n$form{'STATE'}\n$form{'COUNTRY'}\n$form{'ZIP'}\n \n$picyes\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'TITLE'}\n$form{'CONTACT'}\n$form{'DESCRIPTION'}"; close NEWAUCTION; &oops('ITEM') unless (open(NEWAUCTION, ">$basepath$form{'CATEGORY3'}/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'ITEM'}\nT\.U\.\n$form{'TYPE'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}\n$form{'USERNAME'}\n$form{'YEAR'}\n$form{'MAKE'}\n$form{'MODEL'}\n$form{'VIN'}\n$form{'MILEAGE'}\n$form{'INTERIOR'}\n$form{'EXTERIOR'}\n$form{'BID'}\n$form{'CURRENCY'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'CITY'}\n$form{'STATE'}\n$form{'COUNTRY'}\n$form{'ZIP'}\n \n$picyes\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'TITLE'}\n$form{'CONTACT'}\n$form{'DESCRIPTION'}"; close NEWAUCTION; &oops('ITEM') unless (open(NEWAUCTION, ">$basepath$form{'CATEGORY4'}/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'ITEM'}\nT\.U\.\n$form{'TYPE'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}\n$form{'USERNAME'}\n$form{'YEAR'}\n$form{'MAKE'}\n$form{'MODEL'}\n$form{'VIN'}\n$form{'MILEAGE'}\n$form{'INTERIOR'}\n$form{'EXTERIOR'}\n$form{'BID'}\n$form{'CURRENCY'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'CITY'}\n$form{'STATE'}\n$form{'COUNTRY'}\n$form{'ZIP'}\n \n$picyes\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'TITLE'}\n$form{'CONTACT'}\n$form{'DESCRIPTION'}"; close NEWAUCTION; # # # # # # # # # # # # # # # # # # # # # # # # # # # #List all paid registrations in /IDs/paythese/ to see what agents are due payment # $iddir = "IDs"; if (-e "/u1/www/transportuniverse/agents/$iddir/$form{'PAGENT'}.dat") { open(AGENTFILE, "/u1/www/transportuniverse/agents/$iddir/$form{'PAGENT'}.dat"); ($password, $email, $name, $address1, $address2, $phone, $referal) = ; close AGENTFILE; chomp($password, $email, $name, $address1, $address2, $phone, $referal); open NOPAY, ">>/u1/www/transportuniverse/agents/$iddir/paythese/$form{'PAGENT'}.dat"; print NOPAY "0\[\]$referal\[\]auction\[\]$form{'ITEM'}\[\]$form{'USERNAME'}\[\]$form{'CATEGORY'} $form{'CATEGORY2'} $form{'CATEGORY3'} $form{'CATEGORY4'}\n"; close NOPAY; open NOPAYAGENT, ">>/u1/www/transportuniverse/agents/$iddir/$form{'PAGENT'}.dat"; print NOPAYAGENT "0\[\]$referal\[\]auction\[\]$form{'ITEM'}\[\]$form{'USERNAME'}\[\]$form{'CATEGORY'} $form{'CATEGORY2'} $form{'CATEGORY3'} $form{'CATEGORY4'}\n"; close NOPAYAGENT; } # ################################## $newbidflag=1; &thankyou; } } else { &preview; } } ############################################## # Sub: parse bid sub parsebid { $_[0] =~ s/\,//g; @bidamt = split(/\./, $_[0]); $bidamt[0] = "0" if (!($bidamt[0])); $bidamt[0] = int($bidamt[0]); $bidamt[1] = substr($bidamt[1], 0, 2); $bidamt[1] = "00" if (length($bidamt[1]) == 0); $bidamt[1] = "$bidamt[1]0" if (length($bidamt[1]) == 1); return "$bidamt[0].$bidamt[1]"; } ############################################## # Sub: Oops! sub oops { print "



Please be sure to enter the proper information in the $_[0] section.

Please hit your browser's BACK button to try again!

\n"; exit; } ############################################## # Sub: Movefile(file1, file2) sub movefile { ($firstfile, $secondfile) = @_; return 0 unless open(FIRSTFILE,$firstfile); @lines=; close FIRSTFILE; return 0 unless open(SECONDFILE,">$secondfile"); foreach $line (@lines) { print SECONDFILE $line; } close SECONDFILE; return 0 unless unlink($firstfile); return 1; } ############################################## # SUB: Send E-mail sub sendemail { use Socket; $TO=$_[0]; @TO=split('\0',$TO); $SUBJECT=$_[1]; $REPLYTO=$_[2]; $REMOTE = $_[3]; $THEMESSAGE = $_[4]; if ($REMOTE =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) { $addr = pack('C4', $1, $2, $3, $4); } else { die("Bad IP address: $!"); } $port = 25 unless $port; $port = getservbyname($port,'tcp') if $port =~ /\D/; $proto = getprotobyname('tcp'); socket(S, PF_INET, SOCK_STREAM, $proto) or die("Socket failed: $!"); $sockaddr = 'S n a4 x8'; # shouldn't this be in Socket.pm? connect(S, pack($sockaddr, AF_INET, $port, $addr)) or die("Unable to connect: $!"); select(S); $| = 1; select(STDOUT); $a=; print S "HELO ${SERVERNAME}\n"; $a=; print S "MAIL FROM:postmaster\@transportuniverse\.com\n"; $a=; print S "RCPT TO:<$TO[0]>\n"; $a=; if ($#TO > 0) { foreach (1..$#TO) { print S "RCPT TO: $TO[$_]\n";$a=; } } print S "DATA \n"; $a=; print S "To: $TO[0]\n"; if ($#TO > 0) { foreach (1..$#TO) { print S "Cc: $TO[$_]\n"; } } print S "Subject: $SUBJECT\n"; # Print the body print S "$THEMESSAGE\n"; print S ".\n"; $a=; print S "QUIT"; close (S); } ############################################## # Sub: Get Form Data sub get_form_data { $buffer = ""; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs=split(/&/,$buffer); foreach $pair (@pairs) { @a = split(/=/,$pair); $name=$a[0]; $value=$a[1]; $value =~ s/\+/ /g; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/~!/ ~!/g; $value =~ s/[\n\r]/ /sg; #remove \n $value =~ s/\[\]//g; #remove [] push (@data,$name); push (@data, $value); } %form=@data; %form; } ############################################## # Sub: File Lock # This locks files when bidding takes place sub filelock { flock (NEWITEM, 2); seek(NEWITEM, 0, 2); } ############################################## # Sub: Seller edit auction sub selleredit { &oops('USERNAME') unless ($form{'USERNAME'}); &oops('PASSWORD') unless ($form{'PASSWORD'}); $form{'USERNAME'} =~ s/\W//g; $form{'USERNAME'} = lc($form{'USERNAME'}); $form{'USERNAME'} = ucfirst($form{'USERNAME'}); open REGFILE, "$regpath$regdir/$form{'USERNAME'}.dat"; ($password,$email,$add1,$add2,$add3,@junk) = ; chomp($password,$email,$add1,$add2,$add3,@junk); close REGFILE; open THEFILE, "$basepath$form{'CAT'}/$form{'ITEM'}.dat"; ($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids) = ; $title =~ s/\"//g; # quotes cause problems for a text input field chomp($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids); close THEFILE; @firstbid = split(/\[\]/,$bids[0]); @lastbid = split(/\[\]/,$bids[$#bids]); if ($firstbid[0] eq $form{'USERNAME'}) { if (lc($password) eq lc($form{'PASSWORD'})) { print <<"EOF";
Add to Auction
Title/Item Name:
No HTML
$title
Description:
This is the description originally placed with the auction!
$desc
New Text:
Anything you would like to add to your auction.
Offered By:$firstbid[0]
Current High Bid:\$$lastbid[2]
Auction Reserve Price:
You are not obligated to sell below this price.
\$$reserve
Bid Increment:\$$inc
EOF if ($firstbid[0] eq $lastbid[0]) { print <<"EOF";
This auction has no bids. You have the option of deleting it if you wish.
EOF } } else { print "
\n"; print "Incorrect Password!Please Try, Again\n"; print "
\n"; } } else { print "
\n"; print "Only the seller of this Auction may make modifications to the Listing!\n"; print "
\n"; } } ############################################## # Sub: Process Modified Auction sub sellerchange { &oops('ITEM') unless ($form{'ITEM'}); $form{'ITEM'} =~ s/\W//g; &oops('ITEM') unless (open(THEFILE, "$basepath$form{'CAT'}/$form{'ITEM'}.dat")); ($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids) = ; close THEFILE; chomp($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids); @firstbid = split(/\[\]/,$bids[0]); @lastbid = split(/\[\]/,$bids[$#bids]); $form{'IMAGE'} = $image if !($form{'IMAGE'}); $commtime = localtime(time); if ($form{'NEWDESC'} ne "") { $desc1 = $desc; $desc1 .= "
"; $desc1 .= "Added by the Seller on $commtime\:
$form{'NEWDESC'}"; } else { $desc1 = $desc; } &oops('ITEM') unless (open NEWITEM, ">$basepath$form{'CAT'}/$form{'ITEM'}.dat"); print NEWITEM "$title\n$reserve\n$inc\n$desc1\n$loca\n$image\n$image2\n$image3\n$image4\$cat1\n$cat2\n$cat3\n$cat4"; foreach $bad (@bids) { @thebid = split(/\[\]/,$bad); $bidtime = localtime($thebid[3]); print NEWITEM "\n$thebid[0]\[\]$thebid[1]\[\]$thebid[2]\[\]$thebid[3]\[\]$thebid[4]\[\]$thebid[5]\[\]$thebid[6]\[\]$thebid[7]"; $message = "This item has a bidding history that has not changed!"; } close NEWITEM; print "
\n"; print "$form{'TITLE'} has been successfully changed.
\n"; print $message; print "
\n"; #&sendemail('postmaster@transportuniverse.com', ' AUCTION EDITED BY SELLER', 'nobody', $mailserver, "AN AUCTION LISTING HAS BEEN EDITED\nTITLE\: $title\n\nVISIT\: http://$scripturl$ENV{'SCRIPT_NAME'}?$form{'CAT'}/$form{'ITEM'}.dat\n$signature\n"); } ############################################## # Sub: Remove Item sub selldel1 { if (unlink("$basepath$form{'CAT'}/$form{'ITEM'}.dat")) { print "
\n"; print "\n"; print "Your auction has been deleted!\n"; print "
\n"; } else { print "
\n"; print "\n"; print "File Could Not Be Removed!\n"; print "
\n"; } #&sendemail('postmaster@transportuniverse.com', ' AUCTION DELETED BY SELLER', 'nobody', $mailserver, "AN AUCTION LISTING HAS BEEN DELETED\nTITLE\: $title\n\nVISIT\: http://$scripturl$ENV{'SCRIPT_NAME'}?$form{'CAT'}/$form{'ITEM'}.dat\n$signature\n"); } ############################################## # Sub: Seller add engineer report # This allows the seller to add a report to the item. p.s. of course it works... # sub addreport { &oops('USERNAME') unless ($form{'USERNAME'}); &oops('PASSWORD') unless ($form{'PASSWORD'}); $form{'USERNAME'} =~ s/\W//g; $form{'USERNAME'} = lc($form{'USERNAME'}); $form{'USERNAME'} = ucfirst($form{'USERNAME'}); open REGFILE, "$regpath$regdir/$form{'USERNAME'}.dat"; ($password,$email,$add1,$add2,$add3,@junk) = ; chomp($password,$email,$add1,$add2,$add3,@junk); close REGFILE; open THEFILE, "$basepath$form{'CAT'}/$form{'ITEM'}.dat"; ($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids) = ; $title =~ s/\"//g; # quotes cause problems for a text input field chomp($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids); close THEFILE; open DATFILE, ">$basepath$form{'CAT'}/$form{'ITEM'}.dat"; &filelock if ($flock); print DATFILE "$item\n$site\n$type\n$cat1\n$cat2\n$cat3\n$cat4\n$seller\n$year\n$make\n$model\n$vin\n$mileage\n$interior\n$exterior\n$price\n$currency\n$reserve\n$inc\n$city\n$state\n$country\n$zip\nY\n$pic\n$image\n$image2\n$image3\n$image4\n$title\n$cont\n$desc\n@bids\n"; close DATFILE; if ($cat2 ne "") { open DATFILE, ">$basepath$cat2/$form{'ITEM'}.dat"; &filelock if ($flock); print DATFILE "$item\n$site\n$type\n$cat1\n$cat2\n$cat3\n$cat4\n$seller\n$year\n$make\n$model\n$vin\n$mileage\n$interior\n$exterior\n$price\n$currency\n$reserve\n$inc\n$city\n$state\n$country\n$zip\nY\n$pic\n$image\n$image2\n$image3\n$image4\n$title\n$cont\n$desc\n@bids\n"; close DATFILE; } if ($cat3 ne "") { open DATFILE, ">$basepath$cat3/$form{'ITEM'}.dat"; &filelock if ($flock); print DATFILE "$item\n$site\n$type\n$cat1\n$cat2\n$cat3\n$cat4\n$seller\n$year\n$make\n$model\n$vin\n$mileage\n$interior\n$exterior\n$price\n$currency\n$reserve\n$inc\n$city\n$state\n$country\n$zip\nY\n$pic\n$image\n$image2\n$image3\n$image4\n$title\n$cont\n$desc\n@bids\n"; close DATFILE; } if ($cat4 ne "") { open DATFILE, ">$basepath$cat4/$form{'ITEM'}.dat"; &filelock if ($flock); print DATFILE "$item\n$site\n$type\n$cat1\n$cat2\n$cat3\n$cat4\n$seller\n$year\n$make\n$model\n$vin\n$mileage\n$interior\n$exterior\n$price\n$currency\n$reserve\n$inc\n$city\n$state\n$country\n$zip\nY\n$pic\n$image\n$image2\n$image3\n$image4\n$title\n$cont\n$desc\n@bids\n"; close DATFILE; } @firstbid = split(/\[\]/,$bids[0]); @lastbid = split(/\[\]/,$bids[$#bids]); $reporttype = $form{'reporttype'}; $numba = $form{'ITEM'}; if ($firstbid[0] eq $form{'USERNAME'}) { if (lc($password) eq lc($form{'PASSWORD'})) { if ($reporttype=~ m/land/) { &addland; } elsif ($reporttype=~ m/sea/) { &addsea; } elsif ($reporttype=~ m/air/) { &addair; } elsif ($reporttype=~ m/condition/) { &addcondition; } else { print "not working yet\n\n"; } } else { print "
\n"; print "Incorrect Password!\n"; print "
\n"; } } else { print "
\n"; print "Only the seller may make modifications to the listing!\n"; print "
\n"; } } ################################# sub Parse_Form { if ($ENV{'REQUEST_METHOD'} eq 'GET') { @pairs = split(/&/, $ENV{'QUERY_STRING'}); } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); if ($ENV{'QUERY_STRING'}) { @getpairs =split(/&/, $ENV{'QUERY_STRING'}); push(@pairs,@getpairs); } } else { print "Content-type: text/html\n\n"; print "

Use Post or Get"; } foreach $pair (@pairs) { ($key, $value) = split (/=/, $pair); $key =~ tr/+/ /; $key =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~s///g; if ($formdata{$key}) { $formdata{$key} .= ", $value"; } else { $formdata{$key} = $value; } } } ################################# sub ErrorMessage { print "Content-type: text/html\n\n"; print "The server can't open the file. It either doesn't exist or the permissions are wrong. \n"; exit; } ################################# ############################################## # Sub: Process Item Listing and go to Payment Form # sub proccessor { if (($regdir ne "") && !($newbidflag)) { $form{'USERNAME'} =~ s/\W//g; $form{'USERNAME'} = lc($form{'USERNAME'}); $form{'USERNAME'} = ucfirst($form{'USERNAME'}); $form{'PAGENT'} =~ s/\W//g; $form{'PAGENT'} = lc($form{'PAGENT'}); $form{'PAGENT'} = ucfirst($form{'PAGENT'}); &oops('USERNAME') unless (open(REGFILE, "$regpath$regdir/$form{'USERNAME'}.dat")); ($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids) = ; close REGFILE; chomp($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids); &oops('PASSWORD') unless ((lc $password) eq (lc $form{'PASSWORD'})); } &oops('USERNAME') unless ($form{'USERNAME'}); &oops('EMAIL') unless ($form{'EMAIL'} =~ /.+\@.+/); &oops('BID') unless ($form{'BID'} =~ /^(\d+\.?\d*|\.\d+)$/); $form{'BID'} = &parsebid($form{'BID'}); &oops('ADDRESS1') unless ($form{'ADDRESS1'}); &oops('ADDRESS2') unless ($form{'ADDRESS2'}); &oops('ADDRESS3') unless ($form{'ADDRESS3'}); $timenum = time; $thetime = localtime(time); &oops('ITEM') unless (open ITEM, "$basepath$form{'CATEGORY'}/temp/$form{'ITEM'}.dat"); ($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids) = ; close ITEM; chomp($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids); @lastbid = split(/\[\]/,$bids[$#bids]); if ((((time <= $form{'ITEM'}) || (time <= (60 * $aftermin + $lastbid[3]))) && ($form{'BID'} >= $lastbid[2] + $inc)) || ($newbidflag == 1)) { &oops('ITEM') unless (open NEWITEM, ">>$basepath$form{'CATEGORY'}/temp/$form{'ITEM'}.dat"); &filelock if ($flock); print NEWITEM "\n$form{'USERNAME'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; if ($form{'CATEGORY2'} ne "") { &oops('ITEM') unless (open NEWITEM, ">>$basepath$form{'CATEGORY2'}/temp/$form{'ITEM'}.dat"); &filelock if ($flock); print NEWITEM "\n$form{'USERNAME'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; } if ($form{'CATEGORY3'} ne "") { &oops('ITEM') unless (open NEWITEM, ">>$basepath$form{'CATEGORY3'}/temp/$form{'ITEM'}.dat"); &filelock if ($flock); print NEWITEM "\n$form{'USERNAME'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; } if ($form{'CATEGORY4'} ne "") { &oops('ITEM') unless (open NEWITEM, ">>$basepath$form{'CATEGORY4'}/temp/$form{'ITEM'}.dat"); &filelock if ($flock); print NEWITEM "\n$form{'USERNAME'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; } $flag=0; foreach $userbid(@userbids) { $flag=1 if ("$form{'CATEGORY'}$form{'ITEM'}" eq $userbid); } if ($flag==0 && $regdir ne "") { &oops('USERNAME') unless (open(REGFILE, ">>$regpath$regdir/$form{'USERNAME'}.dat")); print REGFILE "\n$form{'CATEGORY'}$form{'ITEM'}\[\]$form{'CATEGORY2'}$form{'ITEM'}\[\]$form{'CATEGORY3'}$form{'ITEM'}\[\]$form{'CATEGORY4'}$form{'ITEM'}"; close REGFILE; } } else { print "Either the auction is closed or your bid is too low.
Hit the back button and reload to get the latest auction stats, then try again!\n"; } ################################################## #EXPERIMENT ALL TRASH AND NO STAR # $totaled = $form{'BID'}; $reserv = $form{'RESERVE'}; if (($totaled <= 5000) && ($reserv <= 5000)) { $total = 0.00; $payagent = 0.00; } elsif ((($totaled > 5000) && ($totaled <= 50000)) || (($reserv > 5000) && ($reserv <= 50000))) { $total = 9.95; $payagent = 5.00; } elsif ((($totaled > 50000) && ($totaled <= 100000)) || (($reserv > 50000) && ($reserv <= 100000))) { $total = 19.95; $payagent = 10.00; } elsif ((($totaled > 100000) && ($totaled <= 1000000)) || (($reserv > 100000) && ($reserv <= 1000000))) { $total = 29.95; $payagent = 15.00; } elsif (($totaled > 1000000) || ($reserv > 1000000)) { $total = 49.95; $payagent = 25.00; } else { print "please click your browser's BACK button and check all fields\n\n"; } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # writes the payment info into the Agents /IDs/waiting file # $iddir = "IDs"; if (-e "/u1/www/transportuniverse/agents/$iddir/$form{'PAGENT'}.dat") { open(AGENTFILE, "/u1/www/transportuniverse/agents/$iddir/$form{'PAGENT'}.dat"); ($password, $email, $name, $address1, $address2, $phone, $referal) = ; close AGENTFILE; chomp($password, $email, $name, $address1, $address2, $phone, $referal); &oops('AGENTWAITING') unless (open AGENTWAITING, ">/u1/www/transportuniverse/agents/$iddir/waiting/$form{'ITEM'}$form{'PAGENT'}.dat"); print AGENTWAITING "$payagent\n$referal\nauction\n$form{'ITEM'}\n$form{'USERNAME'}\n"; close AGENTWAITING; } #################################### print<<"EOF"; TRANSPORT UNIVERSE EOF print "

\$$total is the total cost of your listing.


Click the CONTINUE button below to make your payment on our Secure Server. You will have the option of paying by Visa, MasterCard, American Express, or by check.
\n\n"; ########################################### $formnumber = $form{'ITEM'}; $formuser = $form{'USERNAME'}; $formcategory = $form{'CATEGORY'}; $formcategory2 = $form{'CATEGORY2'}; $formcategory3 = $form{'CATEGORY3'}; $formcategory4 = $form{'CATEGORY4'}; $formsite = auction; $formtitle = $form{'TITLE'}; $formprice = $totaled; $formagent = $form{'PAGENT'}; print<<"EOF";


EOF print "\n"; # # ##### } ################################################## #Sub accepted to post an item if CC is accepted # sub accepted { &Parse_Form; open REGFILE, "$regpath$regdir/$form{'PALIAS'}.dat"; ($password,$email,$add1,$add2,$add3,@junk) = ; chomp($password,$email,$add1,$add2,$add3,@junk); @data = ; close REGFILE; ####################### @firstbid = split(/\[\]/,$bids[0]); @lineiwant = split(/\[\]/,$junk[-1]); foreach $dog (@lineiwant) { $fileiwant = $dog; $fileiwant =~ s/\D//g; $catiwant = $dog; $catiwant =~ s/[0-9]//g; ######################## open .txt file and convert to .dat file ####################### open TXTFILE, "$basepath$catiwant/temp/$fileiwant.dat"; ($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids) = ; $title =~ s/\"//g; # quotes cause problems for a text input field chomp($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids); close TXTFILE; open DATFILE, ">$basepath$catiwant/$fileiwant.dat"; &filelock if ($flock); print DATFILE "$item\n$site\n$type\n$cat1\n$cat2\n$cat3\n$cat4\n$seller\n$year\n$make\n$model\n$vin\n$mileage\n$interior\n$exterior\n$price\n$currency\n$reserve\n$inc\n$city\n$state\n$country\n$zip\n$report\n$pic\n$image\n$image2\n$image3\n$image4\n$title\n$cont\n$desc\n@bids\n"; close DATFILE; close DATFILE; @lastbid = split(/\[\]/,$bids[$#bids]); ############# WRITE LINE TO SEARCH DATABASE ############################ $url = "http://www.transportuniverse.com/cgi-transportuniverse/auction.cgi\?$catiwant\&$fileiwant"; open DATFILE, ">>/u1/www/transportuniverse/db2/super.txt"; print DATFILE "\|$pic\| \|$year\|$make\|$model\|$vin\|$interior\|$exterior\|$mileage\|$price\|USD\|$zip\|$country\|$state\|$city\|$item\|0\|$url\|$title\|\n"; close DATFILE; ##################################################################### } #&sendemail('postmaster@transportuniverse.com', 'PAID AUCTION LISTING POSTED', 'nobody', $mailserver, "A PAID listing has been placed on the AUCTION site\n\nTITLE\: $form{'PTITLE'}\n\nVISIT\: http://$scripturl$ENV{'SCRIPT_NAME'}\?$form{'PCATEGORY'}\&$fileiwant\n\nOPENING BID OR RESERVE is \$$form{'PPRICE'}.\n\nThis listing has been placed in the following categories\:\n$form{'PCATEGORY'} $form{'PCATEGORY2'} $form{'PCATEGORY3'} $form{'PCATEGORY4'}\n$signature\n"); ###################### end of conversion ####################### print "
$form{'PALIAS'}, your Item Number is $form{'PITEM'}.
Your item has been listied in the following categories:
$category{$form{'PCATEGORY'}}
$category{$form{'PCATEGORY2'}}
$category{$form{'PCATEGORY3'}}
$category{$form{'PCATEGORY4'}}

You may wish to print this notice as confirmation of your Auction Listing.

CLICK HERE TO VIEW YOUR LISTING.


FROM THERE YOU SHOULD ADD A FREE COMPREHENSIVE CONDITION REPORT FOR YOUR LISTING


Attract serious interest from serious buyers by providing them with the essential details found in one our exclusive reports.
\n"; # # # # # # # # # # # # # # # # # # # # # # # # # # # #List all paid registrations in /IDs/paythese/ to see what agents are due payment #Format is: payout[]referal[]site[]itemnumber[]lister[]category1[]category2[]category3[]category4 $iddir = "IDs"; if (-e "/u1/www/transportuniverse/agents/$iddir/$form{'PAGENT'}.dat") { open AGENTPAID, "/u1/www/transportuniverse/agents/$iddir/waiting/$form{'PITEM'}$form{'PAGENT'}.dat"; ($payout,$referal,$trantype,$itemnumber,$lister) = ; chomp($payout,$referal,$trantype,$itemnumber,$lister); close AGENTPAID; open NEWPAY, ">>/u1/www/transportuniverse/agents/$iddir/paythese/$form{'PAGENT'}.dat"; print NEWPAY "$payout\[\]$referal\[\]$trantype\[\]$itemnumber\[\]$lister\[\]$form{'PCATEGORY'}\[\]$form{'PCATEGORY2'}\[\]$form{'PCATEGORY3'}\[\]$form{'PCATEGORY4'}\n"; close NEWPAY; open NEWPAYAGENT, ">>/u1/www/transportuniverse/agents/$iddir/$form{'PAGENT'}.dat"; print NEWPAYAGENT "$payout\[\]$referal\[\]$trantype\[\]$itemnumber\[\]$lister\[\]$form{'PCATEGORY'}\[\]$form{'PCATEGORY2'}\[\]$form{'PCATEGORY3'}\[\]$form{'PCATEGORY4'}\n"; close NEWPAYAGENT; unlink("/u1/www/transportuniverse/agents/$iddir/waiting/$form{'PITEM'}$form{'PAGENT'}.dat"); } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # } ############################################## # Sub: Automate Close Auctions 1.1 # This allows admin to close all items that # have passed their closing time, w/o having # to go to each item seperately sub autoclose { foreach $key (sort keys %category) { opendir THEDIR, "$basepath$key" || die "Unable to open directory: $!"; @allfiles = readdir THEDIR; closedir THEDIR; foreach $file (sort { int($a) <=> int($b) } @allfiles) { if (time > $file) { if (-T "$basepath$key/$file") { open THEFILE, "$basepath$key/$file"; ($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids) = ; chomp($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids); @firstbid = split(/\[\]/,$bids[0]); @lastbid = split(/\[\]/,$bids[$#bids]); $nowtime = localtime(time); $closetime = localtime($file); foreach $bid (@bids) { @thebid = split(/\[\]/,$bid); $bidtime = localtime($thebid[3]); } close THEFILE; if ($key ne $closedir) { ######################################################## # PUT AUTO RELIST HERE... ######################################################## sleep 2; $oldreport = $file; $oldreport =~ s/\.dat//; $oldreport = $oldreport . "r"; $repost = 90; # Auction length in days $doit =0; # Set to 0 initially if (($lastbid[2] < $reserve) && ($reserve > 0) && ($firstbid[0] ne $lastbid[0])) { $doit = 1; $new = ($repost * 86400 + time); $newreport = $new . "r"; rename("u1/www/transportuniverse/reports/$oldreport.txt", "u1/www/transportuniverse/reports/$newreport.txt"); open DATFILE, ">$basepath$cat1/$new.dat"; &filelock if ($flock); print DATFILE "$item\n$site\n$type\n$cat1\n$cat2\n$cat3\n$cat4\n$seller\n$year\n$make\n$model\n$vin\n$mileage\n$interior\n$exterior\n$price\n$currency\n$reserve\n$inc\n$city\n$state\n$country\n$zip\n$report\n$pic\n$image\n$image2\n$image3\n$image4\n$title\n$cont\n$desc\n$thebid[0]\[\]$thebid[1]\[\]$thebid[2]\[\]$thebid[3]\[\]$thebid[4]\[\]$thebid[5]\[\]$thebid[6]\[\]$thebid[7]\n"; close DATFILE; unlink($cat1/$file); if ($cat2 ne "") { open DATFILE, ">$basepath$cat2/$new.dat"; &filelock if ($flock); print DATFILE "$item\n$site\n$type\n$cat1\n$cat2\n$cat3\n$cat4\n$seller\n$year\n$make\n$model\n$vin\n$mileage\n$interior\n$exterior\n$price\n$currency\n$reserve\n$inc\n$city\n$state\n$country\n$zip\n$report\n$pic\n$image\n$image2\n$image3\n$image4\n$title\n$cont\n$desc\n$thebid[0]\[\]$thebid[1]\[\]$thebid[2]\[\]$thebid[3]\[\]$thebid[4]\[\]$thebid[5]\[\]$thebid[6]\[\]$thebid[7]\n"; close DATFILE; unlink ($cat2/$file); } if ($cat3 ne "") { open DATFILE, ">$basepath$cat3/$new.dat"; &filelock if ($flock); print DATFILE "$item\n$site\n$type\n$cat1\n$cat2\n$cat3\n$cat4\n$seller\n$year\n$make\n$model\n$vin\n$mileage\n$interior\n$exterior\n$price\n$currency\n$reserve\n$inc\n$city\n$state\n$country\n$zip\n$report\n$pic\n$image\n$image2\n$image3\n$image4\n$title\n$cont\n$desc\n$thebid[0]\[\]$thebid[1]\[\]$thebid[2]\[\]$thebid[3]\[\]$thebid[4]\[\]$thebid[5]\[\]$thebid[6]\[\]$thebid[7]\n"; close DATFILE; unlink ($cat3/$file); } if ($cat4 ne "") { open DATFILE, ">$basepath$cat4/$new.dat"; &filelock if ($flock); print DATFILE "$item\n$site\n$type\n$cat1\n$cat2\n$cat3\n$cat4\n$seller\n$year\n$make\n$model\n$vin\n$mileage\n$interior\n$exterior\n$price\n$currency\n$reserve\n$inc\n$city\n$state\n$country\n$zip\n$report\n$pic\n$image\n$image2\n$image3\n$image4\n$title\n$cont\n$desc\n$thebid[0]\[\]$thebid[1]\[\]$thebid[2]\[\]$thebid[3]\[\]$thebid[4]\[\]$thebid[5]\[\]$thebid[6]\[\]$thebid[7]\n"; close DATFILE; unlink ($cat4/$file); } } if ($firstbid[0] eq $lastbid[0]) { $doit = 1; $new = ($repost * 86400 + time); $newreport = $new . "r"; rename("u1/www/transportuniverse/reports/$oldreport.txt", "u1/www/transportuniverse/reports/$newreport.txt"); open DATFILE, ">$basepath$cat1/$new.dat"; &filelock if ($flock); print DATFILE "$item\n$site\n$type\n$cat1\n$cat2\n$cat3\n$cat4\n$seller\n$year\n$make\n$model\n$vin\n$mileage\n$interior\n$exterior\n$price\n$currency\n$reserve\n$inc\n$city\n$state\n$country\n$zip\n$report\n$pic\n$image\n$image2\n$image3\n$image4\n$title\n$cont\n$desc\n$thebid[0]\[\]$thebid[1]\[\]$thebid[2]\[\]$thebid[3]\[\]$thebid[4]\[\]$thebid[5]\[\]$thebid[6]\[\]$thebid[7]\n"; close DATFILE; unlink($cat1/$file); if ($cat2 ne "") { open DATFILE, ">$basepath$cat2/$new.dat"; &filelock if ($flock); print DATFILE "$item\n$site\n$type\n$cat1\n$cat2\n$cat3\n$cat4\n$seller\n$year\n$make\n$model\n$vin\n$mileage\n$interior\n$exterior\n$price\n$currency\n$reserve\n$inc\n$city\n$state\n$country\n$zip\n$report\n$pic\n$image\n$image2\n$image3\n$image4\n$title\n$cont\n$desc\n$thebid[0]\[\]$thebid[1]\[\]$thebid[2]\[\]$thebid[3]\[\]$thebid[4]\[\]$thebid[5]\[\]$thebid[6]\[\]$thebid[7]\n"; close DATFILE; unlink ($cat2/$file); } if ($cat3 ne "") { open DATFILE, ">$basepath$cat3/$new.dat"; &filelock if ($flock); print DATFILE "$item\n$site\n$type\n$cat1\n$cat2\n$cat3\n$cat4\n$seller\n$year\n$make\n$model\n$vin\n$mileage\n$interior\n$exterior\n$price\n$currency\n$reserve\n$inc\n$city\n$state\n$country\n$zip\n$report\n$pic\n$image\n$image2\n$image3\n$image4\n$title\n$cont\n$desc\n$thebid[0]\[\]$thebid[1]\[\]$thebid[2]\[\]$thebid[3]\[\]$thebid[4]\[\]$thebid[5]\[\]$thebid[6]\[\]$thebid[7]\n"; close DATFILE; unlink ($cat3/$file); } if ($cat4 ne "") { open DATFILE, ">$basepath$cat4/$new.dat"; &filelock if ($flock); print DATFILE "$item\n$site\n$type\n$cat1\n$cat2\n$cat3\n$cat4\n$seller\n$year\n$make\n$model\n$vin\n$mileage\n$interior\n$exterior\n$price\n$currency\n$reserve\n$inc\n$city\n$state\n$country\n$zip\n$report\n$pic\n$image\n$image2\n$image3\n$image4\n$title\n$cont\n$desc\n$thebid[0]\[\]$thebid[1]\[\]$thebid[2]\[\]$thebid[3]\[\]$thebid[4]\[\]$thebid[5]\[\]$thebid[6]\[\]$thebid[7]\n"; close DATFILE; unlink ($cat4/$file); } } ############# WRITE LINE TO SEARCH DATABASE ############################ $url = "http://www.transportuniverse.com/cgi-transportuniverse/auction.cgi\?$catiwant\&$fileiwant"; open DATFILE, ">>/u1/www/transportuniverse/db2/relisted.txt"; print DATFILE "\|$pic\| \|$year\|$make\|$model\|$vin\|$interior\|$exterior\|$mileage\|$price\|USD\|$zip\|$country\|$state\|$city\|$new\|0\|$url\|$title\|\n"; close DATFILE; ##################################################################### if ($doit == 1) { $resend = " Hello $firstbid[0], The auction you posted on Transport Universe has ended. Either you received no bids or your reserve was not met. Your item will be automatically relisted at no charge to you. The only change is a new item number that is listed below. Title : $title Categories: $cat1 $cat2 $cat3 $cat4 New Item number : $new If wish to change your ad in length or content, simply follow the link below to your item, and choose use the MODIFY AUCTION option. If you wish to stop the auction and remove your listing, simply REPLY to this email with DELETE AUCTION as the subject. Link to your item description: http://$scripturl$ENV{'SCRIPT_NAME'}\?$cat1\&$new "; #&sendemail($firstbid[1],"Relist of your T.U. Auction", "nobody", $mailserver, "$resend\n$signature"); #&sendemail('postmaster@transportuniverse.com', ' AUCTION ENDED NO WINNER', 'nobody', $mailserver, "SELLER\; $firstbid[0]\nITEM\: http://$scripturl$ENV{'SCRIPT_NAME'}\?$cat1\&$file\nRELISTED AS\: http://$scripturl$ENV{'SCRIPT_NAME'}\?$cat1\&$new\n$signature\n"); } ######################################################## # END AUTO RELIST HERE... ######################################################## if ($closedir) { umask(000); # UNIX file permission junk mkdir("$basepath$closedir", 0777) unless (-d "$basepath$closedir"); print "Please notify Transport Universe admin that this item cannot be copied to the closed directory even though it is closed.\n" unless &movefile("$basepath$key/$file", "$basepath$closedir/$key$file"); # print "

$category{$key}\: $title closed


"; $numauct = $file; $numauct =~ s/\.dat//; #makes it just the number, rather than number.dat } else { print "Please notify the site admin that this item cannot be removed even though it is closed.\n" unless unlink("$basepath$key/$file"); } if (($lastbid[2] >= $reserve) && ($lastbid[0] ne $firstbid[0])) { &sendemail($lastbid[1], "Transport Universe Live Auction Close: $title", $firstbid[1], $mailserver, "Congratulations! You are the winner of Transport Universe Auction Item Number $ARGV[1].\nYour winning bid was \$$lastbid[2].\n\nPlease contact the seller to make arrangements for payment and shipping:\n\n$firstbid[1]\n\$signature\n"); $reservemsg = "\nThe winning bid was \$$lastbid[2] (Your reserve was: \$$reserve).\n\nPlease contact the high bidder to make any necessary arrangements:\n\n$lastbid[4]\n$lastbid[5]\n$lastbid[6]\n$lastbid[1] "; &sendemail($firstbid[1], "Auction Close: $title", "Winner <$lastbid[1]>", $mailserver, "Auction Number $numauct Is Now Closed.\nThe high bid was \$$lastbid[2] (Your reserve was: \$$reserve).\n\n$reservemsg\n\nPlease contact the high bidder to make any necessary arrangements:\n\n$lastbid[4]\n$lastbid[5]\n$lastbid[6]\n$lastbid[1]\n$signature\n"); #&sendemail('postmaster@transportuniverse.com', ' AUCTION ENDED WITH WINNER', 'nobody', $mailserver, "SELLER\; $firstbid[0]\nITEM\: http://$scripturl$ENV{'SCRIPT_NAME'}\?key\&$file\nWINNER\: $lastbid[0]\nWINNING BID\: \$$lastbid[2]\n$signature\n"); } else { if ($firstbid[2] ne $lastbid[2]) { &sendemail($lastbid[1], "Transport Universe Auction Close: $title", $firstbid[1], $mailserver, "Notice\: You were the high bidder on auction number $ARGV[1].\nYour bid was \$$lastbid[2].\n\nUnfortunately, your bid did not meet the seller\'s reserve price. If the seller chooses to relist this item, you may bid again at the following address\:\n\nhttp://$scripturl$ENV{'SCRIPT_NAME'}\?$key\&$new\n$signature\n"); $bob=1; } else { $bob=1; } } } } } } } } ###################################### ###################################### # # new toys i'm trying out... ############################################## # Sub: Display List Of All Auctions sub listall { print "All Auction Listings\n"; print "\n"; print "\n"; foreach $key (sort keys %category) { opendir THEDIR, "$basepath$key" || die "Unable to open directory: $!"; @allfiles = readdir THEDIR; closedir THEDIR; foreach $file (sort { int($b) <=> int($a) } @allfiles) { ########################## ADDON: Select alternating row color. if ($i % 2 == 1) { $colortablebody = $odd_row_color; } else { $colortablebody = $even_row_color; } $i++; $ii++; ########################### END: Select alternating row color. if (-T "$basepath$key/$file") { open THEFILE, "$basepath$key/$file"; ($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids) = ; close THEFILE; chomp($item, $site, $type, $cat1, $cat2, $cat3, $cat4, $seller, $year, $make, $model, $vin, $mileage, $interior, $exterior, $price, $currency, $reserve, $inc, $city, $state, $country, $zip, $report, $pic, $image, $image2, $image3, $image4, $title, $cont, $desc, @bids); @lastbid = split(/\[\]/,$bids[$#bids]); $file =~ s/\.dat//; @closetime = localtime($file); $closetime[4]++; $thm = $item . "thm\.jpg"; $piciconpath = ""; if (-e "/u1/www/transportuniverse/www/thm/$thm") { $piciconpath = ""; } $reporticonpath = ""; $camera=""; $camera =$piciconpath if (($pic eq "Y") || ($image ne "")); $report =$reporticonpath if ($report eq "Y"); $link = "$make $model"; print "\n"; } print "

\n"; } } print "
VEHICLEYEARLOCATIONPRICE
$camera$report$link
$title
$year$state$country\$$price

\n"; } ########################################### #------------------------------------------------------# # Sub Upload Form for uploading an image file #------------------------------------------------------# sub uploadform { #------------------------------------------------------# if ($allowupload == 0) { &newitem; exit 0; } if ($uploadcharge ne '0') { $chargetext = "There is a \$$uploadcharge charge for file uploads"; } if ($uploadcharge eq '0') { $chargetext = "This service is free"; } print <<"EOF";
SELL YOUR ITEM WITH LIVE AUCTIONS

The most important step you can take towards selling your item
is to include a picture with your listing.  We never charge you to
add photos to your description!  In fact, if you are unable to use
our free upload service, please mail us your photos to the address
below and we will be happy to add them to your item's description!

FREE IMAGE UPLOAD

If You Have An Image On Your Computer, Disk, or CD, Click the Browse Button Below To Select Your Image For Free Automatic Upload.

Images must be in .jpg or .gif format.  For help with this process, CLICK HERE

The picture upload requires Netscape 3.0 or higher, or Internet Explorer (IE) 3.02 or higher.
Picture File:
Click to upload your picture and continue the item listing process.

OR

NO IMAGE? If You Do Not Have a Picture, Click
to list your item without adding a picture.


Please send all photos to:
TRANSPORT UNIVERSE PHOTOS
Box 366 Pittsfield, New Hampshire 03263


Image Upload Help

When you click on the Browse button, a window will open allowing you to look at the files on your computer.  This window is local to your system and is not viewable or accessible to anyone else.  Use this window to locate the image you wish to upload and store on our server.  The window will display files on your hard drive.  You can use the drop-down menu to select other drives for photos that may be on a diskette or a CD.  When you locate the image, double-click on it, or select it and click on the "Open" button.  The name of the file will then appear in the Picture File box.  Click the "Continue" button directly below the Picture File box to continue on to the item information page.

Image Upload is a free service provided by Transport Universe.  Adding an image to your item's description page dramatically increases the effectiveness of your listing.  Buyers want to see what they are buying!  An image in conjunction with our free Item Condition Report will provide buyers with every detail they need to make that all-important decision to buy YOUR item!


If you need further assistance with the Image Upload process, please contact us at:
service\@transportuniverse.com

EOF } #------------------------------------------------------# ############################# it ain't Mozart... sub qonvert { print "what\?\n"; } #######################################################################