<?php
  ///////////////////////////////////////////////////
  //2007 (C)
  //Карпухин Павел
  ///////////////////////////////////////////////////

  $lang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0,2);
  if(is_file ("../lang/".$lang.".php")) include "../lang/".$lang.".php";
     else include "../lang/ru.php";

  $title=$titlepage=$TEXT['support36'];
  require_once "../config.php";
  require_once "top.php";
  ?>
  <title><?php echo $title; ?></title>
  <link rel="StyleSheet" type="text/css" href="../utils/reader.css" />
  </head>
  <body leftmargin="0" marginheight="0" marginwidth="0" rightmargin="0" bottommargin="0" topmargin="0" >
  <?php
  if($result2['user'] == 1) puterror2($TEXT['error-supp11']);
  if($result2['master'] == 1) puterror2($TEXT['error-supp11']);
?>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr align="center"><td class="supp_iniz"><?php echo $TEXT['support74']; ?></td></tr>
<tr>
    <td align="center">
      <table class="table" border="1" width="60%" cellpadding="1" cellspacing="1">
       <tr class="tableheadercat">
        <td><?php echo $TEXT['support63']; ?></td>
        <td><?php echo $TEXT['support65']; ?></td>
       </tr>
       <?php
       $query_total = "SELECT DISTINCT `organizaciya` FROM `tbl_supp_archive` ORDER BY organizaciya ";
        $tot_tmp = mysql_query($query_total);
         if(!$tot_tmp) puterror2($TEXT['error-tbl25']);
           while($sost2 = mysql_fetch_array($tot_tmp,MYSQL_ASSOC))
           {
             $query_total2 = mysql_query("SELECT COUNT(arch_id) FROM tbl_supp_archive WHERE organizaciya = '".$sost2['organizaciya']."'");
              $org = mysql_result($query_total2, 0);

            echo "<tr class='texttable'>
                     <td><a href='rpt_tema.php?organizaciya=".$sost2['organizaciya']."' title='".$TEXT['support14']."'>".$sost2['organizaciya']."</a></td>
                     <td>".$org."</td>
                  </tr>";
            }
            ?>
        </table>
      </td>
   </tr>
</table>
</body>
</html>