<!DOCTYPE html>
<html>
	<head>

	<meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta name="description" content="<!--{$page_keyword}-->">

	<meta name="keywords" content="<!--{$page_keyword}-->"> 

    <meta charset="UTF-8">

		<title>
			登录<!--{$page_title}-->-
			<!--{$copyright_header}-->
		</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0,user-scalable=no">

    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
	<link type="text/css" rel="stylesheet" href="<!--{$skinpath}-->assets/css/bootstrap.min123.css">
	<link type="text/css" rel="stylesheet" href="<!--{$skinpath}-->assets/css/index123.css">
	<link rel="stylesheet" href="<!--{$skinpath}-->assets/css/base1.min.css">
		<script src="<!--{$skinpath}-->assets/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="<!--{$skinpath}-->assets/js/layer.js"></script>

  </head>

  <body>
<!---引用开始--->
<div class="site-topbar">
    <div class="container">
        <div class="topbar-nav">
            <a href="<!--{$urlpath}-->" >首页</a><span class="sep">|</span>
        </div>
    </div>
</div>
<div class="fl wfs bcf7">
        <div class="regist-process-wrapper">
            <div class="regist-process-body fl wfs">
                
                <form id="companyinfologin" method="post" action="./index.php?c=user&a=ajaxlogin" name="login" onsubmit="return checklogin()" >
                    <div class="regist-process-login-left fl">
					
                        <h2 class="title">登录</h2>
					
                          <input class="form-control text" autocomplete="off" name="username" id="username" placeholder="帐号" type="text">
                          <input class="form-control text" name="password" id="password" type="password" placeholder="密码">
                          <input  class="btn btn-danger login-btn" id="login-button" value="立即登录" type="button"/>
						  
                        <div class="operates fl wfs">
                          <!-- <a class="fr" href="#">忘记密码</a> -->
                        </div>
                    </div>
                </form>
                
                <div class="regist-process-login-right fr">
                    <h2 class="title">没有账号？立即注册</h2>
                    <a class="btn btn-info free-registe" href="./index.php?c=user&a=register">免费注册</a>
                    <img class="mid-r-img" src="<!--{$skinpath}-->assets/css/zc/register-reg-4.png" alt="">
                </div>
                
            </div>
        </div>
        
    </div>


<!---引用结束--->
 

<style>
	#floatDivr{display: none;}
</style>

<script>
$("#login-button").click(function(event) {

	var username=document.getElementById("username").value;//获取form中的用户名
	var password=document.getElementById("password").value;
	var regex=/^[/s]+$/;//声明一个判断用户名前后是否有空格的正则表达式
	if(regex.test(username)||username.length==0)//判定用户名的是否前后有空格或者用户名是否为空
		{
			layer.msg("用户名格式不对", {icon: 5});
			return false;
		}
	if(regex.test(password)||password.length==0)//同上述内容
	{
			layer.msg("密码格式不对", {icon: 5});
		return false;
	}

	event.preventDefault();
	var form = new FormData(document.getElementById("companyinfologin"));

	$.ajax({
        url: "./index.php?c=user&a=ajaxlogin",
        type: "POST",
        data: form,
        dataType: "json",
        processData: false,
        contentType: false,
        success: function(data) {
            var json = eval(data);
            var response = json.response;
            var result = json.result;
            if(response == 1) {
            	layer.msg(result, {icon: 1});
                window.location.href = './index.php';
            } else {
            	layer.msg(result, {icon: 5});
            }
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
        	layer.alert('错误');
        }
	});                        
});
</script>
<!--{include file="<!--{$tplpath}-->botton.tpl"}-->
