<!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" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="<?php echo $description; ?>" />
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php

  if(empty($_COOKIE['login'])) puterror2($TEXT['error-loginform5']);
  if(empty($_COOKIE['passwrd'])) puterror2($TEXT['error-loginform5']);
  if(! @mysql_select_db($dbname,$dbcnx))
  {
    echo("<p>At this moment database is not available, therefore correct display of page is impossible.<br />If you do not install project previously, run script <a href=install.php>http://".$_SERVER['SERVER_ADDR']."/personal/install.php</a></p>");
    exit();
  }

  $query = "SELECT tbl_logins.*, tbl_users.org_id
    FROM tbl_logins
    LEFT JOIN tbl_users ON tbl_logins.usr_id=tbl_users.user_id
    WHERE tbl_logins.login='".$_COOKIE['login']."' ";
  $result = mysql_query($query);
  if(!$result) puterror2($TEXT['error-tbl20']);
      $result2 = mysql_fetch_array($result);
      $passw1 = $_COOKIE['passwrd'];
      $passw2 = $result2['pass'];
      $org_id = $result2['org_id'];
      $lgn_id = $result2['login_id'];

       if($passw1 !== $passw2) puterror2($TEXT['error-loginform3']);
       if(empty($passw1)) puterror2($TEXT['error-loginform3']);
       if($result2['otvetstvenniy'] == 1) puterror2($TEXT['error-supp11']);
