<?php
switch ($act) {
	case 'add':
		//用户注册
		$setting = cache::get('email');
		foreach ($setting as $v) {
			if (stripos($v['email_smtp'], 'qq.com') === false or !$v['email_qqid'])continue;			             $setting_qq[] = $v;
		}
		$setting_qq && $dingyue_qq = $setting_qq[array_rand($setting_qq,1)];
		!$setting_qq && $formfalse = 'return false;';
             $login_url = pe_url('page-login');
$html = <<<html
	<form action='http://list.qq.com/cgi-bin/qf_compose_send' method='post' target='_blank'>
	<div class="zhuce">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td width="70" align="right"  style="color:#000000">用户名：</td>
			<td width="55"><input type="text" name="info[user_name]" class="input3" style="width:95px" id="reguser_name" /></td>
			<td width="55" align="right"  style="color:#000000">密码：</td>
			<td width="55"><input type="password" name="info[user_pw]" class="input3" style="width:80px" id="reguser_pw" /></td>
			<td width="85" align="right"  style="color:#000000">确认密码：</td>
			<td width="55"><input type="password" name="info[c_pw]" class="input3" style="width:80px" id="c_pw" /></td>
			<td width="55" align="right"  style="color:#000000">邮箱：</td>
			<td width="135"><input type="text" name="to" class="input1" style="width:95px" id="reguser_email" /></td>
			<td>
				<input type='hidden' name='t' value="qf_booked_feedback" />
				<input type='hidden' name='id' value="{$dingyue_qq['email_qqid']}" />
				<input type="submit" name="pesubmit" class="tjbtn3 js_register" style="cursor:pointer" value="马上注册" />
                         			</td>
                   <td>
                         <input type="button" style="cursor:pointer" onclick="window.location.href='{$login_url}'" value="登 录" /></td>
             
                		</tr>
		</table>
	</div>
	</form>
<script type="text/javascript">
pe_inputdefault('reguser_name','数字、字母或组合');
pe_inputdefault('reguser_email','必需填写qq邮箱');
function jump() {
	window.location.href = "{$pe['host_root']}user.php?mod=prodv";
}
$(function(){
$(".js_register").click(function() {
	$.ajaxSettings.async = false;
	var result = true;
	var rule_abc = /^[A-Za-z0-9]+$/;
	if (rule_abc.test($("#reguser_name").val()) == false) {
		alert('用户名仅限数字、字母或组合');
		return false;
	};
	if ($("#reguser_pw").val() == '') {
		alert('密码必须填写');
		return false;
	};
	if ($("#reguser_pw").val() != $("#c_pw").val()) {
		alert('两次密码不一致');
		return false;
	};
	if (rule_email.test($("#reguser_email").val()) == false) {
		alert('邮箱格式不正确');
		return false;
	};
	var str=($("#reguser_email").val());
	if(str.substr(str.length-7)!='@qq.com' && str.substr(str.length-12)!='@foxmail.com'){
		alert('请使用QQ邮箱注册');
		return false;
	}
	$.getJSON("{$pe['host_root']}user.php",{"mod":"do","act":"registersql","reg[user_name]":$("#reguser_name").val(),"reg[user_pw]":$("#reguser_pw").val(),"reg[user_email]":$("#reguser_email").val()}, function(json){
		result = json.result;
	});
	if (result == 'false_name') {
		alert('用户名已被注册...');
		return false;	
	};
	if (result == 'false_email') {
		alert('邮箱已被注册...');
		return false;	
	};
	if (result == false) {
		alert('注册失败...');
		return false;	
	};
	setTimeout("jump()", 1000);
	{$formfalse}
})
})
</script>
html;
	echo pe_jstext($html);
	break;
}
?>