<?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['grp-srv-title'];

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

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

  $button = $TEXT['btn_run'];
  $action = "movefrmres.php";

  $query1 = "SELECT pods_id, podset FROM `tbl_podset` ORDER BY podset";
    $srv_tmp = mysqli_query($dbcnx,$query1);
       if(!$srv_tmp) {puterror($result2['skin'],$TEXT['error-tbl13']); require_once "../utils/bottom_adm.php"; exit();}
         while($srv = mysqli_fetch_array($srv_tmp,MYSQLI_ASSOC))
           {
             $query_upd = "UPDATE `tbl_ip` SET `pods_id` = ".$srv['pods_id']." WHERE ip_addr REGEXP '".$srv['podset']."' ";
              $query_run = mysqli_query($dbcnx,$query_upd);
                if(!$query_run) {puterror($result2['skin'],$TEXT['error-tbl2']); require_once "../utils/bottom_adm.php"; exit();}
            }
            echo "<table align='center' border='0'><tr align='center' ><td><span class='bold_it'>Operation completed.</span></td></tr></table>";
  require_once "../utils/bottom_adm.php";