<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title>{lang('user_login')}</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">

	<meta name="author" content="CmsEasy Team" />
	<link rel="icon" href="{$base_url}/favicon.ico" type="image/x-icon" />
	<link href="{$base_url}/common/css/bootstrap/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">
	<link href="{$skin_user_path}/css/login.css" rel="stylesheet">
	<link href="{$base_url}/common/font/simple/css/font.css" rel="stylesheet" type="text/css"/>
	<script src="{$base_url}/common/js/jquery/jquery.min.js"></script>


</head>
<body>


<div class="div-table">
	<div class="div-cell">
		<!-- <div class="form-title">
                <h4>{get('sitename')}</h4>
                <h5></h5>
                <p>
                    <i class=""></i>
                    <i class=""></i>
                </p>
            </div> -->
		<div class="form-box">
			<h2>{lang('login_account')}</h2>
			<div class="login-switch">
				<a href="javascript:void(0)" onclick="setdx()" id="telimg">
					<span class="glyphicon glyphicon-barcode"></span>
				</a>
				<div class="line-div"></div>
				<div class="poptip">
					<div class="poptip-arrow">
						<em></em>
						<span></span>
					</div>
					<div class="poptip-content">
						{lang('quick_logon')}
					</div>
				</div></div>
			<form id="loginform"   name="loginform" method="post"  action="<?php echo url('user/login/loginurl/'.$loginurl) ?>" onsubmit="return check()">
				<input type='hidden' id="from"  name="from" value="<?php echo get('from')? get('from'):front::$from;?>"/>


				<?php if(hasflash()) { ?>
				<?php echo showflash(); ?>
				{else}
				<script src="{$base_url}/common/plugins/mobilechk/mobilechk.js"></script>
				<ul>
					<li name="dxdl" style="display: none">
						<div class="input-group">
							<div class="input-group-btn">
								<button type="button" class="btn btn1 dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">+86</button>
							</div><!-- /btn-group -->
							<input type="hidden" name="dxdlnum" id="dxdlnum" value="0">
							<input placeholder="{lang('tel')}" type='text' id="tel"  name="tel" value="{lang('tel')}" onfocus="if(this.value=='{lang('tel')}') {this.value=''}" onblur="if(this.value=='') this.value='{lang('tel')}'" tabindex="3" class="form-control">
						</div><!-- /input-group -->
					</li>
					<li name="dxdl"  style="display: none">
						<div class="input-group">
							<span class="input-group-addon">&nbsp;&nbsp;<i class="icon-credit-card"></i>&nbsp;</span>
							<input type='text' placeholder="{lang('please_enter_the_phone_verification_code')}" id="mobilenum" name="mobilenum" class="form-control" placeholder="{lang('verifycode')}">
							<span class="input-group-btn">
						<input id="btm_sendMobileCode" onclick="sendMobileCode();" type="button" value="{lang('send_cell_phone_verification_code')}" class="btn btn2" />
					  </span>
						</div>
					</li>

					<li name="nodxdl">
						<div class="input-group">
							<span class="input-group-addon"><i class="icon-user"></i></span>
							<input type="text" class="form-control" value="{lang('enter_username')}" placeholder="{lang('enter_username')}" onfocus="if(this.value=='{lang('enter_username')}') {this.value=''}" onblur="if(this.value=='') this.value='{lang('enter_username')}'" data-errortxt="{lang('enter_username')}" name="username" id="username" tabindex="1">
						</div>
					</li>
					<li name="nodxdl">
						<div class="input-group">
							<span class="input-group-addon"><i class="icon-lock"></i></span>
							<input type="password" class="form-control" value="{lang('enter_password')}" placeholder="{lang('enter_password')}" onfocus="if(this.value=='{lang('enter_password')}') {this.value=''}" onblur="if(this.value=='') this.value='{lang('enter_password')}'" data-errortxt="{lang('enter_password')}" name="password" id="password" tabindex="2">
						</div>
					</li>

					{if config::get('mobilechk_enable') && config::get('mobilechk_login') }
					<li name="nodxdl">
						<div class="input-group">
							<div class="input-group-btn">
								<button type="button" class="btn btn1 dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">+86</button>
							</div><!-- /btn-group -->
							<input placeholder="{lang('tel')}" type='text' id="tel"  name="tel" value="{lang('tel')}" onfocus="if(this.value=='{lang('tel')}') {this.value=''}" onblur="if(this.value=='') this.value='{lang('tel')}'" tabindex="3" class="form-control">
						</div><!-- /input-group -->
					</li>
					<li name="nodxdl">
						<div class="input-group">
							<span class="input-group-addon">&nbsp;&nbsp;<i class="icon-credit-card"></i>&nbsp;</span>
							<input type='text' placeholder="{lang('please_enter_the_phone_verification_code')}" id="mobilenum" name="mobilenum" class="form-control" placeholder="验证码">
							<span class="input-group-btn">
						<input id="btm_sendMobileCode" onclick="sendMobileCode('{url('tool/smscode')}',$('#tel'));" type="button" value="{lang('send_cell_phone_verification_code')}" class="btn btn2" />
					  </span>
						</div>
					</li>

					{/if}

					{if config::get('verifycode')=='1' || session::get('YNverification')=='1'}
					<li>
						<div class="input-group">
							<div class="input-group-btn">
								<button type="button" class="btn btn1 dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="padding:0px;">{verify()}</button>
							</div><!-- /btn-group -->
							<input type='text' id="verify"  tabindex="3"  name="verify" class="form-control" value="{lang('please_enter_code')}" placeholder="{lang('please_enter_code')}" onfocus="if(this.value=='{lang('please_enter_code')}') {this.value=''}" onblur="if(this.value=='') this.value='{lang('please_enter_code')}'" data-errortxt="{lang('please_enter_code')}">
						</div>
					</li>
					{elseif config::get('verifycode')=='2'}
					<li>
						<div id="verifycode_embed"></div>
					</li>
					<script src="http://api.geetest.com/get.php"></script>
					<script>
						var loadGeetest = function(config) {
							window.gt_captcha_obj = new window.Geetest({
								gt : config.gt,
								challenge : config.challenge,
								product : 'float',
								offline : !config.success
							});
							gt_captcha_obj.appendTo("#verifycode_embed");
						};

						$.ajax({
							url : '{url('tool/geetest')}',
								type : "get",
								dataType : 'JSON',
								success : function(result) {
//console.log(result);
							loadGeetest(result)
						}
						});
					</script>
					{/if}

					<li>

						<input type="submit" name="submit" value=" {lang('login')} " id="reg" class="btn btn4" />
					</li>
					<li>
						<p><span class="pull-right"name="btn_login"><a href="{url('user/getpass')}">{lang('findpassword')}</a></span>{lang('no_account')},<a href="{url('user/register')}">{lang('immediate_registration')}</a></p>
					</li>
					{if $ologinlist}
					<li class="othre-loak text-center">
						<h5>{lang('other_ways_of_landing')}</h5>
						<br />

						{loop $ologinlist $ologin}
						{if $ologin[enabled]==1}

						<a target="_blank" href="<?php echo url('user/ologin/logtype/'.$ologin[ologin_code]);?>"><img src="{$base_url}/images/{$ologin[ologin_code]}.png" border="0" class="img-circle" width="40" height="40" /></a>&nbsp;&nbsp;
						{/if}
						{/loop}
						{/if}

					</li>{/if}
				</ul>
			</form>
		</div>

		<div class="copyright">{get('site_right')} <a title="{get('sitename')}" href="{$base_url}/">{get('sitename')}</a>. {getCopyRight()}</div>
	</div>
</div>


<script>
	$(function(){
		//默认打开  判断是否是手机登陆
		if('{$tellogin}'){
			setdx();
		}
	});
	function setdx(){
		if ($("[name='dxdl']").css("display")=='none'){
			$("#telimg").html("<span class='icon-screen-desktop'></span>");
			$("#tel").val('');
			$("#dxdlnum").val(1);
			$("[name='dxdl']").attr("style","display: block");
			$("[name='nodxdl']").attr("style","display: none");
			dxdlcheck=true;
		}else{
			$("#telimg").html("<span class='glyphicon glyphicon-barcode'></span>");
			$("#tel").val('');
			document.getElementById("loginform").action='<?php echo url("user/login") ?>';
			$("#dxdlnum").val(0);
			$("[name='dxdl']").attr("style","display:none ");
			$("[name='nodxdl']").attr("style","display: block");
			dxdlcheck=false;
		};
	}
</script>

<script type="text/javascript">
	<!--
	/*
 * jQuery placeholder, fix for IE6,7,8,9
 * @author JENA
 * @since 20131115.1504
 * @website ishere.cn
 */
	var JPlaceHolder = {
		//检测
		_check : function(){
			return 'placeholder' in document.createElement('input');
		},
		//初始化
		init : function(){
			if(!this._check()){
				this.fix();
			}
		},
		//修复
		fix : function(){
			jQuery(':input[placeholder]').each(function(index, element) {
				var self = $(this), txt = self.attr('placeholder');
				self.wrap($('<div></div>').css({position:'relative', zoom:'1', border:'none', background:'none', padding:'none', margin:'none'}));
				var pos = self.position(), h = self.outerHeight(true), paddingleft = self.css('padding-left');
				var holder = $('<span></span>').text(txt).css({position:'absolute', left:pos.left, top:pos.top, height:h, lienHeight:h, paddingLeft:paddingleft, color:'#aaa'}).appendTo(self.parent());
				self.focusin(function(e) {
					holder.hide();
				}).focusout(function(e) {
					if(!self.val()){
						holder.show();
					}
				});
				holder.click(function(e) {
					holder.hide();
					self.focus();
				});
			});
		}
	};
	//执行
	jQuery(function(){
		JPlaceHolder.init();
	});
	//-->
</script>
<script type="text/javascript" LANGUAGE="javascript">
	var  dxdlcheck=false;
	var sec = 30;
	var o_dsq = null;
	function senddjs(){
		sec--;
		$('#btm_sendMobileCode').val(sec+lang('seconds_after_you_can_re_send'));
		if(sec == 0){
			clearInterval(o_dsq);
			$('#btm_sendMobileCode').val(lang('resend_the_checksum'));
			$('#btm_sendMobileCode').attr('disabled',false);
			sec = 30;
		}
	}
	function sendMobileCode(){
		var mobile = $('#tel').val();
		$('#btm_sendMobileCode').attr('disabled',true);
		$.post("{url('tool/smscode')}",{'mobile':mobile},function(data){
			alert(data);
		},'text');
		o_dsq = setInterval("senddjs()",1000);
	}
	function check()
	{
		if(dxdlcheck){
			if(document.loginform.mobilenum.value.length==0){
				alert("{lang('cell_phone_parity_error')}");
				document.loginform.mobilenum.focus();
				return false;
			}
		}

		if(document.loginform.username.value.length==0){
			alert("{lang('please_enter_your_user_name')}");
			document.loginform.username.focus();
			return false;
		}

		if(document.loginform.password.value.length==0){
			alert("{lang('please_set_a_password')}");
			document.loginform.password.focus();
			return false;
		}


		{if config::get('mobilechk_enable') && config::get('mobilechk_login')}
		if(document.loginform.mobilenum.value.length==0){
			alert("{lang('cell_phone_parity_error')}");
			document.loginform.mobilenum.focus();
			return false;
		}
		{/if}

			if(document.loginform.verify.value.length==0){
				alert("{lang('enter_verifycode')}");
				document.loginform.verify.focus();
				return false;
			}


		}


		function set_question(value)
		{
			document.getElementById("question").value=value;
			document.getElementById("question").focus();
		}
</script>

<!-- Bootstrap Js -->
<script src="{$base_url}/common/css/bootstrap/bootstrap-3.3.7/js/bootstrap.min.js"></script>


</body>
</html>