Joywork/cron/testAddObjToZipal.php

42 lines
927 B
PHP
Raw Normal View History

2026-05-22 20:21:54 +02:00
<?php
set_time_limit(0);
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE);
require_once($_SERVER['DOCUMENT_ROOT']."/config.php");
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Отправка объектов на Zipal.ru</title>
</head>
<body>
<?php
$sql = "SELECT * from zipal_objects WHERE id=2397 ORDER BY ID";
$rez_obj = mysql_query($sql);
while($obj = mysql_fetch_assoc($rez_obj)) {
$objectId = $obj['object_id'];
$res = Zipal::createObjectForZipal($mdb, $obj['object_id']);
//var_dump($res);
echo json_encode(utf8ize($res));
}
function utf8ize($mixed) {
if (is_array($mixed)) {
foreach ($mixed as $key => $value) {
$mixed[$key] = utf8ize($value);
}
} else if (is_string ($mixed)) {
return iconv(mb_detect_encoding($mixed, mb_detect_order(), true), "UTF-8", $mixed);
}
return $mixed;
}
?>
</body>
</html>