#!/usr/bin/perl
#-#############################################
# Carded Minors calculator for USBL
# Rob McQuown - robmcquown@yahoo.com,
# modified from the original, which was used by permission
# Version 0.1 - 2/1/2007
#-#############################################
use vars qw(%config %category %level %mult %league_max %form);
use strict;
use Time::Local;
use Cwd;
use Fcntl qw/:flock/;
#-#############################################
# Configuration Section
# Edit these variables!
local %config;
$config{'version'}="0.1";
# Salary minimums by year use [year] to determine (see constitution)
our @minimums = (500000,750000,1250000,2000000,3500000,5000000);
# The Base Directory. We need an
# absolute path for the base directory.
# Include the trailing slash. THIS SHOULD
# NOT BE WEB-ACCESSIBLE!
$config{'basepath'} = '/home/virtual/site503/var/www/perl/CML/';
# $config{'basepath'} = 'C:/Perl/usbl/auction/'; # temp
$config{'max_days'} = '30';
$config{'motd'}="Send comments to robmcquown\@yahoo.com";
# Closed Auction Directory
# This is where closed auction items are stored.
# Leave this blank if you don't want to store
# closed auctions. It can potentially take
# up quite a bit of disk space.
$config{'closedir'} = 'closed';
# User Registration Directory
# This is where user registrations are stored.
# Leave this blank if you don't want to
# require registration. It can potentially
# take up quite a bit of disk space.
$config{'regdir'} = 'reg';
# List each directory and its associated
# category name. These directories should
# be subdirectories of the base directory.
%category = (
pitchers => 'Pitchers',
catchers => 'Catchers',
firstbasemen => 'First Basemen',
secondbasemen => 'Second Basemen',
thirdbasemen => 'Third Basemen',
shortstops => 'Shortstops',
outfielders => 'Outfielders',
);
%level = (
1 => 'A',
2 => 'AA',
3 => 'AAA',
4 => 'MLB',
);
%mult = (
1 => 0.5,
2 => 0.65,
3 => 0.8,
4 => 1.0,
);
# This is the password for deleting auction
# items.
$config{'adminpass'} = 'marietla';
# You need to assign either a mail program or
# a mail host so confirmation e-mails can
# be sent out.
# Leave one commented and one uncommented.
#
# YOU NEED EITHER A MAIL PROGRAM
$config{'mailprog'} = '/home/virtual/site503/usr/sbin/sendmail -t';
#
# OR YOU NEED A MAIL HOST (SMTP)
#$config{'mailhost'} = 'smtp.1and1.com';
# This line should be your e-mail address
#$config{'admin_address'} = 'midlanddog@chartermi.net';
$config{'admin_address'} = 'robmcquown@yahoo.com';
# This line should point to the URL of
# your server. It will be used for sending
# "you have been outbid" e-mail. The script
# name and auction will be appended to the
# end automatically, so DO NOT use a trailing
# slash. If you do not want to send outbid
# e-mail, leave this blank.
$config{'scripturl'} = 'www.the-usbl.org';
# This will let you define colors for the
# tables that are generated and the
# other page colors. The default colors
# create a nice "professional" look. Must
# be in hex format.
$config{'colortablehead'} = '#BBBBBB';
$config{'colortablebody'} = '#EEEEEE';
# Site Name (will appear at the top of each page)
$config{'sitename'} = 'USBL';
# You can configure your own header which will
# be appended to the top of each page.
$config{'header'} =<<"EOF";
$config{'sitename'} - USBL
$config{'sitename'} Carded Minor Leaguer Calculator (ALPHA TEST version $config{'version'})
EOF
# You can configure your own footer which will
# be appended to the bottom of each page.
# Although not required, a link back to
# everysoft.com will help to support future
# development.
$config{'footer'} =<<"EOF";
EOF
# Sniper Protection... How many minutes
# past last bid to hold auction. If auctions
# should close at exactly closing time, set
# to zero.
$config{'aftermin'} = 10;
# File locking enabled? Should be 1 (yes)
# for most systems, but set to 0 (no) if you
# are getting flock errors or the script
# crashes.
$config{'flock'} = 1;
# User Posting Enabled- 1=yes 0=no
$config{'newokay'} = 1;
# User View Money available - 1=yes 0=no
$config{'moneyokay'} = 1;
#-#############################################
# Main Program
# You do not need to edit anything below this
# line.
#-#############################################
# Print The Page Header
#
print "Content-type: text/html\n\n";
print $config{'header'};
local %form = &get_form_data;
if ($form{'action'} eq 'calcpit') { &calcpit; }
elsif ($form{'action'} eq 'calcbat') { &calcbat; }
else { &mainform; }
#-#############################################
# Print The Page Footer
#
#print "