<?php
/**
 * The login view file of user module of ZDOO.
 *
 * @copyright   Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Chunsheng Wang <chunsheng@cnezsoft.com>
 * @package     user
 * @version     $Id: login.html.php 4060 2016-09-29 00:51:35Z daitingting $
 * @link        http://www.zdoo.com
 */
?>
<?php
include '../../common/view/header.lite.html.php';
js::import($jsRoot . 'md5.js');
js::set('scriptName', $_SERVER['SCRIPT_NAME']);
js::set('random', $this->session->random);
js::set('notEncryptedPwd', empty($config->notEncryptedPwd) ? false : $config->notEncryptedPwd);
?>
<div id='bg' style='background-image: url(<?php echo $this->config->webRoot . 'theme/default/images/main/login_bg.png'?>)'>
  <div id='main'>
    <div class='table-row'>
      <div class='table-col col-left'>
        <div id='logo'>
          <?php echo html::image($this->config->webRoot . 'theme/default/images/main/zdoo.png'); ?>
          <div id='logoText'><?php echo $lang->zdooTitle; ?></div>
        </div>
        <div id='loginNotice' class='notice text-center'></div>
      </div>
      <div class='table-col col-right'>
        <div id='login'>
          <h2 id='loginTitle'><?php echo (!empty($config->company->name) ? $config->company->name : $lang->zdoo) . $lang->zdooTitle;?></h2>
          <div class='dropdown' id='langs'>
            <button class='btn' data-toggle='dropdown' title='Change Language/更换语言/更換語言'><span><?php echo $config->langs[$this->app->getClientLang()]; ?></span> <span class="caret"></span></button>
            <ul class='dropdown-menu pull-right'>
              <?php foreach($config->langs as $key => $value):?>
              <li class="<?php echo $key==$this->app->getClientLang()?'active':''; ?>"><a href="###" data-value="<?php echo $key; ?>"><?php echo $value; ?></a></li>
              <?php endforeach;?>
            </ul>
          </div>
          <form method='post' target='hiddenwin' id='loginForm'>
            <div id='responser' class='text-center'></div>
            <div class='form-group'>
              <label for='account'><?php echo $lang->user->account;?></label>
              <?php echo html::input('account','',"class='form-control' placeholder='{$lang->user->inputAccount}'");?>
            </div>
            <div class='form-group'>
              <label for='password'><?php echo $lang->user->password;?></label>
              <?php echo html::password('password','',"class='form-control' placeholder='{$lang->user->inputPassword}'");?>
            </div>
            <div class='checkbox-container'>
              <div class='checkbox-primary inline-block'>
                <input type='checkbox' id='keepLogin' value='on'<?php if($this->cookie->keepLogin) echo " checked='checked'";?>>
                <label for='keepLogin'><?php echo $lang->user->keepLogin;?></label>
              </div>
              <?php echo html::a(inlink('forgetPassword'), $lang->forgetPassword, 'class="pull-right"');?>
            </div>
            <?php echo html::submitButton($lang->login, 'btn btn-primary btn-block');?>
            <?php /** <a class='btn btn-link btn-block'>游客登录</a> */ ?>
            <?php echo html::hidden('referer', $referer); ?>
          </form>
        </div>
      </div>
    <div>
  </div>
</div>
<?php
if($config->debug) js::import($jsRoot . 'jquery/form/min.js');
if(isset($pageJS)) js::execute($pageJS);
if($config->checkVersion)
{
    $requestSchema = isHttps() ? 'https' : 'http';
    js::import("{$requestSchema}://api.zdoo.com/updater-latest-{$config->version}.html");
}
js::set('ignoreNotice', $ignoreNotice);
js::set('ignore', $lang->user->ignore);
?>
</body>
</html>
