<?php
require_once('conf/dbc.php');
require_once('conf/session_start.php');
require_once('conf/ban.php');
$page_title = 'Смена статуса';
require_once('conf/head.php');
if ((isset($_SESSION['id'])) and (isset($_SESSION['nick'])))  {
$user_id = abs(intval($_SESSION['id']));
require_once('conf/top.php');
}
$query = "Select * from users where id = '$user_id' limit 1";
$result = mysqli_query($dbc, $query) or die ('Ошибка передачи запроса к БД');
$row = mysqli_fetch_array($result);
?>
<center> <br/><p class="profile" style="border-top:1px solid #000000; background-color:#000000;"> <span class="net">Смена статуса</span></p></center>
<div style="background-color: #1E1E1E;">
<p style="border-top:1px solid #444e4f;"></p>
<center><b>Новый статус</b></center>
<p style="border-top:1px solid #444e4f;"></p>
</div>
  <?php

if(isset($_POST['st'])){
$str=base64_encode($_POST['st']);
$dbc->query("UPDATE`users`SET`status_us`='$str' WHERE`id`='$user_id'")or die('SQL ERROR');
 header ('Location: settings.php?error=7');
  exit();
}
echo '<form action="?id='.$_SESSION['id'].'" method="post"><br/>
<textarea  style="width:95%; height:25px;" cols="35px" name="st" placeholder="Введите новый статус..." autofocus required></textarea><br/>
<center><input type="submit" style="width:100px; height:24px;" value="Изменить"  accesskey="ы"/></form></center>';
echo '<a href="?status&id='.$user_id.'"><a>';
$stat=$dbc->query("SELECT `status_us` FROM`users` WHERE`id`='$user_id'")->fetch_assoc();

  require_once('conf/navig.php');
    require_once('conf/foot.php');
	mysqli_close($dbc);
  ?>
</body>
</html>