<?php
# Name: PHP版程氏音乐CMS管理系统 v3.0
# Author: 程氏<web@chshcms.com> [QQ:848769359]
# Homepage:http://www.chshcms.cn/
include_once("../lib/cs_conn.php");
include_once("../lib/cs_common.php");
if(CS_UserFun==1) exit(Msg_Error('抱歉,本站会员功能已经关闭!','/'));
if(CS_RegFun==1) exit(Msg_Error('抱歉,本站会员注册已经关闭!','/'));
?><!DOCTYPE html>
<html>
<head>
<meta charset="gbk" />
<title>用户注册 - <?php echo CS_WebName?></title>
    <link rel="stylesheet" href="css/style.css" />
    <script src="../public/js/jquery.js"></script>
    <script language="javascript"> 
        $(document).ready(function(){
        $("#regsubmit").click(function(){
		var username=$("#username").val();
		var password=$("#password").val();
		var nickname=$("#nickname").val();
		var email=$("#email").val();
	$("#username").css("border-color","#666 #ccc #ccc #666");
	$("#password").css("border-color","#666 #ccc #ccc #666");
	$("#nickname").css("border-color","#666 #ccc #ccc #666");
	$("#email").css("border-color","#666 #ccc #ccc #666");
	    if(username==""){
		$("#username").css("border","1px solid red");
		$("#msg_username").text("请输入正确的账号！").css("color","red");
		return false;}
	    else if((len(username)<4)||(len(username)>16)){
		$("#username").css("border","1px solid red");
		$("#msg_username").text("账号限制4-16位！").css("color","red");
		return false;}
	    else if(/.*[\u4e00-\u9fa5]+.*$/.test(username)){ 
		$("#username").css("border","1px solid red");
		$("#msg_username").text("用户名不允许中文注册！").css("color","red");
		return false;}
	    else if(isID(username)==false){
		$("#username").css("border","1px solid red");
		$("#msg_username").text("用户名不允许特殊字符！").css("color","red");
		return false;}
	    else if(password==""){
		$("#password").css("border","1px solid red");
		$("#msg_pass").text("登陆密码不能为空！").css("color","red");
		return false;}
	    else if((len(password)<4)||(len(password)>16)){
		$("#password").css("border","1px solid red");
		$("#msg_pass").text("登陆密码限制4-16位！").css("color","red");
		return false;}
	    else if(nickname==""){
		$("#nickname").css("border","1px solid red");
		$("#msg_nichen").text("昵称不能为空！").css("color","red");
		return false;}
	    else if(email==""){
		$("#email").css("border","1px solid red");
		$("#msg_email").text("邮箱不能为空！").css("color","red");
		return false;}
	    else if(isEmail(email)==false){
		$("#email").css("border","1px solid red");
		$("#msg_email").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;
        }
        function isID(str){
	      res = /^(?!_)(?!.*?_$)[a-zA-Z0-9\u4e00-\u9fa5]+$/;
	      var re = new RegExp(res);
	      return !(str.match(re) == null);
        };
        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);
        };
    </script>
</head>
<body>
<form name="regform" action="do.php?ac=reg" method="post">
<div class="header">
    	<h1><a href="http://<?php echo CS_WebUrl?>/" class=""><?php echo CS_WebName?></a></h1>
        <div class="point">
             <a href="<?php echo CS_WebPath?>">网站首页</a>
<?php
	global $db;
	$sqlw="select * from ".Getdbname('class')." where cs_sid=1 order by CS_sid 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);
           echo '<a href="'.LinkUrl('list','dance','id',$row['CS_ID']).'" target="art">'.$row["CS_Name"].'</a>';
	}
?> 
             <a href="./">会员中心</a>
        </div>
</div>
    <div class="content">
    	<h2>快速注册</h2>
    	<P class="login_title"><span class="go_login">已有<?php echo CS_WebUrl?>账号?<a href="login.php">登录</a></span>欢迎您，紧需10秒!</P>
      
        <dl class="regsiter_form">
        	<dt>通行证</dt>
            <dd style="position:relative;">
            	<input name="username" id="username" maxlength="15" type="text" onfocus="this.style.borderColor='#F93'" onblur="this.style.borderColor='#CCC'"/>
                <div class="tip_Panel user msg">
					<p class="msg_info" id="msg_username"><span>英文字母开头</span>，仅包含字母和数字，4-15位。如y123456789</p>
                </div>
          </dd>
            <dt>密码</dt>
            <dd style="position:relative;">
            	<input  name="password" id="password" maxlength="15" type="password" onfocus="this.style.borderColor='#F93'" onblur="this.style.borderColor='#CCC'"/>
                <div class="tip_Panel password msg">
					<p class="msg_info" id="msg_pass">6-15位数字或数字加字母。</p>
                </div>
            </dd>
            <dt>昵称</dt>
            <dd style="position:relative;">
            	<input type="text" name="nickname" id="nickname" size="28" onfocus="this.style.borderColor='#F93'" onblur="this.style.borderColor='#CCC'"/>
                <div class="tip_Panel nickname msg">
					<p class="msg_info" id="msg_nichen">给自己起个昵称，让大家认识你。</p>
                </div>
            </dd>
            <dt>电子邮箱</dt>
            <dd style="position:relative;">
            	<input type="text" name="email" id="email" size="28" onfocus="this.style.borderColor='#F93'" onblur="this.style.borderColor='#CCC'"/>
                <div class="tip_Panel email msg">
					<p class="msg_info" id="msg_email">重要！找回密码用，推荐使用QQ邮箱。</p>
                </div>
            </dd>
            <dt></dt>
            <ol>
                <input type="submit" value="" class="submit_btn" id="regsubmit" />
                <input type="button" value="" class="qqlogin" onclick="window.open('open/qq/qq_login.php')"/>
                <p>立即注册&nbsp;&nbsp;表示您同意并遵守&nbsp;&nbsp;<a><?php echo CS_WebName?>&nbsp;&nbsp;的服务条款</a></p>
            <ol>
                <p class="float_clear"></p>
        </dl>
        <div class="contact">
            如遇问题请拨打电话：<?php echo CS_Admintel?>&nbsp;&nbsp;&nbsp;&nbsp;QQ：<a href="tencent://message/?uin=<?php echo CS_AdminQQ?>&Site=客服&Menu=yes"><?php echo CS_AdminQQ?></a>
        </div>
        </div>
    <div class="footer"></div>
</form>
<div class="dw_fr w960">
Copyright (C) 2009-2013 <?php echo CS_WebUrl?>, All Rights Reserved. <a href="http://<?php echo CS_WebUrl?>/" title="<?php echo CS_WebName?>"><?php echo CS_WebName?></a> 版权所有<br />
增值电信业务经营许可证：<?php echo CS_Webicp?> <?php echo html_entity_decode(stripslashes(CS_WebCount))?>
</div>
</body>
</html>