<!--user login-->
<?php include(TEMPLATE.'common/header.html');?>
	<title><?php echo strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
	<link href="<?php echo STATIC_PATH;?>style/login.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet">
</head>

<body>
	<?php echo pageBackground();?>
	<div class="background"></div>
	<div class="init-loading"><div><img src="<?php echo STATIC_PATH;?>images/common/loading_simple.gif?v=<?php echo KOD_VERSION;?>"/></div></div>
	<div class="loginbox animated-500 fadeInDown aero" >
		<div class="title">
			<div class="logo"><i class="icon-cloud"></i><?php echo strip_tags(LNG('kod_name'));?></div>
			<div class='info'><?php echo LNG('kod_name_desc');?></div>
			<?php if(!isset($config['settings']['language'])){ ?>
			<div class="menu-group">
				<a id='footer-language' data-toggle="dropdown" href="javascript:void(0);" class="topbar-menu">
					<i class='font-icon icon-flag'></i>Language<b class="caret"></b>
				</a>
				<ul class="dropdown-menu footer-language pull-left animated menuShow" role="menu" aria-labelledby="footer-language">
				<?php 
					$tpl = "";
					foreach ($config['settingAll']['language'] as $key => $value) {
						$name = $value[0];
						$select = I18n::getType() == $key ? "this":"";
						$tpl .= "<li><a href='javascript:core.language(\"{$key}\");' title=\"{$key}/{$value[1]}/{$value[2]}\" class='{$select}'><i class='lang-flag flag-{$key}'></i>{$name}</a></li>";
					}
					echo $tpl;
				?>
				</ul>
			</div>
			<?php } ?>
		</div>
		<div class="form">
			<form action="#">
				<div class="inputs">
					<div>
						<i class="font-icon icon-user"></i>
						<input id="username" name='name' type="text" placeholder="<?php echo LNG('username');?>" 
						required autocomplete="on" disabled/>
					</div>
					<div>
						<i class="font-icon  icon-key"></i>
						<input id="password" name='password' type="password" placeholder="<?php echo LNG('password');?>" 
						required  autocomplete="on" disabled/>
						<input type='hidden' name='csrfLogin' value="<?php echo $_SESSION['csrfLogin'];?>"/>
					</div>
	            	<?php if(need_check_code()){?>
					<div class='check-code'>
						<i class="font-icon icon-unlock-alt"></i>
						<input name='checkCode' class="check-code" type="text" placeholder="<?php echo LNG('login_code');?>" required/>
						<img src='./index.php?user/checkCode' onclick="this.src='./index.php?user/checkCode'" />
					</div>
					<?php }?>
				</div>

				<div class="actions">
					<label for='rm'>
						<input type="checkbox" class="checkbox" name="rememberPassword" id='rm'/>
						<?php echo LNG('login_rember_password');?>
					</label>
					<a href="javascript:void(0);" class="forget-password"><?php echo LNG('forget_password');?></a>
					<br/>
					<input type="submit" id="submit" value="<?php echo LNG('login');?>" />
				</div>
				
				<div class="msg"><?php echo $msg;?></div>

				<?php if ($this->config['settingSystem']['autoLogin'] == '1') {?>
				<div class='guest'>
					<a href="./index.php?user/loginSubmit&name=guest&password=guest"><?php echo LNG('guest_login');?><i class=' icon-arrow-right'></i></a>
				</div>
				<?php } ?>
			</form>
		</div>
	</div>

	<?php $GLOBALS['loadCommonJs'] = true;?>
	<?php include(TEMPLATE.'common/footer.html');?>
	<script type="text/javascript" >
		setTimeout(function(){
			if( typeof(seajs) == 'undefined' ||
				typeof(LNG) == 'undefined'
				){
				alert('js文件不完整,请查看浏览器控制台和服务器配置是否正常。或检查文件是否被修改(或咨询主机商压缩js导致文件损坏);[js load error!]');
			}
		},1000);
		seajs.use("<?php echo STATIC_JS;?>/src/user/main");
	</script>
</body>
</html>
