#!/usr/bin/perl
####
#### Business Website Contact Request
#### Designed by Paul Dupuy, Jr.
####

# Use cgi-lib parser
require "cgi-lib.pl";
&ReadParse(*input);

# Who gets the death message?
$mailerrorto = 'paul@hiwaay.net';

# Time
$now = localtime(time);





###
### Email the information
###

open(MAIL, "|/usr/lib/sendmail -oi -t") || die ("Unable to open mail program.\n");

print MAIL <<"AAA";
From: "Website Pricer"
To: Paul\@hiwaay.net
Subject: Business Website Contact Request
Date: $now
Reply-To: $input{'contactemail'}


     Business Website Contact Request


     The following information was submitted from the contact page
generated by our snazzy Website Pricing program:

     Name: $input{'contactname'}
     Email: $input{'contactemail'}
     Phone: $input{'contactphone'}


AAA



##
## Print list of items chosen
##

if ($input{'logo'} eq 'existing') 
{
	print MAIL "     Your current logo\n";
}
else
{
	print MAIL "     A newly designed logo\n";
}


if($input{'cobrief'}) 
{
	print MAIL "     Brief information about your Company\n";
}


if($input{'codetail'}) 
{
	print MAIL "     Detailed information about your Company\n";
}


if($input{'coimage'}) 
{
	print MAIL "     $input{'coimagenumber'} image";
	if ($input{'coimagenumber'} > 1) {print "s"}
	print MAIL " of your Company\n";
}


if($input{'map'}) 
{
	print MAIL "     A map of your Company's location\n";
}


if($input{'directions'}) 
{
	print MAIL "     Directions to your Company's location\n";
}


if($input{'progeneral'}) 
{
	print MAIL "     General information about your Company's Products/Services\n";
}


if($input{'probrief'}) 
{
	print MAIL "     $input{'probriefnumber'} brief descriptions of your Company's Products/Services\n";
}


if($input{'prodetail'}) 
{
	print MAIL "     $input{'prodetailnumber'} detailed descriptions of your Company's Products/Services\n";
}


if($input{'proimage'}) 
{
	print MAIL "     $input{'proimagenumber'} images of your Company's Products/Services\n";
}


if($input{'order'} eq 'secure') 
{
	print MAIL "     Product/Service ordering, including secure credit card transactions\n";
}


if($input{'order'} eq 'without') 
{
	print MAIL "     Product/Service ordering, without credit card transactions\n";
}


if($input{'order'} eq 'none') 
{
	print MAIL "     No online Product/Service ordering\n";
}


if ($input{'navigation'} eq 'textonly') 
{
	print MAIL "     Navigation using only text\n";
}
else
{
	print MAIL "     Navigation using images and text\n";
}


if ($input{'newsletter'}) 
{
	print MAIL "     Newsletter request button\n";
}


if($input{'information'}) 
{
	print MAIL "     Information submission form\n";
}


if ($input{'counter'}) 
{
	print MAIL "     Webpage visit counter\n";
}


if($input{'background'}) 
{
	print MAIL "     Background image\n";
}


if($input{'addtext'}) 
{	
	print MAIL "     $input{'addtextnumber'} additional words of text\n";
}


if($input{'addimage'}) 
{
	print MAIL "     $input{'addimagenumber'} additional images\n";
}


if($input{'promotion'}) 
{
	print MAIL "     Promotion by Search Engine Website submissions\n";
}


if($input{'host'} eq 'dial') 
{
	print MAIL "     Dial-up $input{'dialtype'}\n";
}
elsif ($input{'host'} eq 'dedicated') 
{
	print MAIL "     Dial-up $input{'dedicatedtype'}\n";
}
else
{
	print MAIL "     Website hosting without access\n";
}


if($input{'registerdomain'}) 
{
	print MAIL "     Domain name registration\n";
}


if($input{'DNS'}) 
{
	print MAIL "     Domain name service\n";
}


if($input{'addemail'}) 
{
	print MAIL "     $input{'addemailnumber'} additional email addresses\n";
}


if($input{'mailinglist'}) 
{
	print MAIL "     Email mailing list\n";
}


if($input{'autorespond'}) 
{
	print MAIL "     Email auto-responder\n";
}



##
## Print the email footer
##

print MAIL <<"AAA";

     Estimated design cost: $input{'designcost'}
     Monthly service charge: $input{'servicecharge'}.00

	
Love is the Law

AAA

close(MAIL);





##
## Output the Thank You Reply page
##

print "Content-type: text/html\n\n";
			
print <<"AAA";
<HTML><HEAD><TITLE>Business Website Contact Request</TITLE></HEAD>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" 
ALINK="#C900D9" VLINK="#660099">

<!--Created by Paul Dupuy, Jr. @ Valley Internet-->

<CENTER><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" ALIGN="CENTER"><TR><TD 
COLSPAN="3" HEIGHT="4"> </TD></TR><TD><IMG 
SRC="http://home.hiwaay.net/~paul/resume/price/head1.gif" WIDTH="133" 
HEIGHT="34" BORDER="0"
ALIGN="MIDDLE" ALT="Valley"></TD><TD WIDTH="13"></TD><TD><IMG
SRC="http://home.hiwaay.net/~paul/resume/price/head2.gif" WIDTH="179" 
HEIGHT="34" BORDER="0" 
ALIGN="MIDDLE" ALT="Internet"></TD></TR></TABLE>
<P>

<FONT SIZE="+2">Business Website Contact Request</FONT>
<P><BR>

<FONT SIZE="+2"><B>Thank You!</B></FONT><P>
<FONT SIZE="+1" FACE="Arial, Helvetica">Your contact information has been sent<BR>
to our Valley Internet Design Staff.</FONT><P>


<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" ALIGN="CENTER" 
WIDTH="53%"><TR><TD>&nbsp;&nbsp;&nbsp; A representative will be contacting you 
shortly. If you would like to speak to us sooner, you can <B>call (256) 
882-7320</B> after 5 pm central time.</TD></TR></TABLE><P>

<FONT SIZE="+1">We look forward to speaking with 
you.</FONT><P><BR>

<A HREF="http://home.hiwaay.net/~paul/resume/price/index.html">About 
Website Pricer</A><P></CENTER>

</BODY></HTML>
AAA








###
### Subroutines
###


##
## Handle system errors
##
sub death 
{
	$message = @_[0];	

	#
	# Mail the Error Message
	#
	open(MAIL, "|/usr/lib/sendmail -oi -t") || die ("Unable to open mail program.\n");

	print MAIL <<"AAA";
Subject: Business Website Price Error
From: contact.pl
To: $mailerrorto


     An error occurred during the execution of contact.pl:

$message


contact.pl

AAA

	close(MAIL) || die ("Unable to close mail program.\n");

	# Quit
	exit;
	
} #endsub death



##
## Love is the Law.

1;