Διορθώσεις στην διαδικασία κρατήσης ραντεβου.

This commit is contained in:
alextselegidis@gmail.com 2013-06-19 21:12:06 +00:00
parent dc586ecefb
commit a481c6747d
4 changed files with 45 additions and 21 deletions

View file

@ -27,7 +27,15 @@ class Customers_Model extends CI_Model {
if (!$this->validate_data($customer_data)) { if (!$this->validate_data($customer_data)) {
throw new ValidationException('Customer data are not valid.'); 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'])) { if (!isset($customer_data['id'])) {
$customer_data['id'] = $this->insert($customer_data); $customer_data['id'] = $this->insert($customer_data);
} else { } else {

View file

@ -212,11 +212,11 @@
<div class="frame-content" style="width:600px"> <div class="frame-content" style="width:600px">
<div class="span3"> <div class="span3">
<label for="last-name">Last Name *</label>
<input type="text" id="last-name" class="required" maxlength="250" />
<label for="first-name">First Name</label> <label for="first-name">First Name</label>
<input type="text" id="first-name" maxlength="100" /> <input type="text" id="first-name" maxlength="100" />
<label for="last-name">Last Name *</label>
<input type="text" id="last-name" class="required" maxlength="250" />
<label for="email">Email *</label> <label for="email">Email *</label>
<input type="text" id="email" class="required" maxlength="250" /> <input type="text" id="email" class="required" maxlength="250" />
@ -260,8 +260,8 @@
<div class="frame-container"> <div class="frame-container">
<h2 class="frame-title">Confirm Appointment</h2> <h2 class="frame-title">Confirm Appointment</h2>
<div class="frame-content" style="width:600px"> <div class="frame-content" style="width:600px">
<div id="appointment-info" class="span3"></div> <div id="appointment-details" class="span3"></div>
<div id="customer-info" class="span3"></div> <div id="customer-details" class="span3"></div>
</div> </div>
</div> </div>

View file

@ -141,6 +141,12 @@ body {
min-width: 270px; /* This is especially needed for ie8 */ 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 { #cancel-appointment-frame {
padding: 12px 17px; padding: 12px 17px;
background: #F5F5F5; background: #F5F5F5;

View file

@ -326,30 +326,40 @@ var FrontendBook = {
* booking. * booking.
*/ */
updateConfirmFrame : function() { updateConfirmFrame : function() {
/*** SET APPOINTMENT INFO ***/ // :: UPDATE APPOINTMENT DETAILS DIV
var selectedDate = $('#select-date').datepicker('getDate'); var selectedDate = $('#select-date').datepicker('getDate');
if (selectedDate !== null) { if (selectedDate !== null) {
selectedDate = Date.parse(selectedDate).toString('dd-MM-yyyy'); selectedDate = Date.parse(selectedDate).toString('dd/MM/yyyy');
} }
$('#appointment-info').html( $('#appointment-details').html(
'<h4>' + $('#select-service option:selected').text() + '</h4>' + '<h3>' + $('#select-service option:selected').text() + '</h3>' +
$('#select-provider option:selected').text() + '<br/>' + '<p>'
'<strong class="text-info">' + selectedDate + ' ' + $('#select-provider option:selected').text()
+ $('.selected-hour').text() + '</strong>' + '<br/>'
+ '<strong class="text-info">'
+ selectedDate + ' ' + $('.selected-hour').text()
+ '</strong>' +
'</p>'
); );
/*** SET CUSTOMER'S INFO ***/ // :: UPDATE CUSTOMER'S DETAILS DIV
$('#customer-info').html( $('#customer-details').html(
'<h4>' + $('#last-name').val() + ' ' + $('#first-name').val() + '</h4>' + '<h3>' + $('#first-name').val() + ' ' + $('#last-name').val() + '</h3>' +
'Phone: ' + $('#phone-number').val() + '<br/>' + '<p>' +
'Email: ' + $('#email').val() + '<br/>' + 'Phone: ' + $('#phone-number').val() +
'Address: ' + $('#address').val() + '<br/>' + '<br/>' +
'City: ' + $('#city').val() + '<br/>' + 'Email: ' + $('#email').val() +
'Zip Code: ' + $('#zip-code').val() '<br/>' +
'Address: ' + $('#address').val() +
'<br/>' +
'City: ' + $('#city').val() +
'<br/>' +
'Zip Code: ' + $('#zip-code').val() +
'</p>'
); );
/*** UPDATE FORM POST DATA ***/ // :: UPDATE APPOINTMENT DATA FORM
var postData = new Object(); var postData = new Object();
postData['customer'] = { postData['customer'] = {