Ejemplo n.º 1
0
 if ($validArrive !== true) {
     $error = $validArrive;
     $focusId = "arrive";
     $showFormPage = 3;
 } else {
     if ($suggested_time == 0) {
         $error = "Please select the suggested meeting time (amount of time prior to departure)";
         $focusId = "meet";
         $showFormPage = 3;
     } else {
         if ($payment_methods_id == 0) {
             $error = "Please select your preferred payment method";
             $focusId = "pay";
             $showFormPage = 4;
         } else {
             if (BookingsHelper::bookingExists($db, $email, $depart . ":00", $arrive . ":00")) {
                 $error = "You have already requested a booking for these arrival and departure times.";
                 $focusId = "email";
             } else {
                 if (!$accepted_terms) {
                     $error = "Please accept our terms and conditions";
                     $focusId = "accept_terms";
                     $showFormPage = 4;
                 } else {
                     // all good, insert booking
                     $suggested_time_datetime = new DateTimeWrapper(0, $depart . ":00", -$suggested_time * 60);
                     $keys = array();
                     $keys[] = "first_name";
                     $keys[] = "last_name";
                     $keys[] = "email";
                     $keys[] = "phone";