<?php
require "../e/class/connect.php";
require "../e/class/db_sql.php";
require "../e/member/class/user.php";
$link=db_connect();
$empire=new mysqlquery;
require "class/fun.php";
$ur=user_returnlogin();
$userid=$ur[userid];
$usercheck=checklogin($userid);
$username=$ur[username];
$user=getuserinfo($userid);
$email=$user[remindemail]?$user[remindemail]:$user[email];
$sendemail=$user[remindsendemail];
$sendmsg=$user[remindsendmsg];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>订阅设置 - 会员中心 -<?=$public_r[sitename]?></title>
<script type="text/javascript">
		function setupLabel(){
            if($('.label-checkbox input').length) {
                $('.label-checkbox').each(function(){
                    $(this).removeClass('label-checkbox-on');
                });
                $('.label-checkbox input:checked').each(function(){
                    $(this).parent('label').addClass('label-checkbox-on');
                });
            };
            if($('.label-radio input').length) {
                $('.label-radio').each(function(){
                    $(this).removeClass('label-radio-on');
                });
                $('.label-radio input:checked').each(function(){
                    $(this).parent('label').addClass('label-radio-on');
                });
            };
        }  
	</script>
<? include_once "temp/header.php"; ?>
<div id="content" class="layout">
  <div class="ui-box ui-qire fn-clear" id="i-box">
<? include_once "temp/left.php"; ?>
    <div class="i-box-cnt" id="i-cnt">
      <div id="i-subscribe">
        <div class="ui-title i-tab-nav-box fn-clear">
          <ul class="i-tab-nav">
            <li class="current">订阅设置</li>
          </ul>
        </div>
        <div class="ui-cnt">
          <form id="remindset" method="">
            <div class="ui-form">
              <p class="qire-notice"> 友情提示：订阅提示有2种提示方式，站内提示和邮件提示。您能可以根据自己的习惯选择，或者一起选择。 </p>
              <div class="ui-form-item fn-clear">
                <label class="ui-label w130">订阅提醒：</label>
                <div class="ui-form-block w300">
                  <label class="label-checkbox" for="if_sendmsg" hidefocus>
                    <input type="checkbox" name="remindsendmsg" value="1" id="if_sendmsg"  <?=$sendmsg?' checked="checked" ':''?>/>
                    开通订阅提醒功能</label>
                </div>
                <p class="ui-message ui-message-clear">订阅有更新时，<?=$public_r[sitename]?>会同步提示您观看。</p>
              </div>
              <div class="ui-form-item ui-form-checkbox fn-clear">
                <label class="ui-label w130">订阅邮件提醒：</label>
                <div class="ui-form-block w300">
                  <label class="label-checkbox" for="if_sendemail" hidefocus>
                    <input type="checkbox" value="1" name="remindsendemail" id="if_sendemail" <?=$sendemail?' checked="checked" ':''?>/>
                    开通订阅邮件提醒功能</label>
                </div>
              </div>
              <div class="ui-form-item fn-clear">
                <label class="ui-label w130"></label>
                <input type="text" class="ui-input w300" value="<?=$email?>" name="remindemail"  />
                <p class="ui-message ui-message-clear">推荐使用QQ邮箱，订阅有更新时，发送至您的指定邮箱。</p>
              </div>
              <div class="ui-form-item fn-clear">
                <label class="ui-label w130"></label>
                <input type="button" id="remindsetbt" class="ui-button w150" value="提 交" />
              </div>
            </div>
          </form>
          <!-- // ui-form End -->
        </div>
      </div>
      <!-- // ui-box End -->
    </div>
    <!-- // maxBox End -->
  </div>
  <script type="text/javascript">
	$("#remindsetbt").click(function(){
		$("#remindset").qiresub({
			curobj:$("#remindsetbt"),
			txt:'数据提交中,请稍后...',
			onsucc:function(result){
				$.hidediv(result);
			}
		}).post({url:'class/ajax.php?action=setremindconfig'});
	});
	</script>
  <script type="text/javascript">
	$(function(){		
		$('.label-checkbox').click(function(){
			setupLabel();
		});
		setupLabel();
	});
	</script>
</div>
<? include_once "temp/footer.php"; ?>
</body>
</html>