#!/usr/bin/perl

print "Content-Type: Text/HTML\n\n";

use CGI ':standard';
use Vpanel 1.00;
require $header;
require $accountinfo;

$domainname = find_domain ($mainuser);

# Define the tab which appears to the front
$tab_section = $tabnum_features;

# Output the content associated with this tab
print "<body class=section-$tab_section>";

# display tabs
require $tabdisplay;

print_header("Installation of a database for $domainname");

print "
	Thank you for your request to create a database on your website. We will be in contact shortly with 
	all the details you require to access your database.<BR><BR>
";

# Send an email
	$hostname = `hostname --fqdn`;
	$from = "info\@$hostname";
	$reply_to = "info\@$hostname";
	$subject = "Installation of a database for $domainname on $hostname\n";
	# $recipient = "hostmaster\@ieinternet.com";
	$recipient = "activateproduct\@ieinternet.com\n";
	$sendmail = "/usr/sbin/sendmail";

	open(SENDMAIL, "|$sendmail -t") or die "Cannot open $sendmail: $!";
	print SENDMAIL "To: $recipient";
	print SENDMAIL "From: $from";
	print SENDMAIL "Reply-To: $reply_to";
	print SENDMAIL "Subject: $subject";
	print SENDMAIL "Hi,\n\nPlease activate a database for $domainname on $hostname\n";
	print SENDMAIL "\n--\nThanks,\n\nYour friendly control panel";
	close(SENDMAIL);

require $footer;
