<!DOCTYPE html>

<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0,user-scalable=no">

<title>注册<!--{$page_title}--><!--{$copyright_header}--></title>

 <link type="text/css" rel="stylesheet" href="<!--{$skinpath}-->assets/css/reset.css">

<link type="text/css" rel="stylesheet" href="<!--{$skinpath}-->assets/css/layout.css">

<link type="text/css" rel="stylesheet" href="<!--{$skinpath}-->assets/css/registerpwd.css">
<link type="text/css" rel="stylesheet" href="<!--{$skinpath}-->assets/css/bootstrap.min123.css">
<link type="text/css" rel="stylesheet" href="<!--{$skinpath}-->assets/css/index123.css">
	<link rel="stylesheet" href="<!--{$skinpath}-->assets/css/base1.min.css">
		<script src="<!--{$skinpath}-->assets/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="<!--{$skinpath}-->assets/js/layer.js"></script>
<style>
    #floatDivr{display: none;}
</style>
</head>
<body>
<div class="site-topbar">
    <div class="container">
        <div class="topbar-nav">
            <a href="<!--{$urlpath}-->" >首页</a><span class="sep">|</span>
        </div>
    </div>
</div>

        <div class="fl wfs bcf7">
            <div class="regist-process-wrapper">
                <div class="regist-process-body fl wfs">
                    
                    <div class="regist-process-register-left fl">
                        <h2 class="title">用户注册</h2>
						
                        <form  id="companyinforeg" method="post" name="regform">
                            <div>
                                <span class="title">手机号码：</span>
                                <input class="form-control text" autofocus="" id="username" name="username" data-type="PH" placeholder="请输入用户名" type="tel" required>
                            </div>
                            <div>
                                <span class="title">会员密码：</span>
                                <input class="form-control text" name="password" id="password" data-type="PH" placeholder="请输入密码" type="password" required >
                            </div>
                            <div>
                                <span class="title">确认密码：</span>
                                <input class="form-control text" name="assertpassword" id="assertpassword" data-type="PH" placeholder="密码确认" type="password" required>
                            </div>
                            <div>
                                <span class="title">会员邮箱：</span>
                                <input class="form-control text" name="email" id="email" data-type="PH" placeholder="请填写邮箱" type="text" required >
                            </div>
                             <div>
                                <span class="title" style="margin-top:20px;">验证码：</span>
                                <input type="text" size="8"  class="form-control text fl" name="checkcode" id="checkcode" autocomplete="off" required  style="width:100px;" />
      							<div style="float:left;margin-top:25px">
									<img alt="图片验证码" title="看不清换一张" class="chkcode_img" src="<!--{$urlpath}-->source/include/imagecode.php?act=verifycode" style="height: 30px;" />
      							</div>
                            </div>
                              <div class="read-protocal">
                                点击“立即注册”，表示您已同意《8CMS用户协议》
                            </div>
                            <input class="btn btn-danger register-now" type="button" id="submit"  value="立即注册">
                        </form>
                    </div>
                    
                    
                   <div class="regist-process-register-right fr">
                       <h2 class="title">我已注册账号</h2>
                       <a class="btn btn-info login-now" href="./index.php?c=user&a=login">立即登录</a>
                        <img class="mid-r-img" src="<!--{$skinpath}-->assets/css/zc/register-reg-4.png" alt="">
                   </div>
                    
                </div>
            </div>
            
        </div>

   <div class="blank"></div>
    <div class="regist-process-foot fl wfs">
        <p class="copyright"></p>
        <p class="address"></p>
    </div>
<script>

	$("#submit").click(function() {
	var username=document.getElementById("username").value;//获取form中的用户名
	var password=document.getElementById("password").value;
	var assertpassword=document.getElementById("assertpassword").value;
	var email=document.getElementById("email").value;
	var checkcode=document.getElementById("checkcode").value;
	var regex=/^[/s]+$/;//声明一个判断用户名前后是否有空格的正则表达式
	if(regex.test(username)||username.length==0)//判定用户名的是否前后有空格或者用户名是否为空
	{
		layer.msg("手机格式不对", {icon: 5});
		return false;
	}
	if(regex.test(password)||password.length==0)//同上述内容
	{
			layer.msg("密码格式不对", {icon: 5});
		return false;
	}
	if(regex.test(assertpassword)||assertpassword.length==0)//同上述内容
	{
			layer.msg("密码格式不对", {icon: 5});
		return false;
	}
	if(regex.test(email)||email.length==0)//同上述内容
	{
			layer.msg("密码格式不对", {icon: 5});
		return false;
	}
	if(regex.test(checkcode)||checkcode.length==0)//同上述内容
	{
			layer.msg("密码格式不对", {icon: 5});
		return false;
	}

	event.preventDefault();
        var form = new FormData(document.getElementById("companyinforeg"));
        $.ajax({
                url: "index.php?c=user&a=ajaxreg",
                type: "post",
                data: form,
                dataType: "json",
                processData: false,
                contentType: false,
                success: function(data) {
                        var json = eval(data);
                        var response = json.response;
                        var result = json.result;

                        if(response == "1") {
                            layer.msg(result, {icon: 1});
                            window.location.href = '/index.php?c=user&a=login';
                        } else {
                            layer.msg(result, {icon: 5});
                        }
                },
                error: function(e) {
                        alert("错误！！");

                }
        });                        
	});
</script>



	        <!-------------------------------------- 主体结束 -------------------------------------->
        <!-------------------------------------- 尾部开始 -------------------------------------->

<!--{include file="<!--{$tplpath}-->botton.tpl"}-->