File size: 1.97Kb
<?
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.pp.ua *
**********************************/
$locate = 'in_cabinet';
if(isset($user)) {
if(isset($_POST['save']) && $_GET['act']== 'save') {
$show_email = input($_POST['show_email']);
$view_profile = input($_POST['view_profile']);
$db->query("UPDATE `settings` SET `show_email` = '". $show_email."', `view_profile` = '". $view_profile."' WHERE `user_id` = '". $user['id']."' ");
// print_r($db->errorInfo());
go('/user/privacy/?act=edited');
}
$title = $lang->word('privacy');
require_once(SYS.'/view/header.php');
if($_GET['act']=='edited') {$tpl->div('block', $lang->word('succ_save'));}
$tpl->div('title', $lang->word('privacy'));
echo '<div class="post">
<form action="/user/privacy/?act=save" method="post">
<b>'. $lang->word('show_email') .'</b>:<br />
<input type="radio" name="show_email" value="yes"'. ($settings['show_email'] == 'yes'?' checked="checked"':NULL) .' />'. $lang->word('ons') .'
<input type="radio" name="show_email" value="no"'. ($settings['show_email'] == 'no'?' checked="checked"':NULL) .' />'. $lang->word('offs') .'<br />
<b>'. $lang->word('view_profiles') .'</b>:<br />
<input type="radio" name="view_profile" value="all"'. ($settings['view_profile'] == 'all'?' checked="checked"':NULL) .' />'. $lang->word('alls') .'
<input type="radio" name="view_profile" value="regs"'. ($settings['view_profile'] == 'regs'?' checked="checked"':NULL) .' />'. $lang->word('regs') .'
<input type="radio" name="view_profile" value="self"'. ($settings['view_profile'] == 'self'?' checked="checked"':NULL) .' />'. $lang->word('selfs') .'<br />
<input type="submit" name="save" value="'. $lang->word('save') .'" />
</form>
</div>';
$tpl->div('block', NAV.'<a href="/user/panel/">'.$lang->word('user_panel').'</a><br/>'. HICO .'<a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
} else { go('/'); }
?>