<!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/resources.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/resources.ico" type="image/x-icon" />
<link rel="shortcut icon" href="Favicon/resources.ico" type="image/x-icon" />
</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']);

  if(!empty($_GET['org_id'])) $temp_org = "upravlenie.php?org_id=".$_GET['org_id']."";
    else $temp_org = "index.php";

  if($_POST['usr_ch'] == "on") $usr_ch_on = "checked";
    else $usr_ch_on = "";

  if($_POST['tip_ch'] == "on") $tip_ch_on = "checked";
    else $tip_ch_on = "";
?>
<div id="fixedtop">
<form action=resources.php?org_id=<?php echo $_GET['org_id']; ?> 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>
</table>
  <table width=100% class=topheader border="0" cellspacing="5">
     <tr align="center" valign="middle">
     <td align="right"><input class="inputsearch" size=30 maxlength=50 type=text name=search title="<?php echo $TEXT['search-btn-title2']; ?>" >&nbsp;<input type=submit value='<?php echo $TEXT['search-btn']; ?>'></td>
     </tr><tr>
       <td align="right" class=menu><input type=radio name=typepar value=1 checked><?php echo $TEXT['res-field5']; ?>
                                    <input type=radio name=typepar value=2><?php echo $TEXT['search-nazv']; ?> &frasl; <?php echo $TEXT['search-descr']; ?>
                                    <input type=checkbox name=usr_ch <?php echo $usr_ch_on; ?> />
                                     <select name=usr_id class="button">
                                     <?php
                                      $query_otv = "SELECT
                                       tbl_logins.usr_id,
                                       tbl_users.familiya,
                                       tbl_users.name,
                                       tbl_users.otchestvo
                                       FROM tbl_logins
                                       LEFT JOIN tbl_users ON tbl_logins.usr_id=tbl_users.user_id
                                       WHERE tbl_logins.otvetstvenniy = '1' ORDER BY tbl_users.familiya, tbl_users.name, tbl_users.otchestvo";
                                       $otv_tmp = mysql_query($query_otv);
                                        if(!$otv_tmp) puterror(mysql_error());
                                         while($otvet = mysql_fetch_array($otv_tmp,MYSQL_ASSOC))
                                          {
                                          if($otvet['usr_id'] == $_POST['usr_id'])
                                           {
                                           $chk = "<option selected value=".$otvet['usr_id'].">".$otvet['familiya']." ".$otvet['name']." ".$otvet['otchestvo']."";
                                           }
                                            else $chk = "<option value=".$otvet['usr_id'].">".$otvet['familiya']." ".$otvet['name']." ".$otvet['otchestvo']."";
                                            echo $chk;
                                         }
                                    ?>
                                    </select>
                                    <input type=checkbox name=tip_ch <?php echo $tip_ch_on; ?> />
                                     <select name=tip_id class="button">
                                     <?php
                                      $query_tip = "SELECT `tip_id`, `tip_name` FROM `tbl_tip_resurs` ORDER BY `position`";
                                       $tip_tmp = mysql_query($query_tip);
                                        if(!$tip_tmp) puterror($TEXT['error-tbl38']);
                                         while($tip = mysql_fetch_array($tip_tmp,MYSQL_ASSOC))
                                          {
                                          if($tip['tip_id'] == $_POST['tip_id'])
                                           {
                                           $chk2 = "<option selected value=".$tip['tip_id'].">".$tip['tip_name']."";
                                           }
                                            else $chk2 = "<option value=".$tip['tip_id'].">".$tip['tip_name']."";
                                            echo $chk2;
                                         }
                                    ?>
                                    </select>
       </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="<?php echo $temp_org; ?>" class=link title="<?php echo $TEXT['menu-btn1-title']; ?>"><?php echo $TEXT['menu-btn1']; ?></a></li>
            <li><a href="index_res.php" class=link title="<?php echo $TEXT['support3']; ?>"><?php echo $TEXT['support32']; ?></a></li>
            </ul>
          </li>
          </ul>
       </td>
</tr>
</table>
</div>
<table class="table" border="0" cellpadding="5" cellspacing="0" width="87%">
<tr class='res'>
  <td width='5%'></td>
  <td><?php echo $TEXT['res-field5']; ?></td>
  <td><?php echo $TEXT['res-title1']; ?></td>
  <td><?php echo $TEXT['res-title2']; ?></td>
  <td><?php echo $TEXT['res-title3']; ?></td>
</tr>
</div>
<div id="fixedbody">