<?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['domain-title4'];
  $helppage = $TEXT['domain-help4'];

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

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

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

  if(empty($_GET['domain'])) puterror3($TEXT['error-domain1']);
  if(strlen($_GET['domain'])>200) puterror3($TEXT['error-domain2']);
  $_GET['domain'] = rep($_GET['domain']);

  $old_dom_id = $_GET['domain'];

  $query = "SELECT * FROM `domains` WHERE `domain`='".$_GET['domain']."' ";
  $result = mysql_query($query);
  if (!$result) puterror3($TEXT['error-tbl27']);
      $result2 = mysql_fetch_array($result);
         $domain = $result2['domain'];
	 $tip = $result2['type'];
?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table>
<tr><td class="useraddedit"><?php echo $TEXT['domain-edit']; ?></td><td class="useraddedit"><input size=50 maxlength=200 class="inputmandatory" type=text name=domain value='<?php echo $domain; ?>'></td></tr>
<tr><td class="useraddedit"><?php echo $TEXT['analiz-msg-type']; ?></td><td class="useraddedit">
<select class="inputmandatory" name=tip>
  <option value='LOCAL' <?php if ($tip =='LOCAL') echo "selected"?>>LOCAL
  <option value='RELAY' <?php if ($tip =='RELAY') echo "selected"?>>RELAY
  <option value='VIRTUAL' <?php if ($tip =='VIRTUAL') echo "selected"?>>VIRTUAL
</select>
</td></tr>
<tr><td></td><td>
<input class=button type=submit value='<?php echo $button; ?>' />
<input type=hidden name=dom_id value='<?php echo $old_dom_id; ?>' />
</td></tr>
</table>
</form>
<?php
  require_once "../../util/bottom.php";
?>