<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">
<?php
  ///////////////////////////////////////////////////
  //2007 (C)
  //Карпухин Павел
  ///////////////////////////////////////////////////

   if(empty($title))       $title       = $TEXT['global-title'];
   if(empty($description)) $description = $TEXT['global-description'];
   if(empty($keywords))    $keywords    = $TEXT['global-keywords'];
   $address = "http://".$_SERVER['SERVER_ADDR']."/personal/upravlenie.php";
?>
<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; ?>" />
<title><?php echo $title; ?></title>
<script type="text/javascript" language="JavaScript" src="utils/drop_down.js"></script>
<link rel="StyleSheet" type="text/css" href="utils/reader.css" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="<?php echo $TEXT['global-title'] ?>" href="http://<?php echo $_SERVER['SERVER_ADDR'] ?>/personal/utils/telspr-<?php echo $lang ?>.xml">
<link rel="alternate" href="http://<?php echo $_SERVER['SERVER_ADDR'] ?>/personal/rss.php?org_id=<?php echo $org_id; ?>" type="application/rss+xml" title="<?php echo $TEXT['global-rss'] ?>" />
</head>
<body leftmargin="0" marginheight="0" marginwidth="0" rightmargin="0" bottommargin="0" topmargin="0" >
<?php
$month["01"] = $TEXT['month01'];
$month["02"] = $TEXT['month02'];
$month["03"] = $TEXT['month03'];
$month["04"] = $TEXT['month04'];
$month["05"] = $TEXT['month05'];
$month["06"] = $TEXT['month06'];
$month["07"] = $TEXT['month07'];
$month["08"] = $TEXT['month08'];
$month["09"] = $TEXT['month09'];
$month["10"] = $TEXT['month10'];
$month["11"] = $TEXT['month11'];
$month["12"] = $TEXT['month12'];
$date_day = date("d");
$week["0"] = $TEXT['week01'];
$week["1"] = $TEXT['week02'];
$week["2"] = $TEXT['week03'];
$week["3"] = $TEXT['week04'];
$week["4"] = $TEXT['week05'];
$week["5"] = $TEXT['week06'];
$week["6"] = $TEXT['week07'];
$date_week = date("w");
$date_month = date("m");
$date_year = date("Y");
$year = $TEXT['year'];

$chislo = (date("$week[$date_week]\<\B\R />$date_day $month[$date_month]\<\B\R /> $date_year $year"));

  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();
  }

  $query_srv = "SELECT `glob_w`, `glob_h`, `user_w`, `user_h`, `res_w`, `res_h`, `admin_mail_rss`, `admin_mail_news` FROM `tbl_srv_param` LIMIT 1";
  $result_srv = mysql_query($query_srv);
  if(!$result_srv) puterror2($TEXT['error-tbl44']);
   $result_srv_set = mysql_fetch_array($result_srv,MYSQL_ASSOC);

  $TEXT['user-width'] = $result_srv_set['user_w']; // ширина формы - инф. о пользователе
  $TEXT['user-height'] = $result_srv_set['user_h']; // высота формы - инф. о пользователе
  $TEXT['user-top'] = ($result_srv_set['glob_h']/2)-($result_srv_set['user_h']/2); // выравнивание на экране (пикселей от верхнего края) - инф. о пользователе
  $TEXT['user-left'] = ($result_srv_set['glob_w']/2)-($result_srv_set['user_w']/2); // выравнивание на экране (пикселей от левого края) - инф. о пользователе

  $TEXT['about-width'] = "520"; // ширина формы - инф. о программе
  $TEXT['about-height'] = "250"; // высота формы - инф. о программе
  $TEXT['about-top'] = ($result_srv_set['glob_h']/2)-(250/2); // выравнивание на экране (пикселей от верхнего края) - о программе
  $TEXT['about-left'] = ($result_srv_set['glob_w']/2)-(520/2); // выравнивание на экране (пикселей от левого края) - о программе

  $TEXT['resour-width'] = $result_srv_set['res_w']; // ширина формы - инф. о ресурсе
  $TEXT['resour-height'] = $result_srv_set['res_h']; // высота формы - инф. о ресурсе
  $TEXT['resour-top'] = ($result_srv_set['glob_h']/2)-($result_srv_set['res_h']/2); // выравнивание на экране (пикселей от верхнего края) - инф. о ресурсе
  $TEXT['resour-left'] = ($result_srv_set['glob_w']/2)-($result_srv_set['res_w']/2); // выравнивание на экране (пикселей от левого края) - инф. о ресурсе

  $TEXT['admin-mail-rss'] = $result_srv_set['admin_mail_rss']; // почтовый адрес администратора rss
  $TEXT['admin-mail-news'] = $result_srv_set['admin_mail_news']; // почтовый адрес администратора новостей

  if(empty($_GET['org_id'])) $_GET['org_id'] = "";
  if(strlen($_GET['org_id'])>11) puterror($TEXT['error-org']);
  $_GET['org_id'] = rep($_GET['org_id']);
  $org_id = $_GET['org_id'];
?>
<div id="fixedtop">
<form action=search_org.php method=post>
 <table class="clock" width="100%" border="0" cellspacing="0">
    <tr align="center">
        <td align="left"><img alt="picture" src= 'img/top_image.png' height='20' border='0' /></td>
        <td class="clock"><?php echo $chislo; ?></td>
    </tr>
<?php
$query_book = "SELECT DISTINCT `first_b` FROM `tbl_users` WHERE `org_id` = '$org_id' AND `visible` = 'show' GROUP BY `first_b` LIMIT 1";
          $result_book = mysql_query($query_book);
           if(!$result_book) puterror($TEXT['error-tbl2']);
              $first_bk = mysql_fetch_array($result_book,MYSQL_ASSOC);
                 $bkv = $first_bk['first_b'];
?>
 </table>
 <table width=100% class=topheader border="0" cellspacing="5">
              <tr align="center" valign="middle">
                  <td align="right"><input size=30 class=inputsearch type=text name=search title="<?php echo $TEXT['search-btn-title']; ?>" >&nbsp;<input type=submit value='<?php echo $TEXT['search-btn']; ?>'>
                  <input type=hidden name=org_id value=<?php echo $org_id; ?>>
                  </td>
              </tr>
              <tr>
              <td align="right" class=menu><input type=radio name=typepar value=1 checked><?php echo $TEXT['search-name2']; ?>
                                           <input type=radio name=typepar value=2><?php echo $TEXT['search-name']; ?>
                                           <input type=radio name=typepar value=3><?php echo $TEXT['search-room']; ?>
                                           <input type=radio name=typepar value=4><?php echo $TEXT['search-int-phone']; ?>
                                           <input type=radio name=typepar value=5><?php echo $TEXT['search-mail']; ?>
                  </td>
              </tr>
  </table>
  </form>
<div class="menu_news_mesto">
 <table align="right" width="15%" border="0">
 <tr align="right">
       <td align="right" class="menu">
          <ul id="nav">
          <li><a href="#"><?php echo $TEXT['menu']; ?></a>
            <ul>
            <li><a href="index.php" class=link title="<?php echo $TEXT['menu-btn1-title']; ?>"><?php echo $TEXT['menu-btn1']; ?></a></li>
            <li><a href="alfavit_upr.php?bukva=<?php echo $bkv; ?>&amp;org_id=<?php echo $_GET['org_id']; ?>" class=link title="<?php echo $TEXT['menu-btn2-title']; ?>"><?php echo $TEXT['menu-btn2']; ?></a></li>
            <li><a href="search_ext.php?org_id=<?php echo $_GET['org_id']; ?>" class=link title="<?php echo $TEXT['menu-btn3-title']; ?>"><?php echo $TEXT['menu-btn3']; ?></a></li>
            <li><a href="razdel.php?org_id=<?php echo $org_id; ?>" class=link title="<?php echo $TEXT['menu-btn4-title']; ?>"><?php echo $TEXT['menu-btn4']; ?></a></li>
            <li><a href="resources.php?org_id=<?php echo $org_id; ?>" class=link title="<?php echo $TEXT['menu-btn5-title']; ?>"><?php echo $TEXT['menu-btn5']; ?></a></li>
            <li><a href="razdel_inst.php" class=link title="<?php echo $TEXT['menu-btn14-title']; ?>"><?php echo $TEXT['menu-btn14']; ?></a></li>
            <li><a href="photoalbum.php?org_id=<?php echo $org_id; ?>" class=link title="<?php echo $TEXT['menu-btn6-title']; ?>"><?php echo $TEXT['menu-btn6']; ?></a></li>
            <li><a href="forecast.php" class=link title="<?php echo $TEXT['menu-btn15-title']; ?>"><?php echo $TEXT['menu-btn15']; ?></a></li>
            <li><a href="support_desc.php?org_id=<?php echo $org_id; ?>" class=link title="<?php echo $TEXT['menu-btn17-title']; ?>"><?php echo $TEXT['menu-btn17']; ?></a></li>
            <li><a href="meetings.php?org_id=<?php echo $org_id; ?>" class=link title="<?php echo $TEXT['meet-help']; ?>"><?php echo $TEXT['meet-title']; ?></a></li>
            <li><a href="help.php" class=link title="<?php echo $TEXT['menu-btn16-title']; ?>"><?php echo $TEXT['menu-btn16']; ?></a></li>
            <li><a href=# onClick="window.open('about.php','popup','top=<?php echo $TEXT['user-top']; ?>,left=<?php echo $TEXT['user-left']; ?>,width=<?php echo $TEXT['about-width']; ?>,height=<?php echo $TEXT['about-height']; ?>,status=no,scrollbars=no,location=no,menubar=no,toolbar=no')" class=link title="<?php echo $TEXT['menu-btn8-title']; ?>"><?php echo $TEXT['menu-btn8']; ?></a></li>
            </ul>
          </li>
        </ul></td>
       </tr>
 <?php
 $query_count_tmp = mysql_query("SELECT COUNT(new_id) FROM tbl_news WHERE `visible` = 'show' AND `org_id` = '$org_id' ");
 $coun_rows_tmp1 = mysql_result($query_count_tmp, 0);
   if($coun_rows_tmp1 > 0)
     {
     $query = "SELECT `new_id`, `header`, `description`, `data` FROM `tbl_news` WHERE `visible` = 'show' AND `org_id` = '$org_id' ORDER BY `position`, `data` DESC";
     $result_n = mysql_query($query);
     if(!$result_n) puterror($TEXT['error-tbl17']);

     echo "</table>
        </div>
         <div class='menu_news_mesto2'>
             <table border='0' cellpadding='0' cellspacing='0' width='100%'>
             <tr><td class='newstbllv'></td><td class='newstblv'></td><td class='newstblrv'></td></tr>
             <tr class='tableheadercat' align='center'>
                <td class='newstbll'></td>
                <td align='center' class='newstblbg' ><a href='mail.php' class='news5' title='".$TEXT['menu-btn9-title']."'><b>".$TEXT['menu-btn9']."</b></a>&nbsp;<a href='rss.php?org_id=".$_GET['org_id']."' class='link' title='".$TEXT['global-rss']."'><img alt='rss' src='img/rss.gif' /></a><hr width='80%' /></td>
                <td class='newstblr'></td>
            </tr>";

            while($result_news = mysql_fetch_array($result_n,MYSQL_ASSOC))
              {
                echo "<tr align=center><td class='newstbll'></td><td class='newsdesch'><a href='news.php?news_id=".$result_news['new_id']."&org_id=".$org_id."' class='news3' title = '".$result_news['description']."'>".$result_news['header']."<br /><span class='newsdesc'>".$result_news['description']."</span></a><hr width='45%' color='#666699' height='1px' align='left' /></td><td class='newstblr'></td></tr>";
              }
        echo "<tr><td class='newstblln'></td><td class='newstbln'></td><td class='newstblrn'></td></tr>";
     }
  ?>
</table>
</div>
</div>
<div id="fixedbody">