<%@ Page language="c#" Codebehind="reg.aspx.cs" AutoEventWireup="True" Inherits="Webdisk.reg" %>
<%@ Register Src="~/indextop.ascx" TagPrefix="uc1" TagName="indextop" %>
<%@ Register Src="~/indexbottom.ascx" TagPrefix="uc1" TagName="indexbottom" %>

<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="本系统由桃源网络硬盘提供 www.mytaoyuan.com 专业的网络存储程序提供商"> 
<meta name="keywords" content="桃源网络硬盘,桃源网盘,网络存储,网络公文包,网络相册">
<title>用户注册</title>
<!--Bootstrap -->
<link rel="stylesheet" href="css/bundle.css" type="text/css">
<!--Custome Style -->
<link rel="stylesheet" href="css/style.css" type="text/css">

</head>
<body>
<!-- Header -->
    <uc1:indextop runat="server" id="indextop" />
<!-- /Header -->

<!-- Process -->
<section id="proecess" class="section-padding">
  <div class="container">
		<form id="Form1" method="post" runat="server">
			<div class="card" id="loading" style="POSITION:absolute;z-index:9999;margin: auto;BACKGROUND-COLOR:#ffffae;display:none; top:50%;left:50%;transform: translate(-50%,-50%);">
			  <div class="card-body">
				<img src="pics/loading.gif" width="32" height="32" align="absMiddle"> <b>正在处理，请稍候……</b>
			  </div>
			</div>
			<asp:panel id="Panel3" runat="server">
                 <div class="row align-items-center justify-content-center">
 <div class="col-lg-8">
        <div class="info-box">
          <div class="box-head">
            <h5>注册网络硬盘</h5>
          </div>
          <div class="box-body">
              <div class="form-group">
               即将绑定您的QQ号，请选择是否在本站注册过？
              </div>
              <div class="row form-group">
				 <INPUT class=btn runat=server id=Submit4 type=button value=已在本站注册 name=Submit onserverclick="Submit4_ServerClick">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		                    <INPUT class=btn id=Submit6 runat=server type=button value=还没有注册 name=Submit3 onserverclick="Submit6_ServerClick">
              </div>
          </div>
        </div>
      </div></div>
			  </asp:panel>
            <asp:panel id="Panel4" runat="server">
                <div class="row align-items-center justify-content-center">
 <div class="col-lg-8">
        <div class="info-box">
          <div class="box-head">
            <h5>注册网络硬盘</h5>
          </div>
          <div class="box-body">
              <div class="form-group">
               注：请登录已有帐号以便绑定该QQ号<span id="note3" style="display:none">（关联您的帐号后下次登录可以直接进入网盘系统）</span>
              </div>
               <div class="form-group row">

    <label for="exampleInputEmail1" class="col-sm-2 col-form-label">用户名</label>
      <div class="col-sm-10">
    <input type="text" class="form-control" id="username3" onblur=VerifyUsername(this.value); maxLength=30 aria-describedby="emailHelp" runat="server">
          <SPAN class=style5> <asp:RequiredFieldValidator id=RequiredFieldValidator5 runat="server" ErrorMessage="请输入用户名" ControlToValidate="username3" Display="Dynamic"></asp:RequiredFieldValidator><asp:regularexpressionvalidator id=Regularexpressionvalidator5 runat="server" ErrorMessage="用户名必须为数字或英文字母" ControlToValidate="username" Display="Dynamic" ValidationExpression="^[\w_]+$">用户名必须为数字或英文字母</asp:regularexpressionvalidator><asp:regularexpressionvalidator id=Regularexpressionvalidator6 runat="server" ErrorMessage="" ControlToValidate="username" Display="Dynamic" ValidationExpression="^[\w_]+$"></asp:regularexpressionvalidator></SPAN>
         <DIV id=chkinfo3></DIV>
          </div>
  </div>
                 <div class="form-group row" id="pass1">
    <label for="exampleInputPassword1" class="col-sm-2 col-form-label">密 码</label>
      <div class="col-sm-10">
    <input type="password" class="form-control" id="Password5" runat="server">
         <SPAN 
                  class=style5><asp:RequiredFieldValidator id=RequiredFieldValidator6 runat="server" ErrorMessage="请输入密码" ControlToValidate="Password5" Display="Dynamic"></asp:RequiredFieldValidator><asp:regularexpressionvalidator id=Regularexpressionvalidator7 runat="server" ErrorMessage="" ControlToValidate="Password1" Display="Dynamic" ValidationExpression="^[\w_]+$"></asp:regularexpressionvalidator></SPAN>
      </div>
  </div>
 <div class="form-group row" id=Div1 runat="server">

    <label for="exampleInputEmail1" class="col-sm-2 col-form-label">输入验证码</label>
      <div class="col-sm-10">
    <input type="text" class="form-control" id="ValidateCode3" aria-describedby="emailHelp" runat="server">
		  <IMG src="ValidateCode.aspx" style="cursor:pointer" onClick="this.src='ValidateCode.aspx?time=' + new Date()">
          <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                                  ControlToValidate="ValidateCode3" Display="Dynamic" ErrorMessage="请输入验证码"></asp:RequiredFieldValidator>
          </div>
  </div>
              <div class="row form-group">
				 <INPUT class=btn id=Submit5 type=button value=登录关联 runat=server name=Submit5 onserverclick="Submit5_ServerClick">
                            <INPUT id=curr3 type=hidden size=6 name=curr3 runat="server">
                            <asp:ValidationSummary id=ValidationSummary3 runat="server" ShowSummary="False" ShowMessageBox="True"></asp:ValidationSummary>
              </div>
          </div>
        </div>
      </div></div>
              </asp:panel>
            <asp:panel id="Panel1" runat="server">
                 <div class="row align-items-center justify-content-center">
                  <div class="col-lg-8">
        <div class="info-box">
          <div class="box-head">
            <h5>注册协议</h5>
          </div>
          <div class="box-body">
              <div class="form-group">
                  <TEXTAREA class=form-control id=agreement name=agreement rows=10 cols=100 runat="server"></TEXTAREA>
              </div>
              <div class="row form-group">
				  <INPUT class=btn id=Submit2 type=button value=我同意 name=submit2 runat="server" onserverclick="Submit2_ServerClick">&nbsp;&nbsp;&nbsp;&nbsp; 
<INPUT class=btn id=Submit3 type=button value=不同意 name=submit3 runat="server" onserverclick="Submit3_ServerClick"> 
              </div>
          </div>
        </div>
      </div></div>
			</asp:panel><asp:panel id="Panel2" runat="server" Visible="False">
                 <div class="row align-items-center justify-content-center">
                 <div class="col-lg-8">
        <div class="info-box">
          <div class="box-head">
            <h5>注册网络硬盘</h5>
          </div>
          <div class="box-body">
             <div class="form-group row" id=mrteam style="DISPLAY: none" runat="server"> 

    <label for="exampleInputEmail1" class="col-sm-2 col-form-label">默认注册分组：</label>
      <div class="col-sm-10">
   <%=teamstr%>
          </div>
  </div>
             <div class="form-group row">

    <label for="exampleInputEmail1" class="col-sm-2 col-form-label">用户名</label>
      <div class="col-sm-10">
    <input type="text" class="form-control" id="username" onblur=VerifyUsername(this.value); maxLength=30 aria-describedby="emailHelp" runat="server">
          <SPAN class=style5> <asp:RequiredFieldValidator id=RequiredFieldValidator1 runat="server" ErrorMessage="请输入用户名" ControlToValidate="username" Display="Dynamic"></asp:RequiredFieldValidator><asp:regularexpressionvalidator id=Regularexpressionvalidator1 runat="server" ErrorMessage="用户名必须为数字或英文字母" ControlToValidate="username" Display="Dynamic" ValidationExpression="^[\w_]+$">用户名必须为数字或英文字母</asp:regularexpressionvalidator><asp:regularexpressionvalidator id=Regularexpressionvalidator2 runat="server" ErrorMessage="" ControlToValidate="username" Display="Dynamic" ValidationExpression="^[\w_]+$"></asp:regularexpressionvalidator></SPAN>
         <DIV id=chkinfo></DIV>
          </div>
  </div>
                 <div class="form-group row" id="pass1">
    <label for="exampleInputPassword1" class="col-sm-2 col-form-label">密 码</label>
      <div class="col-sm-10">
    <input type="password" class="form-control" id="Password1" runat="server">
         <SPAN 
                  class=style5><asp:RequiredFieldValidator id=RequiredFieldValidator2 runat="server" ErrorMessage="请输入密码" ControlToValidate="Password1" Display="Dynamic"></asp:RequiredFieldValidator><asp:regularexpressionvalidator id=Regularexpressionvalidator4 runat="server" ErrorMessage="" ControlToValidate="Password1" Display="Dynamic" ValidationExpression="^[\w_]+$"></asp:regularexpressionvalidator></SPAN>
      </div>
  </div>
           <div class="form-group row" id="pass2">
    <label for="exampleInputPassword1" class="col-sm-2 col-form-label">密码确认</label>
      <div class="col-sm-10">
    <input type="password" class="form-control" id="Password2" runat="server">
        <SPAN class=style5><asp:RequiredFieldValidator id=RequiredFieldValidator4 runat="server" ErrorMessage="请再次输入密码" ControlToValidate="Password2" Display="Dynamic"></asp:RequiredFieldValidator><asp:CompareValidator id=CompareValidator1 runat="server" ErrorMessage="两次输入密码不一致" ControlToValidate="Password2" Display="Dynamic" ControlToCompare="Password1">两次输入密码不一致</asp:CompareValidator></SPAN>
      </div>
  </div>
		  <div class="form-group row">

    <label for="exampleInputEmail1" class="col-sm-2 col-form-label">电子邮箱</label>
      <div class="col-sm-10">
    <input type="text" class="form-control" id="email" aria-describedby="emailHelp" runat="server">
		  <SPAN class=style5><asp:RequiredFieldValidator id=RequiredFieldValidator3 runat="server" ErrorMessage="请输入邮件地址" ControlToValidate="email" Display="Dynamic"></asp:RequiredFieldValidator><asp:RegularExpressionValidator id=RegularExpressionValidator3 runat="server" ErrorMessage="错误的电子邮件地址" ControlToValidate="email" Display="Dynamic" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator></SPAN>
          </div>
  </div>
		  <div class="form-group row" id=vcode runat="server">

    <label for="exampleInputEmail1" class="col-sm-2 col-form-label">输入验证码</label>
      <div class="col-sm-10">
    <input type="text" class="form-control" id="ValidateCode" aria-describedby="emailHelp">
		  <IMG src="ValidateCode.aspx" style="cursor:pointer" onClick="this.src='ValidateCode.aspx?time=' + new Date()">
          </div>
  </div>
              <div class="row form-group">
				   <button type="button" class="btn btn-primary" style="display:block;margin:0 auto" id=Submit1 onclick=RegUser(); >现在注册</button>
             <INPUT id=curr type=hidden size=6 name=curr runat="server"> 
                 <input id="tjuser" type="hidden" runat="server" />
                 <asp:ValidationSummary id=ValidationSummary1 runat="server" ShowSummary="False" ShowMessageBox="True"></asp:ValidationSummary>
              </div>
          </div>
        </div>
      </div> </div>
	        </asp:panel>
<div class="modal fade" tabindex="-1" role="dialog" id="new" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="modaltxt"></h5>
      </div>
      <div class="modal-body" id="modalcontent">
        <p></p>
      </div>
        <button type="button" class="btn btn-primary" id="modalbtn">Save changes</button>
    </div>
  </div>
</div>
		</form>
 

	    <p>
            <input id="hidopenid" type="hidden" runat=server /> 
        </p>
  </div>
</section>
<!-- /Process -->
									<!-- Footer -->
    <uc1:indexbottom runat="server" id="indexbottom" />
<!-- /Footer --> 
</body>
</html>


<!-- Scripts --> 
<script src="js/bundle.js"></script> 
<script type="text/javascript" language="javascript" src="js/dialog.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery-3.5.1.min.js"></script>
        <script type="text/javascript" language="javascript" src="js/bootstrap.min.js"></script>
			<script language="javascript">
                function getUrlParam(paramName) {
                    var s = location.search;
                    if (s != null) {
                        var sarr = s.substr(1).split("&");
                        var tarr;
                        for (i = 0; i < sarr.length; i++) {
                            tarr = sarr[i].split("=");
                            if (tarr.length == 2 && tarr[0].toLowerCase() == paramName) {
                                return tarr[1];
                            }
                        }
                        return "";
                    }
                }
                function getRbGroupValue(rbGroup) {
                    var objs = document.getElementsByName(rbGroup);
                    for (var i = 0; i < objs.length; i++) {
                        if (objs[i].checked) return objs[i].value;
                    }
                    return "";
                }
                function RegUser() {
                    var sub;
                    try {
                        if (Page_ClientValidate()) sub = true; else sub = false;
                    }
                    catch (e) {
                        sub = true;
                    }
                    if (sub) {
                        Init();

                        /*$.post("regajax.aspx", {
                            team: getRbGroupValue('team'),
                            username: document.all.username.value,
                            password: document.all.Password1.value,
                            uquestion: document.all.uquestion.value,
                            uanswer: document.all.uanswer.value,
                            email: document.all.email.value,
                            sex: encodeURI(getRbGroupValue('sex')),
                            url: document.all.url.value,
                            qq: document.all.qq.value,
                            msn: document.all.msn.value,
                            realname: document.all.realname.value,
                            phone: document.all.phone.value,
                            address: document.all.address.value,
                            company: document.all.company.value,
                            bm: document.all.bm.value,
                            recommend: document.all.recommend.value,
                            tjuser: document.all.tjuser.value,
                            ValidateCode: document.all.ValidateCode.value,
                            curr: document.all.curr.value,
                            openid: document.getElementById("hidopenid").value
                        }, function(data, textStatus) {
                            document.all.loading.style.display = 'none';
                            var bRet = data;
                            if (bRet == "0") {
                                var d = new dialog(); d.init();
                                d.set('src', 'pics/dlgico_right.gif');
                                d.set('title', '系统提示信息');
                                d.event('注册成功！', 'window.parent.location="login.aspx";', '', '');
                            }
                            else if (bRet.charAt(0) == "1") {
                                if (bRet.substr(1).indexOf("邮件") != -1) window.location = 'regmail.aspx?user=' + document.getElementById('username').value + '&mail=' + document.getElementById('email').value;
                                var d = new dialog(); d.init();
                                d.set('src', 'pics/dlgico_excal.gif');
                                d.set('title', '系统提示信息');
                                d.event(bRet.substr(1), 'window.parent.location="login.aspx";', '', '');
                            }
                            else {
                                var d = new dialog(); d.init();
                                d.set('src', 'pics/dlgico_excal.gif');
                                d.set('title', '系统提示信息');
                                d.event(bRet, 'window.close();', '', '');
                            }
                        });*/

                        try {
                            $.post(
                                "ajax.aspx",
                                { action: "RegUser", team: getRbGroupValue('team'), username: document.all.username.value, password: document.all.Password1.value, email: document.all.email.value, ValidateCode: document.all.ValidateCode.value, curr: document.all.curr.value, openid: document.getElementById("hidopenid").value, tjuser: document.all.tjuser.value },IsRegUser_callback
                            )
                        }
                        catch (e) {
                            alert(e.value);
                        }
                    }
                }
                function IsRegUser_callback(res) {
                    document.all.loading.style.display = 'none';
                    var bRet = res;
                    if (bRet == "0") {
                        $("#modaltxt").html("系统提示信息");
                        $("#modalcontent").html("注册成功！");
                        $("#modalbtn").text("确定");
                        $("#modalbtn").click(function () {
                            window.parent.location = "index.aspx";
                        });
                    }
                    else if (bRet.charAt(0) == "1") {
                        if (bRet.substr(1).indexOf("邮件") != -1) window.location = 'regmail.aspx?user=' + document.getElementById('username').value + '&mail=' + document.getElementById('email').value;
                        $("#modaltxt").html("系统提示信息");
                        $("#modalcontent").html(bRet.substr(1));
                        $("#modalbtn").text("确定");
                        $("#modalbtn").click(function () {
                            window.parent.location = "index.aspx";
                        });
                    }
                    else {
                        $("#modaltxt").html("系统提示信息");
                        $("#modalcontent").html(bRet);
                        $("#modalbtn").text("确定");
                        $("#modalbtn").click(function () {
                            $("#new").modal("hide");
                        });
                    }
                    $("#new").modal("show");
                }
                function VerifyUsername(name) {
                    $.post(
                        "ajax.aspx",
                        { action: "check", username: name }, IsUsernameExist_callback
                    )
                }
                function IsUsernameExist_callback(res) {
                    var msg = document.getElementById('chkinfo');
                    var bRet = res;
                    if (bRet == "") msg.style.display = 'none';
                    else {
                        msg.style.display = '';
                        msg.innerHTML = res;
                        msg.style.color = 'red';
                    }
                }
                function Init() {
                    document.all.loading.style.top = Math.round((document.body.clientHeight - 100) / 2) + document.body.scrollTop - 50;
                    document.all.loading.style.left = Math.round((document.body.clientWidth - 100) / 2) - 100;
                    document.all.loading.style.display = '';
                }
                function pass() {
                    showerror("&nbsp;<font color='#FD1004'><b>用户名</b></font>不能为空！！", "pics/err.gif");
                    return false;

                }
                function showerror(title, id) {
                    var d = new dialog(); d.init();
                    d.set('src', id);
                    d.set('title', '系统提示信息');
                    d.event(title, 'window.close();', '', '');
                }
            </script>

<script>
    if (getUrlParam('code') != "") {
        document.getElementById("pass1").style.display = 'none';
        document.getElementById("pass2").style.display = 'none';
        document.getElementById("Submit1").value = '关联帐号';
    }
</script>

<style>
  .text {
    font-size: 14px;
  }

  .item {
    padding: 18px 0;
  }

  .box-card {
    width: 480px;
  }
</style>
