<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title><?php echo ($title); ?> | 追格小程序后台管理</title>   
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="description" content="追格微信小程序后台管理">
        <meta name="keywords" content="追格,小程序">
        <meta name="author" content="追格">

        <!-- Base Css Files -->
        <link href="/Public/assets/libs/jqueryui/ui-lightness/jquery-ui-1.10.4.custom.min.css" rel="stylesheet" />
        <link href="/Public/assets/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
        <link href="/Public/assets/libs/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
        <link href="/Public/assets/libs/fontello/css/fontello.css" rel="stylesheet" />
        <link href="/Public/assets/libs/animate-css/animate.min.css" rel="stylesheet" />
        <!-- <link href="/Public/assets/libs/nifty-modal/css/component.css" rel="stylesheet" /> -->
        <link href="/Public/assets/libs/pace/pace.css" rel="stylesheet" />
        <link href="/Public/assets/libs/jquery-icheck/skins/all.css" rel="stylesheet" />
		<link href="/Public/assets/libs/jquery-notifyjs/styles/metro/notify-metro.css" rel="stylesheet" type="text/css" />

        <link href="/Public/assets/css/style.css" rel="stylesheet" type="text/css" />
        <link href="/Public/assets/css/style-responsive.css" rel="stylesheet" />
		<link href="/Public/css/append.css" rel="stylesheet" />

        <link rel="shortcut icon" href="/favicon.ico">
        <link rel="apple-touch-icon" href="/Public/assets/img/apple-touch-icon.png" />
    </head>
	
<body class="fixed-left login-page">	
<!-- Begin page -->	
<div class="container">		
	<div class="full-content-center">
		<p class="text-center">
			<a href="#">
				<img src="/Public/assets/img/login-logo.png" alt="Logo">
			</a>
		</p>
		<div class="login-wrap animated flipInX">				
			<div class="login-block">
			<form role="form" action="" method='post'>						
				<div class="form-group login-input">							
					<i class="fa fa-user overlay"></i>							
					<input type="text" class="form-control text-input" name='username' placeholder="请输入用户名" id='username'>						
				</div>
				<div class="form-group login-input">							
					<i class="fa fa-key overlay"></i>							
					<input type="password" class="form-control text-input" name='password' placeholder="请输入密码" id='password'>						
				</div>
				<div class="row">							
					<div class="col-sm-12">							
						<button type="button" class="btn btn-success btn-block" id="login">登陆</button>							
					</div>
				</div>
			</form>
			</div>
		</div>		
	</div>	
</div>	
<script>
    var resizefunc = [];
</script>
<script src="/Public/assets/libs/jquery/jquery-1.11.1.min.js"></script>
<script src="/Public/assets/libs/jquery-detectmobile/detect.js"></script>
<script src="/Public/assets/libs/jquery-icheck/icheck.min.js"></script>
<script src="/Public/assets/libs/jquery-notifyjs/notify.min.js"></script>
<script src="/Public/assets/libs/jquery-notifyjs/styles/metro/notify-metro.js"></script>
<script src="/Public/assets/libs/jqueryui/jquery-ui-1.10.4.custom.min.js"></script>
<script src="/Public/assets/libs/jquery-ui-touch/jquery.ui.touch-punch.min.js"></script>
<script src="/Public/assets/libs/bootstrap/js/bootstrap.min.js"></script>
<!-- <script src="/Public/assets/libs/bootstrap-bootbox/bootbox.min.js"></script> -->
<script src="/Public/assets/libs/bootstrap-fileinput/bootstrap.file-input.js"></script>
<!-- <script src="/Public/assets/libs/magnific-popup/jquery.magnific-popup.min.js"></script> -->
<script src="/Public/assets/libs/fastclick/fastclick.js"></script>
<script src="/Public/assets/libs/pace/pace.min.js"></script>
<script src="/Public/assets/js/pages/notifications.js"></script>
<script src="/Public/assets/js/init.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#btn-logout").click(function() {
			if(confirm('确定退出？')) {
				window.location.href = '/admin/index/logout';
			}
		});
	});
</script>
<script type="text/javascript">		
$(document).ready(function() {			
	function login() {				
		var username = $('#username').val();				
		var password = $('#password').val();				
		if(username == ''){					
			$('#username').css('background', '#F88E8B');					
			return false;				
		}				
		$('#username').css('background', '');

		if(password == '') {					
			$('#password').css('background','#F88E8B');					
			return false;				
		}				
		$('#password').css('background', '');

		$.post('/Admin/Index/login', 
			{username:username, password:password}, 
			function(e) {						
				if(e > 0) {							
					notify('error', 'top center', '用户名或密码有误');						
				} else {							
					location.href = '/Admin/Index/index';						
				}					
			})			
		}			
							
		$("#login").click(function(e) {				
			login();			
		});			
		
		$(document).keyup(function(e) {				
			var curKey = e.which; 			    
			if(curKey == 13) {			    	
				login();			    
			}			
		});		
	});	
</script>

</body>
</html>