<?php

require_once('conf/dbc.php');
require_once('conf/session_start.php');
require_once('conf/ban.php');
if ((!isset($_SESSION['id'])) or (!isset($_SESSION['nick'])))  {
  ?>
  <script type="text/javascript">
document.location.href = "login.php";
  </script>
  <?php
  exit();
}
$page_title = 'Смена дизайна';
require_once('conf/head.php');
require_once('conf/top.php');


$user_id=abs(intval($_SESSION['id']));
$user=$dbc->query("SELECT * FROM `users` WHERE`id`='$user_id' LIMIT 1")->fetch_assoc();


?>
<?php if ($user[diz] == '0') {?>
<?php
$pdo->exec("UPDATE users SET diz =  '1' WHERE id = '".$user['id']."'");
header('location: /settings.php?error=10');
 ?>
<?php } else {?>
<?php
$pdo->exec("UPDATE users SET diz =  '0' WHERE id = '".$user['id']."'");
header('location: /settings.php?error=10');
}
require_once('conf/navig.php');
require_once('conf/foot.php');
mysqli_close($dbc);
?>

</body>
</html>