if (isset($check_id)) { $check_row = $checksDAO->getCheckByID($check_id); if (!$check_row) { // invalid check id $msg->addError('INVALID_CHECK_ID'); require AC_INCLUDE_PATH . 'header.inc.php'; $msg->printAll(); require AC_INCLUDE_PATH . 'footer.inc.php'; exit; } // get author name $usersDAO = new UsersDAO(); $user_name = $usersDAO->getUserName($check_row['user_id']); if ($user_name != '') { $savant->assign('author', $user_name); } $check_pass_example_rows = $checkExamplesDAO->getByCheckIDAndType($check_id, AC_CHECK_EXAMPLE_PASS); $check_fail_example_rows = $checkExamplesDAO->getByCheckIDAndType($check_id, AC_CHECK_EXAMPLE_FAIL); $check_example_row['pass_example_desc'] = $check_pass_example_rows[0]['description']; $check_example_row['pass_example'] = $check_pass_example_rows[0]['content']; $check_example_row['fail_example_desc'] = $check_fail_example_rows[0]['description']; $check_example_row['fail_example'] = $check_fail_example_rows[0]['content']; $savant->assign('check_row', $check_row); $savant->assign('pre_rows', $checkPrerequisitesDAO->getPreChecksByCheckID($check_id)); $savant->assign('next_rows', $testPassDAO->getNextChecksByCheckID($check_id)); $savant->assign('guideline_rows', $guidelinesDAO->getEnabledGuidelinesByCheckID($check_id)); $savant->assign('check_example_row', $check_example_row); } /*****************************/ /* template starts down here */ $savant->display('check/check_create_edit.tmpl.php');
include_once AC_INCLUDE_PATH . 'classes/DAO/TestProcedureDAO.class.php'; include_once AC_INCLUDE_PATH . 'classes/DAO/TestExpectedDAO.class.php'; include_once AC_INCLUDE_PATH . 'classes/DAO/TestFailDAO.class.php'; include_once AC_INCLUDE_PATH . 'classes/DAO/CheckExamplesDAO.class.php'; $check_id = intval($_GET["id"]); $checksDAO = new ChecksDAO(); $row = $checksDAO->getCheckByID($check_id); if (!$row) { // invalid check id $msg->addError('INVALID_CHECK_ID'); $msg->printAll(); require AC_INCLUDE_PATH . 'footer.inc.php'; exit; } $guidelinesDAO = new GuidelinesDAO(); $guideline_rows = $guidelinesDAO->getEnabledGuidelinesByCheckID($check_id); $checkExamplesDAO = new CheckExamplesDAO(); $pass_examples = $checkExamplesDAO->getByCheckIDAndType($check_id, AC_CHECK_EXAMPLE_PASS); $fail_examples = $checkExamplesDAO->getByCheckIDAndType($check_id, AC_CHECK_EXAMPLE_FAIL); $guidelineGroupsDAO = new GuidelineGroupsDAO(); $guidelineSubgroupsDAO = new GuidelineSubgroupsDAO(); ?> <div class="output-form"> <h2><?php echo _AC("html_tag"); ?> </h2> <span class="msg"><?php echo $row["html_tag"]; ?>