<?php
  ///////////////////////////////////////////////////
  //2010 (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 = $TEXT['addr-move-tit1'];

  require_once "../config_a.php";
  require_once "../utils/functions.php";
  require_once "../utils/top_adm.php";

  if($result2['administrator'] == 0 && $result2['user'] == 0) {puterror($result2['skin'],$TEXT['error-loginform2']); require_once "utils/bottom.php"; exit();}

  $button = $TEXT['btn_vibor'];
  $action = "moveform.php";

  if(empty($_GET['ip_id'])) {puterror($result2['skin'],$TEXT['error-addr21']); require_once "../utils/bottom_adm.php"; exit();}
  if(strlen($_GET['ip_id'])>255) {puterror($result2['skin'],$TEXT['error-addr22']); require_once "../utils/bottom_adm.php"; exit();}
  $_GET['ip_id'] = rep ($_GET['ip_id']);
  $ip_id = $_GET['ip_id'];

?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post >
<table align="center" class="table" border="0" cellpadding="0" cellspacing="0" width="45%">
<tr>
    <td class="bold_it_page" ><?php echo $TEXT['srv-name']; ?>:&nbsp;</td>
    <td width="10%"><select name="srv_id">
    <?php
        $query1 = "SELECT srv_id, name, descr FROM `tbl_srv` ORDER BY name";
        $srv_tmp = mysqli_query($dbcnx,$query1);
          if(!$srv_tmp) {puterror($result2['skin'],$TEXT['error-tbl1']); require_once "../utils/bottom_adm.php"; exit();}
              while($srv = mysqli_fetch_array($srv_tmp,MYSQLI_ASSOC))
                {
                 if(trim($srv['descr']) == '')
                   {
                   $chk = "<option selected value=".$srv['srv_id'].">".$srv['name'];
                   }
                 else {$chk = "<option value=".$srv['srv_id'].">".$srv['name']."(".$srv['descr'].")";}
                 echo $chk;
                }
    ?>
    </select></td>
    <td width="10%"><input class="button" type=submit value='<?php echo $button; ?>'><input type="hidden" name="ip_id" value='<?php echo $ip_id; ?>'></td>
</tr>
</table>
</form>
<?php
  require_once "../utils/bottom_adm.php";
?>