\n
//END;
//get-vars to control document:
//$target: group, which is to classify the group of function, such as "home", "nrep", "admin"
//$sub: sub-group, which is specific function, such as ", is belonged to the group
//check login
//1. isLogin == true, set to home page
//2. isLogin == false, to disable all input vars
if ($llosession->isLogin() || $sub== "list") {
if ($target == ""){
$target = "nrep";
$sub = "list";
}
}else{
$target = "";
$sub = "";
}
//echo("target=".$target." \n");
//Factory: to create web menus
$menus = new Menu("menus.xml");
$menus->printTopMenu();
$menus->printSubMenu($target);
echo << |
\n
END;
//Factory: to create web components
switch ($target){
//Home Mode
case "home":
echo("
");
echo("");
break;
//Nrep Mode
case "nrep":
//Default
if ($sub=="") $sub="input";
switch ($sub){
case "input":
$component = new InputNrep("nrepform_input.xml", "nrepform_problem.xml");
$component->next($HTTP_POST_VARS);
break;
case "search":
$component = new SearchNrep("nrepform_query.xml");
$component->next($HTTP_POST_VARS);
break;
case "list":
$component = new ListNrep("nrepform_list.xml");
$component->next($listyear, $listmonth, $listday, $listid);
break;
case "edit":
$component = new EditNrep("nrepform_input.xml", "nrepform_problem.xml");
$component->next($HTTP_POST_VARS, $listid);
break;
case "delete":
$component = new DeleteNrep();
$component->next($listid, $sure);
break;
}
break;
//Help Mode
case "help":
echo("¬I¤u¤¤");
//echo <<
//location="nrep_func_help.html";
//
//END;
break;
//Error Mode
case "status":
echo("
");
if ($sub=="") $sub="MISSING";
$component = new Status($sub, $message);
$component->next();
break;
//Login Mode
default:
$component = new FormLogin($PHP_SELF, $_auth_group, "nrep");
$component->next($HTTP_POST_VARS);
break;
}
echo << |