#!/usr/bin/perl
####
#### Business Website Price Calculator
#### Designed by Paul Dupuy, Jr.
####
# Use cgi-lib parser
require "cgi-lib.pl";
&ReadParse(*input);
# Who gets the death message?
$mailerrorto = 'paul@hiwaay.net';
###
### Write the price log
###
# Open price log
open (PRICE, ">>websitepricelog") || &death("Could not open websitepricelog: $!");
# Time
$now = localtime(time);
print PRICE "$now\n";
# Print items
for $key (keys %input)
{
print PRICE "$key $input{$key}\n";
}
print PRICE "\n";
# Close price log
close (PRICE) || &death("Could not close websitepricelog: $!");
###
### Output the Results page
###
# Print the header
&header;
# Price per hour
$hour = 50;
# Base design time
$designtime = 1;
# Printing strings
$left = '
§ ';
$hide = '
\n!;
##
## Print list of items while calculating price
##
if ($input{'logo'} eq 'existing')
{
print "$left Your current logo$hide";
print qq!NAME="logo" VALUE="existing">$right!;
$designtime += 1;
}
else
{
print "$left A newly designed logo$hide";
print qq!NAME="logo" VALUE="design">$right!;
$designtime += 4;
}
if($input{'cobrief'})
{
print "$left Brief information about your Company$hide";
print qq!NAME="cobrief" VALUE="1">$right!;
$designtime += .5;
}
if($input{'codetail'})
{
print "$left Detailed information about your Company$hide";
print qq!NAME="codetail" VALUE="1">$right!;
$designtime += .75;
}
if($input{'coimage'})
{
print "$left $input{'coimagenumber'} image";
if ($input{'coimagenumber'} > 1) {print "s"}
print " of your Company$hide";
print qq!NAME="coimage" VALUE="1">$hide!;
print qq!NAME="coimagenumber" VALUE="$input{'coimagenumber'}">$right!;
$designtime += ($input{'coimagenumber'} * .5);
}
if($input{'map'})
{
print "$left A map of your Company's location$hide";
print qq!NAME="map" VALUE="1">$right!;
$designtime += .75;
}
if($input{'directions'})
{
print "$left Directions to your Company's location$hide";
print qq!NAME="directions" VALUE="1">$right!;
$designtime += .5;
}
if($input{'progeneral'})
{
print "$left General information about your Company's Products/Services$hide";
print qq!NAME="progeneral" VALUE="1">$right!;
$designtime += .75;
}
if($input{'probrief'})
{
print "$left $input{'probriefnumber'} brief descriptions of your Company's Products/Services$hide";
print qq!NAME="probrief" VALUE="1">$hide!;
print qq!NAME="probriefnumber" VALUE="$input{'probriefnumber'}">$right!;
# change range string to upper value
$input{'probriefnumber'} =~ s/\d+-//;
$designtime += ($input{'probriefnumber'} * .1);
}
if($input{'prodetail'})
{
print "$left $input{'prodetailnumber'} detailed descriptions of your Company's Products/Services$hide";
print qq!NAME="prodetail" VALUE="1">$hide!;
print qq!NAME="prodetailnumber" VALUE="$input{'prodetailnumber'}">$right!;
# change range string to upper value
$input{'prodetailnumber'} =~ s/\d+-//;
$designtime += ($input{'prodetailnumber'} * .2);
}
if($input{'proimage'})
{
print "$left $input{'proimagenumber'} images of your Company's Products/Services$hide";
print qq!NAME="proimage" VALUE="1">$hide!;
print qq!NAME="proimagenumber" VALUE="$input{'proimagenumber'}">$right!;
# change range string to upper value
$input{'proimagenumber'} =~ s/\d+-//;
$designtime += ($input{'proimagenumber'} * .3);
}
if($input{'order'} eq 'secure')
{
print "$left Product/Service ordering, including secure credit card transactions$hide";
print qq!NAME="order" VALUE="secure">$right!;
$designtime += 10;
}
if($input{'order'} eq 'without')
{
print "$left Product/Service ordering, without credit card transactions$hide";
print qq!NAME="order" VALUE="without">$right!;
$designtime += 5;
}
if($input{'order'} eq 'none')
{
print "$left No online Product/Service ordering$hide";
print qq!NAME="order" VALUE="none">$right!;
$designtime += 5;
}
if ($input{'navigation'} eq 'text')
{
print "$left Navigation using only text$hide";
print qq!NAME="navigation" VALUE="text">$right!;
$designtime += 1;
}
else
{
print "$left Navigation using images and text$hide";
print qq!NAME="navigation" VALUE="image">$right!;
$designtime += 7;
}
if ($input{'newsletter'})
{
print "$left Newsletter request button$hide";
print qq!NAME="newsletter" VALUE="1">$right!;
$designtime += .5;
}
if($input{'information'})
{
print "$left Information submission form$hide";
print qq!NAME="information" VALUE="1">$right!;
$designtime += 1;
}
if($input{'promotion'})
{
print "$left Search Engine Website submissions$hide";
print qq!NAME="promotion" VALUE="1">$right!;
$designtime += 1;
}
if ($input{'counter'})
{
print "$left Webpage visit counter$hide";
print qq!NAME="counter" VALUE="1">$right!;
$designtime += .25;
}
if($input{'background'})
{
print "$left Background image$hide";
print qq!NAME="background" VALUE="1">$right!;
$designtime += .5;
}
if($input{'addtext'})
{
print "$left $input{'addtextnumber'} additional words of text$hide";
print qq!NAME="addtext" VALUE="1">$hide!;
print qq!NAME="addtextnumber" VALUE="$input{'addtextnumber'}">$right!;
# change range string to upper value
$input{'addtextnumber'} =~ s/\d+-//;
$designtime += ($input{'addtextnumber'} * .002);
}
if($input{'addimage'})
{
print "$left $input{'addimagenumber'} additional images$hide";
print qq!NAME="addimage" VALUE="1">$hide!;
print qq!NAME="addimagenumber" VALUE="$input{'addimagenumber'}">$right!;
# change range string to upper value
$input{'addimagenumber'} =~ s/\d+-//;
$designtime += ($input{'addimagenumber'} * .3);
}
if($input{'host'} eq 'dial')
{
print "$left Hosting with dial-up ";
if ($input{'dialtype'} =~ /Modem/)
{
print "modem access$hide";
}
else
{
print "$input{'dialtype'} access$hide";
}
print qq!NAME="host" VALUE="dial">$hide!;
print qq!NAME="dialtype" VALUE="$input{'dialtype'}">$right!;
# Charge is the same for all types
$servicecharge += 50;
}
elsif ($input{'host'} eq 'dedicated')
{
print "$left Hosting with dedicated $input{'dedicatedtype'} access$hide";
print qq!NAME="host" VALUE="dedicated">$hide!;
print qq!NAME="dedicatedtype" VALUE="$input{'dedicatedtype'}">$right!;
if ($input{'dedicatedtype'} =~ /Modem/)
{
$servicecharge += 225;
}
elsif ($input{'dedicatedtype'} =~ /64/)
{
$servicecharge += 375;
}
else #dedicatedtype = 128
{
$servicecharge += 525;
}
}
else
{
print "$left Hosting without access$hide";
print qq!NAME="host" VALUE="without">$right!;
$servicecharge += 25;
}
if($input{'registerdomain'})
{
print "$left Domain name registration$hide";
print qq!NAME="registerdomain" VALUE="1">$right!;
$designtime += 2.3;
}
if($input{'DNS'})
{
print "$left Domain name service$hide";
print qq!NAME="DNS" VALUE="1">$right!;
$servicecharge += 15;
}
if($input{'addemail'})
{
print "$left $input{'addemailnumber'} additional email addresses$hide";
print qq!NAME="addemail" VALUE="1">$hide!;
print qq!NAME="addemailnumber" VALUE="$input{'addemailnumber'}">$right!;
if ($input{'addemailnumber'} =~ /5/)
{
$servicecharge += 10;
}
else # addemailnumber = 11-20
{
$servicecharge += 20;
}
}
if($input{'mailinglist'})
{
print "$left Email mailing list$hide";
print qq!NAME="mailinglist" VALUE="1">$right!;
$servicecharge += 10;
}
if($input{'autorespond'})
{
print "$left Email auto-responder$hide";
print qq!NAME="autorespond" VALUE="1">$right!;
$servicecharge += 3;
}
##
## Calculate the design cost
##
$designcost = int($designtime * $hour);
$designcost .= '.00';
##
## Output top of the returned page
##
print <<"AAA";
Estimated design cost:
\$${designcost}
Monthly service charge:
\$${servicecharge}.00
If you would like us to contact you to discuss your Website,
please submit the following information:
Name:
Email:
Phone:
Our Design Staff can be reached at (256) 882-7320 and
Paul\@hiwaay.net