示例#1
0
文件: bookings.php 项目: janizol/APS
                                                     $values[] = Utils::truncate(Utils::insertStrip($flight), 255);
                                                     // doesn't have seconds
                                                     $values[] = $depart . ":00";
                                                     $values[] = $arrive . ":00";
                                                     $values[] = $suggested_time_datetime->getString();
                                                     $values[] = $payment_methods_id;
                                                     $values[] = $statii_id;
                                                     $types = "sssssssssssii";
                                                     $insertResult = $db->insert("bookings", $keys, $values, $types);
                                                     $submitSuccess = $insertResult;
                                                     if ($insertResult === false) {
                                                         $error = "Could not request booking";
                                                     } else {
                                                         $message = "Your booking has been requested. Please check your email ({$email}) for confirmation.";
                                                         $iid = $db->insertID();
                                                         $emailConfirmResult = BookingsHelper::sendConfirmationEmails($db, $iid, $email);
                                                         $message .= !$emailConfirmResult ? " Could not send confirmation email - please email " . Constants::EMAIL_INFO . " with your booking id: {$iid}." : "";
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
示例#2
0
 $values[] = Utils::truncate(Utils::insertStrip($colour), 255);
 $values[] = Utils::truncate(Utils::insertStrip($flight), 255);
 // doesn't have seconds
 $values[] = $depart . ":00";
 $values[] = $arrive . ":00";
 $values[] = substr($depart, 0, strpos($depart, ' ') + 1) . $suggested_time . ":00";
 $values[] = $payment_methods_id;
 $values[] = $statii_id;
 $values[] = Utils::truncate(Utils::insertStrip($parking_points), 8);
 $types = "sssssssssssssiis";
 if ($clone) {
     $insertResult = $db->insert("bookings", $keys, $values, $types);
     if ($insertResult === false) {
         $error = "Could not insert cloned booking. The server said: " . $db->error();
     } else {
         $emailConfirmResult = BookingsHelper::sendConfirmationEmails($db, $db->insertID(), $email);
         if ($emailConfirmResult === false) {
             $error = "Edited successfully but could not send confirmation emails.";
         } else {
             header("Location: report_time.php");
         }
         header("Location: report_search.php");
     }
 } else {
     $updateResult = $db->update("bookings_id", $bid, "i", "bookings", $keys, $values, $types);
     if ($updateResult === false) {
         $error = "Could not update booking. The server said: " . $db->error();
     } else {
         header("Location: report_time.php");
     }
 }