Esempio n. 1
0
// only list the checks that are not in the pre-requisite checks, or next checks, or guideline, or group
if (isset($_GET['list'])) {
    if ($_GET['list'] == 'pre') {
        $existing_rows = $checkPrerequisitesDAO->getPreChecksByCheckID($_GET['cid']);
    }
    if ($_GET['list'] == 'next') {
        $existing_rows = $testPassDAO->getNextChecksByCheckID($_GET['cid']);
    }
    if ($_GET['list'] == 'guideline') {
        $existing_rows = $checksDAO->getGuidelineLevelChecks($_GET['gid']);
    }
    if ($_GET['list'] == 'group') {
        $existing_rows = $checksDAO->getGroupLevelChecks($_GET['ggid']);
    }
    if ($_GET['list'] == 'subgroup') {
        $existing_rows = $checksDAO->getChecksBySubgroupID($_GET['gsgid']);
    }
    // get checks that are open to public and not in guideline
    unset($str_existing_checks);
    if (is_array($existing_rows)) {
        foreach ($existing_rows as $existing_row) {
            $str_existing_checks .= $existing_row['check_id'] . ',';
        }
        $str_existing_checks = substr($str_existing_checks, 0, -1);
    }
    if ($condition != '') {
        $condition .= ' AND';
    }
    $condition .= " open_to_public=1";
    if ($str_existing_checks != '') {
        $condition .= " AND check_id NOT IN (" . $str_existing_checks . ")";
        $groupLevel_checks = $checksDAO->getGroupLevelChecks($group['group_id']);
        if (is_array($groupLevel_checks)) {
            $num_of_checks += count($groupLevel_checks);
            dispaly_check_table($groupLevel_checks);
        }
        // display named subgroups and their checks
        $named_subgroups = $guidelineSubgroupsDAO->getNamedSubgroupByGroupID($group['group_id']);
        if (is_array($named_subgroups)) {
            foreach ($named_subgroups as $subgroup) {
                ?>
	<h4><?php 
                echo _AC($subgroup['name']);
                ?>
</h4><br/>
<?php 
                $subgroup_checks = $checksDAO->getChecksBySubgroupID($subgroup['subgroup_id']);
                if (is_array($subgroup_checks)) {
                    $num_of_checks += count($subgroup_checks);
                    dispaly_check_table($subgroup_checks);
                } else {
                    echo '		<p class="subgroup">' . _AC('none_found') . '<br/><br/></p>';
                }
            }
            // end of foreach $named_subgroups
        }
        // end of if $named_subgroups
    }
    // end of foreach $named_groups
}
// end of if $named_groups
// display "none found" if no check is defined in this guideline