<?php
  ///////////////////////////////////////////////////
  //2007 (C)
  //Карпухин Павел
  ///////////////////////////////////////////////////

  $lang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0,2);
  if (is_file ("../../lang/".$lang."/".$lang.".php")) include "../../lang/".$lang."/".$lang.".php";
     else include "../../lang/ru/ru.php";

  $title=$titlepage = $TEXT['hostlst-ed'];
  $helppage = $TEXT['hostlst-ed-tit'];

  require_once "../../config.php";
  require_once "../../util/top_layer2.php";

  if($result2['administrator'] == 0) puterror3($TEXT['error-loginform4']);

  if(!isset($button)) $button = $TEXT['btn_edit'];
  if(!isset($action)) $action = "edit.php";

  if(empty($_GET['hostname'])) puterror3($TEXT['hostlst-error1']);
  if(strlen($_GET['hostname'])>65) puterror3($TEXT['hostlst-error2']);
  $_GET['hostname'] = rep($_GET['hostname']);

  $old_hostname = $_GET['hostname'];

  $query = "SELECT * FROM `hostlists` WHERE `hostname`='".$_GET['hostname']."' ";
  $result = mysql_query($query);
  if (!$result) puterror3($TEXT['error-tbl30']);
      $result2 = mysql_fetch_array($result);
         $hostname = $result2['hostname'];
	 $tip = $result2['type'];
?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table>
<tr><td class="useraddedit"><?php echo $TEXT['hostlst-text2']; ?></td><td class="useraddedit"><input size=50 maxlength=64 class="inputmandatory" type=text name=host value='<?php echo $hostname; ?>'></td></tr>
<tr><td class="useraddedit"><?php echo $TEXT['analiz-msg-type']; ?></td><td class="useraddedit">
<select class="inputmandatory" name=tip>
  <option value='AVOIDTLS' <?php if ($tip =='AVOIDTLS') echo "selected"?>>AVOIDTLS
  <option value='TRYAUTH' <?php if ($tip =='TRYAUTH') echo "selected"?>>TRYAUTH
  <option value='NOCALL' <?php if ($tip =='NOCALL') echo "selected"?>>NOCALL
</select>
</td></tr>
<tr><td></td><td>
<input class="button" type=submit value='<?php echo $button; ?>' />
<input type=hidden name=old_hostname value='<?php echo $old_hostname; ?>' />
</td></tr>
</table>
</form>
<?php
  require_once "../../util/bottom.php";
?>