2016-01-09 23:29:28 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2017-09-05 15:58:34 +03:00
|
|
|
<meta charset="utf-8">
|
2016-01-09 23:29:28 +02:00
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<meta name="theme-color" content="#35A768">
|
2017-09-14 16:18:20 +03:00
|
|
|
<title><?= lang('login') . ' - ' . $company_name ?></title>
|
2016-01-09 23:29:28 +02:00
|
|
|
|
2017-09-14 16:18:20 +03:00
|
|
|
<script src="<?= base_url('assets/ext/jquery/jquery.min.js') ?>"></script>
|
|
|
|
<script src="<?= base_url('assets/ext/jquery-ui/jquery-ui.min.js') ?>"></script>
|
|
|
|
<script src="<?= base_url('assets/ext/bootstrap/js/bootstrap.min.js') ?>"></script>
|
|
|
|
<script src="<?= base_url('assets/ext/datejs/date.js') ?>"></script>
|
2016-01-09 23:29:28 +02:00
|
|
|
|
2017-09-14 16:18:20 +03:00
|
|
|
<link rel="stylesheet" type="text/css" href="<?= base_url('assets/ext/jquery-ui/jquery-ui.min.css') ?>">
|
|
|
|
<link rel="stylesheet" type="text/css" href="<?= base_url('assets/ext/bootstrap/css/bootstrap.min.css') ?>">
|
|
|
|
<link rel="stylesheet" type="text/css" href="<?= base_url('assets/css/general.css') ?>">
|
2017-09-05 15:58:34 +03:00
|
|
|
|
2017-09-14 16:18:20 +03:00
|
|
|
<link rel="icon" type="image/x-icon" href="<?= base_url('assets/img/favicon.ico') ?>">
|
2016-01-09 23:29:28 +02:00
|
|
|
|
|
|
|
<style>
|
|
|
|
body {
|
|
|
|
width: 100vw;
|
|
|
|
height: 100vh;
|
|
|
|
display: table-cell;
|
|
|
|
vertical-align: middle;
|
|
|
|
background-color: #CAEDF3;
|
|
|
|
}
|
|
|
|
|
|
|
|
#login-frame {
|
|
|
|
width: 630px;
|
|
|
|
margin: auto;
|
|
|
|
background: #FFF;
|
|
|
|
border: 1px solid #DDDADA;
|
|
|
|
padding: 70px;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media(max-width: 640px) {
|
|
|
|
#login-frame {
|
|
|
|
width: 100%;
|
|
|
|
padding: 20px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2017-09-05 15:58:34 +03:00
|
|
|
<script>
|
2016-01-09 23:29:28 +02:00
|
|
|
var GlobalVariables = {
|
2017-09-14 16:18:20 +03:00
|
|
|
'csrfToken': <?= json_encode($this->security->get_csrf_hash()) ?>,
|
|
|
|
'baseUrl': <?= json_encode($base_url) ?>,
|
|
|
|
'destUrl': <?= json_encode($dest_url) ?>,
|
2016-01-09 23:29:28 +02:00
|
|
|
'AJAX_SUCCESS': 'SUCCESS',
|
|
|
|
'AJAX_FAILURE': 'FAILURE'
|
|
|
|
};
|
|
|
|
|
2017-09-14 16:18:20 +03:00
|
|
|
var EALang = <?= json_encode($this->lang->language) ?>;
|
|
|
|
var availableLanguages = <?= json_encode($this->config->item('available_languages')) ?>;
|
2016-01-09 23:29:28 +02:00
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
GeneralFunctions.enableLanguageSelection($('#select-language'));
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Event: Login Button "Click"
|
|
|
|
*
|
|
|
|
* Make an ajax call to the server and check whether the user's credentials are right.
|
|
|
|
* If yes then redirect him to his desired page, otherwise display a message.
|
|
|
|
*/
|
|
|
|
$('#login-form').submit(function(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
|
|
|
|
var postUrl = GlobalVariables.baseUrl + '/index.php/user/ajax_check_login';
|
|
|
|
var postData = {
|
|
|
|
'csrfToken': GlobalVariables.csrfToken,
|
|
|
|
'username': $('#username').val(),
|
|
|
|
'password': $('#password').val()
|
|
|
|
};
|
|
|
|
|
|
|
|
$('.alert').addClass('hidden');
|
|
|
|
|
|
|
|
$.post(postUrl, postData, function(response) {
|
2017-09-05 15:58:34 +03:00
|
|
|
if (!GeneralFunctions.handleAjaxExceptions(response)) {
|
|
|
|
return;
|
|
|
|
}
|
2016-01-09 23:29:28 +02:00
|
|
|
|
|
|
|
if (response == GlobalVariables.AJAX_SUCCESS) {
|
|
|
|
window.location.href = GlobalVariables.destUrl;
|
|
|
|
} else {
|
|
|
|
$('.alert').text(EALang['login_failed']);
|
|
|
|
$('.alert')
|
|
|
|
.removeClass('hidden alert-danger alert-success')
|
|
|
|
.addClass('alert-danger');
|
|
|
|
}
|
|
|
|
}, 'json');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="login-frame" class="frame-container">
|
2017-09-14 16:18:20 +03:00
|
|
|
<h2><?= lang('backend_section') ?></h2>
|
|
|
|
<p><?= lang('you_need_to_login') ?></p>
|
2016-01-09 23:29:28 +02:00
|
|
|
<hr>
|
|
|
|
<div class="alert hidden"></div>
|
|
|
|
<form id="login-form">
|
|
|
|
<div class="form-group">
|
2017-09-14 16:18:20 +03:00
|
|
|
<label for="username"><?= lang('username') ?></label>
|
2016-01-09 23:29:28 +02:00
|
|
|
<input type="text" id="username"
|
2017-09-14 16:18:20 +03:00
|
|
|
placeholder="<?= lang('enter_username_here') ?>"
|
2016-01-09 23:29:28 +02:00
|
|
|
class="form-control" />
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2017-09-14 16:18:20 +03:00
|
|
|
<label for="password"><?= lang('password') ?></label>
|
2016-01-09 23:29:28 +02:00
|
|
|
<input type="password" id="password"
|
2017-09-14 16:18:20 +03:00
|
|
|
placeholder="<?= lang('enter_password_here') ?>"
|
2016-01-09 23:29:28 +02:00
|
|
|
class="form-control" />
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<button type="submit" id="login" class="btn btn-primary">
|
2017-09-14 16:18:20 +03:00
|
|
|
<?= lang('login') ?>
|
2016-01-09 23:29:28 +02:00
|
|
|
</button>
|
|
|
|
|
|
|
|
<br><br>
|
|
|
|
|
2017-09-14 16:18:20 +03:00
|
|
|
<a href="<?= site_url('user/forgot_password') ?>" class="forgot-password">
|
|
|
|
<?= lang('forgot_your_password') ?></a>
|
2016-01-09 23:29:28 +02:00
|
|
|
|
|
|
|
|
<span id="select-language" class="label label-success">
|
2017-09-14 16:18:20 +03:00
|
|
|
<?= ucfirst($this->config->item('language')) ?>
|
2016-01-09 23:29:28 +02:00
|
|
|
</span>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
2017-09-14 16:18:20 +03:00
|
|
|
<script src="<?= base_url('assets/js/general_functions.js') ?>"></script>
|
2016-01-09 23:29:28 +02:00
|
|
|
</body>
|
|
|
|
</html>
|