2013-10-11 18:58:46 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<?php // PAGE META ?>
|
|
|
|
<title>Easy!Appointments - Installation</title>
|
2013-12-23 18:55:42 +02:00
|
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
|
|
|
2013-10-11 18:58:46 +03:00
|
|
|
<?php // INCLUDE CSS ?>
|
|
|
|
<link
|
|
|
|
rel="stylesheet"
|
|
|
|
type="text/css"
|
2015-01-29 00:53:13 +02:00
|
|
|
href="<?php echo $base_url; ?>/assets/css/libs/bootstrap/bootstrap.css">
|
2013-10-11 18:58:46 +03:00
|
|
|
<link
|
|
|
|
rel="stylesheet"
|
|
|
|
type="text/css"
|
2015-01-29 00:53:13 +02:00
|
|
|
href="<?php echo $base_url; ?>/assets/css/libs/bootstrap/bootstrap-responsive.css">
|
2013-10-11 18:58:46 +03:00
|
|
|
|
|
|
|
<?php // SET FAVICON FOR PAGE ?>
|
|
|
|
<link
|
|
|
|
rel="icon"
|
|
|
|
type="image/x-icon"
|
2015-01-29 00:53:13 +02:00
|
|
|
href="<?php echo $base_url; ?>/assets/img/favicon.ico">
|
2013-10-11 18:58:46 +03:00
|
|
|
|
|
|
|
<?php // INCLUDE SCRIPTS ?>
|
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-01-29 00:53:13 +02:00
|
|
|
src="<?php echo $base_url; ?>/assets/js/libs/jquery/jquery.min.js"></script>
|
2013-10-11 18:58:46 +03:00
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-01-29 00:53:13 +02:00
|
|
|
src="<?php echo $base_url; ?>/assets/js/libs/bootstrap/bootstrap.min.js"></script>
|
2013-10-11 18:58:46 +03:00
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-01-29 00:53:13 +02:00
|
|
|
src="<?php echo $base_url; ?>/assets/js/libs/date.js"></script>
|
2013-10-11 18:58:46 +03:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
2013-12-23 18:55:42 +02:00
|
|
|
var GlobalVariables = {
|
2015-05-28 00:47:19 +03:00
|
|
|
'csrfToken': <?php echo json_encode($this->security->get_csrf_hash()); ?>,
|
2013-12-23 18:55:42 +02:00
|
|
|
'baseUrl': <?php echo '"' . $base_url . '"'; ?>
|
|
|
|
};
|
|
|
|
|
|
|
|
var EALang = <?php echo json_encode($this->lang->language); ?>;
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
2013-10-16 18:53:26 +03:00
|
|
|
var MIN_PASSWORD_LENGTH = 7;
|
|
|
|
var AJAX_SUCCESS = 'SUCCESS';
|
|
|
|
var AJAX_FAILURE = 'FAILURE';
|
|
|
|
|
2013-10-17 18:31:43 +03:00
|
|
|
$(document).ajaxStart(function() {
|
|
|
|
$('#loading').show();
|
|
|
|
});
|
|
|
|
|
|
|
|
$(document).ajaxStop(function() {
|
|
|
|
$('#loading').hide();
|
|
|
|
});
|
|
|
|
|
2013-10-11 18:58:46 +03:00
|
|
|
/**
|
2013-10-16 18:53:26 +03:00
|
|
|
* Event: Install Easy!Appointments Button "Click"
|
2013-10-11 18:58:46 +03:00
|
|
|
*/
|
|
|
|
$('#install').click(function() {
|
|
|
|
if (!validate()) return;
|
|
|
|
|
2015-01-29 00:53:13 +02:00
|
|
|
var postUrl = GlobalVariables.baseUrl + '/index.php/appointments/ajax_install';
|
2013-10-11 18:58:46 +03:00
|
|
|
var postData = {
|
2015-05-28 00:47:19 +03:00
|
|
|
'csrfToken': GlobalVariables.csrfToken,
|
2013-10-16 18:53:26 +03:00
|
|
|
'admin': JSON.stringify(getAdminData()),
|
|
|
|
'company': JSON.stringify(getCompanyData())
|
2013-10-11 18:58:46 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
$.post(postUrl, postData, function(response) {
|
2013-10-16 18:53:26 +03:00
|
|
|
//////////////////////////////////////////////////////
|
|
|
|
console.log('Ajax Install E!A Response:', response);
|
|
|
|
//////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
if (!GeneralFunctions.handleAjaxExceptions(response)) return;
|
|
|
|
|
|
|
|
if (response == AJAX_SUCCESS) {
|
2013-11-24 19:36:22 +02:00
|
|
|
$('.alert').text('Easy!Appointments has been successfully installed!');
|
2013-10-16 18:53:26 +03:00
|
|
|
$('.alert').addClass('alert-success');
|
|
|
|
$('.alert').show();
|
|
|
|
setTimeout(function() {
|
2015-05-20 23:41:03 +03:00
|
|
|
window.location.href = GlobalVariables.baseUrl + '/index.php/backend';
|
2013-10-16 18:53:26 +03:00
|
|
|
}, 1000);
|
|
|
|
}
|
|
|
|
}, 'json');
|
2013-10-11 18:58:46 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Validates the user input. Use this before executing the installation procedure.
|
|
|
|
*
|
|
|
|
* @returns {bool} Returns the validation result.
|
|
|
|
*/
|
|
|
|
function validate() {
|
|
|
|
try {
|
2013-10-16 18:53:26 +03:00
|
|
|
$('.alert').hide();
|
|
|
|
$('input').css('border', '');
|
2013-10-11 18:58:46 +03:00
|
|
|
|
|
|
|
// Check for empty fields.
|
|
|
|
var missingRequired = false;
|
2013-10-16 18:53:26 +03:00
|
|
|
$('input').each(function() {
|
2013-10-11 18:58:46 +03:00
|
|
|
if ($(this).val() == '') {
|
|
|
|
$(this).css('border', '2px solid red');
|
|
|
|
missingRequired = true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
if (missingRequired)
|
|
|
|
throw 'All the page fields are required.';
|
|
|
|
|
|
|
|
// Validate Passwords
|
|
|
|
if ($('#password').val() != $('#retype-password').val()) {
|
|
|
|
$('#password').css('border', '2px solid red');
|
|
|
|
$('#retype-password').css('border', '2px solid red');
|
|
|
|
throw 'Passwords do not match!';
|
|
|
|
}
|
|
|
|
|
2013-10-16 18:53:26 +03:00
|
|
|
if ($('#password').val().length < MIN_PASSWORD_LENGTH) {
|
|
|
|
$('#password').css('border', '2px solid red');
|
|
|
|
$('#retype-password').css('border', '2px solid red');
|
|
|
|
throw 'The password must be at least ' + MIN_PASSWORD_LENGTH + ' characters long.';
|
|
|
|
}
|
|
|
|
|
2013-10-11 18:58:46 +03:00
|
|
|
// Validate Email
|
|
|
|
if (!GeneralFunctions.validateEmail($('#email').val())) {
|
|
|
|
$('#email').css('border', '2px solid red');
|
2013-10-16 18:53:26 +03:00
|
|
|
throw 'The email address is invalid!';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!GeneralFunctions.validateEmail($('#company-email').val())) {
|
|
|
|
$('#company-email').css('border', '2px solid red');
|
|
|
|
throw 'The email address is invalid!';
|
2013-10-11 18:58:46 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
} catch(exc) {
|
2013-10-16 18:53:26 +03:00
|
|
|
$('.alert').text(exc);
|
|
|
|
$('.alert').show();
|
2013-10-11 18:58:46 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the admin data as an object.
|
|
|
|
*
|
|
|
|
* @returns {object}
|
|
|
|
*/
|
|
|
|
function getAdminData() {
|
|
|
|
var admin = {
|
|
|
|
'first_name': $('#first-name').val(),
|
|
|
|
'last_name': $('#last-name').val(),
|
|
|
|
'email': $('#email').val(),
|
|
|
|
'phone_number': $('#phone-number').val(),
|
|
|
|
'username': $('#username').val(),
|
|
|
|
'password': $('#password').val()
|
|
|
|
};
|
|
|
|
|
|
|
|
return admin;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the company data as an object.
|
|
|
|
*
|
|
|
|
* @returns {object}
|
|
|
|
*/
|
|
|
|
function getCompanyData() {
|
2013-10-16 18:53:26 +03:00
|
|
|
var company = {
|
|
|
|
'company_name': $('#company-name').val(),
|
|
|
|
'company_email': $('#company-email').val(),
|
|
|
|
'company_link': $('#company-link').val()
|
|
|
|
};
|
2013-10-11 18:58:46 +03:00
|
|
|
|
2013-10-16 18:53:26 +03:00
|
|
|
return company;
|
2013-10-11 18:58:46 +03:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
2013-10-16 18:53:26 +03:00
|
|
|
|
|
|
|
<style>
|
|
|
|
header {
|
|
|
|
background: #DAFFEB;
|
|
|
|
margin-bottom: 25px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.content {
|
|
|
|
margin: 32px;
|
|
|
|
max-width: 980px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.alert {
|
|
|
|
margin: 25px 0 10px 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
footer {
|
|
|
|
padding: 10px 35px;
|
|
|
|
background-color: #FAFAFA;
|
|
|
|
margin-top: 20px;
|
|
|
|
border-top: 1px solid #EEE;
|
|
|
|
}
|
2013-10-17 18:31:43 +03:00
|
|
|
|
|
|
|
#loading {
|
2013-10-27 19:41:37 +02:00
|
|
|
position: fixed;
|
2013-10-17 18:31:43 +03:00
|
|
|
top: 0px;
|
|
|
|
left: 0px;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
z-index: 999999;
|
|
|
|
background: rgba(255, 255, 255, 0.75);
|
|
|
|
}
|
|
|
|
|
|
|
|
#loading img {
|
|
|
|
margin: auto;
|
|
|
|
display: block;
|
|
|
|
}
|
2013-10-16 18:53:26 +03:00
|
|
|
</style>
|
2013-10-11 18:58:46 +03:00
|
|
|
</head>
|
|
|
|
<body>
|
2013-10-17 18:31:43 +03:00
|
|
|
<div id="loading" style="display: none;">
|
2015-01-29 00:53:13 +02:00
|
|
|
<img src="<?php echo $base_url; ?>/assets/img/loading.gif" />
|
2013-10-17 18:31:43 +03:00
|
|
|
</div>
|
|
|
|
|
2013-10-11 18:58:46 +03:00
|
|
|
<header>
|
|
|
|
<a href="http://easyappointments.org" target="_blank">
|
2015-01-29 00:53:13 +02:00
|
|
|
<img src="<?php echo $base_url; ?>/assets/img/installation-banner.png" alt="Easy!Appointents Installation Banner">
|
2013-10-11 18:58:46 +03:00
|
|
|
</a>
|
|
|
|
</header>
|
2013-10-16 18:53:26 +03:00
|
|
|
|
2013-10-11 18:58:46 +03:00
|
|
|
<div class="content">
|
|
|
|
<div class="welcome">
|
2013-10-16 18:53:26 +03:00
|
|
|
<h2>Welcome to the Easy!Appointments installation page.</h2>
|
2013-10-11 18:58:46 +03:00
|
|
|
<p>
|
|
|
|
This page will help you set the main settings of your Easy!Appointments installation.
|
|
|
|
You will be able to edit these settings and many more in the backend session of your
|
2015-05-28 00:20:26 +03:00
|
|
|
system. Remember to use the <span class="text-error"><?php echo $base_url; ?>/index.php/backend</span>
|
2013-10-16 18:53:26 +03:00
|
|
|
url to connect to the backend section of Easy!Appointments.
|
|
|
|
|
2013-10-11 18:58:46 +03:00
|
|
|
If you face any problems during the usage of Easy!Appointments you can always check
|
2015-05-28 00:20:26 +03:00
|
|
|
the official <a href="https://github.com/alextselegidis/easyappointments/wiki">Wiki Pages</a>
|
2013-10-16 18:53:26 +03:00
|
|
|
and <a href="http://groups.google.com/group/easy-appointments">Support Group</a>
|
|
|
|
for getting help. You may also submit new issues on
|
2015-05-28 00:20:26 +03:00
|
|
|
<a href="https://github.com/alextselegidis/easyappointments/issues">GitHub Issues</a>
|
2013-10-16 18:53:26 +03:00
|
|
|
in order to help our development process.
|
2013-10-11 18:58:46 +03:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
2013-10-16 18:53:26 +03:00
|
|
|
<div class="alert" style="display:none"></div>
|
|
|
|
|
|
|
|
<div class="row-fluid">
|
|
|
|
<div class="admin-settings span5">
|
|
|
|
<h3>Administrator</h3>
|
|
|
|
<label for="first-name">First Name</label>
|
|
|
|
<input type="text" id="first-name" class="span10" />
|
|
|
|
|
|
|
|
<label for="last-name">Last Name</label>
|
|
|
|
<input type="text" id="last-name" class="span10" />
|
|
|
|
|
|
|
|
<label for="email">Email</label>
|
|
|
|
<input type="text" id="email" class="span10" />
|
|
|
|
|
|
|
|
<label for="phone-number">Phone Number</label>
|
|
|
|
<input type="text" id="phone-number" class="span10" />
|
|
|
|
|
|
|
|
<label for="username">Username</label>
|
|
|
|
<input type="text" id="username" class="span10" />
|
|
|
|
|
|
|
|
<label for="password">Password</label>
|
|
|
|
<input type="password" id="password" class="span10" />
|
|
|
|
|
|
|
|
<label for="retype-password">Retype Password</label>
|
|
|
|
<input type="password" id="retype-password" class="span10" />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="company-settings span5">
|
|
|
|
<h3>Company</h3>
|
|
|
|
<label for="company-name">Company Name</label>
|
|
|
|
<input type="text" id="company-name" class="span10" />
|
|
|
|
|
|
|
|
<label for="company-email">Company Email</label>
|
|
|
|
<input type="text" id="company-email" class="span10" />
|
|
|
|
|
|
|
|
<label for="company-link">Company Link</label>
|
|
|
|
<input type="text" id="company-link" class="span10" />
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
2013-10-11 18:58:46 +03:00
|
|
|
</div>
|
|
|
|
|
2013-10-16 18:53:26 +03:00
|
|
|
<br>
|
2013-10-11 18:58:46 +03:00
|
|
|
|
2013-10-16 18:53:26 +03:00
|
|
|
<p>
|
|
|
|
You will be able to set your business logic in the backend settings page
|
|
|
|
after the installation is complete.
|
|
|
|
<br>
|
|
|
|
Press the following button to complete the installation process.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<br>
|
2013-10-11 18:58:46 +03:00
|
|
|
|
2013-11-22 18:19:52 +02:00
|
|
|
<p>
|
|
|
|
<h3>License</h3>
|
|
|
|
Easy!Appointments is licensed under the GPLv3 license. By using
|
2015-05-28 00:20:26 +03:00
|
|
|
the code of Easy!Appointments in any way <br> you agree with the
|
2013-11-22 18:19:52 +02:00
|
|
|
terms described in the following url:
|
|
|
|
<a href="http://www.gnu.org/copyleft/gpl.html">http://www.gnu.org/copyleft/gpl.html</a>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
2013-10-16 18:53:26 +03:00
|
|
|
<button type="button" id="install" class="btn btn-success btn-large">
|
|
|
|
<i class="icon-white icon-ok"></i>
|
|
|
|
Install Easy!Appointments</button>
|
2013-10-11 18:58:46 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<footer>
|
|
|
|
Powered by <a href="http://easyappointments.org">Easy!Appointments</a>
|
|
|
|
</footer>
|
2013-12-23 18:55:42 +02:00
|
|
|
|
|
|
|
<script
|
|
|
|
type="text/javascript"
|
2015-01-29 00:53:13 +02:00
|
|
|
src="<?php echo $base_url; ?>/assets/js/general_functions.js"></script>
|
2013-10-11 18:58:46 +03:00
|
|
|
</body>
|
|
|
|
</html>
|