<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?php
  ///////////////////////////////////////////////////
  //2007 (C)
  //Карпухин Павел
  ///////////////////////////////////////////////////

   if(empty($title))       $title       = $TEXT['global-title'];
   if(empty($description)) $description = $TEXT['global-description'];
   if(empty($keywords))    $keywords    = $TEXT['global-keywords'];
?>
<html>
<head>
<meta http-equiv="Expires" content="Mon, 23 May 1995 02:00:00 GMT" />
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate, no-store, max-age=0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
<meta name="description" content="<?php echo $description; ?>" />
<meta name="keywords" content="<?php echo $keywords; ?>" />
<title><?php echo $title; ?></title>
<link rel="StyleSheet" type="text/css" href="../util/admin.css" />
<link rel="StyleSheet" type="text/css" href="../util/grid.css" />
<link rel="icon" href="../favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
</head>
<body leftmargin="0" marginheight="0" marginwidth="0" rightmargin="0" bottommargin="0" topmargin="0" >
<script src="../util/tree_toggle.js" type="text/javascript"></script>
<table class=topadmin border="0" cellspacing="12" width="100%">
    <tr>
       <td class="nameusrl"><?php echo $TEXT['global-description']; ?><span class="nameusr"> <?php echo $TEXT['global-vertion']; ?></span></td>
       <td align="right" width="50%"><p><img alt='картинка' src= "../img/admin.png" height="15" align="top" /><a href="../main.php" class=link title="<?php echo $TEXT['global-title7']; ?>" ><b><?php echo $TEXT['global-title7']; ?></b></a></p></td>
    </tr>
</table>
<table border="0" cellspacing="0" width=100%>
<tr align="center"><td>

<?php
    if(is_file ("../lang/".$lang."/docs/index.html"))
    {
    echo "<a href='../lang/".$lang."/docs/index.html' class='img' target=_blank title='".$TEXT['global-documents']."' ><img class='help_logo' alt='".$TEXT['global-documents']."' src= '../img/docs.gif' /></a>";
    }
    else echo "<a href='../lang/ru/docs/index.html' class='img' target=_blank title='".$TEXT['global-documents']."' ><img class='help_logo' alt='".$TEXT['global-documents']."' src= '../img/docs.gif' /></a>";
?>

<h1 class=z1><?php echo $titlepage; ?></h1>
<p class=help><?php echo $helppage; ?></p>
<tr align="center" valign="top"><td height="100%"><br />
<?php
   if(! @mysql_select_db($dbname,$dbcnx))
    {
    echo "<table align='center' border='0'><tr align='center' ><td><img alt='stop' src='../img/stop.png' /></td></tr><tr  align='center' ><td><span class='res'>".$TEXT['error-conf3']."</span></td></tr></table>
             </body></html>";
    exit();
    }

  if(empty($_COOKIE['login'])) puterror2($TEXT['error-loginform5']);
  if(empty($_COOKIE['passwrd'])) puterror2($TEXT['error-loginform5']);

  $query = "SELECT * FROM `tbl_logins` WHERE `login`='".$_COOKIE['login']."' ";
  $result = mysql_query($query);
  if(!$result) puterror2($TEXT['error-tbl20']);
      $result2 = mysql_fetch_array($result);
      $passw1 = $_COOKIE['passwrd'];
      $passw2 = $result2['pass'];

       if($passw1 !== $passw2) puterror2($TEXT['error-loginform1']);
       if(empty($passw1)) puterror2($TEXT['error-loginform1']);
       if($result2['otvetstvenniy'] == 1) puterror2($TEXT['error-loginform4']);
?>