diff --git a/src/application/models/customers_model.php b/src/application/models/customers_model.php
index 053b1ea1..e7c8d4f6 100644
--- a/src/application/models/customers_model.php
+++ b/src/application/models/customers_model.php
@@ -27,7 +27,15 @@ class Customers_Model extends CI_Model {
if (!$this->validate_data($customer_data)) {
throw new ValidationException('Customer data are not valid.');
}
+
+ // :: CHECK IF CUSTOMER ALREADY EXIST (FROM EMAIL).
+ if ($this->exists($customer_data) && !isset($customer_data['id'])) {
+ // Find the customer id from the database.
+ $customer_data['id'] = $this->get_batch(
+ array('email' => $customer_data['email']))[0]['id'];
+ }
+ // :: INSERT OR UPDATE CUSTOMER RECORD
if (!isset($customer_data['id'])) {
$customer_data['id'] = $this->insert($customer_data);
} else {
diff --git a/src/application/views/appointments/book.php b/src/application/views/appointments/book.php
index 3fb72a04..efdcd078 100644
--- a/src/application/views/appointments/book.php
+++ b/src/application/views/appointments/book.php
@@ -212,11 +212,11 @@
-
-
-
+
+
+
@@ -260,8 +260,8 @@
diff --git a/src/assets/css/frontend.css b/src/assets/css/frontend.css
index 6ff2cb57..5321825d 100644
--- a/src/assets/css/frontend.css
+++ b/src/assets/css/frontend.css
@@ -141,6 +141,12 @@ body {
min-width: 270px; /* This is especially needed for ie8 */
}
+#book-appointment-wizard #appointment-details p,
+#book-appointment-wizard #customer-details p { font-size: 16px; line-height: 28px; }
+
+
+/* CANCEL APPOINTMENT
+ ------------------------------------------------------------------------- */
#cancel-appointment-frame {
padding: 12px 17px;
background: #F5F5F5;
diff --git a/src/assets/js/frontend_book.js b/src/assets/js/frontend_book.js
index 1311133b..3772d699 100644
--- a/src/assets/js/frontend_book.js
+++ b/src/assets/js/frontend_book.js
@@ -326,30 +326,40 @@ var FrontendBook = {
* booking.
*/
updateConfirmFrame : function() {
- /*** SET APPOINTMENT INFO ***/
+ // :: UPDATE APPOINTMENT DETAILS DIV
var selectedDate = $('#select-date').datepicker('getDate');
if (selectedDate !== null) {
- selectedDate = Date.parse(selectedDate).toString('dd-MM-yyyy');
+ selectedDate = Date.parse(selectedDate).toString('dd/MM/yyyy');
}
- $('#appointment-info').html(
- '
' + $('#select-service option:selected').text() + '
' +
- $('#select-provider option:selected').text() + '
' +
- '
' + selectedDate + ' '
- + $('.selected-hour').text() + ''
+ $('#appointment-details').html(
+ '
' + $('#select-service option:selected').text() + '
' +
+ '
'
+ + $('#select-provider option:selected').text()
+ + '
'
+ + ''
+ + selectedDate + ' ' + $('.selected-hour').text()
+ + '' +
+ '
'
);
- /*** SET CUSTOMER'S INFO ***/
- $('#customer-info').html(
- '
' + $('#last-name').val() + ' ' + $('#first-name').val() + '
' +
- 'Phone: ' + $('#phone-number').val() + '
' +
- 'Email: ' + $('#email').val() + '
' +
- 'Address: ' + $('#address').val() + '
' +
- 'City: ' + $('#city').val() + '
' +
- 'Zip Code: ' + $('#zip-code').val()
+ // :: UPDATE CUSTOMER'S DETAILS DIV
+ $('#customer-details').html(
+ '
' + $('#first-name').val() + ' ' + $('#last-name').val() + '
' +
+ '
' +
+ 'Phone: ' + $('#phone-number').val() +
+ '
' +
+ 'Email: ' + $('#email').val() +
+ '
' +
+ 'Address: ' + $('#address').val() +
+ '
' +
+ 'City: ' + $('#city').val() +
+ '
' +
+ 'Zip Code: ' + $('#zip-code').val() +
+ '
'
);
- /*** UPDATE FORM POST DATA ***/
+ // :: UPDATE APPOINTMENT DATA FORM
var postData = new Object();
postData['customer'] = {