Ejemplo n.º 1
0
$response = $rets->Login();
var_dump($response);
//$response=$rets->GetCount('Property','11','(363=|A)');
//print $response.'<br/>';
$sysid_array = $rets->GetDataArray('Property', '11', '(363=|A)', 'sysid', null);
//echo count($sysid_array).'<br/>';
foreach ($sysid_array as $index => $array) {
    //echo '<br/>['.$index.']'.$array['sysid'].'<br/>';
    insert_sysid($array['sysid']);
}
$selectSQL = "SELECT sysid FROM sysid_raw WHERE imported='N' AND problem='N' LIMIT 0, 50";
$get_sysid = mysql_query_or_die($selectSQL, $useradmin);
while ($row_get_sysid = mysql_fetch_assoc($get_sysid)) {
    $new_sysid = $row_get_sysid['sysid'];
    $listing_array = $rets->GetDataArray('Property', '11', '(sysid=' . $new_sysid . ')', null, null);
    if (insert_update_listing($listing_array[0])) {
        if (update_sysid_in_raw($new_sysid)) {
            echo "<br/><span style=\"color:#336633;\">[info] sysid updated in sysid_raw database. {$new_sysid} imported='Y'.</span><br/>";
        }
    } else {
        echo "<br/><span style=\"color:#FF0000;\">[warning] didn't get anything from the server</span><br/>";
        sysid_problem_in_raw($new_sysid);
    }
}
/*$selectSQL = "SELECT sysid FROM listings WHERE ISNULL(title_to_land) LIMIT 0,8";
$get_sysid = mysql_query_or_die($selectSQL, $useradmin);
while ($row_get_sysid=mysql_fetch_assoc($get_sysid)){
	$new_sysid=$row_get_sysid['sysid'];
	$listing_array = $rets->GetDataArray('Property','11','(sysid='.$new_sysid.')',null,null);
	if(insert_update_listing($listing_array[0])){
		echo "<br/><span style=\"color:#336633\">[info] Title to land updated</span><br/>";
Ejemplo n.º 2
0
function import_sysid()
{
    global $useradmin, $rets;
    $selectSQL = "SELECT sysid FROM sysid_raw_new LIMIT 0, 50";
    $get_sysid = mysql_query_or_die($selectSQL, $useradmin);
    while ($row_get_sysid = mysql_fetch_assoc($get_sysid)) {
        $listing_array = $rets->GetDataArray('Property', '11', '(sysid=' . $row_get_sysid['sysid'] . ')', null, 1);
        if (insert_update_listing($listing_array[0])) {
            echo "<br/>[Info] Successfully inserted to listings databse<br/>";
            $deleteSQL = "DELETE FROM sysid_raw_new WHERE sysid=" . $row_get_sysid['sysid'];
            $result = mysql_query_or_die($deleteSQL, $useradmin);
        } else {
            echo "<br/>[Warning] Error occured when inserting record<br/>";
        }
    }
    $selectSQL = "SELECT listings.sysid FROM sysid_raw_current LEFT JOIN listings ON sysid_raw_current.sysid=listings.sysid WHERE listings.status='D'";
    $get_sysid = mysql_query_or_die($selectSQL, $useradmin);
    while ($row_get_sysid = mysql_fetch_assoc($get_sysid)) {
        echo "<br/>re-activating sysid:" . $row_get_sysid['sysid'] . "<br/>";
        $updateSQL = sprintf("UPDATE listings SET status=%s WHERE sysid=%s", GetSQLValueString('A', "text"), GetSQLValueString($row_get_sysid['sysid'], "int"));
        $result = mysql_query_or_die($updateSQL, $useradmin);
    }
}