<?php
  ///////////////////////////////////////////////////
  //2010 (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 = $TEXT['param_edit'];
  $button = $TEXT['btn_save'];
  $action = "edit.php";

  require_once "../config_a.php";
  require_once "../utils/functions.php";
  require_once "../utils/top_adm.php";

  if($result2['administrator'] == 0) {puterror($result2['skin'],$TEXT['error-loginform2']); require_once "../utils/bottom_adm.php"; exit();}
  if(empty($_GET['cl_id'])) {puterror($result2['skin'],$TEXT['param_err7']); require_once "../utils/bottom_adm.php"; exit();}
  if(strlen($_GET['cl_id'])>12) {puterror($result2['skin'],$TEXT['param_err8']); require_once "../utils/bottom_adm.php"; exit();}
  $_GET['cl_id'] = rep($_GET['cl_id']);
  $old_cl_id = $_GET['cl_id'];

  $query_cl = "SELECT * FROM `tbl_clear` WHERE `cl_id`='".$_GET['cl_id']."' ";
  $result_cl = mysqli_query($dbcnx,$query_cl);
  if (!$result_cl) {puterror($result2['skin'],$TEXT['error-tbl8']); require_once "../utils/bottom_adm.php"; exit();}
      $result2_cl = mysqli_fetch_array($result_cl,MYSQLI_ASSOC);
         $by_data = $result2_cl['by_data'];
         $by_count = $result2_cl['by_count'];
         $tbl = $result2_cl['col_tbl_name'];
         if($result2_cl['by_data'] > 0) {$b_dat = "checked";}
          else {$b_dat = "";}
         if($result2_cl['by_count'] > 0) {$b_coun = "checked";}
          else {$b_coun = "";}
         if($result2_cl['col_tbl_name'] == "tbl_logs") {$col_tbl_name = $TEXT['menu-btn5'];}

?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table align="center" border="0" width="50%">
<tr><td class="bold_it_page"><?php echo $TEXT['analiz-tab']; ?></td><td>
<select class="input" name=tip>
  <option value='tbl_logs' <?php if ($tbl =='tbl_logs') {echo "selected";} ?>><?php echo $TEXT['menu-btn5']; ?>
</select>
</td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['param_days']; ?></td><td><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="bold_it_page"><?php echo $TEXT['size-count2']; ?></td><td><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="button2" 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 "../utils/bottom_adm.php";
?>