Пример #1
0
function GetPropertyFromRealty($StreetAddr, $City, $State, $Zip)
{
    $StreetAddr = urlencode($StreetAddr);
    $URL = "http://dlpapi.realtytrac.com/Reports/Get?ApiKey=a2d3e2aa-9c9b-4aab-af3a-56785ae67e25&Login=accurity&Password=1cyquent!&JobID=&LoanNumber=&PreparedBy=&ResellerID=&PreparedFor=&OwnerFirstName=&OwnerLastName=&AddressType=&PropertyStreetAddress={$StreetAddr}&AddressNumber=&StartAddressNumberRange=&EndAddressNumberRange=&StreetDir=&StreetName=&StreetSuffix=&City={$City}&StateCode={$State}&County=&ZipCode={$Zip}&PropertyParcelID=&APN=&ApnRangeStart=&ApnRangeEnd=&GeoCodeX=&GeoCodeY=&GeoCodeRadius=&SearchType=&NumberOfRecords=&Format=XML&ReportID=102";
    $path = $_SESSION['path'];
    $fp = fopen($path, "a");
    fwrite($fp, "<p>Query To Get Main Property - <b>{$URL} </b></p>");
    fclose($fp);
    $data = file_get_contents($URL);
    $p = xml_parser_create();
    xml_parse_into_struct($p, $data, $vals, $index);
    xml_parser_free($p);
    foreach ($vals as $aval) {
        if ($aval['type'] == 'complete' && isset($aval['attributes'])) {
            foreach ($aval['attributes'] as $key => $val) {
                if ($key == "PROPERTYPARCELID_EXT") {
                    $aProp[$key] = $val;
                }
            }
        }
        if ($aval['type'] == 'complete' && isset($aval['attributes']) && $aval['tag'] == "PARSED_STREET_ADDRESS") {
            foreach ($aval['attributes'] as $key => $val) {
                if (array_key_exists($key, $aProp)) {
                    continue;
                }
                $aProp[$key] = $val;
            }
        }
        if ($aval['type'] == 'open' && isset($aval['attributes'])) {
            foreach ($aval['attributes'] as $key => $val) {
                if ($aval['tag'] == "MAILING_ADDRESS_EXT") {
                    continue;
                }
                $aProp[$key] = $val;
            }
        }
    }
    if (!isset($aProp)) {
        // get the property id
        $propertyId = getPropertyId($StreetAddr, $City, $State, $Zip);
        $aProp = getByPropertyId($propertyId);
    }
    return $aProp;
}
Пример #2
0
            } else {
                for ($j = 0; $j < count($cell[$i]); $j++) {
                    $key = $property[$j]['id'];
                    $value = $cell[$i][$j];
                    $pair[$n][$key] = $value;
                }
            }
            $n++;
            //$n should only be raised when $pair[$n] has been filled
        }
    }
    echo '<table>';
    for ($i = 1; $i <= count($pair); $i++) {
        if ($_POST['cu'] == 'create') {
            echo "<tr><td>CREATE</td>\r\n";
            foreach ($pair[$i] as $key => $value) {
                if ($value != "") {
                    echo "<tr><td>LAST</td><td>{$key}</td><td>" . formatValue($value, getDataType($key)) . "</td></tr>\r\n";
                }
            }
        } else {
            $item = getPropertyId($pair[$i]['item'], "item");
            foreach ($pair[$i] as $key => $value) {
                if ($key != "item" && $value != "") {
                    echo "<tr><td>{$item}</td><td>{$key}</td><td>" . formatValue($value, getDataType($key)) . "</td></tr>\r\n";
                }
            }
        }
    }
    echo '</table>';
}