www.gusucode.com > citySHOP B2C商城系统 进销存 2.0.6码程序 > upload/data/templates/1_logging.tpl.php

    <? if(!defined('IN_APP')) exit('Access Denied'); include template('header'); ?>
<script language="javascript">
function ajaxchk(cid, data) {
var chkajax = false;
var tip = e(cid.name+'_tip');
$('#'+cid.name+'_tip').ajaxStart(function(){
tip.innerHTML = '<img src="images/default/loading.gif" border="0" />';
});
$.ajax({
url:'ajax.php?hash='+Math.random(),
type:'post',
data:data,
cache:false,
async:false,
error:function(){
  tip.innerHTML = "error...";
},
success:function(data){
if(data=='succeed'){
chkres(tip,'write','输入正确');
chkajax = true;
}else{
    chkres(tip,'warning',data);
chkajax = false;
}
$('#'+cid.name+'_tip').unbind('ajaxStart');
}
});
return chkajax;
     }
function chkres(tip,tp,str){
tip.className = tp;
tip.innerHTML = str;
if(tp=='write'){
return true;
}else{
return false;
}
}
function chk_username(cid){
var tip = e(cid.name+'_tip');
if(cid.value.match(/[\'\"\s]+/)!=null){
return chkres(tip,'warning','格式不正确或包含非法字符!');
}else if(cid.value.length<2 || cid.value.length>15){
return chkres(tip,'warning','用户名必须是2-15位字符!');
}else{	
return ajaxchk(cid,'action=chkusername&inajax=1&username='+cid.value);
}
return true;
}
function chk_password(cid){
var tip = e(cid.name+'_tip');
if(cid.value.length<4 || cid.value.length>16){
return chkres(tip,'warning','请输入4-16位字符');
}
return chkres(tip,'write','输入正确');
}
function chk_passwordag(cid){
var tip = e(cid.name+'_tip');
if(cid.value!=e('password').value){
return chkres(tip,'warning','两次输入的密码不一致');
}
return chkres(tip,'write','输入正确');
}
function chk_email(cid){
var tip = e(cid.name+'_tip');
if(cid.value.match(/^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/)==null){
return chkres(tip,'warning','Email为空或格式不正确');
}else{
return ajaxchk(cid,'action=chkemail&inajax=1&email='+cid.value);
}
return true;
}
function freshcode(evt){
$.get('ajax.php',{action:'freshcode',inajax:'1'},function(data){
$("#seccodehide").val(data);
evt.src = "seccode.php?seccodeauth="+data+"&hash="+Math.random();
});
}
function chk_checkcode(cid){
var tip = e(cid.name+'_tip');
if(cid.value==''){
return chkres(tip,'warning','请输入左侧显示的字母');
}else{
var scode = $("#seccodehide").val();			
return ajaxchk(cid,'action=chkseccode&seccodeauth='+scode+'&inajax=1&sec='+cid.value);
}
return true;
}
function chk_agree(){
if(!$("#agreemallrule").attr('checked')){
alert('请阅读并同意《商城用户协议》后才能提交');
return false;	
}
return true;
}

function chkregform(){
   if(chk_username(e('username')) && e('usernamemode').value && chk_password(e('password')) && chk_passwordag(e('passwordag')) && chk_email(e('email')) && chk_checkcode(e('checkcode')) && e('checkcodemode').value && chk_agree()){
return true;
   }else{
return false;
       }
   return false;
  }
function chkloginform(){
if(e('usernamel').value==""){
alert("请输入用户名");
e('usernamel').focus();
return false;
}else if(e('usernamel').value.match(/[\'\"\s]+/)!=null){
alert("格式不正确或包含非法字符!");
e('usernamel').focus();
return false;
}else if(e('usernamel').value.length<2 || e('usernamel').value.length>15){
alert("用户名必须是2-15位字符!");
e('usernamel').focus();
return false;	
}else if(e('passwordl').value.length<4 || e('passwordl').value.length>16){
alert("请输入4-16位字符的密码");
e('passwordl').focus();
return false;
}
return true;
}  
</script>
<div id="mainCenter">
<div class="box w480 mt fleft loginBox">
<h2>登录</h2>
<form method="post" action="login.php" onsubmit="return chkloginform();">
<input type="hidden" name="formhash" value="<?=FORMHASH?>" />
                <input type="hidden" name="referer" value="<?=$referer?>" />
                <ul>
<li>用户名:<input class="inputText" name="usernamel" id="usernamel" type="text" maxlength="15" value="<?=$def_username?>" /></li>
<li>密 码:<input class="inputText" name="passwordl" id="passwordl" type="password" maxlength="16" /><a href="retrieve_password.php"> 忘记密码?</a></li>
<li class="leftPadding"><input name="saveusername" type="checkbox" value="true" checked="checked" /> 记住用户名 <input name="autologin" type="checkbox" value="true" checked="checked" /> 自动登陆</li>
<li class="leftBtnPadding"><button class="loginBtn" name="loginsubmit" value="true" type="submit">&nbsp;</button></li>
</ul>
</form>
</div>
<div class="box w480 mt fright regBox">
<h2>新用户注册</h2>
<form method="post" action="login.php" onsubmit="return chkregform();">
<input type="hidden" name="formhash" value="<?=FORMHASH?>" />
                <input type="hidden" name="referer" value="<?=$referer?>" />
<ul>
<li><span class="reglabel">用户名:</span><input type="hidden" id="usernamemode" name="usernamemode" value="false" /><input class="inputText" id="username" name="username" type="text" maxlength="15" onblur="chk_username(this)" /><span id="username_tip" class="regtip">2-15位中英文、数字、下划线或组合</span></li>
<li><span class="reglabel">密 码:</span><input class="inputText" id="password" name="password" type="password" maxlength="16" onblur="chk_password(this)" /><span id="password_tip" class="regtip">4-16位字符</span></li>
<li><span class="reglabel">再次输入密码:</span><input class="inputText" id="passwordag" name="passwordag" type="password" maxlength="16" onblur="chk_passwordag(this)" /><span id="passwordag_tip" class="regtip">再次输入密码</span></li>
<li><span class="reglabel">邮 箱:</span><input class="inputText" id="email" name="email" type="text" maxlength="40" onblur="chk_email(this)" /><span id="email_tip" class="regtip">你的常用Email邮箱</span></li>
<li><span class="reglabel">验证码:</span>
<input type="hidden" id="checkcodemode" name="checkcodemode" value="false" />
<input class="inputText" id="checkcode" name="checkcode" type="text" maxlength="5" onblur="chk_checkcode(this)" />
<input type="hidden" id="seccodehide" name="seccodehide" value="<?=$seccodeauth?>" /><a href="###"><img src="seccode.php?seccodeauth=<?=$seccodeauth?>&amp;hash=<? echo rand(1,100000);; ?>" class="notcheck" align="absbottom" onclick="freshcode(this)" /></a><span id="checkcode_tip" class="regtip">注意区分大小写哦</span></li>
<li><span class="reglabel">&nbsp;</span><input type="checkbox" id="agreemallrule" name="agreemallrule" value="true" /><a href="<?=$article_head?>37<?=$article_end?>">我已阅读并同意《商城用户协议》</a></li>
                    <li class="leftBtnPadding"><button class="regBtn" type="submit" name="regsubmit" value="true">&nbsp;</button> <button class="redoBtn" type="reset">&nbsp;</button></li>
</ul>
</form>
</div>
<div class="clearBoth"></div>
</div>
<? include template('footer'); ?>