From: Steve Sutton Date: Fri, 20 Nov 2015 16:38:45 +0000 (-0500) Subject: Update for mobile numbers if the format is yyyy-mm-dd X-Git-Tag: v1.0.6^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=bb74fd3b325ef397256b409a4059fbb5fc0702c4;p=WP-Themes%2Fbpla.git Update for mobile numbers if the format is yyyy-mm-dd --- 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 */