<?php $setting = app('anlutro\LaravelSettings\Facade'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8"/>
  <?php $setting = app('anlutro\LaravelSettings\Facade'); ?>
  <title>登入頁面 - <?php echo e($setting::get('company_name','新保科技')); ?> <?php echo app('translator')->get('messages.community_manage'); ?>系統</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
  <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  <meta content="" name="description"/>
  <meta content="" name="author"/>
  <link rel="stylesheet" href="<?php echo e(asset('monitor_assets/css/bootstrap.css')); ?>" type="text/css" />
  <link rel="stylesheet" href="<?php echo e(asset('monitor_assets/css/animate.css')); ?>" type="text/css" />
  <link rel="stylesheet" href="<?php echo e(asset('monitor_assets/css/font-awesome.min.css')); ?>" type="text/css" />
  <link rel="stylesheet" href="<?php echo e(asset('monitor_assets/css/font.css')); ?>" type="text/css" cache="false" />
  <link rel="stylesheet" href="<?php echo e(asset('monitor_assets/css/plugin.css')); ?>" type="text/css" />
  <link rel="stylesheet" href="<?php echo e(asset('monitor_assets/css/app.css')); ?>" type="text/css" />
  <link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/global/plugins/jquery-keyboard/jqkeyboard.css')); ?>">
  <link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/global/plugins/bootstrap-toastr/toastr.min.css')); ?>"/>
  <!--[if lt IE 9]>
    <script src="js/ie/respond.min.js" cache="false"></script>
    <script src="js/ie/html5.js" cache="false"></script>
    <script src="js/ie/fix.js" cache="false"></script>
  <![endif]-->
  <style type="text/css">
body{
  font-family: Microsoft JhengHei;
  font-size: 130%;
  background: #5C9BD1;
}

</style>
</head>
<body>
  <section id="content" class="m-t-lg wrapper-md animated fadeInUp">
    <?php $CommunityPresenter = app('NSST\Presenters\CommunityPresenter'); ?>
    <h3 class="nav-brand text-white" style="text-align:center;"><?php echo e($CommunityPresenter->comName()); ?></h3>
    <div class="row m-n">
      <div class="col-md-4 col-md-offset-4 m-t-lg">
        <section class="panel">
          <header class="panel-heading text-center" style="font-size:26px;">
            <?php echo app('translator')->get('messages.loginnnn'); ?>
          </header>
          <form action="index.html" class="panel-body">
            <div class="form-group">
              <label class="control-label" style="font-size:20px;"><?php echo app('translator')->get('messages.account'); ?></label>
              <input id="username" type="text" placeholder="Ex: A01-001" class="form-control">
            </div>
            <div class="form-group">
              <label class="control-label" style="font-size:20px;"><?php echo app('translator')->get('messages.pwd'); ?></label>
              <input id="password" type="password" placeholder="Password" class="form-control">
            </div>
            <a id="btn_submit" href="#" class="btn btn-facebook btn-block m-b-sm"></i><?php echo app('translator')->get('messages.loginnnn'); ?></a>
            <a id="btn_keyboard" href="#" class="btn btn-success btn-block m-b-sm"></i><?php echo app('translator')->get('messages.open_keyballl'); ?></a>
          </form>
        </section>
      </div>
    </div>
  </section>
  <!-- footer -->
  <footer id="footer">
    <div class="text-center padder clearfix">
      <p>
        <small class="text-white"><?php echo e($setting::get('copyright_1','2015 © NSST 全方位建築智慧化管理系統')); ?> <?php echo e($setting::get('copyright_company','新保科技有限公司')); ?></small>
      </p>
    </div>
  </footer>
  <!-- / footer -->
  <script src="<?php echo e(asset('assets/global/plugins/jquery.min.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('assets/global/plugins/jquery-migrate.min.js')); ?>" type="text/javascript"></script>
    <!-- IMPORTANT! Load jquery-ui.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
    <script src="<?php echo e(asset('assets/global/plugins/jquery-ui/jquery-ui.min.js')); ?>" type="text/javascript"></script>
  <!-- Bootstrap -->
  <script src="<?php echo e(asset('monitor_assets/js/bootstrap.js')); ?>"></script>
  <!-- app -->
  <script src="<?php echo e(asset('monitor_assets/js/app.js')); ?>"></script>
  <script src="<?php echo e(asset('monitor_assets/js/app.plugin.js')); ?>"></script>
  <script src="<?php echo e(asset('monitor_assets/js/app.data.js')); ?>"></script>

  <script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/jquery-keyboard/jqkeyboard-min.js')); ?>"></script>
  <script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/jquery-keyboard/jqk.layout.en.js')); ?>"></script>
  <script src="<?php echo e(asset('assets/global/plugins/bootstrap-toastr/toastr.min.js')); ?>" type="text/javascript" ></script>
  <script type="text/javascript">
        $(document).ready(function(){
            jqKeyboard.init();
        });

        $('#btn_keyboard').click(function(){
            $('#jq-keyboard').show();
        });

        $(document).on('click','#btn_submit',function(){
            if($('#username').val() == '' || $('#password').val() == ''){
                toastr['error']('<?php echo app('translator')->get('messages.enter_acc_psd'); ?>')
            }else{
                $.ajax({
                    type : 'POST',
                    url : '<?php echo e(action('MonitorController@postLogin')); ?>',
                    data : {
                        username : $('#username').val(),
                        password : $('#password').val()
                    },
                    success : function (sendback){
                        if(sendback.success == true){
                            toastr['success']('<?php echo app('translator')->get('messages.loginnnn'); ?><?php echo app('translator')->get('messages.success'); ?>');
                            window.location.replace('<?php echo e(action('MonitorController@index')); ?>');
                            
                        }else{
                            toastr['error'](sendback.message);
                        }
                    },
                    error : function(sendback){
                        toastr['error']('<?php echo app('translator')->get('messages.loginnnn'); ?>，<?php echo app('translator')->get('messages.error_f5'); ?>');
                    }
                })
            }
        });
  </script>
</body>
</html>