<!--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
		$arr = array(2,3,6,8,9,10,12);
		$get = $arr[mt_rand(0,count($arr)-1)];
		$image = STATIC_PATH."images/wall_page/".$get.".jpg";
		echo '<img class="background" src="'.$image.'" />';
		echo '<style type="text/css">.title{background: #6699cc url('.$image.') 0px -92px;}</style>';
	?>
	<div class="init-loading"><div><img src="<?php echo STATIC_PATH;?>images/common/loading_simple.gif"/></div></div>
	<div class="loginbox animated-500 fadeInDown" >
		<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>
			<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>
		</div>
		<div class="form">
			<form action="#">
				<div class="inputs">
					<div>
						<span><?php echo LNG('username');?>：</span>
						<input id="username" name='name' type="text" placeholder="<?php echo LNG('username');?>" required autocomplete="on"/>
					</div>
					<div>
						<span><?php echo LNG('password');?>：</span>
						<input id="password" name='password' type="password" placeholder="<?php echo LNG('password');?>" required  autocomplete="on" />
					</div>
	            	<?php if(need_check_code()){?>
					<div class='check-code'>
						<span><?php echo LNG('login_code');?>：</span>
						<input name='checkCode' class="check-code" type="text" placeholder="<?php echo LNG('login_code');?>" required autocomplete="off"/>
						<img src='./index.php?user/checkCode' onclick="this.src='./index.php?user/checkCode'" />
						<div style="clear:both;"></div>
					</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>
				<div style="clear:both;"></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.config({
			base: "<?php echo STATIC_PATH;?>js/",
			preload: ["lib/jquery-1.8.0.min"],
			map:[
				[ /^(.*\.(?:css|js))(.*)$/i,'$1$2?ver='+G.version]
			]
		});
		seajs.use("<?php echo STATIC_JS;?>/src/user/main");
	</script>
</body>
</html>
