// -*- c++ -*-
$maintdir = "..";
require("$maintdir/constants.php3");
require("$authdir/get-login.php3");
get_login(true);
// If we get past here, we're logged in
require("$classdir/Question.php3");
require("$classdir/Category.php3");
require("$classdir/CategoryXref.php3");
do_header("Add / Remove questions from category list");
do_main_menu();
$cat = getCatByID($id);
if (!$cat->isValid()) {
?>
Sorry, this does not appear to be a valid category.
do_main_menu(); ?>
[ Back to question list ]
include("$lamtop/includes/std_footer.php3");
exit;
}
print("" . $cat->getName() .
"\n\n");
// Get all the questions in an associative array by ID number
$quests = getAllQuestsAssoc();
// Only print the "delete" table if there are questions in this category
$xrefs = getCatXrefsByCID($cat->getID());
if (!$xrefs[0]->isValid())
$s = 0;
else
$s = sizeof($xrefs);
if ($s <= 0) {
?>
There are currently no questions in this category.
} else {
?>
do_main_menu();
print("\n
[ Return to list maintenance ]\n\n");
print("\n
\n\n");
}
// Now print all questions. Would be nicer to only print the
// questions that are not already in this category, but oh well..
$q = getAllQuests();
if (!$q[0]->isValid())
$s = 0;
else
$s = sizeof($q);
?>
do_main_menu();
print("\n
[ Return to list maintenance ]\n\n");
include("$lamtop/includes/std_footer.php3");