<?php
  ///////////////////////////////////////////////////
  //Администрирование, параметры
  //2009 (C)
  //Карпухин Павел
  ///////////////////////////////////////////////////

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

  $title=$titlepage = $TEXT['param_btn'];
  $helppage = $TEXT['param_help'];
  require_once "../config.php";
  require_once "../util/top.php";

  if($result2['administrator'] == 0) puterror2($TEXT['error-loginform2']);
?>
 <img alt="<?php echo $TEXT['param_add']; ?>" src= "../img/insert.png" height="15" align="top" /><a class="boldit" href="addform.php" title="<?php echo $TEXT['param_add']; ?>"><?php echo $TEXT['param_add']; ?></a>
 <br />
 <br />
 <span class="tabledata"><?php echo $TEXT['param_about']; ?></span>
<table class="table" border="1" cellpadding="3" cellspacing="0" width="60%">
<?php
     $query = "SELECT `cl_id`, `col_tbl_name`, `by_data`, `by_count` FROM `tbl_clear`";
     $result = mysql_query($query);
     if(!$result) puterror2($TEXT['error-tbl37']);
       if(mysql_num_rows($result)>0);
         {
           echo "<tr class='tableheadercat'>
            <td>".$TEXT['analiz-tab']."</td>
            <td>".$TEXT['param_days']."</td>
            <td>".$TEXT['size-count2']."</td>
            <td colspan=2>".$TEXT['tbl-action']."</td>
                 </tr>";
             while($result_tables = mysql_fetch_array($result,MYSQL_ASSOC))
               {
              $edit = "<a href=editform.php?cl_id=".$result_tables['cl_id']." title='".$TEXT['login-edit-tit']."'>".$TEXT['tbl-edit']."</a>";
              $delete = "<a href=delete.php?cl_id=".$result_tables['cl_id']." title='".$TEXT['login-del-tit']."'>".$TEXT['tbl-delete']."</a>";

              if($result_tables['by_data'] == 0) $by_data = "<img alt='picture' src=../img/unlock.png />";
               else $by_data = $result_tables['by_data'];

              if($result_tables['by_count'] == 0) $by_count = "<img alt='picture' src=../img/unlock.png />";
               else $by_count = $result_tables['by_count'];

              if($result_tables['col_tbl_name'] == "tbl_logs") $col_tbl_name = $TEXT['menu-btn14'];
               elseif($result_tables['col_tbl_name'] == "tbl_supp_archive") $col_tbl_name = $TEXT['param_zay'];
                elseif($result_tables['col_tbl_name'] == "tbl_prn_logs") $col_tbl_name = $TEXT['prn-title'];
           ?>
           <tr class='tabledata' onmouseover="this.style.backgroundColor='#cccccc';" onmouseout="this.style.backgroundColor='#ffffff';">
              <td><?php echo $col_tbl_name; ?></td>
              <td><?php echo $by_data; ?></td>
              <td><?php echo $by_count; ?></td>
              <td><?php echo $edit; ?></td>
              <td><?php echo $delete; ?></td>
           </tr>
           <?php
               }
         }
?>
</table>
<?php
  require_once "../util/bottom.php";
?>