Example #1
0
}
// Called by "create/edit checks": add pre-requisite checks, add next checks,
//           "create/edit guidelined", add checks into guideline or group.
// 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';
    }
if (is_array($guidelineLevel_checks)) {
    $num_of_checks += count($guidelineLevel_checks);
    dispaly_check_table($guidelineLevel_checks);
}
// display named guidelines and their checks
$named_groups = $guidelineGroupsDAO->getNamedGroupsByGuidelineID($gid);
if (is_array($named_groups)) {
    foreach ($named_groups as $group) {
        ?>
	<h3><?php 
        echo _AC($group['name']);
        ?>
</h3><br/>
<?php 
        // get group level checks: the checks in subgroups without subgroup names
        $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']);