<?php
include "../include/conn.php";
include "../include/function.php";
include "../include/userset.php";
include "skins/function_common.php";
if(S_VipFun==0){exit("本站会员功能已经关闭!");}
$ac=SafeRequest("ac","get","zr");
$op=SafeRequest("op","get","zr");
if($ac=="reg"){
 if($op<>"qqlogin"){
$title="会员在线注册";
 }else{
$title="QQ帐号连接";
 }
}elseif(($ac=="lostpasswd")||($ac=="passgo")){
$title="会员密码找回";
}elseif($ac=="activation"){
$title="会员激活帐号";
}else{
$title="随便看看";
}
if($userlogin==true and $op<>"qqlogin"){echo "<script>window.location.href ='space.php?ac=home';</script>";}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gbk" />
<meta http-equiv="x-ua-compatible" content="ie=7" />
<title><?php echo $title?>-会员中心 - Powered by PjRen.Net Dance</title>
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="css/main.css" type="text/css" media="all" />
<link rel="stylesheet" href="css/user.css" type="text/css" media="all" />
<link rel="stylesheet" href="css/register.css" type="text/css" media="all" />
<link rel="stylesheet" href="css/main_home.css" type="text/css" media="all" />
<script src="js/jquery.js"></script>
<script src="js/alerts.js"></script>
<script language="javascript">
$(document).ready(function(){
$("#loginsubmit").click(function(){
		var username=$("#username").val();
		var password=$("#password").val();
	$("#username").css("border-color","#666 #ccc #ccc #666");
	$("#password").css("border-color","#666 #ccc #ccc #666");
	if(username==""){
		$("#username").css("border","1px solid red");
		$("#tishi").text("请输入正确的账号！").css("color","red");
		return false;}
	else if((len(username)<4)||(len(username)>16)){
		$("#username").css("border","1px solid red");
		$("#tishi").text("账号限制4-16位！").css("color","red");
		return false;}
	else if(password==""){
		$("#password").css("border","1px solid red");
		$("#tishi").text("登陆密码不能为空！").css("color","red");
		return false;}
	});

});
function len(s) {
	var l = 0;
	var a = s.split("");
	for (var i=0;i<a.length;i++) {
	if (a[i].charCodeAt(0)<299) {
		l++;
		}
	else{
   l+=2;
		}
	}
	return l;
}
</script>
</head>
<body>
<div class="top">
	<div class="logo"><a href="<?php echo S_SiteDomain?>/user"></a></div>
	<div class="nav">
		<ul>
			<li><a href="<?php echo S_SiteDomain?>/" target="list">首页</a></li>
							<li><a href="?">会员空间</a></li>
					</ul>
				<div class="user">
			<div class="face">
				<img id="header-avatar" src="images/avatar/noface_small.gif" onerror="pubLibs.avatarError(this,'small');" width="30" height="30" />
			</div>
			<div class="info">
				欢迎您登录！			</div>
			<div class="info">
				<a href="?">登 录</a>&nbsp;|&nbsp;<a href="?ac=reg">免费注册</a>			</div>
		</div>
	</div>
</div>
<div class="user">
<?php
if($ac=="reg"){
?>

	<div class="defaultHome">
	<div class="defaultHomeMain">
		<div class="regMain" id="regData">
<?php
if($op=="qqlogin"){
?>
			<div class="title">
				<div class="name">现在您可以用QQ账号连接 <?php echo S_SiteName?> 了!</div>
			</div>
			<ul id="qqBinding">
			<form  name="form1" action="do.php?ac=qqadd" method="post">
				<li><span  style="font-size:14px;color:#333;">将<?php echo S_SiteName?>账号与您的QQ进行绑定！</span></li>
				<li>
					<div class="rM_title">登陆账号：</div>
					<div class="rM_input" >
						<input type="text" style="width:190px;" class="input_normal" name="name" id="name" maxlength="18" />
					</div><input type="hidden" name="qqid" id="qqid" value="<?php echo $_SESSION["openid"]?>" />
					<div class="input_msg" id="mqloginName">登录账号是由字母、数字、下划线组成，且不能以数字开头。</div>
				</li>
				<li>
					<div class="rM_title">登录密码：</div>
					<div class="rM_input">
						<input type="password" style="width:190px;" class="input_normal" name="password" id="password1" maxlength="20"/>
					</div>
					<div class="input_msg" id="mqpassword">6到16个字符，由英文字母（区分大小写）、符号或数字组成。</div>
				</li>
				<li>
					<div class="rM_title">您的邮箱：</div>
					<div class="rM_input" >
						<input type="text" style="width:190px;" class="input_normal" name="mail" id="mail" />
					</div>
					<div class="input_msg" id="mqloginName">您的邮箱，找回密码用的。</div>
				</li>
				<li>
					<div class="rM_noleft" style="color:#0000ff;font-size:14px;">
						请在上面输入您<?php echo S_SiteName?>的账号和密码然后进行绑定。
					</div>
				</li>
				<li>
					<div class="rM_noleft">
						<input type="submit" class="input_register" value="确定绑定账号" id="binding" />
					</div>
				</li>
			</form>
			</ul>
			<div style="display:inline;float:left;border-top:1px dashed #000;width:100%;margin-top:40px;padding-bottom:20px;"></div>

<?php
}else{
?>
			<div class="title">
				<div class="name">注册信息</div>
				<div class="text">
					<span>欢迎注册您的&nbsp;<strong><?php echo S_SiteName?></strong>&nbsp;账号。</span>
				</div>
			</div>
			<ul>
			<form  name="form2" action="do.php?ac=reg" method="post">
				<li><a href="qq/oauth/redirect_to_login.php"><img src="images/qq_login.png"></a></li>
				<li><span  style="font-size:14px;color:#ff0000;">提醒：本站会员所发布的信息全部要经过人工逐一审核，一经发现发布广告、色情、非法信息将直接封账号处理!</span></li>

				<li>
					<div class="rM_title">登陆账号：</div>
					<div class="rM_input" id="rM_loginName">
						<input type="text" style="width:190px;" class="input_normal" name="loginName" id="loginName" maxlength="18" />
					</div>
					<div class="input_msg"  id="tishi1">作为登录账号，由字母、数字组成，且不能以数字开头。</div>
				</li>
				<li>
					<div class="rM_title">设置密码：</div>
					<div class="rM_input" id="rM_rpassword">
						<input type="password" style="width:190px;" class="input_normal" name="password" id="password" maxlength="20"/>
					</div>
					<div class="input_msg" id="tishi2">6到16个字符，请使用英文字母（区分大小写）、符号或数字。</div>
				</li>
				<li>
					<div class="rM_title">确认密码：</div>
					<div class="rM_input" id="rM_rpassword2">
						<input type="password" style="width:190px;" class="input_normal" name="password2" id="password2" maxlength="20"/>
					</div>
					<div class="input_msg" id="tishi3">再次输入您所设置的密码，以确认密码无误。</div>
				</li>
				<li>
					<div class="rM_title">呢称：</div>
					<div class="rM_input" id="rM_nickname">
						<input type="text" style="width:190px;" class="input_normal" name="nickname" id="nickname" value="<?php echo $nicheng?>" maxlength="30" />
					</div>
					<div class="input_msg" id="tishi4">请填写您的名字（不能使用空格、数字、和 < > ' " / \ 等非法字符）。</div>
				</li>
				<li>
					<div class="rM_title">性别：</div>
					<div class="rM_sex">
							<select style="width:120px;" class="select_normal" name="sex" id="sex">
							<option value="1" selected='selected'>帅 哥</option>
							<option value="2">美 女</option>
							</select>
					</div>
					<div class="input_msg">请选择您的性别。</div>
				</li>
				<li>
					<div class="rM_title">城市：</div>
					<div class="rM_input" id="rM_address">
<script type="text/javascript" src="js/city.js" charset="gb2312"></script>
<select name="province"></select><select name="city_tmp"></select>
<script language="javascript" defer> 
new PCAS("province","city_tmp","辽宁省","盘锦市");
</script>

					</div>
					<div class="input_msg" id="tishi5">请单击选择您的所在城市。</div>
				</li>
				<li>
					<div class="rM_title">ＱＱ：</div>
					<div class="rM_input" id="rM_rqq">
						<input type="text" style="width:190px;" class="input_normal" name="qq" id="qq" maxlength="12" />
					</div>
					<div class="input_msg" id="tishi6">输入您的QQ号，只供站务人员联系使用，不会公开。</div>
				</li>
				<li>
					<div class="rM_title">邮箱：</div>
					<div class="rM_input" id="rM_email">
						<input type="text" style="width:190px;" class="input_normal" name="email" id="email" />
					</div><input type="hidden" name="qqid" id="qqid" value="<?php echo $_SESSION["openid"]?>" />
					<div class="input_msg" id="tishi7">安全邮箱能够帮您取回您忘记的密码。</div>
				</li>
				<li>
					<div class="rM_title">验证码：</div>
					<div class="rM_input" id="rM_rvCode">
						<input type="text" style="width:66px;" class="input_normal" name="Code" id="Code" maxlength="4" /><img id="img_seccode" src="../include/code.php" align="absmiddle">
					</div>
					<div class="input_msg" id="tishi8">(不区分大小写.)</div>
				</li>
				<li>
					<div class="rM_title">&nbsp;&nbsp;&nbsp;&nbsp;</div>
					<div class="rM_input">
						<input  type="submit" class="input_register" value="提交注册信息" id="queren" />
					</div>
					<div class="input_msg" id="tishi">&nbsp;</div>
				</li>
			</form>
			</ul>
<?php
}
?>
		</div>
	</div>
	</div>
<script language="javascript">
$(document).ready(function(){
$("#queren").click(function(){
   
		var loginName=$("#loginName").val();
		var password=$("#password").val();
		var password2=$("#password2").val();
		var nickname=$("#nickname").val();
		var city_tmp=$("#city_tmp").val();
		var qq=$("#qq").val();
		var email=$("#email").val();
		var Code=$("#Code").val();
		$("#loginName").css("border-color","#666 #ccc #ccc #666");
		$("#password").css("border-color","#666 #ccc #ccc #666");
		$("#password2").css("border-color","#666 #ccc #ccc #666");
		$("#nickname").css("border-color","#666 #ccc #ccc #666");
		$("#city_tmp").css("border-color","#666 #ccc #ccc #666");
		$("#qq").css("border-color","#666 #ccc #ccc #666");
		$("#email").css("border-color","#666 #ccc #ccc #666");
		$("#Code").css("border-color","#666 #ccc #ccc #666");

	if(loginName==""){
		$("#loginName").css("border","1px solid red");
		$("#tishi").text("请输入用户名！").css("color","red");
		return false;}
	else if((len(loginName)<4)||(len(loginName)>16)){
		$("#loginName").css("border","1px solid red");
		$("#tishi").text("用户名限制4-16位！").css("color","red");
		return false;}
	else if(/.*[\u4e00-\u9fa5]+.*$/.test(loginName)){ 
		$("#loginName").css("border","1px solid red");
		$("#tishi").text("用户名不允许中文注册！").css("color","red");
		return false;}
	else if(isID(loginName)==false){
		$("#loginName").css("border","1px solid red");
		$("#tishi").text("用户名不允许特殊字符！").css("color","red");
		return false;}
	else if(password==""){
		$("#password").css("border","1px solid red");
		$("#tishi").text("请输入密码！").css("color","red");
		return false;}
	else if((password.length!=32)&&((password.length<6)||(password.length>18))){
		$("#password").css("border","1px solid red");
		$("#tishi").text("密码限制6-16位！").css("color","red");
		return false;}
	else if(password2==""){
		$("#password2").css("border","1px solid red");
		$("#tishi").text("请确定密码！").css("color","red");
		return false;}
	else if((password2.length!=32)&&((password2.length<6)||(password2.length>18))){
		$("#password2").css("border","1px solid red");
		$("#tishi").text("确定密码限制6-18位！").css("color","red");
		return false;}
	else if(nickname==""){
		$("#nickname").css("border","1px solid red");
		$("#tishi").text("请输入呢称！").css("color","red");
		return false;}
	else if(isID(nickname)==false){
		$("#nickname").css("border","1px solid red");
		$("#tishi").text("呢称不允许特殊字符！").css("color","red");
		return false;}
	else if(len(nickname)>20){
		$("#nickname").css("border","1px solid red");
		$("#tishi").text("呢称限制最大20位！").css("color","red");
		return false;}
	else if(city_tmp==""){
		$("#city_tmp").css("border","1px solid red");
		$("#tishi").text("请选择城市地区！").css("color","red");
		return false;}
	else if(qq==""){
		$("#qq").css("border","1px solid red");
		$("#tishi").text("请输入QQ！").css("color","red");
		return false;}
	else if((len(qq)<5)||(len(qq)>18)){
		$("#qq").css("border","1px solid red");
		$("#tishi").text("QQ限制5-18位！").css("color","red");
		return false;}
	else if(email==""){
		$("#email").css("border","1px solid red");
		$("#tishi").text("请输入Email！").css("color","red");
		return false;}
	else if(isEmail(email)==false){
		$("#email").css("border","1px solid red");
		$("#tishi").text("邮箱格式错误！").css("color","red");
		return false;}
	else if(len(email)>50){
		$("#email").css("border","1px solid red");
		$("#tishi").text("邮箱限制最大50位！").css("color","red");
		return false;}
	else if(Code==""){
		$("#Code").css("border","1px solid red");
		$("#tishi").text("请输入验证码！").css("color","red");
		return false;}
	else if(len(Code)>4){
		$("#Code").css("border","1px solid red");
		$("#tishi").text("验证码为4位！").css("color","red");
		return false;}
});
 
$("#submit11").click(function(){
	var S_Name=$("#SearchStr").val();
	$("#SearchStr").css("border-color","#666 #ccc #ccc #666");
	if(S_Name==""){
		$("#SearchStr").css("border","1px solid red");
		return false;
		}
	})
 
})
function turnback(){
	window.history.go(-1);
	};

function isEmail(str){
 res = /^[0-9a-zA-Z_\-\.]+@[0-9a-zA-Z_\-]+(\.[0-9a-zA-Z_\-]+)*$/;
 var re = new RegExp(res);
 return !(str.match(re) == null);
};
function isID(str){
	res = /^(?!_)(?!.*?_$)[a-zA-Z0-9\u4e00-\u9fa5]+$/;
	var re = new RegExp(res);
	return !(str.match(re) == null);
};

function len(s) {
	var l = 0;
	var a = s.split("");
	for (var i=0;i<a.length;i++) {
	if (a[i].charCodeAt(0)<299) {
		l++;
		}
	else{
   l+=2;
		}
	}
	return l;
}
</script>
<?php
}elseif($ac=="lostpasswd"){
?>
	<div class="defaultHome">
	<div class="defaultHomeMain">
		<div class="regMain" id="regData">
			<div class="title">
				<div class="name">找回密码</div>
				<div class="text">
					<span>找回您在本站注册的会员账号登录密码。</span>
				</div>
			</div>
			<ul>
			<form  name="formz" action="do.php?ac=lostpasswd" method="post">
				<li>
					<div class="rM_title">登陆账号：</div>
					<div class="rM_input"><input type="text" style="width:190px;" class="input_normal" name="username" id="username" maxlength="18" /></div>
					<div class="input_msg">请输入您想要找回密码的登录账号。</div>
				</li>
				<li><div class="rM_noleft2"><font color="0000ff"><b>提示：如果您忘记了您的登录账号，请使用您注册时填写的QQ号加QQ：<?php echo S_AdminQQ?> 找回您的登录账号。</b></font></div></li>
				<li>
					<div class="rM_noleft">
						<input  type="submit" class="input_register" value="确定找回密码" />
					</div>
				</li>
			</form>
			</ul>
		</div>
	</div>
	</div>
<?php
}elseif($ac=="passgo"){
$us=SafeRequest("u","get");
$key=SafeRequest("key","get");
$us=passport_decrypt($us,S_UserKey);
$key=passport_decrypt($key,S_UserKey);
$CsYzm=md5($key.$us);
if(isset($_COOKIE["Cs_PassKey"])){
	$Cs_PassKey=$_COOKIE["Cs_PassKey"];
}
else{
	$Cs_PassKey="";
}
?>
	<div class="defaultHome">
	<div class="defaultHomeMain">
		<div class="regMain" id="regData">
<?php
if($CsYzm==$Cs_PassKey){
?>
			<div class="title">
				<div class="name">找回密码</div>
				<div class="text">
					<span>找回您在本站注册的会员账号登录密码。</span>
				</div>
			</div>
			<ul>
			<form  name="formz" action="do.php?ac=passgo" method="post">
				<li>
					<div class="rM_title">新密码：</div>
					<div class="rM_input"><input type="password" style="width:190px;" class="input_normal" name="pass" id="pass" maxlength="18" /></div>
					<div class="input_msg">请输入您的新密码。</div>
				</li><input type="hidden" name="username" id="username" value="<?php echo $us?>" />
				<li>
					<div class="rM_title">确定密码：</div>
					<div class="rM_input"><input type="password" style="width:190px;" class="input_normal" name="pass1" id="pass1" maxlength="18" /></div>
					<div class="input_msg">请在次输入您的新密码。</div>
				</li>
				<li>
					<div class="rM_noleft">
						<input  type="submit" class="input_register" value="确定修改密码" />
					</div>
				</li>
			</form>
			</ul>
<?php
}else{
?>
			<div class="title">
				<div class="name"><font color="red">抱歉，验证错误，或者您的邮件验证已经超时！</font><script>setTimeout("window.location.href ='index.php';", 4000);</script></div>
			</div>
<?php
}
?>
		</div>
	</div>
	</div>
<?php
}elseif($ac=="activation"){
?>
	<div class="defaultHome">
	<div class="defaultHomeMain">
		<div class="regMain" id="regData">
			<div class="title">
				<div class="name">激活同步帐号</div>
			</div>
			<ul>
			<form  name="formz" action="do.php?ac=activation" method="post">
				<li>
					<div class="rM_title">激活账号：</div>
					<div class="rM_input"><b>(<font color="#ff0000"><?php echo $_SESSION["username"]?></font>)</b></div>
					<div class="input_msg"><font color="0000ff">您想要激活的登录账号。</font></div>
				</li>
				<li>
					<div class="rM_title">验证码：</div>
					<div class="rM_input"><input type="text" style="width:66px;" class="input_normal" name="Code" id="Code" maxlength="4" /><img id="img_seccode" src="../include/code.php" align="absmiddle"></div>
					<div class="input_msg">输入验证码！</div>
				</li>
				<li><div class="rM_noleft2"><font color="0000ff"><b>提示：激活后将同步UC论坛帐号。</b></font></div></li>
				<li>
					<div class="rM_noleft">
						<input  type="submit" class="input_register" value="确定激活" />
					</div>
				</li>
			</form>
			</ul>
		</div>
	</div>
	</div>
<?php
}else{
?>
	<div class="defaultHome">
	<div class="defaultHomeMain">
		<div class="defaultHomeLeft">
			<div class="defaultHomeLeft_top"></div>
			<div class="defaultHomeLeft_center">
				<div class="defaultHomeTips"><span id="tishi"></span></div>
				<form name="loginform" action="do.php?ac=login" method="post">
					<div class="loginnameStyle">
						<div class="loginnameText">账&nbsp;号</div>
						<div class="loginnameInput"><input type="text" name="username" id="username" class="input_normal" style="width:150px;" maxlength="30" /></div>
					</div>
					<div class="passwordStyle">
						<div class="passwordText">密&nbsp;码</div>
						<div class="passwordInput"><input type="password" name="password" id="password" class="input_normal" style="width:150px;" maxlength="30" /></div>
					</div>
					<div class="stateStyle">
						<div class="stateInput"><input type="checkbox" name="cookietime" id="cookietime" value="31536000" /></div>
						<div class="stateText"><label for="setCookieTime">记住登录状态</label></div>
						<div class="btnStyle">
							<input type="submit" id="loginsubmit" class="home_btn" value="登陆"/>
						</div>
					</div>
				</form>
				<div class="forgetStyle">
					<div class="forgetText"><a href="?ac=lostpasswd">忘记密码？</a></div>
				</div>
				<div class="qqlogin">
					<a href="qq/oauth/redirect_to_login.php"><img src="images/qq_login.png"></a>
				</div>

				<div class="loginStyle">
					<div class="loginQuestions">还没注册？</div>
					<div class="loginJoin">赶快加入<span class="logoText">我们一起来</span>吧!</div>
					<div class="loginBtn"><a href="?ac=reg"><img src="images/btn/regist_a.png"></a></div>
				</div>
			</div>
			<div class="defaultHomeLeft_bottom"></div>
		</div>
		<div class="defaultHomeRight">
			<div class="homeHotUser">
				<div class="title">最新加入会员</div>
				<ul>
<?php
	global $db;
	$sql="select s_id,s_name,S_RealName,S_Logo from s_users where S_State=0 order by s_id desc";
	$rs=$db->query($sql);
	$num=$db->num_rows($rs);
	$nums=56;
	if($num<$nums){
		$j=$num;
	}else{
		$j=$nums;
	}
	for($i=0;$i<$j;$i++){
		$row=$db->fetch_array($rs);
?>
<li><a href='<?php echo userlink("index",$row["s_name"])?>' title='<?php echo $row["S_RealName"]?>' target='_blank'><img class='avatar-42b' src='<?php echo piclink("logo",$row["S_Logo"])?>' /></a></li>
<?php
	}
?>

													</ul>
			</div>
			<div class="homeHotPublisher">
				<div class="title">会员人气排行榜</div>
				<ul>
<?php
	global $db;
	$sql="select s_id,s_name,S_RealName,S_Logo from s_users where S_State=0 order by s_hits desc";
	$rs=$db->query($sql);
	$num=$db->num_rows($rs);
	$nums=33;
	if($num<$nums){
		$j=$num;
	}else{
		$j=$nums;
	}
	for($i=0;$i<$j;$i++){
		$row=$db->fetch_array($rs);
?>
<li><a href='<?php echo userlink("index",$row["s_name"])?>' title='<?php echo $row["S_RealName"]?>' target='_blank'><img class='avatar-58' src='<?php echo piclink("logo",$row["S_Logo"])?>' /></a></li>
<?php
	}
?>
													</ul>
			</div>
 
 
						<div class="homeMiniblog">
				<div class="title">我们每天都在努力做到最好:</div>
				<ul>
<?php
$a=1;
	global $db;
	$sqlw="select * from s_article where S_classid=7 order by s_addtime desc";
	$rs=$db->query($sqlw);
	$num=$db->num_rows($rs);
	$nums=5;
	if($num<$nums){
		$j=$num;
	}else{
		$j=$nums;
	}
	for($i=0;$i<$j;$i++){
		$row=$db->fetch_array($rs);
?>
					<li><?php echo $a?>.<a href="<?php echo LinkUrl("s_article",$row['S_ClassID'],1,$row['S_ID'])?>" target="art"><?php echo $row["S_Name"]?></a>	<?php echo $row["S_AddTime"]?></li>
<?php
$a=$a+1;
	}
?>
					<!--li class="more"><a href="/1/" target="_blank">查看更多更新日志?</a></li-->
				</ul>
			</div>

		</div>

	</div>
	</div>
<?php
}
?>
	<div class="defaultHomeBottom"></div>
	<div class="userBottom">
		本站仅提供音乐作品DJ版本的推广及发布服务，所有音乐的版权归各音乐公司及作者所有
<br />Copyright ? 2012 <?php echo ymurl(S_SiteDomain)?> All Rights Reserved <?php echo html_entity_decode(stripslashes(S_SiteCount))?></div>
</div>
</body>
</html>
