<% include_once("class.LloSession.php"); include_once("class.Menu.php"); include_once("class.FormLogin.php"); include_once("class.InputNrep.php"); include_once("class.SearchNrep.php"); include_once("class.ListNrep.php"); include_once("class.EditNrep.php"); include_once("class.DeleteNrep.php"); include_once("class.Status.php"); include("config.php"); //Initialize session(Warnning: THIS MUST BE IN FIRST LINE) session_save_path($_php_save_path); if ($debug > 0) echo("$_php_save_path=".$_php_save_path."
/n"); session_start(); if (!session_is_registered("llosession")){ if ($debug > 0) echo("Initialize...
/n"); $login = "johnny"; $llosession = new LloSession(); session_register("llosession"); } %> LLO Web Site <% //echo << // // \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("Iu"); //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 << \n END; if ($debug > 0){ while (list ($key, $value) = each ($HTTP_POST_VARS)) { echo("
$key='$value'\n"); } } %>