function displayChildrenRecursive($xmlObj, $depth = 0) { if (count($xmlObj->children()) > 0) { echo str_repeat("\t", $depth); echo "<ul>\n"; } foreach ($xmlObj->children() as $child) { echo str_repeat("\t", $depth + 1); echo "<li>{$child['text']}</li>\n"; displayChildrenRecursive($child, $depth + 1); } if (count($xmlObj->children()) > 0) { echo str_repeat("\t", $depth); echo "</ul>\n"; } }
function displayChildrenRecursive($xmlObj, $base, $depth = 0) { foreach ($xmlObj->children() as $child) { if ($child->getName() == "PlanViewer") { if ($code = Cping($child)) { $names[$depth] = $child; $codes[$depth] = $code; $temp = $names[$depth]; $temp2 = $codes[$depth]; //$index = $count; InsertDB($base, $temp, $temp2); } } displayChildrenRecursive($child, $base, $depth + 1); } }
//require_once ("support/http.php"); //require_once ("support/web_browser.php"); //require_once ("support/simple_html_dom.php"); if (isset($_POST['probe'])) { $conn = ConnectDB(); ProbeEntry($conn); } if (isset($_POST['Update_ifps'])) { $url = "http://public.khov.com/Syndication/BHI/XML/ALLKHOVNANIAN.xml"; $rawDat = file_get_contents($url); $sitemap = new SimpleXMLElement($rawDat); $comm = ConnectDB(); $sql = "TRUNCATE TABLE KHovFeed.ifps_db"; $comm->query($sql); $text = ConnectDB(); displayChildrenRecursive($sitemap, $text); } if (isset($_POST['Update_isps'])) { $url = "http://public.khov.com/Syndication/BHI/XML/ALLKHOVNANIAN.xml"; $rawDat = file_get_contents($url); $sitemap = new SimpleXMLElement($rawDat); $comm = ConnectDB(); $sql = "TRUNCATE TABLE KHovFeed.isps_db"; $comm->query($sql); $text = ConnectDB(); ParSteChildrenRecursive($sitemap, $text); } if (isset($_POST['Update_nf'])) { VrDbFloors(); } if (isset($_POST['clean_cbhm'])) {