2013-09-20 16:58:11 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2013-12-20 19:44:44 +02:00
|
|
|
<title><?php echo $this->lang->line('login') . ' - ' . $company_name; ?></title>
|
2013-09-20 16:58:11 +03:00
|
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
|
|
|
|
|
|
<?php // INCLUDE JS FILES ?>
|
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-05-28 00:15:43 +03:00
|
|
|
src="<?php echo $this->config->item('base_url'); ?>/assets/js/libs/jquery/jquery.min.js"></script>
|
2013-09-20 16:58:11 +03:00
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-05-28 00:15:43 +03:00
|
|
|
src="<?php echo $this->config->item('base_url'); ?>/assets/js/libs/bootstrap/bootstrap.min.js"></script>
|
2013-09-20 16:58:11 +03:00
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-05-28 00:15:43 +03:00
|
|
|
src="<?php echo $this->config->item('base_url'); ?>/assets/js/libs/date.js"></script>
|
2013-09-20 16:58:11 +03:00
|
|
|
|
|
|
|
<?php // INCLUDE CSS FILES ?>
|
|
|
|
<link
|
|
|
|
rel="stylesheet"
|
|
|
|
type="text/css"
|
2015-05-28 00:15:43 +03:00
|
|
|
href="<?php echo $this->config->item('base_url'); ?>/assets/css/libs/bootstrap/bootstrap.css">
|
2013-09-20 16:58:11 +03:00
|
|
|
<link
|
|
|
|
rel="stylesheet"
|
|
|
|
type="text/css"
|
2015-05-28 00:15:43 +03:00
|
|
|
href="<?php echo $this->config->item('base_url'); ?>/assets/css/libs/bootstrap/bootstrap-responsive.css">
|
2013-12-25 03:22:37 +02:00
|
|
|
<link
|
|
|
|
rel="stylesheet"
|
|
|
|
type="text/css"
|
2015-05-28 00:15:43 +03:00
|
|
|
href="<?php echo $this->config->item('base_url'); ?>/assets/css/general.css">
|
2013-09-20 16:58:11 +03:00
|
|
|
|
|
|
|
<?php // SET FAVICON FOR PAGE ?>
|
|
|
|
<link
|
|
|
|
rel="icon"
|
|
|
|
type="image/x-icon"
|
2015-05-28 00:15:43 +03:00
|
|
|
href="<?php echo $this->config->item('base_url'); ?>/assets/img/favicon.ico">
|
2013-09-20 16:58:11 +03:00
|
|
|
|
|
|
|
<style>
|
|
|
|
body {
|
|
|
|
background-color: #CAEDF3;
|
|
|
|
}
|
|
|
|
|
|
|
|
#login-frame {
|
|
|
|
width: 630px;
|
|
|
|
margin: 150px auto 0 auto;
|
|
|
|
background: #FFF;
|
|
|
|
border: 1px solid #DDDADA;
|
|
|
|
padding: 70px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#login-icon {
|
|
|
|
float: right;
|
|
|
|
margin-top: 17px;
|
|
|
|
}
|
|
|
|
|
|
|
|
label {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.forgot-password {
|
2013-12-25 03:22:37 +02:00
|
|
|
/* margin-left: 20px; */
|
2013-09-20 16:58:11 +03:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2013-09-23 18:42:36 +03:00
|
|
|
<script type="text/javascript">
|
2013-12-19 18:28:19 +02:00
|
|
|
var GlobalVariables = {
|
2015-05-28 00:47:19 +03:00
|
|
|
'csrfToken': <?php echo json_encode($this->security->get_csrf_hash()); ?>,
|
2013-12-19 18:28:19 +02:00
|
|
|
'baseUrl': <?php echo '"' . $base_url . '"'; ?>,
|
|
|
|
'destUrl': <?php echo '"' . $dest_url . '"'; ?>,
|
|
|
|
'AJAX_SUCCESS': 'SUCCESS',
|
|
|
|
'AJAX_FAILURE': 'FAILURE'
|
|
|
|
};
|
|
|
|
|
|
|
|
var EALang = <?php echo json_encode($this->lang->language); ?>;
|
2013-12-25 03:22:37 +02:00
|
|
|
var availableLanguages = <?php echo json_encode($this->config->item('available_languages')); ?>;
|
2013-12-19 18:28:19 +02:00
|
|
|
|
2013-09-20 16:58:11 +03:00
|
|
|
$(document).ready(function() {
|
2013-12-25 03:22:37 +02:00
|
|
|
GeneralFunctions.enableLanguageSelection($('#select-language'));
|
|
|
|
|
2013-09-20 16:58:11 +03:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2014-01-04 00:26:10 +02:00
|
|
|
$('#login-form').submit(function(event) {
|
2013-09-23 18:42:36 +03:00
|
|
|
event.preventDefault();
|
|
|
|
|
2015-05-20 23:41:03 +03:00
|
|
|
var postUrl = GlobalVariables.baseUrl + '/index.php/user/ajax_check_login';
|
2013-09-20 16:58:11 +03:00
|
|
|
var postData = {
|
2015-05-28 00:47:19 +03:00
|
|
|
'csrfToken': GlobalVariables.csrfToken,
|
2013-09-20 16:58:11 +03:00
|
|
|
'username': $('#username').val(),
|
|
|
|
'password': $('#password').val()
|
|
|
|
};
|
|
|
|
|
2013-09-23 18:42:36 +03:00
|
|
|
$('.alert').addClass('hidden');
|
|
|
|
|
2013-09-20 16:58:11 +03:00
|
|
|
$.post(postUrl, postData, function(response) {
|
|
|
|
//////////////////////////////////////////////////
|
|
|
|
console.log('Check Login Response: ', response);
|
|
|
|
//////////////////////////////////////////////////
|
|
|
|
|
2013-09-23 18:42:36 +03:00
|
|
|
if (!GeneralFunctions.handleAjaxExceptions(response)) return;
|
|
|
|
|
|
|
|
if (response == GlobalVariables.AJAX_SUCCESS) {
|
|
|
|
window.location.href = GlobalVariables.destUrl;
|
2013-09-20 16:58:11 +03:00
|
|
|
} else {
|
2013-12-20 19:44:44 +02:00
|
|
|
$('.alert').text(EALang['login_failed']);
|
2013-09-20 16:58:11 +03:00
|
|
|
$('.alert').removeClass('hidden');
|
|
|
|
}
|
2013-09-23 18:42:36 +03:00
|
|
|
}, 'json');
|
2013-09-20 16:58:11 +03:00
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="login-frame" class="frame-container">
|
2013-12-20 19:44:44 +02:00
|
|
|
<h2><?php echo $this->lang->line('backend_section'); ?></h2>
|
|
|
|
<p><?php echo $this->lang->line('you_need_to_login'); ?></p>
|
2013-09-20 16:58:11 +03:00
|
|
|
<hr>
|
|
|
|
<div class="alert hidden"></div>
|
2013-09-23 18:42:36 +03:00
|
|
|
<form id="login-form">
|
2013-12-20 19:44:44 +02:00
|
|
|
<label for="username"><?php echo $this->lang->line('username'); ?></label>
|
2013-12-25 03:22:37 +02:00
|
|
|
<input type="text" id="username"
|
|
|
|
placeholder="<?php echo $this->lang->line('enter_username_here'); ?>"
|
|
|
|
class="span3" />
|
2013-09-20 16:58:11 +03:00
|
|
|
|
2013-12-20 19:44:44 +02:00
|
|
|
<label for="password"><?php echo $this->lang->line('password'); ?></label>
|
2013-12-25 03:22:37 +02:00
|
|
|
<input type="password" id="password"
|
|
|
|
placeholder="<?php echo $this->lang->line('enter_password_here'); ?>"
|
|
|
|
class="span3" />
|
2013-09-20 16:58:11 +03:00
|
|
|
|
2013-12-25 03:22:37 +02:00
|
|
|
<br>
|
2013-09-20 16:58:11 +03:00
|
|
|
|
2013-12-25 03:22:37 +02:00
|
|
|
<button type="submit" id="login" class="btn btn-primary">
|
|
|
|
<?php echo $this->lang->line('login'); ?>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<br><br>
|
2013-09-20 16:58:11 +03:00
|
|
|
|
2015-05-20 23:41:03 +03:00
|
|
|
<a href="<?php echo $base_url; ?>/index.php/user/forgot_password" class="forgot-password">
|
2015-04-09 22:49:03 +03:00
|
|
|
<?php echo $this->lang->line('forgot_your_password'); ?></a>
|
2013-12-25 03:22:37 +02:00
|
|
|
|
|
|
|
|
<span id="select-language" class="badge badge-inverse">
|
|
|
|
<?php echo ucfirst($this->config->item('language')); ?>
|
|
|
|
</span>
|
2013-09-20 16:58:11 +03:00
|
|
|
</form>
|
|
|
|
</div>
|
2013-12-19 18:28:19 +02:00
|
|
|
|
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-05-28 00:15:43 +03:00
|
|
|
src="<?php echo $this->config->item('base_url'); ?>/assets/js/general_functions.js"></script>
|
2013-09-20 16:58:11 +03:00
|
|
|
</body>
|
|
|
|
</html>
|