'; } function validateemail($email){ return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email); } $inc = 'formEdit.inc.php'; $bookingFound = false; if($_POST['tries1'] > 0 && isset($_POST['SB1'])){ // formEdit has been submitted, get values $reference = $_POST['reference']; $pcode = strtoupper(str_replace(" ", "",$_POST['postcode'])); $tries = $_POST['tries1']; } else { // first visit to page $reference = ''; $pcode = ''; $tries = 0; } if($reference != '' && $pcode != '' && $tries > 0){ // formEdit has been fully submitted, check database $result = mysql_query("SELECT * FROM `splitenquiry` WHERE `enqnumber` = '".mysql_real_escape_string($reference)."' AND `pcode` = '".mysql_real_escape_string($pcode)."';"); if(!$result){ die("MySQL Error: ".mysql_error()); } if(mysql_num_rows($result) == 1){ // Booking found $bookingFound = true; $booking = mysql_fetch_assoc($result); // convert string date/time to timestamp $bookingstamp = strtotime($booking['month'].' '.$booking['day'].' '.$booking['year'].' '.$booking['hour'].':'.$booking['minute'].':00'); } elseif(mysql_num_rows($result) == 0) { // Booking not found $bookingFound = false; } else { // Multiple Bookings found die("ERROR: Multiple Bookings with that reference / postcode found"); } if($bookingFound && !$_POST['editsubmit']) { if($bookingstamp < strtotime("+1 day")){ $searchError = "You cannot change a booking online in the 24 hours before you are due to travel. Please call 01483 280 050"; if($bookingstamp < time()){ $searchError = "Your booking has already passed"; } } } } if($bookingFound && !$searchError){ // A booking has been found, load formEdit2 $inc = 'formEdit2.inc.php'; if(isset($_POST['editsubmit'])){ // formEdit2 has been submitted, check for errors // convert string date/time to timestamp $editedstamp = strtotime($_POST['month'].' '.$_POST['day'].' '.$_POST['year'].' '.$_POST['hour'].':'.$_POST['minute'].':00'); if($editedstamp < strtotime("+1 day")){ $errorflag = true; $datej1error = true; $dayerror = true; $montherror = true; $yearerror = true; $hourerror = true; $minuteerror = true; } // ensure destinations have been entered if($_POST['jfrom'] == ''){ $jfromerror = true; $errorflag = true; } if($_POST['jto'] == ''){ $jtoerror = true; $errorflag = true; } if($errorflag == false){ // Edited booking has been submitted successfully // Commit changes to the database and log $inc = 'formEdit3.inc.php'; $ip=$_SERVER['REMOTE_ADDR']; // Log that booking has been edited $query = "INSERT INTO `editlog` (`enqnumber`, `editdate`, `editip`) VALUES ('".$reference."', '".time()."', '".$ip."');"; $result = mysql_query($query) or die("Error in query: ".$query); // Update booking, including resetting driver allocations etc. $query = "UPDATE `splitenquiry` SET `passenger` = '".$_POST['passenger']."', `day` = '".$_POST['day']."', `month` = '".$_POST['month']."', `year` = '".$_POST['year']."', `hour` = '".$_POST['hour']."', `minute` = '".$_POST['minute']."', `jfrom` = '".$_POST['jfrom']."', `jto` = '".$_POST['jto']."', `airport` = '".$_POST['airport']."', `flight` = '".$_POST['flight']."', `passengers` = '".$_POST['passengers']."', `vehicle` = '".$_POST['vehicle']."', `luggage` = '".$_POST['luggage']."', `request` = '".$_POST['request']."', `booking` = 'Y', `allocated` = 'N', `driver` = 'NOT ALLOCATED', `driverid` = 0, `vreg` = '', `dist` = '', `fare` = '' WHERE `enqnumber` ='".$reference."';"; $result = mysql_query($query) or die("Error in query: ".$query); // Booking has been edited successfully. Send emails $mailto = $booking['fname']." ".$booking['lname']." <".$booking['email'].">"; //$mailto = 'Mark Garratt '; $mailsubj = "Silver Arrows Booking Changed"; $mailhead = 'From: Silver Arrows ' . "\r\n" . 'Reply-To: simon@silver-arrows.co.uk' . "\r\n" . 'Bcc: simon@silver-arrows.co.uk' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $mailbody="Dear ".$booking['title']." ".$booking['fname']." ".$booking['lname']." ".$booking['company']." Thank you for contacting Silver Arrows, we have changed your booking as follows: RE: ".$booking['company']." Name: ".$booking['title']." ".$booking['fname']." ".$booking['lname']." ".$booking['company']." Passenger (if specified): ".$_POST['passenger']." Journey Date: ".$_POST['day']." ".$_POST['month']." ".$_POST['year']." Time: ".$_POST['hour']." ".$_POST['minute']." Journey From: ".$_POST['jfrom']." To: ".$_POST['jto']." Airport: ".$_POST['airport']." Flight: ".$_POST['flight']." Passengers: ".$_POST['passengers']." Vehicle: ".$_POST['vehicle']." Luggage: ".$_POST['luggage']." Enquiry Number: ".$reference." Please Check the above details. In the event of an error please contact: Silver Arrows on 01483 280 050 immediately THIS EMAIL IS NOT MONITORED AND CANNOT BE REPLIED TO.\n REPLY TO bookings@silver-arrows.co.uk OR CALL 01483 28 00 50"; if(@mail($mailto, $mailsubj, $mailbody, $mailhead)){ $mailerror=false; } else { $mailerror=true; } } } } else { // booking not found, redisplay first form $inc = 'formEdit.inc.php'; } ?> Leatherhead Taxi | 01483 280 050 | Online Quotation in London and Home Counties
Mercedes-Benz Logo

Silver Arrows Logo Header

Mercedes-Benz Logo



UK TIME (LONDON)



Silver Arrows Coverage Map - Link

CLICK ON MAP FOR COVERAGE


Flight Stats - Link

TRACK ANY FLIGHT
WORLD WIDE HERE

 

CHECK DATES HERE

CHECK WORLD TIMES HERE

 


Terms and Conditions