From a481c6747d8af72a148c7f0a2918c9910b7ce5d9 Mon Sep 17 00:00:00 2001 From: "alextselegidis@gmail.com" Date: Wed, 19 Jun 2013 21:12:06 +0000 Subject: [PATCH] =?UTF-8?q?=CE=94=CE=B9=CE=BF=CF=81=CE=B8=CF=8E=CF=83?= =?UTF-8?q?=CE=B5=CE=B9=CF=82=20=CF=83=CF=84=CE=B7=CE=BD=20=CE=B4=CE=B9?= =?UTF-8?q?=CE=B1=CE=B4=CE=B9=CE=BA=CE=B1=CF=83=CE=AF=CE=B1=20=CE=BA=CF=81?= =?UTF-8?q?=CE=B1=CF=84=CE=AE=CF=83=CE=B7=CF=82=20=CF=81=CE=B1=CE=BD=CF=84?= =?UTF-8?q?=CE=B5=CE=B2=CE=BF=CF=85.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/application/models/customers_model.php | 8 ++++ src/application/views/appointments/book.php | 10 ++--- src/assets/css/frontend.css | 6 +++ src/assets/js/frontend_book.js | 42 +++++++++++++-------- 4 files changed, 45 insertions(+), 21 deletions(-) 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 @@

Confirm Appointment

-
-
+
+
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'] = {