From bb74fd3b325ef397256b409a4059fbb5fc0702c4 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 20 Nov 2015 11:38:45 -0500 Subject: [PATCH] Update for mobile numbers if the format is yyyy-mm-dd --- page-150.php | 30 ++++++++++++++++++++++++++++-- style.css | 2 +- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/page-150.php b/page-150.php index bb12085..3430a2d 100644 --- a/page-150.php +++ b/page-150.php @@ -18,7 +18,25 @@

- array( + 'filter' => FILTER_VALIDATE_REGEXP, + 'options' => array( + 'regexp' => '%[0-9]{4}-[0-9]{2}-[0-9]{2}%' + ) + ), + 'DepartureDate' => array( + 'filter' => FILTER_VALIDATE_REGEXP, + 'options' => array( + 'regexp' => '%[0-9]{4}-[0-9]{2}-[0-9]{2}%' + ) + ), + ) + ); + $formData = filter_var_array( $_POST, array( 'ArrivalDate' => array( @@ -42,11 +60,19 @@ ); $location = urlencode($formData['Location']); $arrival = urlencode($formData['ArrivalDate']); + if ($formData2['ArrivalDate']) { + $arrival = urlencode( date( "m/d/Y", strtotime( $formData2['ArrivalDate'] ) ) ); + } $departure = urlencode($formData['DepartureDate']); + if ($formData2['DepartureDate']) { + $departure = urlencode( date( "m/d/Y", strtotime( $formData2['DepartureDate'] ) ) ); + } $occupancy = urlencode($formData['Occupancy']); - if ($arrival == NULL || $departure == NULL || $occupancy == NULL){ + if ($arrival == NULL || $departure == NULL){ $arrival = urlencode(date("m/d/Y", strtotime("+2 days"))); $departure = urlencode(date("m/d/Y", strtotime($arrival. ' +2 days'))); + } + if ($occupancy == NULL){ $occupancy = urlencode(1); } $iframeSrc = "https://weblink.instantsoftware.com/search/1134?ArrivalDate={$arrival}&DepartureDate={$departure}&Occupancy={$occupancy}&Location={$location}";?> diff --git a/style.css b/style.css index 6310d71..2e6e571 100644 --- a/style.css +++ b/style.css @@ -3,5 +3,5 @@ Theme Name: BigPowderhornLodging Author: Gaslight Media Author URI: http://www.gaslightmedia.com Description: A theme for BigPowderhornLodging -Version: 1.0.5 +Version: 1.0.6 */ -- 2.17.1