<?php

include './system/common.php';

include './system/functions.php';

include './system/user.php';
if(!$user){
    header('location: /');
    exit;
}
$title = 'Настройки почты';

include './system/h.php';



if(isset($_POST['submit'])){
$mail = intval($_POST['mail']);
mysql_query("UPDATE users SET mail_closed='$mail' WHERE id ='".$user['id']."'") or die(mysql_error());
echo ' <div class="content">
<center>
Сохранено!</center></div>';
}







echo '

<div class="content">
<center>Режим почты
<br/>

<form action="" method="POST">  <input type="radio" name="mail" value="0" checked /> Открытый <input type="radio" name="mail" value="1" />Закрытый <br/><input type="submit" name="submit" value="Сохранить"></form></center>

</div>
';



include './system/f.php';
?>