Government of the Republic of Trinidad and Tobago

Sitemap

Sitemap

open();
$query = “SELECT * FROM cms_menus WHERE MenuParent = ‘$parentID’ AND Status = 1 ORDER BY NavOrder ASC”;
$result = $sqlChildren->query($query);
$numRows = $sqlChildren->numRows();

if($numRows > 0){
$subNavID = ‘subNav’.$parentID;
$getChildren = ‘ onmouseover=”showSubNav(\”.$subNavID.’\’);” >’.$parentName.’

    ‘;
    while($rs = $sqlChildren->fetchObject()){
    $menuID = $rs->MenuID;
    $navID = ‘nav’.$rs->MenuID;
    $menuName = $rs->MenuName;
    $menuGroup = $rs->MenuGroup;
    $menuLink = ‘/’.$menuGroup.’.php?mid=’.$menuID;
    $getChildren .= ‘

  • ‘;
    }
    $getChildren .= ‘

‘;
} else {
$getChildren = ‘>’.$parentName.’
‘;
}

return $getChildren;
}

$sql = new DB(WEB_CONN);
$sql->open();
$query = “SELECT * FROM cms_menus WHERE MenuParent = ‘0’ AND Status = 1 ORDER BY NavOrder ASC”;
$sql->query($query);
$menus = ‘

    ‘;
    while($rs = $sql->fetchObject()){
    $menuID = $rs->MenuID;
    $navID = ‘nav’.$rs->MenuID;
    $menuName = $rs->MenuName;
    $menuGroup = $rs->MenuGroup;
    $menuLink = strlen($rs->MenuLink) > 0 ? $rs->MenuLink : ‘/’.$menuGroup.’.php?mid=’.$menuID;
    if(strtolower($menuGroup) == ‘homepage’)
    $menuLink = ‘/index.php’;
    $menus .= ‘

  • ‘;

    }
    $menus .= ‘

‘;

echo $menus;
?>