<?PHP
/*	index.php for GetPEN
	This is the file that always gets called it includes a command processor and then a display outputter.
	*/
	$bugsy="";
	include (".htfolder.inc.php");

	$newby=intval($_SESSION["newby"])+1;
	if (array_key_exists("nuby",$_REQUEST)) $newby=intval($_REQUEST["nuby"]);
	$skipnewby=array(1,2,99);
	$bugsy.="We shan't be doing $skipnewby.<br/>";
	while (in_array($newby,$skipnewby))
	{
		$newby++;
		$bugsy.="Upgraded newby to $newby.<br/>";
	}

	##++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++	COMMAND
	$command="cmd$newby.cmd";
	loggywoggy("Looking to do $command.");
	if (file_exists("command/$command")) include ("command/$command");

	##++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++	DISPLAY
	$display="center$newby.inc.html";
	loggywoggy("Looking to display $display.");
	include ("display/TopBar.inc.html");
	include ("display/$display");
	include ("display/BottomBar.inc.html");

	$_SESSION["newby"]=$newby;
?>