Ejemplo n.º 1
0
error_reporting(E_ALL);
header('Content-Type: text/html; charset=utf-8');
$document_root = '/home/home365/public_html';
require_once $document_root . '/dbconnect/dbconnect.php';
require_once $document_root . '/utilities/utilities.php';
require_once 'excel_reader.php';
if (mysql_select_db("home365_ios", $useradmin)) {
} else {
    echo "Error selecting database, exited.";
    exit;
}
function null_2_default($string, $default)
{
    return isset($string) && $string != '' ? $string : $default;
}
$current_timestamp = get_GMT(microtime(true));
$current_time = date("Y-m-d H:i:s", $current_timestamp);
$data = new Spreadsheet_Excel_Reader("mls.xls");
$sheet_count = $data->sheetcount();
for ($sheet_index = 0; $sheet_index < $sheet_count; $sheet_index++) {
    $row_count = $data->rowcount($sheet_index);
    $col_count = $data->colcount($sheet_index);
    echo "Sheet:{$sheet_index}<br/>";
    echo "Row Count:" . $row_count . "<br/>";
    echo "Column Count:" . $col_count . "<br/>";
    for ($row_index = 1; $row_index <= $row_count; $row_index++) {
        for ($col_index = 1; $col_index <= $col_count; $col_index++) {
            if ($row_index > 1 && $col_index <= 3) {
                if ($col_index == 1) {
                    $month = $data->val($row_index, $col_index, $sheet_index) === '' ? $month : $data->val($row_index, $col_index, $sheet_index);
                }
Ejemplo n.º 2
0
require_once 'dbconnect/dbconnect.php';
require_once 'utilities/utilities.php';
require_once 'RETS.php';
if (mysql_select_db("home365_ios", $useradmin)) {
} else {
    echo "Error selecting database, exited.";
    exit;
}
$rets = new RETS();
$rets->url = 'http://brc.retsca.interealty.com/Login.asmx/Login';
$rets->user = '******';
$rets->password = '******';
$rets->useragent = 'RETSAllisonJiang/1.0';
$rets->useragent_password = '******';
$current_GMT_time = get_GMT(time());
$current_GMT_time_string = date("Y-m-d H:i:s", $current_GMT_time);
$current_YVR_time = getTimeByCity($current_GMT_time, 'YVR');
$current_YVR_time_string = date("Y-m-d H:i:s", $current_YVR_time);
//The following code is to test if the cron job is executed.
$file = "file.txt";
$current = file_get_contents($file);
$current .= "{$current_YVR_time_string}\n";
file_put_contents($file, $current);
//login and receive server response.
$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/>';