<?
$page = "admin_signup.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") {
$allow_password = $_POST['allow_password'];
if($allow_password != "1") { $allow_password = "0"; }
$signup_choosetemplate = $_POST['signup_choosetemplate'];
$signup_templatedefault = $_POST['signup_templatedefault'];
$signup_emaildupeok = $_POST['signup_emaildupeok'];
$signup_emaildomain = htmlspecialchars(str_replace(" ", "", $_POST[signup_emaildomain]), ENT_QUOTES);
$signup_emailverify = $_POST['signup_emailverify'];
$signup_emailcheck = $_POST['signup_emailcheck'];
$signup_notify = $_POST['signup_notify'];
$signup_timezone = $_POST['signup_timezone'];
$signup_format_date = $_POST['signup_format_date'];
$signup_format_time = $_POST['signup_format_time'];
$signup_sendemail = $_POST['signup_sendemail'];
$signup_terms = $_POST['signup_terms'];
$signup_termstext = $_POST['signup_termstext'];
$signup_image = $_POST['signup_image'];

mysql_query("UPDATE bhost_admin SET allow_password='$allow_password', signup_choosetemplate='$signup_choosetemplate', signup_templatedefault='$signup_templatedefault', signup_emaildupeok='$signup_emaildupeok', signup_emaildomain='$signup_emaildomain', signup_emailverify='$signup_emailverify', signup_emailcheck='$signup_emailcheck', signup_notify='$signup_notify', signup_timezone='$signup_timezone', signup_format_date='$signup_format_date', signup_format_time='$signup_format_time', signup_sendemail='$signup_sendemail', signup_terms='$signup_terms', signup_termstext='$signup_termstext', signup_image='$signup_image'");

if($admin_info[signup_emailverify] == 1 & $signup_emailverify == 0) {
mysql_query("UPDATE bhost_users SET verified='1' WHERE verified='0'");
}

if($admin_info[signup_emailverify] == 0 & $signup_emailverify == 1) {
mysql_query("UPDATE bhost_users SET verified='1' WHERE verified='0'");
}

echo $head;
echo "
<h2>$admin_signup4</h2>
$admin_signup5
<br><br>
<form action='admin_signup.php' method='POST'>
<input type='submit' class='button' value='$admin_signup6'>
</form>
";
echo $foot;

exit();
}





echo $head;

echo "
<h2>$admin_signup4</h2>
$admin_signup7
<br><br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><form action='admin_signup.php' method='POST' name='info'>
<td class='header'>$admin_signup8</td></tr>
<tr>
<td class='box'>
 <table cellpadding='0' cellspacing='0'>
 <tr><td><input type='radio' name='allow_password' id='allow_password1' value='1'"; if($admin_info[allow_password] == "1") { echo " CHECKED"; } echo "></td><td><label for='allow_password1'>$admin_signup9</label></td></tr>
 <tr><td><input type='radio' name='allow_password' id='allow_password0' value='0'"; if($admin_info[allow_password] == "0") { echo " CHECKED"; } echo "></td><td><label for='allow_password0'>$admin_signup10</label></td></tr>
 </table>
<br>
$admin_signup11
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_signup12</td></tr>
<tr>
<td class='box'>
  <table cellpadding='0' cellspacing='0'>
  <tr>
  <td>
   <table cellpadding='0' cellspacing='0'>
   <tr><td><input type='radio' name='signup_choosetemplate' id='signup_choosetemplate1' value='1' onClick='disableTemplates()'"; if($admin_info[signup_choosetemplate] == "1") { echo " CHECKED"; } echo "></td><td><label for='signup_choosetemplate1'>$admin_signup13</label></td></tr>
   <tr><td valign='middle'><input type='radio' name='signup_choosetemplate' id='signup_choosetemplate0' value='0' onClick='enableTemplates()'"; if($admin_info[signup_choosetemplate] == "0") { echo " CHECKED"; } echo "></td><td><label for='signup_choosetemplate0'>$admin_signup14</label></td></tr>
   </table>
  </td>
  <td valign='bottom'>
&nbsp;<select name='signup_templatedefault' style='margin-top: 3px;'>
";

$templates = mysql_query("SELECT * FROM bhost_templates");
while($template = mysql_fetch_assoc($templates)) {
echo "
<option value='$template[t_id]'"; if($admin_info[signup_templatedefault] == "$template[t_id]") { echo " SELECTED"; } echo ">$template[name]</option>
";
}

echo "
</select>
   </td>
   </tr>
   </table>

<br>
$admin_signup45
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_signup15</td></tr>
<tr>
<td class='box'>
$admin_signup16<br><br>
<select name='signup_timezone'>
<option value='-8'"; if($admin_info[signup_timezone] == "-8") { echo "selected"; } echo ">Pacific Time (US & Canada)</option>
<option value='-7'"; if($admin_info[signup_timezone] == "-7") { echo "selected"; } echo ">Mountain Time (US & Canada)</option>
<option value='-6'"; if($admin_info[signup_timezone] == "-6") { echo "selected"; } echo ">Central Time (US & Canada)</option>
<option value='-5'"; if($admin_info[signup_timezone] == "-5") { echo "selected"; } echo ">Eastern Time (US & Canada)</option>
<option value='-4'"; if($admin_info[signup_timezone] == "-4") { echo "selected"; } echo ">Atlantic Time (Canada)</option>
<option value='-9'"; if($admin_info[signup_timezone] == "-9") { echo "selected"; } echo ">Alaska (US & Canada)</option>
<option value='-10'"; if($admin_info[signup_timezone] == "-10") { echo "selected"; } echo ">Hawaii (US)</option>
<option value='-11'"; if($admin_info[signup_timezone] == "-11") { echo "selected"; } echo ">Midway Island, Samoa</option>
<option value='-12'"; if($admin_info[signup_timezone] == "-12") { echo "selected"; } echo ">Eniwetok, Kwajalein</option>
<option value='-3.3'"; if($admin_info[signup_timezone] == "-3.3") { echo "selected"; } echo ">Newfoundland</option>
<option value='-3'"; if($admin_info[signup_timezone] == "-3") { echo "selected"; } echo ">Brasilia, Buenos Aires, Georgetown</option>
<option value='-2'"; if($admin_info[signup_timezone] == "-2") { echo "selected"; } echo ">Mid-Atlantic</option>
<option value='-1'"; if($admin_info[signup_timezone] == "-1") { echo "selected"; } echo ">Azores, Cape Verde Is.</option>
<option value='0'"; if($admin_info[signup_timezone] == "0") { echo "selected"; } echo ">Greenwich Mean Time (Lisbon, London)</option>
<option value='1'"; if($admin_info[signup_timezone] == "1") { echo "selected"; } echo ">Amsterdam, Berlin, Paris, Rome, Madrid</option>
<option value='2'"; if($admin_info[signup_timezone] == "2") { echo "selected"; } echo ">Athens, Helsinki, Istanbul, Cairo, E. Europe</option>
<option value='3'"; if($admin_info[signup_timezone] == "3") { echo "selected"; } echo ">Baghdad, Kuwait, Nairobi, Moscow</option>
<option value='3.3'"; if($admin_info[signup_timezone] == "3.3") { echo "selected"; } echo ">Tehran</option>
<option value='4'"; if($admin_info[signup_timezone] == "4") { echo "selected"; } echo ">Abu Dhabi, Kazan, Muscat</option>
<option value='4.3'"; if($admin_info[signup_timezone] == "4.3") { echo "selected"; } echo ">Kabul</option>
<option value='5'"; if($admin_info[signup_timezone] == "5") { echo "selected"; } echo ">Islamabad, Karachi, Tashkent</option>
<option value='5.5'"; if($admin_info[signup_timezone] == "5.5") { echo "selected"; } echo ">Bombay, Calcutta, New Delhi</option>
<option value='6'"; if($admin_info[signup_timezone] == "6") { echo "selected"; } echo ">Almaty, Dhaka</option>
<option value='7'"; if($admin_info[signup_timezone] == "7") { echo "selected"; } echo ">Bangkok, Jakarta, Hanoi</option>
<option value='8'"; if($admin_info[signup_timezone] == "8") { echo "selected"; } echo ">Beijing, Hong Kong, Singapore, Taipei</option>
<option value='9'"; if($admin_info[signup_timezone] == "9") { echo "selected"; } echo ">Tokyo, Osaka, Sapporto, Seoul, Yakutsk</option>
<option value='9.3'"; if($admin_info[signup_timezone] == "9.3") { echo "selected"; } echo ">Adelaide, Darwin</option>
<option value='10'"; if($admin_info[signup_timezone] == "10") { echo "selected"; } echo ">Brisbane, Melbourne, Sydney, Guam</option>
<option value='11'"; if($admin_info[signup_timezone] == "11") { echo "selected"; } echo ">Magadan, Soloman Is., New Caledonia</option>
<option value='12'"; if($admin_info[signup_timezone] == "12") { echo "selected"; } echo ">Fiji, Kamchatka, Marshall Is., Wellington</option>
</select>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_signup41</td></tr>
<tr>
<td class='box'>
$admin_signup42
<select name='signup_format_date'>
<option value='n/j/Y'"; if($admin_info[signup_format_date] == "n/j/Y") { echo "selected"; } echo ">".cdate("n/j/Y", time())."</option>
<option value='n.j.Y'"; if($admin_info[signup_format_date] == "n.j.Y") { echo "selected"; } echo ">".cdate("n.j.Y", time())."</option>
<option value='n-j-Y'"; if($admin_info[signup_format_date] == "n-j-Y") { echo "selected"; } echo ">".cdate("n-j-Y", time())."</option>
<option value='Y/n/j'"; if($admin_info[signup_format_date] == "Y/n/j") { echo "selected"; } echo ">".cdate("Y/n/j", time())."</option>
<option value='Y-n-j'"; if($admin_info[signup_format_date] == "Y-n-j") { echo "selected"; } echo ">".cdate("Y-n-j", time())."</option>
<option value='Y-m-d'"; if($admin_info[signup_format_date] == "Y-m-d") { echo "selected"; } echo ">".cdate("Y-m-d", time())."</option>
<option value='Ynj'"; if($admin_info[signup_format_date] == "Ynj") { echo "selected"; } echo ">".cdate("Ynj", time())."</option>
<option value='j/n/Y'"; if($admin_info[signup_format_date] == "j/n/Y") { echo "selected"; } echo ">".cdate("j/n/Y", time())."</option>
<option value='j.n.Y'"; if($admin_info[signup_format_date] == "j.n.Y") { echo "selected"; } echo ">".cdate("j.n.Y", time())."</option>
<option value='M. j, Y'"; if($admin_info[signup_format_date] == "M. j, Y") { echo "selected"; } echo ">".cdate("M. j, Y", time())."</option>
<option value='F j, Y'"; if($admin_info[signup_format_date] == "F j, Y") { echo "selected"; } echo ">".cdate("F j, Y", time())."</option>
<option value='j F Y'"; if($admin_info[signup_format_date] == "j F Y") { echo "selected"; } echo ">".cdate("j F Y", time())."</option>
<option value='l, F j, Y'"; if($admin_info[signup_format_date] == "l, F j, Y") { echo "selected"; } echo ">".cdate("l, F j, Y", time())."</option>
<option value='D-j-M-Y'"; if($admin_info[signup_format_date] == "D-j-M-Y") { echo "selected"; } echo ">".cdate("D-j-M-Y", time())."</option>
<option value='D j M Y'"; if($admin_info[signup_format_date] == "D j M Y") { echo "selected"; } echo ">".cdate("D j M Y", time())."</option>
<option value='D j F Y'"; if($admin_info[signup_format_date] == "D j F Y") { echo "selected"; } echo ">".cdate("D j F Y", time())."</option>
<option value='l j F Y'"; if($admin_info[signup_format_date] == "l j F Y") { echo "selected"; } echo ">".cdate("l j F Y", time())."</option>
<option value='Y-M-j'"; if($admin_info[signup_format_date] == "Y-M-j") { echo "selected"; } echo ">".cdate("Y-M-j", time())."</option>
<option value='j-M-Y'"; if($admin_info[signup_format_date] == "j-M-Y") { echo "selected"; } echo ">".cdate("j-M-Y", time())."</option>
</select>
"; 

$time = "460269000"; 

echo "
<select name='signup_format_time'>
<option value='g:i A'"; if($admin_info[signup_format_time] == "g:i A") { echo "selected"; } echo ">".cdate("g:i A", $time)."</option>
<option value='h:i A'"; if($admin_info[signup_format_time] == "h:i A") { echo "selected"; } echo ">".cdate("h:i A", $time)."</option>
<option value='g:i'"; if($admin_info[signup_format_time] == "g:i") { echo "selected"; } echo ">".cdate("g:i", $time)."</option>
<option value='h:i'"; if($admin_info[signup_format_time] == "h:i") { echo "selected"; } echo ">".cdate("h:i", $time)."</option>
<option value='H:i'"; if($admin_info[signup_format_time] == "H:i") { echo "selected"; } echo ">".cdate("H:i", $time)."</option>
<option value='H\hi'"; if($admin_info[signup_format_time] == "H\hi") { echo "selected"; } echo ">".cdate("H\hi", $time)."</option>
</select>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_signup17</td></tr>
<tr>
<td class='box'>
 <table cellpadding='0' cellspacing='0'>
 <tr><td><input type='radio' name='signup_emaildupeok' id='signup_emaildupeok1' value='1'"; if($admin_info[signup_emaildupeok] == "1") { echo " CHECKED"; } echo "></td><td><label for='signup_emaildupeok1'>$admin_signup18</label></td></tr>
 <tr><td><input type='radio' name='signup_emaildupeok' id='signup_emaildupeok0' value='0'"; if($admin_info[signup_emaildupeok] == "0") { echo " CHECKED"; } echo "></td><td><label for='signup_emaildupeok0'>$admin_signup19</label></td></tr>
 </table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_signup43</td></tr>
<tr>
<td class='box'>
$admin_signup44<br>
<input type='text' class='text' name='signup_emaildomain' size='30' maxlength='100' value='$admin_info[signup_emaildomain]'>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_signup1</td></tr>
<tr>
<td class='box'>
 <table cellpadding='0' cellspacing='0'>
 <tr><td><input type='radio' name='signup_emailcheck' id='signup_emailcheck0' value='0'"; if($admin_info[signup_emailcheck] == "0") { echo " CHECKED"; } echo "></td><td><label for='signup_emailcheck0'>$admin_signup2</label></td></tr>
 <tr><td><input type='radio' name='signup_emailcheck' id='signup_emailcheck1' value='1'"; if($admin_info[signup_emailcheck] == "1") { echo " CHECKED"; } echo "></td><td><label for='signup_emailcheck1'>$admin_signup3</label></td></tr>
 </table>
<br>
$admin_signup51
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_signup20</td></tr>
<tr>
<td class='box'>
 <table cellpadding='0' cellspacing='0'>
 <tr><td><input type='radio' name='signup_emailverify' id='signup_emailverify0' value='0'"; if($admin_info[signup_emailverify] == "0") { echo " CHECKED"; } echo "></td><td><label for='signup_emailverify0'>$admin_signup21</label></td></tr>
 <tr><td><input type='radio' name='signup_emailverify' id='signup_emailverify1' value='1'"; if($admin_info[signup_emailverify] == "1") { echo " CHECKED"; } echo "></td><td><label for='signup_emailverify1'>$admin_signup22</label></td></tr>
 </table>
<br>
$admin_signup23
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_signup24</td></tr>
<tr>
<td class='box'>
 <table cellpadding='0' cellspacing='0'>
 <tr><td><input type='radio' name='signup_notify' id='signup_notify1' value='1'"; if($admin_info[signup_notify] == "1") { echo " CHECKED"; } echo "></td><td><label for='signup_notify1'>$admin_signup25</label></td></tr>
 <tr><td><input type='radio' name='signup_notify' id='signup_notify0' value='0'"; if($admin_info[signup_notify] == "0") { echo " CHECKED"; } echo "></td><td><label for='signup_notify0'>$admin_signup26</label></td></tr>
 </table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_signup27</td></tr>
<tr>
<td class='box'>
 <table cellpadding='0' cellspacing='0'>
 <tr><td><input type='radio' name='signup_sendemail' id='signup_sendemail1' value='1'"; if($admin_info[signup_sendemail] == "1") { echo " CHECKED"; } echo "></td><td><label for='signup_sendemail1'>$admin_signup28</label></td></tr>
 <tr><td><input type='radio' name='signup_sendemail' id='signup_sendemail0' value='0'"; if($admin_info[signup_sendemail] == "0") { echo " CHECKED"; } echo "></td><td><label for='signup_sendemail0'>$admin_signup29</label></td></tr>
 </table>
<br>
$admin_signup30
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_signup32</td></tr>
<tr>
<td class='box'>
 <table cellpadding='0' cellspacing='0'>
 <tr><td><input type='radio' name='signup_terms' id='signup_terms0' value='0'"; if($admin_info[signup_terms] == "0") { echo " CHECKED"; } echo "></td><td><label for='signup_terms0'>$admin_signup33</label></td></tr>
 <tr><td><input type='radio' name='signup_terms' id='signup_terms1' value='1'"; if($admin_info[signup_terms] == "1") { echo " CHECKED"; } echo "></td><td><label for='signup_terms1'>$admin_signup34</label></td></tr>
 </table>
<br>
$admin_signup35
<br><br>
<textarea rows='8' cols='70' name='signup_termstext' style='width: 100%;'>$admin_info[signup_termstext]</textarea>
</td>
</tr>
</table>

<br>
";


// CHECK FOR GD LIBRARIES
if(!function_exists('gd_info')) {
$gd = "no";
$gdproblem = "
<font color='#FF0000'>$admin_signup46</font>
<br><br>
";
} else {
$gd = "yes";
}

echo "
<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_signup47</td></tr>
<tr>
<td class='box'>
 <table cellpadding='0' cellspacing='0'>
 <tr><td><input type='radio' name='signup_image' id='signup_image0' value='0'"; if($admin_info[signup_image] == "0" OR $gd == "no") { echo " CHECKED"; } echo "></td><td><label for='signup_image0'>$admin_signup48</label></td></tr>
 <tr><td><input type='radio' name='signup_image' id='signup_image1' value='1'"; if($admin_info[signup_image] == "1" AND $gd != "no") { echo " CHECKED"; } if($gd == "no") { echo " DISABLED"; } echo "></td><td><label for='signup_image1'>$admin_signup49</label></td></tr>
 </table>
<br>$gdproblem
$admin_signup50
</td>
</tr>
</table>

<br>

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

<script language='JavaScript'>
<!--

function disableTemplates() {
window.document.info.signup_templatedefault.style.visibility = \"hidden\";
}

function enableTemplates() {
window.document.info.signup_templatedefault.style.visibility = \"visible\";
}

appendEvent = function(el, evname, func) {
 if (el.attachEvent) { // IE
   el.attachEvent('on' + evname, func);
 } else if (el.addEventListener) { // Gecko / W3C
   el.addEventListener(evname, func, true);
 } else {
   el['on' + evname] = func;
 }
};
"; if($admin_info[signup_choosetemplate] == "1") { echo "appendEvent(window, 'load', disableTemplates);"; } echo "
// -->
</script>
";

echo $foot;
?>