<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理系统</title>
<link href="__PUBLIC__/Admin/css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
    body {font-family: Verdana, Arial;font-size: 12px;*font-size: 11px;color: #333;margin: 0px;padding: 0px; line-height:20px;}
    ul{ margin:0; padding:0; list-style:none;}
    form{ margin:0; padding:0;}

    a{ color:#333; text-decoration:none;}
    a:hover{ color:#cc0000; text-decoration:underline;}
    .aBlue a{ color:#0088dd; text-decoration:none;}
    .aBlue a:hover{ color:#0088dd; text-decoration:underline;}


    #DivMainLogin{ width:1000px; height:612px; margin:0 auto;}
    #DivLoginLeft{ width:360px; float:left; margin-top:162px; margin-left:132px; display:inline}
    #DivLoginCenter{ width:2px; float:left; height:376px;  margin-top:100px;}
    #DivLoginRight{ float:left; margin-top:210px; margin-left:46px;}
    #LeftFonts{ margin:15px 0 0 30px; line-height:24px;}

    .LoginInp{ background:url(images/inp.jpg) repeat-x top; border:1px solid #ccc; width:200px; margin-top:8px; padding:1px 3px;}
    .FormRow2{ line-height:24px; margin:10px 0 0 44px;}
    .mainRightR{ background:url(images/right08.jpg) repeat-y right; clear:both; height:500px; min-height:500px; padding:0px 0px 0px 20px;}


    .topMenu{ float:right; margin-right:12px; margin-top:41px;}
    .topMenu a{ float:left; margin-left:2px; background:url(images/topMenu.gif) no-repeat; width:77px; height:30px; line-height:30px; text-align:center; color:#436799; margin-top:6px;}
    .topMenu a:hover{ float:left; margin-top:0px; margin-left:3px; background:url(images/topMenuActive.gif) no-repeat; width:83px; height:40px; line-height:40px; text-align:center; color:#436799; color:#fff; font-weight:bold; text-decoration:none;}
    .topMenu .active{ float:left; margin-top:0px; margin-left:3px; background:url(images/topMenuActive.gif) no-repeat; width:83px; height:40px; line-height:40px; text-align:center; color:#436799; color:#fff; font-weight:bold;}
    .topMenu .active:hover{ color:#fff; text-decoration:none;}

    .leftMenu a{ width:169px; line-height:29px; background:#fff url(images/i08.jpg) repeat-x; display:block; text-align:left; text-indent:32px; color:#185c82;}
    .leftMenu a:hover{ color:#185c82; text-decoration:none;}
    .leftSubMenu a{line-height:27px; background:; border-bottom:1px solid #cbdae2;color:#444;}
    .leftSubMenu a:hover{ color:#000; text-decoration:none;background:#f5f5f5;}

    .table{ border:1px solid #aed7e8; border-collapse:collapse; padding:4px;}
    .table td{border:1px solid #aed7e8; border-collapse:collapse; padding:4px;}

    .btn{ background:#fff url(images/btn.jpg) repeat-x bottom; color:#1a4a82; border:1px solid #accde7; height:24px; cursor:pointer; padding:0 5px;}
    .LoginInp{  background-color:White;height:25px; font-size:15px}

</style>
<script type="text/javascript" src="__PUBLIC__/Admin/js/jquery.js"></script>
<script type="text/javascript" >
$(function(){   
    $("#submit").click(function(){
       $.ajax({   
          type:"POST",   
              url:"<?php echo U('Public/dologin');?>",
              data:{
                  username: $('#username').val(), password: $('#password').val(), verifycode: $('#verifycode').val()
                  },   
              beforeSend:function(){
                    $("#msg").html('<img src="__PUBLIC__/Admin/images/loading.gif" align="absmiddle">正在提交登录...'); 
                  },                
              success:function(data){
                switch(data)
                {
                    case 'errorVerifyCode':
                        fleshVerify();
                        $("#msg").html('验证码错误'); 
                        break
                    case 'emptyInfo':
                        $("#msg").html('用户名密码必须填写'); 
                        break
                    case 'usernameFalse':
                        $("#msg").html('用户信息不存在，登录失败'); 
                        fleshVerify();
                        break
                    case 'passwordFalse':
                        $("#msg").html('密码错误'); 
                        fleshVerify();
                        break
                    case 'roleLost':
                        $("#msg").html('不存在的用户组，请联系管理员');
                        fleshVerify();
                        break
                    case 'loginSuccess':
                        $("#msg").html('登录成功</span>');
                        window.location.href = '<?php echo U("Index/");?>';
                        return true;
                        break
                    default:
                        $("#msg").html(data);
                        alert ('未知错误，请联系管理员');
                }
                return false;           
            }               
         });   
        return false;
    });  
    $("#verifyImg").click(function(){
        fleshVerify();                      
    })
}); 
function fleshVerify(){
//重载验证码
var timenow = new Date().getTime();
document.getElementById('verifyImg').src= "<?php echo U('Public/verify/');?>"+timenow;
}
</script>
</head>
<body style="background-color: #e9eaee">
    <div style="width: 1000px; height: 613px; background-image: url(__PUBLIC__/Admin/images/loginbg.jpg);
        margin: 0px; padding: 0px; margin: 0 auto; background-repeat: no-repeat">
        <form id="loginform" name="loginform" method="post" action="<?php echo U('Public/dologin');?>" style="margin: 0px; padding: 0px;
        padding-top: 110px">

<div class="aspNetHidden">

	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBQLRlsrcDQKl1bKzCQK1qbSRCwKzmc2yBwKC3IeGDCvqg5vCCEQz2sHCqiz5oDThgxNVyfIeGDA7X5B/vZse">
</div>
        <div style="width: 300px; height: 160px; line-height: 44px; font-weight: bold; font-family: 微软雅黑;
            color: #292c32; font-size: 16px; margin: 0 auto">
            管理帐户：<input name="username" type="text" id="username" class="LoginInp">
            <br>
            登录密码：<input name="password" type="password" id="password" class="LoginInp">
            <br>
            安全验证：<input name="verifycode" type="text" id="verifycode" class="LoginInp" style="width: 60px">
            <img style="cursor: pointer" onclick="javascript:fleshVerify()" border="0" src="<?php echo U('Public/verify/');?>" title="看不清图片点击换张新图片。" id="verifyImg" align="absmiddle" name="verifyImg">
             <div class="FormRow" id="msg"></div>
            <div class="FormRow2" style="padding-left: 38px">
                <input type="image" name="btnLogin" id="submit" align="absmiddle" src="__PUBLIC__/Admin/images/btnBg.jpg">
            </div>
        </div>
       
        </form>
    </div>


</body></html>