private function getChildNode($x)
 {
     $chidNode = array();
     foreach ($x->childNodes as $p) {
         if ($this->hasChild($p)) {
             getChildNode($p);
         } else {
             if ($p->nodeType == XML_ELEMENT_NODE) {
                 $chidNode[] = array('node' => $x->nodeName, 'nodeName' => $p->nodeName, 'name' => $p->getAttribute('name'), 'nodeValue' => $p->nodeValue);
             }
         }
     }
     return array($x->nodeName => $chidNode);
 }
Esempio n. 2
0
function getChildNode($rootid, &$child_list)
{
    global $dsql;
    $sql = "select id from #@__destinations where pid='{$rootid}' and isopen = '1' and isnav='0' ";
    $arr = $dsql->getAll($sql);
    foreach ($arr as $row) {
        if (!empty($row['id'])) {
            array_push($child_list, $row['id']);
            getChildNode($row['id'], $child_list);
        }
    }
}
Esempio n. 3
0
                    $sEuroPrice = str_replace(',', '.', $sFEuroPrice);
                    $sPrice = str_replace('EUR', '', $sEuroPrice);
                    $content->price = trim($sPrice);
                }
            }
            foreach ($oContainerParamsDiv as $param2) {
                if ($param2->hasAttribute('class') && $param2->getAttribute('class') == 'sfred pt') {
                    $content->stock = trim($param2->nodeValue);
                }
                if ($param2->hasAttribute('class') && $param2->getAttribute('class') == 'publisher') {
                    $content->publisher = trim(utf8_decode(getChildNode($param2)->nodeValue));
                }
                if ($param2->hasAttribute('class') && $param2->getAttribute('class') == 'author') {
                    $content->author = trim(utf8_decode(getChildNode($param2)->nodeValue));
                }
                if ($param2->hasAttribute('class') && $param2->getAttribute('class') == 'left_thumb') {
                    $content->thumb = trim(utf8_decode(getChildNode(getChildNode($param2))->getAttribute('src')));
                }
                if ($param2->hasAttribute('class') && $param2->getAttribute('class') == 'damcond') {
                    $content->type = trim(utf8_decode($param2->nodeValue));
                }
                if ($param2->hasAttribute('class') && $param2->getAttribute('class') == 'itemicon clearfix') {
                    $content->media = trim(utf8_decode($param2->nodeValue));
                }
            }
            $contents[] = $content;
        }
    }
    echo json_encode($contents);
});
Flight::start();