<?
$page = "admin_emailsettings.php";
include "admin_header.php";
if(isset($_POST['task'])) { $task = $_POST['task']; } elseif(isset($_GET['task'])) { $task = $_GET['task']; } else { $task = "main"; }


if($task == "dosave") {
$mailinglist_subject = str_replace("'", "&#39;", $_POST['mailinglist_subject']);
$mailinglist_message = $_POST['mailinglist_message'];
$comment_subject = str_replace("'", "&#39;", $_POST['comment_subject']);
$comment_message = $_POST['comment_message'];
$welcome_subject = str_replace("'", "&#39;", $_POST['welcome_subject']);
$welcome_message = $_POST['welcome_message'];
$verify_subject = str_replace("'", "&#39;", $_POST['verify_subject']);
$verify_message = $_POST['verify_message'];
$user_password_subject = str_replace("'", "&#39;", $_POST['user_password_subject']);
$user_password_email = $_POST['user_password_email'];
$forgot_subject = str_replace("'", "&#39;", $_POST['forgot_subject']);
$forgot_message = $_POST['forgot_message'];
$invite_subject = str_replace("'", "&#39;", $_POST['invite_subject']);
$invite_message = $_POST['invite_message'];
$is_error = "no";

if(str_replace(" ", "", $mailinglist_subject) == "") { $is_error = "yes"; }
if(str_replace(" ", "", $mailinglist_message) == "") { $is_error = "yes"; }
if(str_replace(" ", "", $comment_subject) == "") { $is_error = "yes"; }
if(str_replace(" ", "", $comment_message) == "") { $is_error = "yes"; }
if(str_replace(" ", "", $welcome_subject) == "") { $is_error = "yes"; }
if(str_replace(" ", "", $welcome_message) == "") { $is_error = "yes"; }
if(str_replace(" ", "", $verify_subject) == "") { $is_error = "yes"; }
if(str_replace(" ", "", $verify_message) == "") { $is_error = "yes"; }
if(str_replace(" ", "", $user_password_subject) == "") { $is_error = "yes"; }
if(str_replace(" ", "", $user_password_email) == "") { $is_error = "yes"; }
if(str_replace(" ", "", $forgot_subject) == "") { $is_error = "yes"; }
if(str_replace(" ", "", $forgot_message) == "") { $is_error = "yes"; }
if(str_replace(" ", "", $invite_subject) == "") { $is_error = "yes"; }
if(str_replace(" ", "", $invite_message) == "") { $is_error = "yes"; }

if($is_error == "yes") {
echo $head;
echo "
<h2>$admin_emailsettings29</h2>
$admin_emailsettings30<br><br><input type='button' class='button' value='$admin_emailsettings31' onClick='history.go(-1);'>
";
echo $foot;
exit();
}

mysql_query("UPDATE bhost_admin SET mailinglist_subject='$mailinglist_subject', mailinglist_message='$mailinglist_message', comment_subject='$comment_subject', comment_message='$comment_message', welcome_subject='$welcome_subject', welcome_message='$welcome_message', verify_subject='$verify_subject', verify_message='$verify_message', user_password_subject='$user_password_subject', user_password_email='$user_password_email', forgot_subject='$forgot_subject', forgot_message='$forgot_message', invite_subject='$invite_subject', invite_message='$invite_message'");
echo $head;
echo "
<h2>$admin_emailsettings1</h2>
$admin_emailsettings2
<br><br>
<form action='admin_emailsettings.php' method='POST'>
<input type='submit' class='button' value='$admin_emailsettings3'>
</form>
";
echo $foot;
exit();
}


echo $head;
echo "
<h2>$admin_emailsettings1</h2>
$admin_emailsettings4
<br><br>


<form action='admin_emailsettings.php' method='POST'>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_emailsettings23</td></tr>
<tr>
<td class='box'>
$admin_emailsettings24
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr>
<td align='right'>$admin_emailsettings7&nbsp;</td>
<td>
<input type='text' name='mailinglist_subject' class='text' size='63' value='$admin_info[mailinglist_subject]'>
</td>
</tr>
<tr>
<td align='right' valign='top'>$admin_emailsettings8&nbsp;</td>
<td>
<textarea name='mailinglist_message' rows='5' cols='65'>$admin_info[mailinglist_message]</textarea>
<br>
$admin_emailsettings25
</td>
</tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_emailsettings5</td></tr>
<tr>
<td class='box'>
$admin_emailsettings6
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr>
<td align='right'>$admin_emailsettings7&nbsp;</td>
<td>
<input type='text' name='comment_subject' class='text' size='63' value='$admin_info[comment_subject]'>
</td>
</tr>
<tr>
<td align='right' valign='top'>$admin_emailsettings8&nbsp;</td>
<td>
<textarea name='comment_message' rows='5' cols='65'>$admin_info[comment_message]</textarea>
<br>
$admin_emailsettings9
</td>
</tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_emailsettings10</td></tr>
<tr>
<td class='box'>
$admin_emailsettings11
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr>
<td align='right'>$admin_emailsettings7&nbsp;</td>
<td>
<input type='text' name='welcome_subject' class='text' size='63' value='$admin_info[welcome_subject]'>
</td>
</tr>
<tr>
<td align='right' valign='top'>$admin_emailsettings8&nbsp;</td>
<td>
<textarea name='welcome_message' rows='5' cols='65'>$admin_info[welcome_message]</textarea>
<br>
$admin_emailsettings12
</td>
</tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_emailsettings13</td></tr>
<tr>
<td class='box'>
$admin_emailsettings14
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr>
<td align='right'>$admin_emailsettings7&nbsp;</td>
<td>
<input type='text' name='verify_subject' class='text' size='63' value='$admin_info[verify_subject]'>
</td>
</tr>
<tr>
<td align='right' valign='top'>$admin_emailsettings8&nbsp;</td>
<td>
<textarea name='verify_message' rows='5' cols='65'>$admin_info[verify_message]</textarea>
<br>
$admin_emailsettings15
</td>
</tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_emailsettings16</td></tr>
<tr>
<td class='box'>
$admin_emailsettings17
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr>
<td align='right'>$admin_emailsettings7&nbsp;</td>
<td>
<input type='text' class='text' size='63' name='user_password_subject' maxlength='200' value='$admin_info[user_password_subject]'>
</td>
</tr>
<tr>
<td align='right' valign='top'>$admin_emailsettings8&nbsp;</td>
<td>
<textarea name='user_password_email' rows='5' cols='65'>$admin_info[user_password_email]</textarea>
<br>
$admin_emailsettings18
</td>
</tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_emailsettings20</td></tr>
<tr>
<td class='box'>
$admin_emailsettings21
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr>
<td align='right'>$admin_emailsettings7&nbsp;</td>
<td>
<input type='text' name='forgot_subject' class='text' size='63' value='$admin_info[forgot_subject]'>
</td>
</tr>
<tr>
<td align='right' valign='top'>$admin_emailsettings8&nbsp;</td>
<td>
<textarea name='forgot_message' rows='5' cols='65'>$admin_info[forgot_message]</textarea>
<br>
$admin_emailsettings22
</td>
</tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_emailsettings26</td></tr>
<tr>
<td class='box'>
$admin_emailsettings27
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr>
<td align='right'>$admin_emailsettings7&nbsp;</td>
<td>
<input type='text' name='invite_subject' class='text' size='63' value='$admin_info[invite_subject]'>
</td>
</tr>
<tr>
<td align='right' valign='top'>$admin_emailsettings8&nbsp;</td>
<td>
<textarea name='invite_message' rows='5' cols='65'>$admin_info[invite_message]</textarea>
<br>
$admin_emailsettings28
</td>
</tr>
</table>
</td>
</tr>
</table>

<br>

<input class='button' type='submit' value='$admin_emailsettings19'>
<input type='hidden' name='task' value='dosave'>
</form>
";

echo $foot;
?>