include('includes/global.php'); ?> $propPerPage = 16; ################### # GET SEARCH FIELDS if (isset($_GET['tenure'])) { $tenure = $_GET['tenure']; } else { $tenure = ''; } if (isset($_GET['location'])) { $location = $_GET['location']; } else { $location = ''; } if (isset($_GET['class'])) { $class = $_GET['class']; } else { $class = ''; } if (isset($_GET['minSize'])) { $minSize = $_GET['minSize']; } else { $minSize = 0; } if (isset($_GET['maxSize'])) { $maxSize = $_GET['maxSize']; } else { $maxSize = 10000000; } if (isset($_GET['keyword'])) { $keyword = $_GET['keyword']; } else { $keyword = ''; } if ($keyword != '') { $keyword = strip_tags($keyword); mysql_real_escape_string($keyword); // Prevent sql injection. $keyword = ltrim($keyword); // Remove blank space from left of search term $keyword = rtrim($keyword); // Remove blank space from right of search term } if (isset($_GET['page'])) { $page = $_GET['page']; } else { $page = 1; } $propNoStart = ($page - 1) * $propPerPage; #$propNoEnd = ($propNoStart + $propPerPage) - 1; ####################### # PROCESS SEARCH FIELDS $searchQuery = "SELECT * FROM properties"; $searchFilters = array(); if ($tenure == 'For Sale') { array_push($searchFilters,"AP_Prop_Freehold = '1'"); } if ($tenure == 'To Let') { array_push($searchFilters,"AP_Prop_Leasehold = '1'"); } if ($location != 'Any') { array_push($searchFilters,"AP_Prop_Town = '$location'"); } if ($class != 'Any') { array_push($searchFilters,"AP_Prop_UnitNames LIKE '%$class%'"); } if ($minSize != '0') { array_push($searchFilters,"AP_Prop_Max_Size_Web >= $minSize"); } if ($maxSize != '10000000') { array_push($searchFilters,"AP_Prop_Min_Size_Web <= $maxSize"); } if ($keyword != '') { array_push($searchFilters,"AP_Prop_Description LIKE '%$keyword%' OR AP_Prop_Full_Address LIKE '%$keyword%'"); } #ACTIVE PROPERTIES ONLY? if ((isset($_GET['active']) && ($_GET['active'] == '1'))) { array_push($searchFilters,"(AP_Prop_Market_Status = '8' OR AP_Prop_Market_Status = '14')"); } else { #array_push($searchFilters,"((AP_Prop_Market_Status = '8' OR AP_Prop_Market_Status = '14') OR ((AP_Prop_Market_Status = '4' OR AP_Prop_Market_Status = '5') AND AP_Prop_LAST_UNAVAILABLE_DATE > NOW() - INTERVAL 60 DAY))"); array_push($searchFilters,"(AP_Prop_Market_Status = '8' OR AP_Prop_Market_Status = '14' OR AP_Prop_Market_Status = '4' OR AP_Prop_Market_Status = '5')"); } if (count($searchFilters) > 0) { $searchQuery .= " WHERE "; foreach ($searchFilters as $searchFilter) { $searchQuery .= $searchFilter.' AND '; } $searchQuery = preg_replace('/ AND $/', '', $searchQuery); } $searchQuery .= " ORDER BY AP_Prop_Max_Size_Web DESC"; /* TOTAL RECORDS */ $noRecordsQuery = $dbConnection->prepare("$searchQuery"); $noRecordsQuery->execute(); $totalRecords = $noRecordsQuery->rowCount(); /* END TOTAL RECORDS */ $searchQuery .= " LIMIT $propNoStart, $propPerPage"; #REBUILD URL $newURL = strtolower('/commercial-properties/'.str_replace(' ','-',$tenure).'/'); if ((isset($_GET['location']))&&($_GET['location'] != 'Any')) { $newURL.= $_GET['location'].'/'; } #META DATA $classDefault = 'commercial property'; $locationDefault = 'North West England'; if ($class != 'Any') { switch ($class) { case 'Industrial Development Land': $h1HeaderString = 'Industrial Development Land'; $classDefault = strtolower($class); break; case 'Investment - Land': $h1HeaderString = 'Investment Land'; $classDefault = strtolower($class); break; case 'Land': $h1HeaderString = 'Land'; $classDefault = 'Industrial Development Land'; $classDefault = strtolower($class); break; case 'Nursery': $h1HeaderString = 'Nurseries'; $classDefault = strtolower($class); break; case 'Office': $h1HeaderString = 'Offices'; $classDefault = strtolower($class); break; case 'Public House': $h1HeaderString = 'Public Houses'; $classDefault = strtolower($class); break; case 'Residential Development Land': $h1HeaderString = 'Residential Development Land'; $classDefault = strtolower($class); break; default: $h1HeaderString = $class.' Properties'; $classDefault = strtolower($class); } } else { $h1HeaderString = "Commercial Properties"; } if ($tenure != 'Any') { $h1HeaderString .= ' '.$tenure; } if ($location != 'Any') { $h1HeaderString .= " in ".$location; $locationDefault = $location; } else { $h1HeaderString .= ", ".$locationDefault; } $description = "At Nolan Redshaw, our commercial property team specialise in all aspects of $classDefault work from disposals and acquisitions to lettings and management in and around the $locationDefault. We have extensive experience acting on behalf of a wide range clients and dealing with a broad spectrum of $classDefault property throughtout the $locationDefault."; #DIMENSIONS QUERY $dimensionQuery = $dbConnection->prepare("SELECT * FROM dimensions"); $dimensionQuery->execute(); $dimensionRecords = $dimensionQuery->fetchAll(); ?>
include('includes/viewport.php'); ?>Unfortunately we do not currently have any properties that match your requirements.
'; print 'Please try broadening your search criteria or get in touch with us and let us know what you are looking for.
'; } else { $propertyRecords = $propertyQuery->fetchAll(); print 'NOW SOLD
NOW LET
UNDER OFFER
'.$propertyAddress.'
'.$sizeText.'
print $quoteString; ?>
Contact Nolan RedshawWORKING IN PARTNERSHIP
#PICTURES $pictureArray = array(); $extensions = array("png"); $pictureFolder = '/images/partnerships/'; if (file_exists($_SERVER['DOCUMENT_ROOT'].$pictureFolder)) { $directory = new RecursiveDirectoryIterator($_SERVER['DOCUMENT_ROOT'].$pictureFolder,RecursiveDirectoryIterator::SKIP_DOTS); $iterator = new RecursiveIteratorIterator($directory,RecursiveIteratorIterator::LEAVES_ONLY); foreach ($iterator as $fileinfo) { if (in_array($fileinfo->getExtension(), $extensions)) { $pictureTemp = $fileinfo->getPathname(); if (file_exists($pictureTemp)) { $pictureTemp = str_replace($_SERVER['DOCUMENT_ROOT'],'',$pictureTemp); array_push($pictureArray,$pictureTemp); } } } shuffle($pictureArray); } ?>