<?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_edit'];
  $helppage = "";

  require_once "../config.php";
  require_once "../util/top.php";

  if($result2['administrator'] == 0) puterror2($TEXT['error-loginform2']);

  if(!isset($button)) $button = $TEXT['btn_edit'];
  if(!isset($action)) $action = "edit.php";

  if(empty($_GET['cl_id'])) puterror2($TEXT['param_err7']);
  if(strlen($_GET['cl_id'])>12) puterror2($TEXT['param_err8']);
  $_GET['cl_id'] = rep($_GET['cl_id']);

  $old_cl_id = $_GET['cl_id'];

  $query = "SELECT * FROM `tbl_clear` WHERE `cl_id`='".$_GET['cl_id']."' ";
  $result = mysql_query($query);
  if(!$result) puterror2($TEXT['error-tbl37']);
      $result2 = mysql_fetch_array($result);
         $by_data = $result2['by_data'];
         $by_count = $result2['by_count'];
         $tbl = $result2['col_tbl_name'];
         if($result2['by_data'] > 0) $b_dat = "checked";
          else $b_dat = "";
         if($result2['by_count'] > 0) $b_coun = "checked";
          else $b_coun = "";
         if($result2['col_tbl_name'] == "tbl_logs") $col_tbl_name = $TEXT['menu-btn14'];
          elseif($result2['col_tbl_name'] == "tbl_supp_archive") $col_tbl_name = $TEXT['param_zay'];

?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table>
<tr><td class="useraddedit"><?php echo $TEXT['analiz-tab']; ?></td><td class="useraddedit">
<select class="input" name=tip>
  <option value='tbl_logs' <?php if($tbl =='tbl_logs') echo "selected"?>><?php echo $TEXT['menu-btn14']; ?>
  <option value='tbl_supp_archive' <?php if($tbl =='tbl_supp_archive') echo "selected"?>><?php echo $TEXT['param_zay']; ?>
  <option value='tbl_prn_logs' <?php if($tbl =='tbl_prn_logs') echo "selected"?>><?php echo $TEXT['prn-title']; ?>
</select>
</td></tr>
<tr><td class="useraddedit"><?php echo $TEXT['param_days']; ?></td><td class="useraddedit"><input size=20 maxlength=20 type=text name=paramdays value=<?php echo $by_data; ?>>&nbsp;<input type=checkbox name=paramon <?php echo $b_dat; ?>></td></tr>
<tr><td class="useraddedit"><?php echo $TEXT['size-count2']; ?></td><td class="useraddedit"><input size=20 maxlength=20 type=text name=sizecount value=<?php echo $by_count; ?>>&nbsp;<input type=checkbox name=sizeon <?php echo $b_coun; ?>></td></tr>
<tr><td></td><td>
<input class="button" type=submit value='<?php echo $button; ?>' />
<input type=hidden name=cl_id value='<?php echo $old_cl_id; ?>' />
</td></tr>
</table>
</form>
<?php
  require_once "../util/bottom.php";
?>
