<!DOCTYPE html>
<?php
///////////////////////////////////////////////////
//2010 (C)
//Карпухин Павел
///////////////////////////////////////////////////

if(empty($title)) {$title  = $TEXT['global-title'];}
if(empty($description)) {$description = $TEXT['global-description'];}
$address = "http://".$_SERVER['SERVER_ADDR']."/manydhcp/main.php";
?>
<html>
<head>
<meta http-equiv="Expires" content="Mon, 23 May 1995 02:00:00 GMT" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate, no-store, max-age=0" />
<meta name="description" content="<?php echo $description; ?>" />
<title><?php echo $title; ?></title>
<?php
  if(empty($_COOKIE['ident'])) {puterrorclr($TEXT['error-loginform4']); exit();}
  if(strlen($_COOKIE['ident'])>15) {puterrorclr($TEXT['error-login14']); exit();}
  if(empty($_COOKIE['passwrd'])) {puterrorclr($TEXT['error-loginform4']); exit();}
  if(strlen($_COOKIE['passwrd'])>100) {puterrorclr($TEXT['error-login5']); exit();}

  $query = "SELECT login_id, login, pass, administrator, user, skin, familiya, name, otchestvo, fltr_size, chk_upd FROM `tbl_logins` WHERE `login_id`='".$_COOKIE['ident']."' ";
  $result = mysqli_query($dbcnx,$query);
  if(!$result) {puterror($result2['skin'],$TEXT['error-tbl4']); require_once "../utils/bottom_adm.php"; exit();}
      $result2 = mysqli_fetch_array($result,MYSQLI_ASSOC);
      $passw1 = $_COOKIE['passwrd'];
      $passw2 = $result2['pass'];

      if($passw1 !== $passw2) {puterror($result2['skin'],$TEXT['error-loginform1']); require_once "../utils/bottom_adm.php"; exit();}
      if(empty($passw1)) {puterror($result2['skin'],$TEXT['error-loginform1']); require_once "../utils/bottom_adm.php"; exit();}

      if($result2['fltr_size'] < 1) {$result2['fltr_size'] = 20;}
?>
<link rel="StyleSheet" type="text/css" href="../skins/<?php echo $result2['skin']; ?>/reader.css" />
<link rel="icon" href="../favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
</head>
<body>
<script type="text/javascript" language="JavaScript" src="../utils/drop_down.js"></script>
<table align="center" width="96%" border="0" cellspacing="0" cellpadding="0">
 <tr>
  <td width="16">&nbsp;</td>
  <td></td>
  <td width="16">&nbsp;</td>
 </tr>
 <tr>
  <td class="osn_top_r"></td>
  <td class="osn_top"></td>
  <td class="osn_top_l"><a href="../logout.php" class=shut_img title="<?php echo $TEXT['global-logout-tit']; ?>"><img class="shut_logo" alt="<?php echo $TEXT['global-logout2']; ?>" src="../skins/<?php echo $result2['skin']; ?>/clr.png"></a></td>
 </tr>
 <tr>
  <td class="osn_left">&nbsp;</td>
  <td class="osn_center">
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
   <td>
    <form action=../addresses/index.php method=post>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
   <td width="55%">
  <?php
  if($result2['administrator'] == 1)
  {
   ?>
     <ul id="nav">
	<li><a class="link" href="../main.php" ><?php echo $TEXT['menu-btn1']; ?></a>
        <?php
         if($sams == "1") {echo "<ul><li><a class='tooltip3' href='../sams/index.php?vkl=0&amp;vkl_ch=on&amp;skin=".$result2['skin']."' >".$TEXT['menu-btn34']."<span>".$TEXT['menu-btn34-title']."<small></small></span></a></li></ul>";}
        ?>
        </li>
	<li><a href="#null"><?php echo $TEXT['menu-btn20']; ?></a>
	  <ul>
	    <li><a href="#null"><?php echo $TEXT['menu-btn25']; ?></a>
              <ul>
                  <li><a href="../users/index.php" title="<?php echo $TEXT['menu-btn17-title']; ?>"><?php echo $TEXT['menu-btn17']; ?></a></li>
                  <li><a href="../addresses/index.php" title="<?php echo $TEXT['menu-btn15-title']; ?>"><?php echo $TEXT['menu-btn15']; ?></a></li>
                  <li><a href="../servers/index.php" title="<?php echo $TEXT['menu-btn13-title']; ?>"><?php echo $TEXT['menu-btn13']; ?></a></li>
                  <li><a href="../domain/index.php" title="<?php echo $TEXT['menu-btn12-title']; ?>"><?php echo $TEXT['menu-btn12']; ?></a></li>
                <li><hr align="left" width="70" /></li>
                <li><a href="../house/index.php" title="<?php echo $TEXT['menu-btn29-title']; ?>"><?php echo $TEXT['menu-btn29']; ?></a></li>
                <li><a href="../etazh/index.php" title="<?php echo $TEXT['menu-btn30-title']; ?>"><?php echo $TEXT['menu-btn30']; ?></a></li>
                <li><a href="../oborud/index.php" title="<?php echo $TEXT['menu-btn31-title']; ?>"><?php echo $TEXT['menu-btn31']; ?></a></li>
                <li><a href="../podset/index.php" title="<?php echo $TEXT['menu-btn32-title']; ?>"><?php echo $TEXT['menu-btn32']; ?></a></li>
              </ul>
	    </li>
	    <li><a href="#null"><?php echo $TEXT['menu-obsluzhivanie']; ?></a>
	      <ul>
                  <li><a href="../service/analize.php" title="<?php echo $TEXT['menu-btn11-title']; ?>"><?php echo $TEXT['menu-btn11']; ?></a></li>
                  <li><a href="../service/optimize.php" title="<?php echo $TEXT['menu-btn10-title']; ?>"><?php echo $TEXT['menu-btn10']; ?></a></li>
                  <li><a href="../service/check.php" title="<?php echo $TEXT['menu-btn9-title']; ?>"><?php echo $TEXT['menu-btn9']; ?></a></li>
                  <li><a href="../service/repair.php" title="<?php echo $TEXT['menu-btn6-title']; ?>"><?php echo $TEXT['menu-btn6']; ?></a></li>
                  <li><a href="../service/dbsize.php" title="<?php echo $TEXT['menu-btn4-title']; ?>"><?php echo $TEXT['menu-btn4']; ?></a></li>
                  <li><a href="../ondisk/index.php" title="<?php echo $TEXT['menu-btn19-title']; ?>"><?php echo $TEXT['menu-btn19']; ?></a></li>
                  <li><a href="../savepar/index.php" title="<?php echo $TEXT['menu-btn14-title']; ?>"><?php echo $TEXT['menu-btn14']; ?></a></li>
                  <li><a href="../service/pingerfrm.php" title="<?php echo $TEXT['menu-btn22-title']; ?>"><?php echo $TEXT['menu-btn22']; ?></a></li>
                  <li><a href="../service/dump.php" title="<?php echo $TEXT['backup-tit']; ?>"><?php echo $TEXT['backup-tit']; ?></a></li>
                  <li><a href="../service/importfrm2.php" title="<?php echo $TEXT['restore-tit']; ?>"><?php echo $TEXT['menu-btn28']; ?></a></li>
              </ul>
	     </li>
             <li><a href="#null"><?php echo $TEXT['menu-btn23']; ?></a>
	      <ul>
                  <li><a href="../service/moverfrm.php" title="<?php echo $TEXT['menu-btn24-title']; ?>"><?php echo $TEXT['menu-btn24']; ?></a></li>
                  <li><a href="../service/copyfrm.php" title="<?php echo $TEXT['grp-srv-copy-title']; ?>"><?php echo $TEXT['menu-btn33']; ?></a></li>
                  <li><a href="../service/zadrfrm.php" title="<?php echo $TEXT['menu-btn26-title']; ?>"><?php echo $TEXT['menu-btn26']; ?></a></li>
                  <li><a href="../service/deletefrm.php" title="<?php echo $TEXT['menu-btn2-title']; ?>"><?php echo $TEXT['menu-btn2']; ?></a></li>
                  <li><a href="../service/wakefrm.php" title="<?php echo $TEXT['menu-btn35-title']; ?>"><?php echo $TEXT['menu-btn35']; ?></a></li>
                  <li><a href="../service/importfrm_sams.php" title="<?php echo $TEXT['menu-btn37-title']; ?>"><?php echo $TEXT['menu-btn37']; ?></a></li>
                  <li><a href="../service/checkswitch_frm.php" title="<?php echo $TEXT['menu-btn38-title']; ?>"><?php echo $TEXT['menu-btn38']; ?></a></li>
              </ul>
	     </li>
             <li><a href="../service/doublefrm.php" title="<?php echo $TEXT['menu-btn27-title']; ?>"><?php echo $TEXT['menu-btn27']; ?></a></li>
             <li><a href="../logs/index.php" title="<?php echo $TEXT['menu-btn5-title']; ?>"><?php echo $TEXT['menu-btn5']; ?></a></li>
             <li><a href="../logins/index.php" title="<?php echo $TEXT['menu-btn7-title']; ?>"><?php echo $TEXT['menu-btn7']; ?></a></li>
             <li><a href="../srvset/index.php" title="<?php echo $TEXT['menu-btn36-title']; ?>"><?php echo $TEXT['menu-btn36']; ?></a></li>
             <li><a href="../service/exportfrm.php" title="<?php echo $TEXT['menu-btn21-title']; ?>"><?php echo $TEXT['menu-btn21']; ?></a></li>
             <li><a href="../service/importfrm.php" title="<?php echo $TEXT['menu-btn18-title']; ?>"><?php echo $TEXT['menu-btn18']; ?></a></li>
             <li><a href="../update.php?skin=<?php echo $result2['skin']; ?>" title="<?php echo $TEXT['menu-btn3-title']; ?>"><?php echo $TEXT['menu-btn3']; ?></a></li>
	   </ul>
	</li>
      </ul>
<?php
  }
  else
  {
?>
   <ul id="nav">
	<li><a href="../main.php" class="link" ><?php echo $TEXT['menu-btn1']; ?></a>
        <?php
         if($sams == "1") {echo "<ul><li><a class='tooltip3' href='../sams/index.php?vkl=0&amp;vkl_ch=on' >".$TEXT['menu-btn34']."<span>".$TEXT['menu-btn34-title']."<small></small></span></a></li></ul>";}
        ?>
        </li>
	<li><a href="#null"><?php echo $TEXT['menu-btn20']; ?></a>
	  <ul>
	    <li><a href="#null"><?php echo $TEXT['menu-btn25']; ?></a>
              <ul>
                  <li><a href="../addresses/index.php" title="<?php echo $TEXT['menu-btn15-title']; ?>"><?php echo $TEXT['menu-btn15']; ?></a></li>
                  <li><a href="../podset/index.php" title="<?php echo $TEXT['menu-btn132-title']; ?>"><?php echo $TEXT['menu-btn32']; ?></a></li>
              </ul>
	    </li>
            <li><a href="../service/doublefrm.php" title="<?php echo $TEXT['menu-btn27-title']; ?>"><?php echo $TEXT['menu-btn27']; ?></a></li>
            <li><a href="../logs/index.php" title="<?php echo $TEXT['menu-btn5-title']; ?>"><?php echo $TEXT['menu-btn5']; ?></a></li>
            <li><a href="../logins/index.php" title="<?php echo $TEXT['menu-btn7-title']; ?>""><?php echo $TEXT['menu-btn7']; ?></a></li>
	   </ul>
	</li>
      </ul>
<?php
  }
?>
</td>
 <td align="right"><input class="inputsearch" size="30" maxlength="50" type=text name=search title="<?php echo $TEXT['search-btn-title']; ?>" >&nbsp;<input type=submit class="button" value='<?php echo $TEXT['search-btn']; ?>'></td>
</tr>
</table>
<hr size="1" width="99%" />
  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
    <tr>
     <td align="left" class="bold_it"><?php echo $TEXT['global-hellow']; ?><?php echo $result2['name']; ?>&nbsp;<?php echo $result2['otchestvo']; ?></td>
     <td align="right" class="menu">
       <input type=radio name=typepar value=5 checked><?php echo $TEXT['search-skv']; ?>
       <input type=radio name=typepar value=1><?php echo $TEXT['search-ip']; ?>
       <input type=radio name=typepar value=2><?php echo $TEXT['search-mac']; ?>
       <input type=radio name=typepar value=4><?php echo $TEXT['addr-name']; ?>
       <input type=radio name=typepar value=3><?php echo $TEXT['addr-descr']; ?>
     </td>
    </tr>
   </table>
  <hr size="3" width="98%" />
</form>
  <tr>
   <td>