<?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];
$email=$ur[email];
$nickname=getnickname($ur[userid]);
$ur=getuserinfoadd($userid);
$ur[username]=$username;
$ur[email]=$email;
?>
<!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>基本资料修改 - 会员中心 -奇热网</title>
<? include_once "temp/header.php"; ?>
<!-- // i-header end -->
<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">
      <form id="upuser" action="#">
        <div id="i-profile">
          <div class="ui-title i-tab-nav-box">
            <ul class="i-tab-nav fn-clear">
              <li class="current"><a href="info.php" hidefocus>基本资料</a></li>
              <li class="line"></li>
              <li ><a href="avatar.php" hidefocus>头像设置</a></li>
              <li class="line"></li>
              <li ><a href="pass.php" hidefocus>密码设置</a></li>
              <!--<li ><a href="/user-Center-emailset" hidefocus>订阅提醒</a></li>-->
            </ul>
          </div>
          <div class="ui-form">
            <div class="ui-form-item fn-clear">
              <label class="ui-label w130">您的<strong>Email</strong>地址：</label>
              <input type="text" class="ui-input w300" value="<?=$ur[email]?>" readonly="readonly" />
              <p class="ui-message ui-message-clear">Email地址可在<span style="color:#999">密码设置</span>中修改</p>
            </div>
            <div class="ui-form-item fn-clear">
              <label for="username" class="ui-label w130">用户名：</label>
              <input type="text" id="username" name="username" class="ui-input w300" value="<?=$ur[username]?>" readonly="readonly" />
              <p class="ui-message ui-message-clear">支持英文、数字，4-20个字符</p>
            </div>
            <div class="ui-form-item fn-clear">
              <label for="nickname" class="ui-label w130">昵称：</label>
              <input type="text" id="nickname" name="nickname" class="ui-input w300" value="<?=$ur[nickname]?>" />
              <p class="ui-message ui-message-clear">支持汉字、英文、数字，4-20个字符</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 for="male" class="ui-label-checkbox">
                  <input id="male" type="radio" name="sex" value="1" <?=$ur[sex]==1?'checked="checked"':''?>  />
                  男</label>
                <label for="female" class="ui-label-checkbox">
                  <input id="female" type="radio" name="sex" value="2" <?=$ur[sex]==2?'checked="checked"':''?>  />
                  女</label>
              </div>
            </div>
            <div class="ui-form-item fn-clear">
              <label class="ui-label w130">出生年月日：</label>
              <div class="ui-select">
                <select id="yearList" class="yearSelect" name="year">
                <?php
				for($i=1955;$i<=2013;$i++){
					?>
				<option value="<?=$i?>" <?=$i==$ur[year]?'selected':''?>><?=$i?></option>
                <?php
				}
				?>
                </select>
              </div>
              <div class="ui-select">
                <select id="monthList" class="nonYearSelect" name="moon">
                <?php
				for($i=1;$i<=12;$i++){
					?>
				<option value="<?=$i?>" <?=$i==$ur[moon]?'selected':''?>><?=$i?></option>
                <?php
				}
				?>
                </select>
              </div>
              <div class="ui-select">
                <select id="dayList" class="nonYearSelect"  name="day">
                <?php
				for($i=1;$i<=31;$i++){
					?>
				<option value="<?=$i?>" <?=$i==$ur[day]?'selected':''?>><?=$i?></option>
                <?php
				}
				?>
                </select>
              </div>
              <input type="hidden" value="" id="birthday" name="birthday">
            </div>
            <div class="ui-form-item fn-clear">
              <label class="ui-label w130">居住地：</label>
              <div id="birthcitybox">
                <div class="ui-select">
                  <select name="prov_id" id="prov_id">
                  </select>
                </div>
                <div class="ui-select">
                  <select name="city_id" id="city_id">
                  </select>
                </div>
                <input type="hidden" value="<?=$ur[city]?>" id="curcity"/>
                <script language="JavaScript" type="text/javascript" charset="gb2312" src="temp/css/city.js"></script>
                <script type="text/javascript"><!--
								showprovince('prov_id', 'city_id', '<?=$ur[prov]?>', 'birthcitybox');
								setcity('prov_id', 'city_id');
								//--></script>
              </div>
            </div>
            <div class="ui-form-item fn-clear">
              <label class="ui-label w130">学历：</label>
              <div class="ui-select">
                <select name="edu" id="edu">
                  <option value="1"<?=$ur[edu]=="1"?' selected':''?>>小学</option>
                  <option value="2"<?=$ur[edu]=="2"?' selected':''?>>初中</option>
                  <option value="3"<?=$ur[edu]=="3"?' selected':''?>>高中/中专</option>
                  <option value="4"<?=$ur[edu]=="4"?' selected':''?>>大专</option>
                  <option value="5"<?=$ur[edu]=="5"?' selected':''?>>本科</option>
                  <option value="6"<?=$ur[edu]=="6"?' selected':''?>>硕士及以上</option>
                </select>
              </div>
            </div>
            <div class="ui-form-item fn-clear">
              <label class="ui-label w130">行业：</label>
              <div class="ui-select">
                <select name="industry" id="industry">
                  <option value="1"<?=$ur[industry]=="1"?' selected':''?>>教育/学生</option>
                  <option value="2"<?=$ur[industry]=="2"?' selected':''?>>计算机/互联网</option>
                  <option value="3"<?=$ur[industry]=="3"?' selected':''?>>建筑</option>
                  <option value="4"<?=$ur[industry]=="4"?' selected':''?>>金融/房产</option>
                  <option value="5"<?=$ur[industry]=="5"?' selected':''?>>政府/公共服务</option>
                  <option value="6"<?=$ur[industry]=="6"?' selected':''?>>电信/网络</option>
                  <option value="7"<?=$ur[industry]=="7"?' selected':''?>>服务</option>
                  <option value="8"<?=$ur[industry]=="8"?' selected':''?>>传媒/娱乐</option>
                  <option value="9"<?=$ur[industry]=="9"?' selected':''?>>农林/化工</option>
                  <option value="10"<?=$ur[industry]=="10"?' selected':''?>>旅游/交通</option>
                  <option value="11"<?=$ur[industry]=="11"?' selected':''?>>其他</option>
                </select>
              </div>
            </div>
            <div class="ui-form-item fn-clear">
              <label class="ui-label w130">个性签名：</label>
              <textarea class="ui-input ui-textarea w400" name="saytext" id="signature"><?=$ur[saytext]?></textarea>
            </div>
            <div class="ui-form-item fn-clear">
              <label class="ui-label w130"></label>
              <input type="button" id="upbt" class="ui-button w150" value="保 存" />
            </div>
          </div>
          <!-- // ui-form End -->
        </div>
        <!-- // ui-box End -->
      </form>
    </div>
    <!-- // i-cnt End -->
    <script type="text/javascript">
			$("#upbt").click(function(){
				$("#upuser").qiresub({
					curobj:$("#upbt"),
					txt:'数据提交中,请稍后...',
					onsucc:function(result){
						$.hidediv(result);
					}
				}).post({url:'class/ajax.php?action=saveuserinfo'});
			});
			$("#edu").val("5");
			$("#industry").val("2");
			$("#income").val("0");
			
			$('#emailcheck').click(function (e){
				$.showfloatdiv({cssname:'loading'});
		    	var turl=$(this).attr('href');
				$.get(
					turl,'',
					function(data){
						$.hidediv(data);
					},'json'
				);
				return false;
			});

		</script>
  </div>
</div>
<? include_once "temp/footer.php"; ?>
</body>
</html>