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

  if (empty($title)) {$title  = $TEXT['global-title'];}
  if (empty($description)) {$description = $TEXT['global-description'];}

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

  $query = "SELECT login_id, login, skin, pass, administrator, user, name, otchestvo FROM `tbl_logins` WHERE `login_id`='".$_COOKIE['ident']."' ";
  $result = mysqli_query($dbcnx,$query);
  if(!$result) {puterror2($result2['skin'],$TEXT['error-tbl7']); require_once "../utils/bottom_adm.php"; exit();}
      $result2 = mysqli_fetch_array($result);
      $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)) {puterror2($result2['skin'],$TEXT['error-loginform1']); require_once "../utils/bottom_adm.php"; exit();}

?>
<link rel="StyleSheet" type="text/css" href="skins/<?php echo $result2['skin']; ?>/print.css" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
</head>
<body>