#!/usr/local/bin/perl
#!C:\bin\perl\bin\perl.exe
#!/usr/bin/perl/
# use one of the above lines to set the path to perl on your server
##########################################################################################

#####################################################################
# get parameters from the file
open(PAR,"<param14.dat");
@params = <PAR>;
close(PAR);
foreach $line (@params) {
	@option = split(/"/,$line);
	if (@option[0] =~ 'method') {$server = @option[1]}

	if (@option[0] =~ 'colortx') {$colortx = @option[1]}
	if (@option[0] =~ 'colorbg') {$colorbg = @option[1]}
	if (@option[0] =~ 'coloral') {$coloral = @option[1]}
	if (@option[0] =~ 'colorvl') {$colorvl = @option[1]}
	if (@option[0] =~ 'sizetx') {$sizetx = @option[1]}
	if (@option[0] =~ 'nametx') {$nametx = @option[1]}
	if (@option[0] =~ 'pathcgi') {$pathcgi = @option[1]}
	if (@option[0] =~ 'pathdata') {$pathdata = @option[1]}
	if (@option[0] =~ 'pathmail') {$pathmail = @option[1]}
	if (@option[0] =~ 'urlcgi') {$urlcgi = @option[1]}
	if (@option[0] =~ 'urldata') {$urldata = @option[1]}
	if (@option[0] =~ 'htmlfoot') {$htmlfoot = @option[1]}
	if (@option[0] =~ 'htmlhead') {$htmlhead = @option[1]}
	if (@option[0] =~ 'title') {$title = @option[1]}
	if (@option[0] =~ 'welcome') {$welcome = @option[1]}
	if (@option[0] =~ 'confirm') {$confirm = @option[1]}
	if (@option[0] =~ 'emailstep') {$emailstep = @option[1]}
	if (@option[0] =~ 'emailsent') {$emailsent = @option[1]}
	if (@option[0] =~ 'hellotext') {$hellotext = @option[1]}

	if (@option[0] =~ 'priority') {$priority = @option[1]}
	if (@option[0] =~ 'status') {$status = @option[1]}
	if (@option[0] =~ 'category') {$category = @option[1]}
	if (@option[0] =~ 'products') {$products = @option[1]}
	if (@option[0] =~ 'message') {$message = @option[1]}

	if (@option[0] =~ 'submit') {$submit = @option[1]}
	if (@option[0] =~ 'mailto') {$mailto = @option[1]}
	if (@option[0] =~ 'subject') {$subject = @option[1]}

	if (@option[0] =~ 'showip') {$showip = @option[1]}

}


#####################################################################
# get user-defined html for header and footer
open(HD,"<$htmlhead");
@head = <HD>;
close(HD);
open(FT,"<$htmlfoot");
@foot = <FT>;
close(FT);

$ft = "<FONT FACE=\"$nametx\" COLOR=\"$colortx\" SIZE=\"$sizetx\">";

##########################################################################################
# print the support form

print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>\n";
print " $title\n";
print "</TITLE>\n";
print "</HEAD>\n";

#print header
foreach $linehd (@head) {
	print "$linehd\n";
}


print "<BODY BGCOLOR=\"$colorbg\">\n";
print "$ft\n";
print "$welcome<BR>\n";

print "<P ALIGN=\"left\">\n";

if ($showip eq 'yes') {
	$time = localtime;
	print "Your ip address is $ENV{'REMOTE_ADDR'} at $time.<BR><BR>\n"
}
print " <FORM ACTION=\"post14.pl\" METHOD=POST>\n";
print "  <TABLE BORDER=0>\n";

print "   <TR>\n";
print "    <TD ALIGN=\"left\">\n";
print "     $ft\n";
print "      <B>Your Name:</B>\n";
print "     </FONT>\n";
print "    </TD>\n";
print "    <TD>\n";
print "     $ft\n";
print "      <INPUT TYPE=TEXT SIZE=20 NAME=\"inc_who\" MAXLENGTH=40>\n";
print "     </FONT>\n";
print "    </TD>\n";
print "   </TR>\n";

print "   <TR>\n";
print "    <TD ALIGN=\"left\">\n";
print "     $ft\n";
print "      <B>Your Company:</B>\n";
print "     </FONT>\n";
print "    </TD>\n";
print "    <TD>\n";
print "     $ft\n";
print "      <INPUT TYPE=TEXT SIZE=20 NAME=\"inc_com\" MAXLENGTH=40>\n";
print "     </FONT>\n";
print "    </TD>\n";
print "   </TR>\n";

print "   <TR>\n";
print "    <TD ALIGN=\"left\">\n";
print "     $ft\n";
print "      <B>Your Telephone:</B>\n";
print "     </FONT>\n";
print "    </TD>\n";
print "    <TD>\n";
print "     $ft\n";
print "      <INPUT TYPE=TEXT SIZE=20 NAME=\"inc_pho\" MAXLENGTH=40>\n";
print "     </FONT>\n";
print "    </TD>\n";
print "   </TR>\n";

print "   <TR>\n";
print "    <TD ALIGN=\"left\">\n";
print "     $ft\n";
print "      <B>Your E-Mail:</B>\n";
print "     </FONT>\n";
print "    </TD>\n";
print "    <TD>\n";
print "     $ft\n";
print "      <INPUT TYPE=TEXT SIZE=20 NAME=\"inc_mai\" MAXLENGTH=40>\n";
print "     </FONT>\n";
print "    </TD>\n";
print "   </TR>\n";


print "   <TR>\n";
print "    <TD ALIGN=\"left\">\n";
print "     $ft\n";
print "      <B>Regarding:</B>\n";
print "     </FONT>\n";
print "    </TD>\n";
print "    <TD>\n";
print "     $ft\n";
print "      <SELECT NAME=\"inc_reg\">\n";
print "       <OPTION>--- Select A Category ---\n";

#print products
@prodname = split(/,/,$products);
foreach $prodline (@prodname){
	print "       <OPTION>$prodline\n";
}

print "      </SELECT>\n";
print "     </FONT>\n";
print "    </TD>\n";
print "   </TR>\n";

print "   <TR>\n";
print "    <TD ALIGN=\"left\" VALIGN=\"top\">\n";
print "     $ft\n";
print "      <B>Message:</B><BR>(Max 1000 Chars)\n";
print "     </FONT>\n";
print "    </TD>\n";
print "    <TD>\n";
print "     $ft\n";
print "      <TEXTAREA ROWS=4 COLS=40 WRAP NAME=\"inc_des\" MAXLENGTH=1000>\n$message\n";
print "      </TEXTAREA>\n";
print "     </FONT>\n";
print "    </TD>\n";
print "   </TR>\n";

print "   <TR>\n";
print "    <TD ALIGN=\"left\">\n";
print "     $ft\n";
print "      <B></B>\n";
print "     </FONT>\n";
print "    </TD>\n";
print "    <TD>\n";
print "     $ft\n";
print "      <INPUT TYPE=SUBMIT VALUE=\"Submit Request\">\n";

print "      <INPUT TYPE=HIDDEN NAME=\"inc_pri\" VALUE=\"$priority\">\n";
print "      <INPUT TYPE=HIDDEN NAME=\"inc_sta\" VALUE=\"$status\">\n";
print "      <INPUT TYPE=HIDDEN NAME=\"inc_cat\" VALUE=\"$category\">\n";

print "      <INPUT TYPE=HIDDEN NAME=\"inc_sub\" VALUE=\"$submit\">\n";
print "      <INPUT TYPE=HIDDEN NAME=\"inc_mto\" VALUE=\"$mailto\">\n";
print "      <INPUT TYPE=HIDDEN NAME=\"softopia\" VALUE=\"http://www.softopia.com\">\n";
print "      <INPUT TYPE=HIDDEN NAME=\"giganta\" VALUE=\"http://www.giganta.com\">\n";
print "     </FONT>\n";
print "    </TD>\n";
print "   </TR>\n";
print "  </TABLE>\n";
print " </FORM>\n";
print "</P>\n";
print "\n";

# beg ad tag
print "$ft\n";
print " <small class=small>\n";
print "  <BR>\n";
print "  Form and scripts provided by <a href=\"http://www.softopia.com\">www.softopia.com</a>.<br>\n";
print "  iTrack v1.4 copyright © 1996-2000\n";
print "  <BR>\n";
print " </small>\n";
print "</FONT>\n";
# end ad tag

print "</BODY>\n";

#print footer
foreach $lineft (@foot) {
	print "$lineft\n";
}

print "</HTML>\n";
