View file admin/editblocklimit.php

File size: 1.55Kb
<?php
require_once('includes/db.php');
require_once('includes/config.php');
require_once('includes/auth.php');

require_once('includes/header.php');

$error = '';
$message = '';
if(isset($_POST['edit']))
{
   if($_POST['block_limit'] < 0)
   {
      $error .= 'Неправильное значение!<br>';
   }
   else
   {
      mysql_query('UPDATE config SET block_limit = "' . $_POST['block_limit'] . '" WHERE id = 1');
      $message = 'Значение изменено';
   }
}
?>
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="addbg"><td align="center" background="images/t5.gif"><font color="#FFFFFF"></font>
        <font class="header">
        Условие блокировки
      </font></td>
</tr></table><br>

<div align="center">
<font class="succ">
<?php echo $message; ?>
</font><br>
</div>

<div align="center">
<font class="error">
<?php echo $error; ?>
</font><br>
</div>

<?php

$configs = mysql_query('SELECT block_limit FROM config WHERE id = 1');

$config = mysql_fetch_array($configs, MYSQL_ASSOC);

?>

<br>

<table align="center" border="0">
<form action="" method="post">


<tr class="addbg"><td width="50%">
Мин. количество посетителей в день
</td><td width="50%">
<input type="text" name="block_limit" value="<?php echo $config['block_limit']; ?>" maxlength="255">
</td>
</tr>

<tr class="addbg"><td colspan="2" align="center">
<br>
<input type="submit" name="edit" value="  <?php echo EDIT; ?>  ">
<br><br>
</td></tr>


</form>

</table>

<?php
require_once('includes/footer.php');
?>