تازه ها

[insert_php]

$jsonurl=”http://lib.iranhdm.ir:8080/rest/news/bibliographic/listBiblio”;

try {
$context = stream_context_create(
array(
‘http’ => array(
‘follow_location’ => true,
‘max_redirects’ => 20
)
)
);

$resultjson = file_get_contents(‘http://lib.iranhdm.ir:8080/rest/news/bibliographic/listBiblio’,false,$context);
$datajson = json_decode($resultjson,true);

echo ‘

تازه های نشر

‘;

if (is_array($datajson[‘newItemsEntity’])) {
if ( empty($datajson[‘newItemsEntity’][0])) {
echo ‘

‘;
echo “” ;
if(($datajson[‘newItemsEntity’][‘materialType’]==”BF”)||($datajson[‘newItemsEntity’][‘materialType’]==”BL”)) echo “ “;
if(($datajson[‘newItemsEntity’][‘materialType’]==”VF”)||($datajson[‘newItemsEntity’][‘materialType’]==”VL”)) echo “ “;
if(($datajson[‘newItemsEntity’][‘materialType’]==”AF”)||($datajson[‘newItemsEntity’][‘materialType’]==”AL”)) echo “ “;
if(($datajson[‘newItemsEntity’][‘materialType’]==”TF”)||($datajson[‘newItemsEntity’][‘materialType’]==”TL”)) echo “ “;
if(($datajson[‘newItemsEntity’][‘materialType’]==”PF”)||($datajson[‘newItemsEntity’][‘materialType’]==”PL”)) echo “ “;
if(($datajson[‘newItemsEntity’][‘materialType’]==”DF”)||($datajson[‘newItemsEntity’][‘materialType’]==”DL”)) echo “ “;
echo $datajson[‘newItemsEntity’][‘title’].”

“;
echo ‘

‘;
echo ”

“;
}
else {
foreach ($datajson[‘newItemsEntity’] as $keyjson => $valuejson)
{
echo ‘

“;
}
}

}

if ($resultjson === false) {
echo “ziro”;
}
} catch (Exception $ex) {
echo “Exception”;
}

[/insert_php]