Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /www/wwwroot/citssznet/visa/includes/classes/sys.mysql.php on line 7
$(document).on("click",".login",function(){
$(".jbox-body").fadeOut("fast");
$(".jbox-body").html("");
var html = '';
$.jBox.open(html,'登录',400,370, {buttons: {'关闭': true},opacity:0.7,top:'25%'});
});
$(document).on("click",".forgetpwd",function(){
$(".jbox-body").fadeOut("fast");
$(".jbox-body").html("");
var html = '';
$.jBox.open(html,'重置密码',400,370, {buttons: {'关闭': true},opacity:0.7,top:'25%'});
});
$(document).on("click",".resetbtn",function(){
var phone = $("#phone").val(); //获取手机号
var phoneReg = !!phone.match(telreg);
if(phoneReg == false){
$(".ctrlnotice").html("请填写正确的手机号码(11位)");
$("#phone").focus();
shake($("#phone"),"selectshake",4);
return false;
}
var pattern = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
if(!pattern.test($("#mail").val())){
$(".ctrlnotice").html("请填写正确的邮箱地址");
$("#mail").focus();
shake($("#mail"),"selectshake",4);
return false;
}
$(".ctrlnotice").html('');
$(this).val("请稍等......");
$(this).attr("disabled","disabled");
var params = $('form').serialize();
var url='http://cits-sz.net/visa/uc-findpwd.do';
$.ajax({
url: url,
type: 'post',
data: params,
dataType:'json',
success: function (data) {
$(".resetbtn").val("重置密码");
$(".resetbtn").removeAttr("disabled");
$(".ctrlnotice").html(data.html);
}
});
});
$(document).on("click",".register",function(){
$(".jbox-body").fadeOut("fast");
$(".jbox-body").html("");
var html = '';
$.jBox.open(html,'注册',400,510, {buttons: {'关闭': true},opacity:0.7,top:'25%'});
});
$(document).on("click",".loginbtn,.regbtn",function(){
var dataevent=$(this).attr("data-event");
var params = $('.formlogin').serialize();
if (dataevent=='register'){
var phone = $("#phone").val(); //获取手机号
var phoneReg = !!phone.match(telreg);
if(phoneReg == false){
$(".loginnotice").html("请填写正确的手机号码(11位)");
$("#phone").focus();
shake($("#phone"),"selectshake",4);
return false;
}
if($.trim($("#yspwd").val())==''){
$(".loginnotice").html("请输入密码");
$("#yspwd").focus();
shake($("#yspwd"),"selectshake",4);
return false;
}
if($.trim($("#pwd").val())==''){
$(".loginnotice").html("请输入确认密码");
$("#pwd").focus();
shake($("#pwd"),"selectshake",4);
return false;
}
if($("#yspwd").val()!=$("#pwd").val()){
$(".loginnotice").html("两次输入密码必须一致");
$("#yspwd").focus();
shake($("#yspwd"),"selectshake",4);
return false;
}
var pattern = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
if(!pattern.test($("#mail").val())){;
$(".loginnotice").html("请填写正确的邮箱地址");
$("#mail").focus();
shake($("#mail"),"selectshake",4);
return false;
}
}
var url="http://cits-sz.net/visa/logreg-"+dataevent+".do";
$.ajax({
url: url,
type: 'post',
data: params,
dataType:'json',
success: function (data) {
if (data.html==1){
$(".headerM .user").html(''+data.phonein+' 个人中心 退出');
$(".jbox-body").fadeOut("fast");
$(".jbox-body").html("");
if (data.loginid) $("#loginstatus").val(data.loginid);
$("#name").val(data.name);
$("#phonein").val(data.phonein);
$("#qq").val(data.qq);
$("#nextbtn").show();
}else{
$('.loginnotice').html(dataevent=='login'?'帐号或密码错误':(data.html==2?'该号码已被注册,请重新填写':''));
}
}
});
});