$beds = $_POST['beds'];
$min_price = '-';
$max_price = '-';
$kitchen = '-';
$baths = '-';
$driveway = '-';
$garden = '-';
$conservatory = '-';
$receptions = '-';
$type = '-';
$sub_type = '-';
$age = '-';
$sql_statement = "SELECT propRef, propTypeCode, propSubTypeCode, addressRef ";
$sql_statement .= "FROM properties ";
$sql_statement .= "WHERE propStatus='VOID' ";
$sqlResults = selectResults($sql_statement);
$error_or_rows = $sqlResults[0];
if (substr($error_or_rows, 0, 5) == 'ERROR') {
    print "<br />Error on DB<br><br />" . $error_or_rows . "<br /><br />" . $sql_statement . "<br /> ";
} else {
    $returnedProps = 1;
    for ($ii = 1; $ii <= $error_or_rows; $ii++) {
        $outputDisplay = '';
        $propRef = $sqlResults[$ii]['propRef'];
        $propTypeCode = $sqlResults[$ii]['propTypeCode'];
        $propSubTypeCode = $sqlResults[$ii]['propSubTypeCode'];
        $propAddressRef = $sqlResults[$ii]['addressRef'];
        $string = searchProp($propRef, $propTypeCode, $propSubTypeCode, $propAddressRef, $town, $area, $min_price, $max_price, $kitchen, $beds, $baths, $driveway, $garden, $conservatory, $receptions, $type, $sub_type, $age, $returnedProps);
        if (!empty($string)) {
            list($outputDisplay, $returnedProps) = explode('|', $string);
        }
function getOfficeContact($officeCode, $contactType)
{
    $sql_statement1 = "SELECT contactValue ";
    $sql_statement1 .= "FROM  officeContacts ";
    $sql_statement1 .= "WHERE officeCode='" . $officeCode . "' ";
    $sql_statement1 .= "AND contactTypeCode='" . $contactType . "' ";
    $sqlResults1 = selectResults($sql_statement1);
    $error_or_rows1 = $sqlResults1[0];
    if (substr($error_or_rows1, 0, 5) == 'ERROR') {
        return "<br />Error on DB<br><br>" . $error_or_rows1 . "<br><br>" . $sql_statement1;
    } else {
        return $sqlResults1[1]['contactValue'];
    }
}